@oslokommune/punkt-react 18.0.0 → 18.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/components/accordion/Accordion.d.ts +2 -12
- package/dist/components/accordion/AccordionItem.d.ts +2 -8
- package/dist/components/alert/Alert.d.ts +4 -3
- package/dist/components/backlink/BackLink.d.ts +3 -13
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +7 -16
- package/dist/components/calendar/types.d.ts +2 -4
- package/dist/components/checkbox/Checkbox.d.ts +2 -4
- package/dist/components/combobox/types.d.ts +3 -5
- package/dist/components/datepicker/DateTags.d.ts +2 -3
- package/dist/components/datepicker/types.d.ts +4 -5
- package/dist/components/fileupload/DropZone.d.ts +2 -4
- package/dist/components/fileupload/FileUpload.d.ts +9 -64
- package/dist/components/header/types.d.ts +3 -7
- package/dist/components/index.d.ts +1 -1
- package/dist/components/inputwrapper/InputWrapper.d.ts +2 -4
- package/dist/components/link/Link.d.ts +2 -6
- package/dist/components/radio/RadioButton.d.ts +2 -4
- package/dist/components/searchinput/SearchInput.d.ts +2 -4
- package/dist/components/select/Select.d.ts +2 -4
- package/dist/components/tag/Tag.d.ts +2 -4
- package/dist/components/textarea/Textarea.d.ts +2 -4
- package/dist/components/textinput/Textinput.d.ts +2 -4
- package/dist/components/timepicker/types.d.ts +2 -5
- package/dist/components/timepicker/useTimepickerState.d.ts +1 -1
- package/dist/punkt-react.cjs +1 -1
- package/dist/punkt-react.js +1208 -1203
- package/dist/shared-strings/index.d.ts +1 -1
- package/dist/shared-strings/nb.d.ts +3 -0
- package/dist/shared-strings/types.d.ts +17 -0
- package/dist/shared-types/accordion.d.ts +58 -0
- package/dist/shared-types/alert.d.ts +20 -0
- package/dist/shared-types/aria.d.ts +2 -1
- package/dist/shared-types/backlink.d.ts +23 -0
- package/dist/shared-types/breadcrumbs.d.ts +33 -0
- package/dist/shared-types/fileupload.d.ts +56 -2
- package/dist/shared-types/footer.d.ts +10 -0
- package/dist/shared-types/form-field.d.ts +46 -0
- package/dist/shared-types/header-footer.d.ts +2 -0
- package/dist/shared-types/index.d.ts +15 -5
- package/dist/shared-types/render-link.d.ts +22 -0
- package/dist/shared-types/searchinput.d.ts +2 -1
- package/dist/shared-types/skin.d.ts +2 -9
- package/package.json +2 -2
- package/src/components/accordion/Accordion.tsx +2 -12
- package/src/components/accordion/AccordionItem.tsx +2 -8
- package/src/components/alert/Alert.tsx +12 -5
- package/src/components/backlink/BackLink.tsx +7 -16
- package/src/components/breadcrumbs/Breadcrumbs.tsx +14 -16
- package/src/components/calendar/types.ts +2 -6
- package/src/components/checkbox/Checkbox.tsx +2 -4
- package/src/components/combobox/types.ts +3 -5
- package/src/components/datepicker/DateTags.tsx +2 -4
- package/src/components/datepicker/types.ts +6 -7
- package/src/components/fileupload/DropZone.tsx +3 -4
- package/src/components/fileupload/FileUpload.tsx +25 -68
- package/src/components/header/types.ts +3 -8
- package/src/components/index.ts +1 -1
- package/src/components/inputwrapper/InputWrapper.tsx +2 -4
- package/src/components/link/Link.tsx +2 -6
- package/src/components/radio/RadioButton.tsx +2 -4
- package/src/components/searchinput/SearchInput.tsx +2 -5
- package/src/components/select/Select.tsx +3 -4
- package/src/components/tag/Tag.tsx +2 -5
- package/src/components/textarea/Textarea.tsx +3 -4
- package/src/components/textinput/Textinput.tsx +3 -4
- package/src/components/timepicker/types.ts +2 -6
package/dist/punkt-react.js
CHANGED
|
@@ -62,7 +62,7 @@ var M = /* @__PURE__ */ O((/* @__PURE__ */ E(((e, t) => {
|
|
|
62
62
|
return n;
|
|
63
63
|
}) : window.classNames = n;
|
|
64
64
|
})();
|
|
65
|
-
})))(), 1), N = "https://punkt-cdn.oslo.kommune.no/18.
|
|
65
|
+
})))(), 1), N = "https://punkt-cdn.oslo.kommune.no/18.2/icons/";
|
|
66
66
|
typeof window < "u" && (window.pktFetch = window.pktFetch === void 0 ? fetch : window.pktFetch, window.pktIconPath = window.pktIconPath || N);
|
|
67
67
|
var P = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"></svg>", ee = {}, te = 2, ne = 1500, F = typeof Storage < "u" && typeof sessionStorage < "u", re = typeof window < "u" ? d : c, ie = (e, t) => !e || !F ? "" : sessionStorage.getItem(t + e + ".svg") ?? "", ae = (e) => window.pktFetch(e).then((t) => {
|
|
68
68
|
if (!t.ok) throw Error("Missing icon: " + e);
|
|
@@ -173,123 +173,10 @@ var R = i(({ defaultOpen: e = !1, id: t, title: n, skin: r, compact: i = !1, isO
|
|
|
173
173
|
})]
|
|
174
174
|
});
|
|
175
175
|
});
|
|
176
|
-
|
|
177
|
-
//#region src/components/button/Button.tsx
|
|
178
|
-
R.displayName = "PktAccordionItem", typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/18.0/animations/");
|
|
179
|
-
var z = 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) => {
|
|
180
|
-
let x = [
|
|
181
|
-
t,
|
|
182
|
-
"pkt-btn",
|
|
183
|
-
o && `pkt-btn--${o}`,
|
|
184
|
-
s && "pkt-btn--full",
|
|
185
|
-
c && "pkt-btn--full-small",
|
|
186
|
-
l && `pkt-btn--${l}`,
|
|
187
|
-
d && `pkt-btn--${d}`,
|
|
188
|
-
p && `pkt-btn--${p}`,
|
|
189
|
-
f && `pkt-btn--${f}`,
|
|
190
|
-
m && "pkt-btn--isLoading"
|
|
191
|
-
].filter(Boolean).join(" ");
|
|
192
|
-
return /* @__PURE__ */ v("button", {
|
|
193
|
-
...y,
|
|
194
|
-
"aria-busy": m || void 0,
|
|
195
|
-
"aria-disabled": h || void 0,
|
|
196
|
-
disabled: h,
|
|
197
|
-
className: x,
|
|
198
|
-
type: u,
|
|
199
|
-
ref: b,
|
|
200
|
-
children: [
|
|
201
|
-
m && /* @__PURE__ */ _(L, {
|
|
202
|
-
className: "pkt-btn__icon pkt-btn__spinner",
|
|
203
|
-
name: "spinner-blue",
|
|
204
|
-
path: g
|
|
205
|
-
}),
|
|
206
|
-
d !== "label-only" && /* @__PURE__ */ _(L, {
|
|
207
|
-
className: "pkt-btn__icon",
|
|
208
|
-
name: n,
|
|
209
|
-
...i && { path: i }
|
|
210
|
-
}),
|
|
211
|
-
/* @__PURE__ */ _("span", {
|
|
212
|
-
className: "pkt-btn__text",
|
|
213
|
-
children: e
|
|
214
|
-
}),
|
|
215
|
-
d === "icons-right-and-left" && /* @__PURE__ */ _(L, {
|
|
216
|
-
className: "pkt-btn__icon",
|
|
217
|
-
name: r,
|
|
218
|
-
...a && { path: a }
|
|
219
|
-
})
|
|
220
|
-
]
|
|
221
|
-
});
|
|
222
|
-
});
|
|
223
|
-
z.displayName = "PktButton";
|
|
224
|
-
//#endregion
|
|
225
|
-
//#region src/components/alert/Alert.tsx
|
|
226
|
-
var ce = ({ 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, ...f }) => {
|
|
227
|
-
let [p, h] = m(!1), g = {
|
|
228
|
-
"pkt-alert": !0,
|
|
229
|
-
[`pkt-alert--${r}`]: r,
|
|
230
|
-
[`pkt-alert--${u}`]: u,
|
|
231
|
-
"pkt-hide": p
|
|
232
|
-
}, y = {
|
|
233
|
-
"pkt-alert__grid": !0,
|
|
234
|
-
"pkt-alert__noTitle": !i,
|
|
235
|
-
"pkt-alert__noDate": !a
|
|
236
|
-
}, b = o(() => {
|
|
237
|
-
h(!0), f.onClose && f.onClose(new CustomEvent("close", {
|
|
238
|
-
detail: { origin: event },
|
|
239
|
-
bubbles: !0,
|
|
240
|
-
composed: !0
|
|
241
|
-
}));
|
|
242
|
-
}, [f.onClose, h]), x = s || c;
|
|
243
|
-
return /* @__PURE__ */ _("div", {
|
|
244
|
-
...f,
|
|
245
|
-
"aria-live": x,
|
|
246
|
-
role: l,
|
|
247
|
-
className: (0, M.default)(g, d),
|
|
248
|
-
children: /* @__PURE__ */ v("div", {
|
|
249
|
-
className: (0, M.default)(y),
|
|
250
|
-
children: [
|
|
251
|
-
/* @__PURE__ */ _(L, {
|
|
252
|
-
className: "pkt-alert__icon",
|
|
253
|
-
"aria-hidden": "true",
|
|
254
|
-
name: u === "info" ? "alert-information" : `alert-${u}`
|
|
255
|
-
}),
|
|
256
|
-
t && /* @__PURE__ */ _("div", {
|
|
257
|
-
className: "pkt-alert__close",
|
|
258
|
-
children: /* @__PURE__ */ _(z, {
|
|
259
|
-
tabIndex: 0,
|
|
260
|
-
"aria-label": "close",
|
|
261
|
-
size: r,
|
|
262
|
-
type: "button",
|
|
263
|
-
skin: "tertiary",
|
|
264
|
-
iconName: "close",
|
|
265
|
-
variant: "icon-only",
|
|
266
|
-
onClick: b,
|
|
267
|
-
children: /* @__PURE__ */ _("span", {
|
|
268
|
-
className: "sr-only",
|
|
269
|
-
children: "Lukk"
|
|
270
|
-
})
|
|
271
|
-
})
|
|
272
|
-
}),
|
|
273
|
-
i && /* @__PURE__ */ _("div", {
|
|
274
|
-
className: "pkt-alert__title",
|
|
275
|
-
children: i
|
|
276
|
-
}),
|
|
277
|
-
/* @__PURE__ */ _("div", {
|
|
278
|
-
className: "pkt-alert__text",
|
|
279
|
-
children: e
|
|
280
|
-
}),
|
|
281
|
-
a && /* @__PURE__ */ v("div", {
|
|
282
|
-
className: "pkt-alert__date",
|
|
283
|
-
children: ["Sist oppdatert: ", a]
|
|
284
|
-
})
|
|
285
|
-
]
|
|
286
|
-
})
|
|
287
|
-
});
|
|
288
|
-
};
|
|
289
|
-
ce.displayName = "PktAlert";
|
|
176
|
+
R.displayName = "PktAccordionItem";
|
|
290
177
|
//#endregion
|
|
291
178
|
//#region ../../shared-strings/nb.ts
|
|
292
|
-
var
|
|
179
|
+
var ce = {
|
|
293
180
|
generic: {
|
|
294
181
|
from: "Fra",
|
|
295
182
|
to: "Til",
|
|
@@ -391,6 +278,7 @@ var B = {
|
|
|
391
278
|
},
|
|
392
279
|
backlink: { label: "Gå tilbake til forrige side" },
|
|
393
280
|
breadcrumbs: { ariaLabel: "brødsmulemeny" },
|
|
281
|
+
alert: { lastUpdated: "Sist oppdatert: {date}" },
|
|
394
282
|
tag: { remove: "Klikk for å fjerne {label}" },
|
|
395
283
|
header: {
|
|
396
284
|
search: "Søk",
|
|
@@ -438,33 +326,33 @@ var B = {
|
|
|
438
326
|
srFilesUploadedOfTotal: "{uploaded} av {total} {label} lastet opp",
|
|
439
327
|
srFilesFailedOfTotal: "Feil ved opplasting: {failed} av {total} {label} feilet"
|
|
440
328
|
}
|
|
441
|
-
},
|
|
442
|
-
function
|
|
443
|
-
return t ? e.replace(
|
|
329
|
+
}, z = /\{(\w+)\}/g;
|
|
330
|
+
function B(e, t) {
|
|
331
|
+
return t ? e.replace(z, (n, r) => {
|
|
444
332
|
let i = t[r];
|
|
445
|
-
return i == null ? (
|
|
333
|
+
return i == null ? (ue(r, e), n) : String(i);
|
|
446
334
|
}) : e;
|
|
447
335
|
}
|
|
448
336
|
function le(e, t, n) {
|
|
449
337
|
return e === 1 ? t : n;
|
|
450
338
|
}
|
|
451
|
-
var
|
|
452
|
-
function
|
|
339
|
+
var V = /* @__PURE__ */ new Set();
|
|
340
|
+
function ue(e, t) {
|
|
453
341
|
let n = `${e}::${t}`;
|
|
454
|
-
|
|
342
|
+
V.has(n) || (V.add(n), console.warn(`[punkt] Mangler verdi for plassholderen {${e}} i teksten «${t}»`));
|
|
455
343
|
}
|
|
456
344
|
//#endregion
|
|
457
345
|
//#region ../../shared-strings/store.ts
|
|
458
|
-
var
|
|
459
|
-
function
|
|
346
|
+
var de = Symbol.for("@oslokommune/punkt-strings");
|
|
347
|
+
function H() {
|
|
460
348
|
let e = globalThis;
|
|
461
|
-
return e[
|
|
349
|
+
return e[de] || (e[de] = {
|
|
462
350
|
overrides: {},
|
|
463
351
|
listeners: /* @__PURE__ */ new Set()
|
|
464
|
-
}), e[
|
|
352
|
+
}), e[de];
|
|
465
353
|
}
|
|
466
|
-
function
|
|
467
|
-
let t =
|
|
354
|
+
function fe(e) {
|
|
355
|
+
let t = H(), n = { ...t.overrides };
|
|
468
356
|
for (let t of Object.keys(e)) {
|
|
469
357
|
let r = e[t];
|
|
470
358
|
r && (n[t] = {
|
|
@@ -474,59 +362,59 @@ function K(e) {
|
|
|
474
362
|
}
|
|
475
363
|
t.overrides = n, t.listeners.forEach((e) => e());
|
|
476
364
|
}
|
|
477
|
-
function
|
|
478
|
-
return
|
|
365
|
+
function U() {
|
|
366
|
+
return H().overrides;
|
|
479
367
|
}
|
|
480
|
-
function
|
|
481
|
-
let e =
|
|
368
|
+
function W() {
|
|
369
|
+
let e = H();
|
|
482
370
|
e.overrides = {}, e.listeners.forEach((e) => e());
|
|
483
371
|
}
|
|
484
|
-
function
|
|
485
|
-
let t =
|
|
372
|
+
function G(e) {
|
|
373
|
+
let t = H();
|
|
486
374
|
return t.listeners.add(e), () => {
|
|
487
375
|
t.listeners.delete(e);
|
|
488
376
|
};
|
|
489
377
|
}
|
|
490
378
|
//#endregion
|
|
491
379
|
//#region ../../shared-strings/resolve.ts
|
|
492
|
-
var
|
|
493
|
-
function
|
|
380
|
+
var pe = /* @__PURE__ */ new Map();
|
|
381
|
+
function K(e, t) {
|
|
494
382
|
if (t) for (let n of Object.keys(t)) {
|
|
495
383
|
let r = t[n];
|
|
496
384
|
r !== void 0 && (e[n] = r);
|
|
497
385
|
}
|
|
498
386
|
}
|
|
499
|
-
function
|
|
387
|
+
function me(e) {
|
|
500
388
|
return !!e && Object.keys(e).length > 0;
|
|
501
389
|
}
|
|
502
|
-
function
|
|
503
|
-
let t =
|
|
390
|
+
function he(e) {
|
|
391
|
+
let t = U(), n = pe.get(e);
|
|
504
392
|
if (n && n.overrides === t) return n.value;
|
|
505
393
|
let r = t[e], i;
|
|
506
|
-
if (
|
|
507
|
-
let t = { ...
|
|
508
|
-
|
|
509
|
-
} else i =
|
|
510
|
-
return
|
|
394
|
+
if (me(r)) {
|
|
395
|
+
let t = { ...ce[e] };
|
|
396
|
+
K(t, r), i = t;
|
|
397
|
+
} else i = ce[e];
|
|
398
|
+
return pe.set(e, {
|
|
511
399
|
overrides: t,
|
|
512
400
|
value: i
|
|
513
401
|
}), i;
|
|
514
402
|
}
|
|
515
|
-
function
|
|
516
|
-
let n = t.filter((t) =>
|
|
403
|
+
function q(e, ...t) {
|
|
404
|
+
let n = t.filter((t) => me(t?.[e])), r = he(e);
|
|
517
405
|
if (n.length === 0) return r;
|
|
518
406
|
let i = { ...r };
|
|
519
|
-
for (let t of n)
|
|
407
|
+
for (let t of n) K(i, t?.[e]);
|
|
520
408
|
return i;
|
|
521
409
|
}
|
|
522
|
-
function
|
|
410
|
+
function J(e, ...t) {
|
|
523
411
|
let n = {};
|
|
524
|
-
for (let r of e) n[r] =
|
|
412
|
+
for (let r of e) n[r] = q(r, ...t);
|
|
525
413
|
return n;
|
|
526
414
|
}
|
|
527
415
|
//#endregion
|
|
528
416
|
//#region ../../shared-strings/consent.ts
|
|
529
|
-
var
|
|
417
|
+
var ge = {
|
|
530
418
|
i18n: {
|
|
531
419
|
nb: {
|
|
532
420
|
contentPresentation: {
|
|
@@ -635,8 +523,59 @@ var he = {
|
|
|
635
523
|
}
|
|
636
524
|
}
|
|
637
525
|
]
|
|
638
|
-
}
|
|
639
|
-
|
|
526
|
+
};
|
|
527
|
+
//#endregion
|
|
528
|
+
//#region src/components/button/Button.tsx
|
|
529
|
+
typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/18.2/animations/");
|
|
530
|
+
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) => {
|
|
531
|
+
let x = [
|
|
532
|
+
t,
|
|
533
|
+
"pkt-btn",
|
|
534
|
+
o && `pkt-btn--${o}`,
|
|
535
|
+
s && "pkt-btn--full",
|
|
536
|
+
c && "pkt-btn--full-small",
|
|
537
|
+
l && `pkt-btn--${l}`,
|
|
538
|
+
d && `pkt-btn--${d}`,
|
|
539
|
+
p && `pkt-btn--${p}`,
|
|
540
|
+
f && `pkt-btn--${f}`,
|
|
541
|
+
m && "pkt-btn--isLoading"
|
|
542
|
+
].filter(Boolean).join(" ");
|
|
543
|
+
return /* @__PURE__ */ v("button", {
|
|
544
|
+
...y,
|
|
545
|
+
"aria-busy": m || void 0,
|
|
546
|
+
"aria-disabled": h || void 0,
|
|
547
|
+
disabled: h,
|
|
548
|
+
className: x,
|
|
549
|
+
type: u,
|
|
550
|
+
ref: b,
|
|
551
|
+
children: [
|
|
552
|
+
m && /* @__PURE__ */ _(L, {
|
|
553
|
+
className: "pkt-btn__icon pkt-btn__spinner",
|
|
554
|
+
name: "spinner-blue",
|
|
555
|
+
path: g
|
|
556
|
+
}),
|
|
557
|
+
d !== "label-only" && /* @__PURE__ */ _(L, {
|
|
558
|
+
className: "pkt-btn__icon",
|
|
559
|
+
name: n,
|
|
560
|
+
...i && { path: i }
|
|
561
|
+
}),
|
|
562
|
+
/* @__PURE__ */ _("span", {
|
|
563
|
+
className: "pkt-btn__text",
|
|
564
|
+
children: e
|
|
565
|
+
}),
|
|
566
|
+
d === "icons-right-and-left" && /* @__PURE__ */ _(L, {
|
|
567
|
+
className: "pkt-btn__icon",
|
|
568
|
+
name: r,
|
|
569
|
+
...a && { path: a }
|
|
570
|
+
})
|
|
571
|
+
]
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
Y.displayName = "PktButton";
|
|
575
|
+
//#endregion
|
|
576
|
+
//#region src/components/strings/PktStringsProvider.tsx
|
|
577
|
+
var X = n(void 0), Z = ({ strings: e, children: t }) => {
|
|
578
|
+
let n = s(X), r = f(() => {
|
|
640
579
|
if (!n) return e;
|
|
641
580
|
let t = { ...n };
|
|
642
581
|
for (let n of Object.keys(e)) t[n] = {
|
|
@@ -645,16 +584,16 @@ var he = {
|
|
|
645
584
|
};
|
|
646
585
|
return t;
|
|
647
586
|
}, [n, e]);
|
|
648
|
-
return /* @__PURE__ */ _(
|
|
587
|
+
return /* @__PURE__ */ _(X.Provider, {
|
|
649
588
|
value: r,
|
|
650
589
|
children: t
|
|
651
590
|
});
|
|
652
591
|
};
|
|
653
592
|
//#endregion
|
|
654
593
|
//#region src/hooks/usePktStrings.ts
|
|
655
|
-
function
|
|
656
|
-
let n = h(
|
|
657
|
-
return f(() =>
|
|
594
|
+
function _e(e, t) {
|
|
595
|
+
let n = h(G, U, U), r = s(X), i = e.join("|");
|
|
596
|
+
return f(() => J(e, r, t), [
|
|
658
597
|
i,
|
|
659
598
|
n,
|
|
660
599
|
r,
|
|
@@ -662,8 +601,74 @@ function ge(e, t) {
|
|
|
662
601
|
]);
|
|
663
602
|
}
|
|
664
603
|
//#endregion
|
|
604
|
+
//#region src/components/alert/Alert.tsx
|
|
605
|
+
var ve = ({ 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 }) => {
|
|
606
|
+
let [h, g] = m(!1), y = _e(["generic", "alert"], f), b = {
|
|
607
|
+
"pkt-alert": !0,
|
|
608
|
+
[`pkt-alert--${r}`]: r,
|
|
609
|
+
[`pkt-alert--${u}`]: u,
|
|
610
|
+
"pkt-hide": h
|
|
611
|
+
}, x = {
|
|
612
|
+
"pkt-alert__grid": !0,
|
|
613
|
+
"pkt-alert__noTitle": !i,
|
|
614
|
+
"pkt-alert__noDate": !a
|
|
615
|
+
}, S = o(() => {
|
|
616
|
+
g(!0), p.onClose && p.onClose(new CustomEvent("close", {
|
|
617
|
+
detail: { origin: event },
|
|
618
|
+
bubbles: !0,
|
|
619
|
+
composed: !0
|
|
620
|
+
}));
|
|
621
|
+
}, [p.onClose, g]), C = s || c;
|
|
622
|
+
return /* @__PURE__ */ _("div", {
|
|
623
|
+
...p,
|
|
624
|
+
"aria-live": C,
|
|
625
|
+
role: l,
|
|
626
|
+
className: (0, M.default)(b, d),
|
|
627
|
+
children: /* @__PURE__ */ v("div", {
|
|
628
|
+
className: (0, M.default)(x),
|
|
629
|
+
children: [
|
|
630
|
+
/* @__PURE__ */ _(L, {
|
|
631
|
+
className: "pkt-alert__icon",
|
|
632
|
+
"aria-hidden": "true",
|
|
633
|
+
name: u === "info" ? "alert-information" : `alert-${u}`
|
|
634
|
+
}),
|
|
635
|
+
t && /* @__PURE__ */ _("div", {
|
|
636
|
+
className: "pkt-alert__close",
|
|
637
|
+
children: /* @__PURE__ */ _(Y, {
|
|
638
|
+
tabIndex: 0,
|
|
639
|
+
"aria-label": "close",
|
|
640
|
+
size: r,
|
|
641
|
+
type: "button",
|
|
642
|
+
skin: "tertiary",
|
|
643
|
+
iconName: "close",
|
|
644
|
+
variant: "icon-only",
|
|
645
|
+
onClick: S,
|
|
646
|
+
children: /* @__PURE__ */ _("span", {
|
|
647
|
+
className: "sr-only",
|
|
648
|
+
children: y.generic.close
|
|
649
|
+
})
|
|
650
|
+
})
|
|
651
|
+
}),
|
|
652
|
+
i && /* @__PURE__ */ _("div", {
|
|
653
|
+
className: "pkt-alert__title",
|
|
654
|
+
children: i
|
|
655
|
+
}),
|
|
656
|
+
/* @__PURE__ */ _("div", {
|
|
657
|
+
className: "pkt-alert__text",
|
|
658
|
+
children: e
|
|
659
|
+
}),
|
|
660
|
+
a && /* @__PURE__ */ _("div", {
|
|
661
|
+
className: "pkt-alert__date",
|
|
662
|
+
children: B(y.alert.lastUpdated, { date: a })
|
|
663
|
+
})
|
|
664
|
+
]
|
|
665
|
+
})
|
|
666
|
+
});
|
|
667
|
+
};
|
|
668
|
+
ve.displayName = "PktAlert";
|
|
669
|
+
//#endregion
|
|
665
670
|
//#region src/components/backlink/BackLink.tsx
|
|
666
|
-
var
|
|
671
|
+
var ye = i(({ href: e = "/", text: t = "Forsiden", ariaLabel: n, renderLink: r, className: i, strings: a, ...o }, s) => {
|
|
667
672
|
let c = /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(L, {
|
|
668
673
|
className: "pkt-back-link__icon pkt-icon pkt-link__icon",
|
|
669
674
|
name: "chevron-thin-left",
|
|
@@ -676,10 +681,10 @@ var _e = i(({ href: e = "/", text: t = "Forsiden", ariaLabel: n, renderLink: r,
|
|
|
676
681
|
className: t,
|
|
677
682
|
...r,
|
|
678
683
|
children: n
|
|
679
|
-
})), u =
|
|
684
|
+
})), u = _e(["backlink"], a), d = ["pkt-back-link", i].filter(Boolean).join(" ");
|
|
680
685
|
return /* @__PURE__ */ _("nav", {
|
|
681
686
|
className: d,
|
|
682
|
-
"aria-label": n
|
|
687
|
+
"aria-label": n ?? u.backlink.label,
|
|
683
688
|
ref: s,
|
|
684
689
|
children: l({
|
|
685
690
|
href: e,
|
|
@@ -689,11 +694,11 @@ var _e = i(({ href: e = "/", text: t = "Forsiden", ariaLabel: n, renderLink: r,
|
|
|
689
694
|
})
|
|
690
695
|
});
|
|
691
696
|
});
|
|
692
|
-
|
|
697
|
+
ye.displayName = "PktBackLink";
|
|
693
698
|
//#endregion
|
|
694
699
|
//#region src/components/breadcrumbs/Breadcrumbs.tsx
|
|
695
|
-
var
|
|
696
|
-
let s = e, c = s[s.length - 2], l =
|
|
700
|
+
var be = i(({ breadcrumbs: e, navigationType: t, renderLink: n, className: r, strings: i, ...a }, o) => {
|
|
701
|
+
let s = e, c = s[s.length - 2], l = _e(["breadcrumbs"], i), u = [r, "pkt-breadcrumbs"].filter(Boolean).join(" "), d = n || (t === "router" ? ({ href: e, className: t, children: n, props: r }) => /* @__PURE__ */ _(y, {
|
|
697
702
|
to: e,
|
|
698
703
|
className: t,
|
|
699
704
|
...r,
|
|
@@ -746,108 +751,108 @@ var ve = i(({ breadcrumbs: e, navigationType: t, renderLink: n, className: r, st
|
|
|
746
751
|
})]
|
|
747
752
|
});
|
|
748
753
|
});
|
|
749
|
-
|
|
754
|
+
be.displayName = "PktBreadcrumbs";
|
|
750
755
|
//#endregion
|
|
751
756
|
//#region ../../node_modules/date-fns/constants.js
|
|
752
|
-
var
|
|
753
|
-
|
|
754
|
-
var
|
|
757
|
+
var xe = 365.2425, Se = 6048e5, Ce = 864e5, we = 86400;
|
|
758
|
+
we * 7, we * xe / 12 * 3;
|
|
759
|
+
var Te = Symbol.for("constructDateFrom");
|
|
755
760
|
//#endregion
|
|
756
761
|
//#region ../../node_modules/date-fns/constructFrom.js
|
|
757
|
-
function
|
|
758
|
-
return typeof e == "function" ? e(t) : e && typeof e == "object" &&
|
|
762
|
+
function Ee(e, t) {
|
|
763
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && Te in e ? e[Te](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
759
764
|
}
|
|
760
765
|
//#endregion
|
|
761
766
|
//#region ../../node_modules/date-fns/toDate.js
|
|
762
|
-
function
|
|
763
|
-
return
|
|
767
|
+
function De(e, t) {
|
|
768
|
+
return Ee(t || e, e);
|
|
764
769
|
}
|
|
765
770
|
//#endregion
|
|
766
771
|
//#region ../../node_modules/date-fns/addDays.js
|
|
767
|
-
function
|
|
768
|
-
let r =
|
|
769
|
-
return isNaN(t) ?
|
|
772
|
+
function Oe(e, t, n) {
|
|
773
|
+
let r = De(e, n?.in);
|
|
774
|
+
return isNaN(t) ? Ee(n?.in || e, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
770
775
|
}
|
|
771
776
|
//#endregion
|
|
772
777
|
//#region ../../node_modules/date-fns/_lib/defaultOptions.js
|
|
773
|
-
var
|
|
774
|
-
function
|
|
775
|
-
return
|
|
778
|
+
var ke = {};
|
|
779
|
+
function Ae() {
|
|
780
|
+
return ke;
|
|
776
781
|
}
|
|
777
782
|
//#endregion
|
|
778
783
|
//#region ../../node_modules/date-fns/startOfWeek.js
|
|
779
|
-
function
|
|
780
|
-
let n =
|
|
784
|
+
function Q(e, t) {
|
|
785
|
+
let n = Ae(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, i = De(e, t?.in), a = i.getDay(), o = (a < r ? 7 : 0) + a - r;
|
|
781
786
|
return i.setDate(i.getDate() - o), i.setHours(0, 0, 0, 0), i;
|
|
782
787
|
}
|
|
783
788
|
//#endregion
|
|
784
789
|
//#region ../../node_modules/date-fns/startOfISOWeek.js
|
|
785
|
-
function
|
|
786
|
-
return
|
|
790
|
+
function je(e, t) {
|
|
791
|
+
return Q(e, {
|
|
787
792
|
...t,
|
|
788
793
|
weekStartsOn: 1
|
|
789
794
|
});
|
|
790
795
|
}
|
|
791
796
|
//#endregion
|
|
792
797
|
//#region ../../node_modules/date-fns/getISOWeekYear.js
|
|
793
|
-
function
|
|
794
|
-
let n =
|
|
798
|
+
function Me(e, t) {
|
|
799
|
+
let n = De(e, t?.in), r = n.getFullYear(), i = Ee(n, 0);
|
|
795
800
|
i.setFullYear(r + 1, 0, 4), i.setHours(0, 0, 0, 0);
|
|
796
|
-
let a =
|
|
801
|
+
let a = je(i), o = Ee(n, 0);
|
|
797
802
|
o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
|
|
798
|
-
let s =
|
|
803
|
+
let s = je(o);
|
|
799
804
|
return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= s.getTime() ? r : r - 1;
|
|
800
805
|
}
|
|
801
806
|
//#endregion
|
|
802
807
|
//#region ../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
|
|
803
|
-
function
|
|
804
|
-
let t =
|
|
808
|
+
function Ne(e) {
|
|
809
|
+
let t = De(e), n = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()));
|
|
805
810
|
return n.setUTCFullYear(t.getFullYear()), e - +n;
|
|
806
811
|
}
|
|
807
812
|
//#endregion
|
|
808
813
|
//#region ../../node_modules/date-fns/_lib/normalizeDates.js
|
|
809
|
-
function
|
|
810
|
-
let n =
|
|
814
|
+
function Pe(e, ...t) {
|
|
815
|
+
let n = Ee.bind(null, e || t.find((e) => typeof e == "object"));
|
|
811
816
|
return t.map(n);
|
|
812
817
|
}
|
|
813
818
|
//#endregion
|
|
814
819
|
//#region ../../node_modules/date-fns/startOfDay.js
|
|
815
|
-
function
|
|
816
|
-
let n =
|
|
820
|
+
function Fe(e, t) {
|
|
821
|
+
let n = De(e, t?.in);
|
|
817
822
|
return n.setHours(0, 0, 0, 0), n;
|
|
818
823
|
}
|
|
819
824
|
//#endregion
|
|
820
825
|
//#region ../../node_modules/date-fns/differenceInCalendarDays.js
|
|
821
|
-
function
|
|
822
|
-
let [r, i] =
|
|
823
|
-
return Math.round((s - c) /
|
|
826
|
+
function Ie(e, t, n) {
|
|
827
|
+
let [r, i] = Pe(n?.in, e, t), a = Fe(r), o = Fe(i), s = +a - Ne(a), c = +o - Ne(o);
|
|
828
|
+
return Math.round((s - c) / Ce);
|
|
824
829
|
}
|
|
825
830
|
//#endregion
|
|
826
831
|
//#region ../../node_modules/date-fns/startOfISOWeekYear.js
|
|
827
|
-
function
|
|
828
|
-
let n =
|
|
829
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0),
|
|
832
|
+
function Le(e, t) {
|
|
833
|
+
let n = Me(e, t), r = Ee(t?.in || e, 0);
|
|
834
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), je(r);
|
|
830
835
|
}
|
|
831
836
|
//#endregion
|
|
832
837
|
//#region ../../node_modules/date-fns/isDate.js
|
|
833
|
-
function
|
|
838
|
+
function Re(e) {
|
|
834
839
|
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
835
840
|
}
|
|
836
841
|
//#endregion
|
|
837
842
|
//#region ../../node_modules/date-fns/isValid.js
|
|
838
|
-
function
|
|
839
|
-
return !(!
|
|
843
|
+
function ze(e) {
|
|
844
|
+
return !(!Re(e) && typeof e != "number" || isNaN(+De(e)));
|
|
840
845
|
}
|
|
841
846
|
//#endregion
|
|
842
847
|
//#region ../../node_modules/date-fns/endOfDay.js
|
|
843
|
-
function
|
|
844
|
-
let n =
|
|
848
|
+
function Be(e, t) {
|
|
849
|
+
let n = De(e, t?.in);
|
|
845
850
|
return n.setHours(23, 59, 59, 999), n;
|
|
846
851
|
}
|
|
847
852
|
//#endregion
|
|
848
853
|
//#region ../../node_modules/date-fns/_lib/normalizeInterval.js
|
|
849
|
-
function
|
|
850
|
-
let [n, r] =
|
|
854
|
+
function Ve(e, t) {
|
|
855
|
+
let [n, r] = Pe(e, t.start, t.end);
|
|
851
856
|
return {
|
|
852
857
|
start: n,
|
|
853
858
|
end: r
|
|
@@ -855,25 +860,25 @@ function Be(e, t) {
|
|
|
855
860
|
}
|
|
856
861
|
//#endregion
|
|
857
862
|
//#region ../../node_modules/date-fns/eachDayOfInterval.js
|
|
858
|
-
function
|
|
859
|
-
let { start: n, end: r } =
|
|
863
|
+
function He(e, t) {
|
|
864
|
+
let { start: n, end: r } = Ve(t?.in, e), i = +n > +r, a = i ? +n : +r, o = i ? r : n;
|
|
860
865
|
o.setHours(0, 0, 0, 0);
|
|
861
866
|
let s = t?.step ?? 1;
|
|
862
867
|
if (!s) return [];
|
|
863
868
|
s < 0 && (s = -s, i = !i);
|
|
864
869
|
let c = [];
|
|
865
|
-
for (; +o <= a;) c.push(
|
|
870
|
+
for (; +o <= a;) c.push(Ee(n, o)), o.setDate(o.getDate() + s), o.setHours(0, 0, 0, 0);
|
|
866
871
|
return i ? c.reverse() : c;
|
|
867
872
|
}
|
|
868
873
|
//#endregion
|
|
869
874
|
//#region ../../node_modules/date-fns/startOfYear.js
|
|
870
|
-
function
|
|
871
|
-
let n =
|
|
875
|
+
function Ue(e, t) {
|
|
876
|
+
let n = De(e, t?.in);
|
|
872
877
|
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
873
878
|
}
|
|
874
879
|
//#endregion
|
|
875
880
|
//#region ../../node_modules/date-fns/locale/en-US/_lib/formatDistance.js
|
|
876
|
-
var
|
|
881
|
+
var We = {
|
|
877
882
|
lessThanXSeconds: {
|
|
878
883
|
one: "less than a second",
|
|
879
884
|
other: "less than {{count}} seconds"
|
|
@@ -935,20 +940,20 @@ var Ue = {
|
|
|
935
940
|
one: "almost 1 year",
|
|
936
941
|
other: "almost {{count}} years"
|
|
937
942
|
}
|
|
938
|
-
},
|
|
939
|
-
let r, i =
|
|
943
|
+
}, Ge = (e, t, n) => {
|
|
944
|
+
let r, i = We[e];
|
|
940
945
|
return r = typeof i == "string" ? i : t === 1 ? i.one : i.other.replace("{{count}}", t.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
941
946
|
};
|
|
942
947
|
//#endregion
|
|
943
948
|
//#region ../../node_modules/date-fns/locale/_lib/buildFormatLongFn.js
|
|
944
|
-
function
|
|
949
|
+
function Ke(e) {
|
|
945
950
|
return (t = {}) => {
|
|
946
951
|
let n = t.width ? String(t.width) : e.defaultWidth;
|
|
947
952
|
return e.formats[n] || e.formats[e.defaultWidth];
|
|
948
953
|
};
|
|
949
954
|
}
|
|
950
|
-
var
|
|
951
|
-
date:
|
|
955
|
+
var qe = {
|
|
956
|
+
date: Ke({
|
|
952
957
|
formats: {
|
|
953
958
|
full: "EEEE, MMMM do, y",
|
|
954
959
|
long: "MMMM do, y",
|
|
@@ -957,7 +962,7 @@ var Ke = {
|
|
|
957
962
|
},
|
|
958
963
|
defaultWidth: "full"
|
|
959
964
|
}),
|
|
960
|
-
time:
|
|
965
|
+
time: Ke({
|
|
961
966
|
formats: {
|
|
962
967
|
full: "h:mm:ss a zzzz",
|
|
963
968
|
long: "h:mm:ss a z",
|
|
@@ -966,7 +971,7 @@ var Ke = {
|
|
|
966
971
|
},
|
|
967
972
|
defaultWidth: "full"
|
|
968
973
|
}),
|
|
969
|
-
dateTime:
|
|
974
|
+
dateTime: Ke({
|
|
970
975
|
formats: {
|
|
971
976
|
full: "{{date}} 'at' {{time}}",
|
|
972
977
|
long: "{{date}} 'at' {{time}}",
|
|
@@ -975,17 +980,17 @@ var Ke = {
|
|
|
975
980
|
},
|
|
976
981
|
defaultWidth: "full"
|
|
977
982
|
})
|
|
978
|
-
},
|
|
983
|
+
}, Je = {
|
|
979
984
|
lastWeek: "'last' eeee 'at' p",
|
|
980
985
|
yesterday: "'yesterday at' p",
|
|
981
986
|
today: "'today at' p",
|
|
982
987
|
tomorrow: "'tomorrow at' p",
|
|
983
988
|
nextWeek: "eeee 'at' p",
|
|
984
989
|
other: "P"
|
|
985
|
-
},
|
|
990
|
+
}, Ye = (e, t, n, r) => Je[e];
|
|
986
991
|
//#endregion
|
|
987
992
|
//#region ../../node_modules/date-fns/locale/_lib/buildLocalizeFn.js
|
|
988
|
-
function
|
|
993
|
+
function Xe(e) {
|
|
989
994
|
return (t, n) => {
|
|
990
995
|
let r = n?.context ? String(n.context) : "standalone", i;
|
|
991
996
|
if (r === "formatting" && e.formattingValues) {
|
|
@@ -999,7 +1004,7 @@ function Ye(e) {
|
|
|
999
1004
|
return i[a];
|
|
1000
1005
|
};
|
|
1001
1006
|
}
|
|
1002
|
-
var
|
|
1007
|
+
var Ze = {
|
|
1003
1008
|
ordinalNumber: (e, t) => {
|
|
1004
1009
|
let n = Number(e), r = n % 100;
|
|
1005
1010
|
if (r > 20 || r < 10) switch (r % 10) {
|
|
@@ -1009,7 +1014,7 @@ var Xe = {
|
|
|
1009
1014
|
}
|
|
1010
1015
|
return n + "th";
|
|
1011
1016
|
},
|
|
1012
|
-
era:
|
|
1017
|
+
era: Xe({
|
|
1013
1018
|
values: {
|
|
1014
1019
|
narrow: ["B", "A"],
|
|
1015
1020
|
abbreviated: ["BC", "AD"],
|
|
@@ -1017,7 +1022,7 @@ var Xe = {
|
|
|
1017
1022
|
},
|
|
1018
1023
|
defaultWidth: "wide"
|
|
1019
1024
|
}),
|
|
1020
|
-
quarter:
|
|
1025
|
+
quarter: Xe({
|
|
1021
1026
|
values: {
|
|
1022
1027
|
narrow: [
|
|
1023
1028
|
"1",
|
|
@@ -1041,7 +1046,7 @@ var Xe = {
|
|
|
1041
1046
|
defaultWidth: "wide",
|
|
1042
1047
|
argumentCallback: (e) => e - 1
|
|
1043
1048
|
}),
|
|
1044
|
-
month:
|
|
1049
|
+
month: Xe({
|
|
1045
1050
|
values: {
|
|
1046
1051
|
narrow: [
|
|
1047
1052
|
"J",
|
|
@@ -1088,7 +1093,7 @@ var Xe = {
|
|
|
1088
1093
|
},
|
|
1089
1094
|
defaultWidth: "wide"
|
|
1090
1095
|
}),
|
|
1091
|
-
day:
|
|
1096
|
+
day: Xe({
|
|
1092
1097
|
values: {
|
|
1093
1098
|
narrow: [
|
|
1094
1099
|
"S",
|
|
@@ -1129,7 +1134,7 @@ var Xe = {
|
|
|
1129
1134
|
},
|
|
1130
1135
|
defaultWidth: "wide"
|
|
1131
1136
|
}),
|
|
1132
|
-
dayPeriod:
|
|
1137
|
+
dayPeriod: Xe({
|
|
1133
1138
|
values: {
|
|
1134
1139
|
narrow: {
|
|
1135
1140
|
am: "a",
|
|
@@ -1200,11 +1205,11 @@ var Xe = {
|
|
|
1200
1205
|
};
|
|
1201
1206
|
//#endregion
|
|
1202
1207
|
//#region ../../node_modules/date-fns/locale/_lib/buildMatchFn.js
|
|
1203
|
-
function
|
|
1208
|
+
function Qe(e) {
|
|
1204
1209
|
return (t, n = {}) => {
|
|
1205
1210
|
let r = n.width, i = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], a = t.match(i);
|
|
1206
1211
|
if (!a) return null;
|
|
1207
|
-
let o = a[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ?
|
|
1212
|
+
let o = a[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? et(s, (e) => e.test(o)) : $e(s, (e) => e.test(o)), l;
|
|
1208
1213
|
l = e.valueCallback ? e.valueCallback(c) : c, l = n.valueCallback ? n.valueCallback(l) : l;
|
|
1209
1214
|
let u = t.slice(o.length);
|
|
1210
1215
|
return {
|
|
@@ -1213,15 +1218,15 @@ function Ze(e) {
|
|
|
1213
1218
|
};
|
|
1214
1219
|
};
|
|
1215
1220
|
}
|
|
1216
|
-
function
|
|
1221
|
+
function $e(e, t) {
|
|
1217
1222
|
for (let n in e) if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n])) return n;
|
|
1218
1223
|
}
|
|
1219
|
-
function
|
|
1224
|
+
function et(e, t) {
|
|
1220
1225
|
for (let n = 0; n < e.length; n++) if (t(e[n])) return n;
|
|
1221
1226
|
}
|
|
1222
1227
|
//#endregion
|
|
1223
1228
|
//#region ../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
|
|
1224
|
-
function
|
|
1229
|
+
function tt(e) {
|
|
1225
1230
|
return (t, n = {}) => {
|
|
1226
1231
|
let r = t.match(e.matchPattern);
|
|
1227
1232
|
if (!r) return null;
|
|
@@ -1238,19 +1243,19 @@ function et(e) {
|
|
|
1238
1243
|
}
|
|
1239
1244
|
//#endregion
|
|
1240
1245
|
//#region ../../node_modules/date-fns/locale/en-US.js
|
|
1241
|
-
var
|
|
1246
|
+
var nt = {
|
|
1242
1247
|
code: "en-US",
|
|
1243
|
-
formatDistance:
|
|
1244
|
-
formatLong:
|
|
1245
|
-
formatRelative:
|
|
1246
|
-
localize:
|
|
1248
|
+
formatDistance: Ge,
|
|
1249
|
+
formatLong: qe,
|
|
1250
|
+
formatRelative: Ye,
|
|
1251
|
+
localize: Ze,
|
|
1247
1252
|
match: {
|
|
1248
|
-
ordinalNumber:
|
|
1253
|
+
ordinalNumber: tt({
|
|
1249
1254
|
matchPattern: /^(\d+)(th|st|nd|rd)?/i,
|
|
1250
1255
|
parsePattern: /\d+/i,
|
|
1251
1256
|
valueCallback: (e) => parseInt(e, 10)
|
|
1252
1257
|
}),
|
|
1253
|
-
era:
|
|
1258
|
+
era: Qe({
|
|
1254
1259
|
matchPatterns: {
|
|
1255
1260
|
narrow: /^(b|a)/i,
|
|
1256
1261
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
@@ -1260,7 +1265,7 @@ var tt = {
|
|
|
1260
1265
|
parsePatterns: { any: [/^b/i, /^(a|c)/i] },
|
|
1261
1266
|
defaultParseWidth: "any"
|
|
1262
1267
|
}),
|
|
1263
|
-
quarter:
|
|
1268
|
+
quarter: Qe({
|
|
1264
1269
|
matchPatterns: {
|
|
1265
1270
|
narrow: /^[1234]/i,
|
|
1266
1271
|
abbreviated: /^q[1234]/i,
|
|
@@ -1276,7 +1281,7 @@ var tt = {
|
|
|
1276
1281
|
defaultParseWidth: "any",
|
|
1277
1282
|
valueCallback: (e) => e + 1
|
|
1278
1283
|
}),
|
|
1279
|
-
month:
|
|
1284
|
+
month: Qe({
|
|
1280
1285
|
matchPatterns: {
|
|
1281
1286
|
narrow: /^[jfmasond]/i,
|
|
1282
1287
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
@@ -1315,7 +1320,7 @@ var tt = {
|
|
|
1315
1320
|
},
|
|
1316
1321
|
defaultParseWidth: "any"
|
|
1317
1322
|
}),
|
|
1318
|
-
day:
|
|
1323
|
+
day: Qe({
|
|
1319
1324
|
matchPatterns: {
|
|
1320
1325
|
narrow: /^[smtwf]/i,
|
|
1321
1326
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
@@ -1345,7 +1350,7 @@ var tt = {
|
|
|
1345
1350
|
},
|
|
1346
1351
|
defaultParseWidth: "any"
|
|
1347
1352
|
}),
|
|
1348
|
-
dayPeriod:
|
|
1353
|
+
dayPeriod: Qe({
|
|
1349
1354
|
matchPatterns: {
|
|
1350
1355
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1351
1356
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
@@ -1371,41 +1376,41 @@ var tt = {
|
|
|
1371
1376
|
};
|
|
1372
1377
|
//#endregion
|
|
1373
1378
|
//#region ../../node_modules/date-fns/getDayOfYear.js
|
|
1374
|
-
function
|
|
1375
|
-
let n =
|
|
1376
|
-
return
|
|
1379
|
+
function rt(e, t) {
|
|
1380
|
+
let n = De(e, t?.in);
|
|
1381
|
+
return Ie(n, Ue(n)) + 1;
|
|
1377
1382
|
}
|
|
1378
1383
|
//#endregion
|
|
1379
1384
|
//#region ../../node_modules/date-fns/getISOWeek.js
|
|
1380
|
-
function
|
|
1381
|
-
let n =
|
|
1382
|
-
return Math.round(r /
|
|
1385
|
+
function it(e, t) {
|
|
1386
|
+
let n = De(e, t?.in), r = je(n) - +Le(n);
|
|
1387
|
+
return Math.round(r / Se) + 1;
|
|
1383
1388
|
}
|
|
1384
1389
|
//#endregion
|
|
1385
1390
|
//#region ../../node_modules/date-fns/getWeekYear.js
|
|
1386
|
-
function
|
|
1387
|
-
let n =
|
|
1391
|
+
function at(e, t) {
|
|
1392
|
+
let n = De(e, t?.in), r = n.getFullYear(), i = Ae(), a = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? i.firstWeekContainsDate ?? i.locale?.options?.firstWeekContainsDate ?? 1, o = Ee(t?.in || e, 0);
|
|
1388
1393
|
o.setFullYear(r + 1, 0, a), o.setHours(0, 0, 0, 0);
|
|
1389
|
-
let s =
|
|
1394
|
+
let s = Q(o, t), c = Ee(t?.in || e, 0);
|
|
1390
1395
|
c.setFullYear(r, 0, a), c.setHours(0, 0, 0, 0);
|
|
1391
|
-
let l =
|
|
1396
|
+
let l = Q(c, t);
|
|
1392
1397
|
return +n >= +s ? r + 1 : +n >= +l ? r : r - 1;
|
|
1393
1398
|
}
|
|
1394
1399
|
//#endregion
|
|
1395
1400
|
//#region ../../node_modules/date-fns/startOfWeekYear.js
|
|
1396
|
-
function
|
|
1397
|
-
let n =
|
|
1398
|
-
return a.setFullYear(i, 0, r), a.setHours(0, 0, 0, 0),
|
|
1401
|
+
function ot(e, t) {
|
|
1402
|
+
let n = Ae(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, i = at(e, t), a = Ee(t?.in || e, 0);
|
|
1403
|
+
return a.setFullYear(i, 0, r), a.setHours(0, 0, 0, 0), Q(a, t);
|
|
1399
1404
|
}
|
|
1400
1405
|
//#endregion
|
|
1401
1406
|
//#region ../../node_modules/date-fns/getWeek.js
|
|
1402
|
-
function
|
|
1403
|
-
let n =
|
|
1404
|
-
return Math.round(r /
|
|
1407
|
+
function st(e, t) {
|
|
1408
|
+
let n = De(e, t?.in), r = Q(n, t) - +ot(n, t);
|
|
1409
|
+
return Math.round(r / Se) + 1;
|
|
1405
1410
|
}
|
|
1406
1411
|
//#endregion
|
|
1407
1412
|
//#region ../../node_modules/date-fns/_lib/addLeadingZeros.js
|
|
1408
|
-
function
|
|
1413
|
+
function $(e, t) {
|
|
1409
1414
|
return (e < 0 ? "-" : "") + Math.abs(e).toString().padStart(t, "0");
|
|
1410
1415
|
}
|
|
1411
1416
|
//#endregion
|
|
@@ -1413,14 +1418,14 @@ function st(e, t) {
|
|
|
1413
1418
|
var ct = {
|
|
1414
1419
|
y(e, t) {
|
|
1415
1420
|
let n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
1416
|
-
return
|
|
1421
|
+
return $(t === "yy" ? r % 100 : r, t.length);
|
|
1417
1422
|
},
|
|
1418
1423
|
M(e, t) {
|
|
1419
1424
|
let n = e.getMonth();
|
|
1420
|
-
return t === "M" ? String(n + 1) :
|
|
1425
|
+
return t === "M" ? String(n + 1) : $(n + 1, 2);
|
|
1421
1426
|
},
|
|
1422
1427
|
d(e, t) {
|
|
1423
|
-
return
|
|
1428
|
+
return $(e.getDate(), t.length);
|
|
1424
1429
|
},
|
|
1425
1430
|
a(e, t) {
|
|
1426
1431
|
let n = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
@@ -1433,20 +1438,20 @@ var ct = {
|
|
|
1433
1438
|
}
|
|
1434
1439
|
},
|
|
1435
1440
|
h(e, t) {
|
|
1436
|
-
return
|
|
1441
|
+
return $(e.getHours() % 12 || 12, t.length);
|
|
1437
1442
|
},
|
|
1438
1443
|
H(e, t) {
|
|
1439
|
-
return
|
|
1444
|
+
return $(e.getHours(), t.length);
|
|
1440
1445
|
},
|
|
1441
1446
|
m(e, t) {
|
|
1442
|
-
return
|
|
1447
|
+
return $(e.getMinutes(), t.length);
|
|
1443
1448
|
},
|
|
1444
1449
|
s(e, t) {
|
|
1445
|
-
return
|
|
1450
|
+
return $(e.getSeconds(), t.length);
|
|
1446
1451
|
},
|
|
1447
1452
|
S(e, t) {
|
|
1448
1453
|
let n = t.length, r = e.getMilliseconds();
|
|
1449
|
-
return
|
|
1454
|
+
return $(Math.trunc(r * 10 ** (n - 3)), t.length);
|
|
1450
1455
|
}
|
|
1451
1456
|
}, lt = {
|
|
1452
1457
|
am: "am",
|
|
@@ -1476,20 +1481,20 @@ var ct = {
|
|
|
1476
1481
|
return ct.y(e, t);
|
|
1477
1482
|
},
|
|
1478
1483
|
Y: function(e, t, n, r) {
|
|
1479
|
-
let i =
|
|
1480
|
-
return t === "YY" ?
|
|
1484
|
+
let i = at(e, r), a = i > 0 ? i : 1 - i;
|
|
1485
|
+
return t === "YY" ? $(a % 100, 2) : t === "Yo" ? n.ordinalNumber(a, { unit: "year" }) : $(a, t.length);
|
|
1481
1486
|
},
|
|
1482
1487
|
R: function(e, t) {
|
|
1483
|
-
return
|
|
1488
|
+
return $(Me(e), t.length);
|
|
1484
1489
|
},
|
|
1485
1490
|
u: function(e, t) {
|
|
1486
|
-
return
|
|
1491
|
+
return $(e.getFullYear(), t.length);
|
|
1487
1492
|
},
|
|
1488
1493
|
Q: function(e, t, n) {
|
|
1489
1494
|
let r = Math.ceil((e.getMonth() + 1) / 3);
|
|
1490
1495
|
switch (t) {
|
|
1491
1496
|
case "Q": return String(r);
|
|
1492
|
-
case "QQ": return
|
|
1497
|
+
case "QQ": return $(r, 2);
|
|
1493
1498
|
case "Qo": return n.ordinalNumber(r, { unit: "quarter" });
|
|
1494
1499
|
case "QQQ": return n.quarter(r, {
|
|
1495
1500
|
width: "abbreviated",
|
|
@@ -1509,7 +1514,7 @@ var ct = {
|
|
|
1509
1514
|
let r = Math.ceil((e.getMonth() + 1) / 3);
|
|
1510
1515
|
switch (t) {
|
|
1511
1516
|
case "q": return String(r);
|
|
1512
|
-
case "qq": return
|
|
1517
|
+
case "qq": return $(r, 2);
|
|
1513
1518
|
case "qo": return n.ordinalNumber(r, { unit: "quarter" });
|
|
1514
1519
|
case "qqq": return n.quarter(r, {
|
|
1515
1520
|
width: "abbreviated",
|
|
@@ -1549,7 +1554,7 @@ var ct = {
|
|
|
1549
1554
|
let r = e.getMonth();
|
|
1550
1555
|
switch (t) {
|
|
1551
1556
|
case "L": return String(r + 1);
|
|
1552
|
-
case "LL": return
|
|
1557
|
+
case "LL": return $(r + 1, 2);
|
|
1553
1558
|
case "Lo": return n.ordinalNumber(r + 1, { unit: "month" });
|
|
1554
1559
|
case "LLL": return n.month(r, {
|
|
1555
1560
|
width: "abbreviated",
|
|
@@ -1566,19 +1571,19 @@ var ct = {
|
|
|
1566
1571
|
}
|
|
1567
1572
|
},
|
|
1568
1573
|
w: function(e, t, n, r) {
|
|
1569
|
-
let i =
|
|
1570
|
-
return t === "wo" ? n.ordinalNumber(i, { unit: "week" }) :
|
|
1574
|
+
let i = st(e, r);
|
|
1575
|
+
return t === "wo" ? n.ordinalNumber(i, { unit: "week" }) : $(i, t.length);
|
|
1571
1576
|
},
|
|
1572
1577
|
I: function(e, t, n) {
|
|
1573
|
-
let r =
|
|
1574
|
-
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) :
|
|
1578
|
+
let r = it(e);
|
|
1579
|
+
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : $(r, t.length);
|
|
1575
1580
|
},
|
|
1576
1581
|
d: function(e, t, n) {
|
|
1577
1582
|
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : ct.d(e, t);
|
|
1578
1583
|
},
|
|
1579
1584
|
D: function(e, t, n) {
|
|
1580
|
-
let r =
|
|
1581
|
-
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) :
|
|
1585
|
+
let r = rt(e);
|
|
1586
|
+
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : $(r, t.length);
|
|
1582
1587
|
},
|
|
1583
1588
|
E: function(e, t, n) {
|
|
1584
1589
|
let r = e.getDay();
|
|
@@ -1607,7 +1612,7 @@ var ct = {
|
|
|
1607
1612
|
let i = e.getDay(), a = (i - r.weekStartsOn + 8) % 7 || 7;
|
|
1608
1613
|
switch (t) {
|
|
1609
1614
|
case "e": return String(a);
|
|
1610
|
-
case "ee": return
|
|
1615
|
+
case "ee": return $(a, 2);
|
|
1611
1616
|
case "eo": return n.ordinalNumber(a, { unit: "day" });
|
|
1612
1617
|
case "eee": return n.day(i, {
|
|
1613
1618
|
width: "abbreviated",
|
|
@@ -1631,7 +1636,7 @@ var ct = {
|
|
|
1631
1636
|
let i = e.getDay(), a = (i - r.weekStartsOn + 8) % 7 || 7;
|
|
1632
1637
|
switch (t) {
|
|
1633
1638
|
case "c": return String(a);
|
|
1634
|
-
case "cc": return
|
|
1639
|
+
case "cc": return $(a, t.length);
|
|
1635
1640
|
case "co": return n.ordinalNumber(a, { unit: "day" });
|
|
1636
1641
|
case "ccc": return n.day(i, {
|
|
1637
1642
|
width: "abbreviated",
|
|
@@ -1655,7 +1660,7 @@ var ct = {
|
|
|
1655
1660
|
let r = e.getDay(), i = r === 0 ? 7 : r;
|
|
1656
1661
|
switch (t) {
|
|
1657
1662
|
case "i": return String(i);
|
|
1658
|
-
case "ii": return
|
|
1663
|
+
case "ii": return $(i, t.length);
|
|
1659
1664
|
case "io": return n.ordinalNumber(i, { unit: "day" });
|
|
1660
1665
|
case "iii": return n.day(r, {
|
|
1661
1666
|
width: "abbreviated",
|
|
@@ -1750,11 +1755,11 @@ var ct = {
|
|
|
1750
1755
|
},
|
|
1751
1756
|
K: function(e, t, n) {
|
|
1752
1757
|
let r = e.getHours() % 12;
|
|
1753
|
-
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) :
|
|
1758
|
+
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : $(r, t.length);
|
|
1754
1759
|
},
|
|
1755
1760
|
k: function(e, t, n) {
|
|
1756
1761
|
let r = e.getHours();
|
|
1757
|
-
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) :
|
|
1762
|
+
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : $(r, t.length);
|
|
1758
1763
|
},
|
|
1759
1764
|
m: function(e, t, n) {
|
|
1760
1765
|
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : ct.m(e, t);
|
|
@@ -1803,21 +1808,21 @@ var ct = {
|
|
|
1803
1808
|
}
|
|
1804
1809
|
},
|
|
1805
1810
|
t: function(e, t, n) {
|
|
1806
|
-
return
|
|
1811
|
+
return $(Math.trunc(e / 1e3), t.length);
|
|
1807
1812
|
},
|
|
1808
1813
|
T: function(e, t, n) {
|
|
1809
|
-
return
|
|
1814
|
+
return $(+e, t.length);
|
|
1810
1815
|
}
|
|
1811
1816
|
};
|
|
1812
1817
|
function dt(e, t = "") {
|
|
1813
1818
|
let n = e > 0 ? "-" : "+", r = Math.abs(e), i = Math.trunc(r / 60), a = r % 60;
|
|
1814
|
-
return a === 0 ? n + String(i) : n + String(i) + t +
|
|
1819
|
+
return a === 0 ? n + String(i) : n + String(i) + t + $(a, 2);
|
|
1815
1820
|
}
|
|
1816
1821
|
function ft(e, t) {
|
|
1817
|
-
return e % 60 == 0 ? (e > 0 ? "-" : "+") +
|
|
1822
|
+
return e % 60 == 0 ? (e > 0 ? "-" : "+") + $(Math.abs(e) / 60, 2) : pt(e, t);
|
|
1818
1823
|
}
|
|
1819
1824
|
function pt(e, t = "") {
|
|
1820
|
-
let n = e > 0 ? "-" : "+", r = Math.abs(e), i =
|
|
1825
|
+
let n = e > 0 ? "-" : "+", r = Math.abs(e), i = $(Math.trunc(r / 60), 2), a = $(r % 60, 2);
|
|
1821
1826
|
return n + i + t + a;
|
|
1822
1827
|
}
|
|
1823
1828
|
//#endregion
|
|
@@ -1880,8 +1885,8 @@ function Ct(e, t, n) {
|
|
|
1880
1885
|
//#region ../../node_modules/date-fns/format.js
|
|
1881
1886
|
var wt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Tt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Et = /^'([^]*?)'?$/, Dt = /''/g, Ot = /[a-zA-Z]/;
|
|
1882
1887
|
function kt(e, t, n) {
|
|
1883
|
-
let r =
|
|
1884
|
-
if (!
|
|
1888
|
+
let r = Ae(), i = n?.locale ?? r.locale ?? nt, 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 = De(e, n?.in);
|
|
1889
|
+
if (!ze(s)) throw RangeError("Invalid time value");
|
|
1885
1890
|
let c = t.match(Tt).map((e) => {
|
|
1886
1891
|
let t = e[0];
|
|
1887
1892
|
if (t === "p" || t === "P") {
|
|
@@ -1930,7 +1935,7 @@ function At(e) {
|
|
|
1930
1935
|
//#endregion
|
|
1931
1936
|
//#region ../../node_modules/date-fns/getISODay.js
|
|
1932
1937
|
function jt(e, t) {
|
|
1933
|
-
let n =
|
|
1938
|
+
let n = De(e, t?.in).getDay();
|
|
1934
1939
|
return n === 0 ? 7 : n;
|
|
1935
1940
|
}
|
|
1936
1941
|
//#endregion
|
|
@@ -2118,7 +2123,7 @@ var Yt = (e) => !e || isNaN(e.getTime()) ? "" : `${e.getFullYear()}-${String(e.g
|
|
|
2118
2123
|
return isNaN(n.getTime()) ? "" : kt(n, t);
|
|
2119
2124
|
}, Qt = (e = "", t) => {
|
|
2120
2125
|
let n = typeof e == "string" ? Jt(e) : e;
|
|
2121
|
-
return !n || isNaN(n.getTime()) ? /* @__PURE__ */ new Date() : t ? t === "end" ?
|
|
2126
|
+
return !n || isNaN(n.getTime()) ? /* @__PURE__ */ new Date() : t ? t === "end" ? Be(n) : Fe(n) : n;
|
|
2122
2127
|
}, $t = (e, t, n = 1) => {
|
|
2123
2128
|
if (typeof e != "number" || typeof t != "number" || typeof n != "number" || isNaN(e) || isNaN(t) || isNaN(n)) return /* @__PURE__ */ new Date();
|
|
2124
2129
|
let r = new Date(e, t, n);
|
|
@@ -2178,7 +2183,7 @@ function gn(e) {
|
|
|
2178
2183
|
return typeof e == "string" && (e = e.split(",")), e.length === 1 && e[0] === "" ? [] : e.map((e) => Jt(e));
|
|
2179
2184
|
}
|
|
2180
2185
|
function _n(e, t) {
|
|
2181
|
-
let n =
|
|
2186
|
+
let n = He({
|
|
2182
2187
|
start: e,
|
|
2183
2188
|
end: t
|
|
2184
2189
|
}), r = {};
|
|
@@ -2190,7 +2195,7 @@ function _n(e, t) {
|
|
|
2190
2195
|
}
|
|
2191
2196
|
function vn(e, t, n, r) {
|
|
2192
2197
|
if (t.length !== 1) return !0;
|
|
2193
|
-
let i =
|
|
2198
|
+
let i = He({
|
|
2194
2199
|
start: t[0],
|
|
2195
2200
|
end: e
|
|
2196
2201
|
});
|
|
@@ -2229,7 +2234,7 @@ function Cn(e, t) {
|
|
|
2229
2234
|
numDays: a,
|
|
2230
2235
|
numRows: Math.ceil((a + i) / 7),
|
|
2231
2236
|
numDaysPrevMonth: $t(e, t, 0).getDate(),
|
|
2232
|
-
initialWeek:
|
|
2237
|
+
initialWeek: st(n)
|
|
2233
2238
|
};
|
|
2234
2239
|
}
|
|
2235
2240
|
function wn(e, t, n, r) {
|
|
@@ -2253,10 +2258,10 @@ function Dn(e) {
|
|
|
2253
2258
|
return t === "INPUT" || t === "SELECT" || t === "BUTTON" && !e.dataset?.date;
|
|
2254
2259
|
}
|
|
2255
2260
|
function On(e, t, n) {
|
|
2256
|
-
let r =
|
|
2261
|
+
let r = Oe(e, t);
|
|
2257
2262
|
if (!r) return null;
|
|
2258
2263
|
let i = n(`button[data-date="${Yt(r)}"]`);
|
|
2259
|
-
for (; i instanceof HTMLButtonElement && i.dataset.disabled;) if (r =
|
|
2264
|
+
for (; i instanceof HTMLButtonElement && i.dataset.disabled;) if (r = Oe(r, t), i = n(`button[data-date="${Yt(r)}"]`), !i) return null;
|
|
2260
2265
|
return r;
|
|
2261
2266
|
}
|
|
2262
2267
|
function kn(e) {
|
|
@@ -2265,7 +2270,7 @@ function kn(e) {
|
|
|
2265
2270
|
//#endregion
|
|
2266
2271
|
//#region src/components/calendar/useCalendarState.ts
|
|
2267
2272
|
function An(e) {
|
|
2268
|
-
let { selected: t, multiple: n = !1, maxMultiple: r = 0, range: i = !1, earliest: a = null, latest: s = null, excludedates: u, excludeweekdays: d = [], weeknumbers: h = !1, withcontrols: g = !1, currentmonth: _, today: v, strings: y, onDateSelected: b, onClose: x, id: S, className: C } = e, w = l(), T = S ?? w, E =
|
|
2273
|
+
let { selected: t, multiple: n = !1, maxMultiple: r = 0, range: i = !1, earliest: a = null, latest: s = null, excludedates: u, excludeweekdays: d = [], weeknumbers: h = !1, withcontrols: g = !1, currentmonth: _, today: v, strings: y, onDateSelected: b, onClose: x, id: S, className: C } = e, w = l(), T = S ?? w, E = _e(["dates", "calendar"], y), D = f(() => ({
|
|
2269
2274
|
month: E.dates.month,
|
|
2270
2275
|
year: E.dates.year,
|
|
2271
2276
|
week: E.dates.week,
|
|
@@ -2274,7 +2279,7 @@ function An(e) {
|
|
|
2274
2279
|
months: E.dates.months,
|
|
2275
2280
|
prevMonth: E.calendar.prevMonth,
|
|
2276
2281
|
nextMonth: E.calendar.nextMonth
|
|
2277
|
-
}), [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(() => gn(N), [N]), [ee, te] = m(0), [ne, F] = m(0), [re, ie] = m({}), [ae, oe] = m(null), [se, I] = m(null), L = p(null), R = p([]),
|
|
2282
|
+
}), [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(() => gn(N), [N]), [ee, te] = m(0), [ne, F] = m(0), [re, ie] = m({}), [ae, oe] = m(null), [se, I] = m(null), L = p(null), R = p([]), ce = p(0), z = p(!1), B = p(!1), le = f(() => ({
|
|
2278
2283
|
earliest: a,
|
|
2279
2284
|
latest: s,
|
|
2280
2285
|
excludedates: k,
|
|
@@ -2303,43 +2308,43 @@ function An(e) {
|
|
|
2303
2308
|
}
|
|
2304
2309
|
te(e.getFullYear()), F(e.getMonth()), B.current = !0;
|
|
2305
2310
|
}, []), c(() => {
|
|
2306
|
-
if (B.current && !
|
|
2311
|
+
if (B.current && !z.current && N.length > 0 && N[0] !== "") {
|
|
2307
2312
|
let e = Jt(N[N.length - 1]);
|
|
2308
2313
|
isNaN(e.getTime()) || (te(e.getFullYear()), F(e.getMonth()));
|
|
2309
2314
|
}
|
|
2310
2315
|
}, [N]), c(() => {
|
|
2311
2316
|
i && P.length === 2 ? ie(_n(P[0], P[1])) : (!i || P.length < 2) && ie({});
|
|
2312
2317
|
}, [i, P]);
|
|
2313
|
-
let
|
|
2318
|
+
let V = o((e) => {
|
|
2314
2319
|
A || M(e), b?.(e);
|
|
2315
|
-
}, [A, b]),
|
|
2320
|
+
}, [A, b]), ue = o(() => {
|
|
2316
2321
|
x?.();
|
|
2317
|
-
}, [x]),
|
|
2318
|
-
te(typeof e == "string" ? parseInt(e) : e), F(typeof t == "string" ? parseInt(t) : t),
|
|
2319
|
-
}, []),
|
|
2322
|
+
}, [x]), de = o((e, t) => {
|
|
2323
|
+
te(typeof e == "string" ? parseInt(e) : e), F(typeof t == "string" ? parseInt(t) : t), ce.current = 0, I(null), R.current = [], z.current = !0;
|
|
2324
|
+
}, []), H = o(() => {
|
|
2320
2325
|
let e = ne === 0 ? 11 : ne - 1, t = ne === 0 ? ee - 1 : ee;
|
|
2321
|
-
|
|
2326
|
+
de(t, e);
|
|
2322
2327
|
}, [
|
|
2323
2328
|
ee,
|
|
2324
2329
|
ne,
|
|
2325
|
-
|
|
2326
|
-
]),
|
|
2330
|
+
de
|
|
2331
|
+
]), fe = o(() => {
|
|
2327
2332
|
let e = ne === 11 ? 0 : ne + 1, t = ne === 11 ? ee + 1 : ee;
|
|
2328
|
-
|
|
2333
|
+
de(t, e);
|
|
2329
2334
|
}, [
|
|
2330
2335
|
ee,
|
|
2331
2336
|
ne,
|
|
2332
|
-
|
|
2333
|
-
]),
|
|
2337
|
+
de
|
|
2338
|
+
]), U = o((e) => fn(e, le), [le]), W = o((e, t) => pn(e, t, le, {
|
|
2334
2339
|
multiple: n,
|
|
2335
2340
|
maxMultiple: r,
|
|
2336
2341
|
selectedCount: N.length
|
|
2337
2342
|
}), [
|
|
2338
|
-
|
|
2343
|
+
le,
|
|
2339
2344
|
n,
|
|
2340
2345
|
r,
|
|
2341
2346
|
N.length
|
|
2342
|
-
]),
|
|
2347
|
+
]), G = o(() => typeof N == "string" ? N.split(",") : N, [N]), pe = o((e) => {
|
|
2343
2348
|
if (!i || P.length !== 1 || !vn(e, P, k, d) || P[0] >= e) {
|
|
2344
2349
|
oe(null);
|
|
2345
2350
|
return;
|
|
@@ -2350,50 +2355,50 @@ function An(e) {
|
|
|
2350
2355
|
P,
|
|
2351
2356
|
k,
|
|
2352
2357
|
d
|
|
2353
|
-
]),
|
|
2358
|
+
]), K = o((e) => {
|
|
2354
2359
|
if (!e) return;
|
|
2355
2360
|
let t;
|
|
2356
|
-
if (i) t = Sn(e,
|
|
2361
|
+
if (i) t = Sn(e, G(), {
|
|
2357
2362
|
excludedates: k,
|
|
2358
2363
|
excludeweekdays: d
|
|
2359
|
-
}), A || M(t), t.length === 2 ? (b?.(t),
|
|
2360
|
-
else if (n) t = xn(e,
|
|
2364
|
+
}), A || M(t), t.length === 2 ? (b?.(t), ue()) : (t.length === 1 && ie({}), b?.(t));
|
|
2365
|
+
else if (n) t = xn(e, G(), r), V(t);
|
|
2361
2366
|
else {
|
|
2362
2367
|
let n = Yt(e);
|
|
2363
|
-
t = N.includes(n) ? [] : [n],
|
|
2368
|
+
t = N.includes(n) ? [] : [n], V(t), ue();
|
|
2364
2369
|
}
|
|
2365
2370
|
}, [
|
|
2366
2371
|
i,
|
|
2367
2372
|
n,
|
|
2368
2373
|
r,
|
|
2369
|
-
|
|
2374
|
+
G,
|
|
2370
2375
|
N,
|
|
2371
2376
|
k,
|
|
2372
2377
|
d,
|
|
2373
2378
|
A,
|
|
2374
|
-
|
|
2375
|
-
|
|
2379
|
+
V,
|
|
2380
|
+
ue,
|
|
2376
2381
|
b
|
|
2377
|
-
]),
|
|
2378
|
-
let t = yn(e,
|
|
2379
|
-
A || M(t), i && t.length === 2 && (b?.(t),
|
|
2382
|
+
]), me = o((e) => {
|
|
2383
|
+
let t = yn(e, G());
|
|
2384
|
+
A || M(t), i && t.length === 2 && (b?.(t), ue());
|
|
2380
2385
|
}, [
|
|
2381
|
-
|
|
2386
|
+
G,
|
|
2382
2387
|
A,
|
|
2383
2388
|
i,
|
|
2384
2389
|
b,
|
|
2385
|
-
|
|
2386
|
-
]),
|
|
2387
|
-
let t = bn(e,
|
|
2390
|
+
ue
|
|
2391
|
+
]), he = o((e) => {
|
|
2392
|
+
let t = bn(e, G());
|
|
2388
2393
|
A || M(t);
|
|
2389
|
-
}, [
|
|
2390
|
-
let t = xn(e,
|
|
2394
|
+
}, [G, A]), q = o((e) => {
|
|
2395
|
+
let t = xn(e, G(), r);
|
|
2391
2396
|
A || M(t);
|
|
2392
2397
|
}, [
|
|
2393
|
-
|
|
2398
|
+
G,
|
|
2394
2399
|
r,
|
|
2395
2400
|
A
|
|
2396
|
-
]),
|
|
2401
|
+
]), J = o(() => {
|
|
2397
2402
|
let e = Yt(en(O)), t = L.current?.querySelector(`button[data-date="${e}"]`);
|
|
2398
2403
|
if (t instanceof HTMLButtonElement) {
|
|
2399
2404
|
I(e), t.focus();
|
|
@@ -2404,11 +2409,11 @@ function An(e) {
|
|
|
2404
2409
|
let e = L.current?.querySelector(`button[data-date="${n.currentDateISO}"]`);
|
|
2405
2410
|
e instanceof HTMLButtonElement && (I(n.currentDateISO), e.focus());
|
|
2406
2411
|
}
|
|
2407
|
-
}, []),
|
|
2412
|
+
}, []), ge = o((e, t) => {
|
|
2408
2413
|
let n = e.target;
|
|
2409
2414
|
if (Dn(n)) return;
|
|
2410
2415
|
if (e.preventDefault(), !se) {
|
|
2411
|
-
|
|
2416
|
+
J();
|
|
2412
2417
|
return;
|
|
2413
2418
|
}
|
|
2414
2419
|
let r = On(Qt(se), t, L.current.querySelector.bind(L.current));
|
|
@@ -2416,7 +2421,7 @@ function An(e) {
|
|
|
2416
2421
|
let e = L.current.querySelector(`button[data-date="${Yt(r)}"]`);
|
|
2417
2422
|
e instanceof HTMLButtonElement && !e.dataset.disabled && (I(Yt(r)), e.focus());
|
|
2418
2423
|
}
|
|
2419
|
-
}, [se,
|
|
2424
|
+
}, [se, J]);
|
|
2420
2425
|
return {
|
|
2421
2426
|
componentId: T,
|
|
2422
2427
|
strings: D,
|
|
@@ -2437,34 +2442,34 @@ function An(e) {
|
|
|
2437
2442
|
excludedates: k,
|
|
2438
2443
|
excludeweekdays: d,
|
|
2439
2444
|
className: C,
|
|
2440
|
-
dateConstraints:
|
|
2445
|
+
dateConstraints: le,
|
|
2441
2446
|
calendarRef: L,
|
|
2442
2447
|
selectableDatesRef: R,
|
|
2443
|
-
tabIndexSetRef:
|
|
2444
|
-
prevMonth:
|
|
2445
|
-
nextMonth:
|
|
2446
|
-
changeMonth:
|
|
2447
|
-
handleDateSelect:
|
|
2448
|
-
addToSelected:
|
|
2449
|
-
removeFromSelected:
|
|
2450
|
-
toggleSelectedDate:
|
|
2451
|
-
handleRangeHover:
|
|
2452
|
-
isExcluded:
|
|
2453
|
-
isDayDisabled:
|
|
2454
|
-
focusOnCurrentDate:
|
|
2448
|
+
tabIndexSetRef: ce,
|
|
2449
|
+
prevMonth: H,
|
|
2450
|
+
nextMonth: fe,
|
|
2451
|
+
changeMonth: de,
|
|
2452
|
+
handleDateSelect: K,
|
|
2453
|
+
addToSelected: me,
|
|
2454
|
+
removeFromSelected: he,
|
|
2455
|
+
toggleSelectedDate: q,
|
|
2456
|
+
handleRangeHover: pe,
|
|
2457
|
+
isExcluded: U,
|
|
2458
|
+
isDayDisabled: W,
|
|
2459
|
+
focusOnCurrentDate: J,
|
|
2455
2460
|
handleKeydown: o((e) => {
|
|
2456
2461
|
if (e.key === "Escape") {
|
|
2457
|
-
e.preventDefault(),
|
|
2462
|
+
e.preventDefault(), ue();
|
|
2458
2463
|
return;
|
|
2459
2464
|
}
|
|
2460
2465
|
let t = kn(e.key);
|
|
2461
|
-
t !== null &&
|
|
2462
|
-
}, [
|
|
2466
|
+
t !== null && ge(e.nativeEvent, t);
|
|
2467
|
+
}, [ue, ge]),
|
|
2463
2468
|
handleFocusOut: o((e) => {
|
|
2464
2469
|
let t = e.target, n = e.relatedTarget;
|
|
2465
|
-
L.current && L.current.contains(n) || t.classList.contains("pkt-hide") || t.closest(".pkt-cal-month-picker") ||
|
|
2466
|
-
}, [
|
|
2467
|
-
close:
|
|
2470
|
+
L.current && L.current.contains(n) || t.classList.contains("pkt-hide") || t.closest(".pkt-cal-month-picker") || ue();
|
|
2471
|
+
}, [ue]),
|
|
2472
|
+
close: ue,
|
|
2468
2473
|
setFocusedDate: I
|
|
2469
2474
|
};
|
|
2470
2475
|
}
|
|
@@ -2749,8 +2754,8 @@ var Ln = i(({ children: e, skin: t, textStyle: n, size: r, closeTag: i, classNam
|
|
|
2749
2754
|
c(() => {
|
|
2750
2755
|
E(w.current?.textContent?.trim() ?? "");
|
|
2751
2756
|
}, [e]);
|
|
2752
|
-
let D =
|
|
2753
|
-
if (i && !l) return T &&
|
|
2757
|
+
let D = _e(["tag"], g), O = f(() => {
|
|
2758
|
+
if (i && !l) return T && B(D.tag.remove, { label: T }) || h;
|
|
2754
2759
|
}, [
|
|
2755
2760
|
i,
|
|
2756
2761
|
l,
|
|
@@ -2896,7 +2901,7 @@ Rn.displayName = "PktCard";
|
|
|
2896
2901
|
//#endregion
|
|
2897
2902
|
//#region src/components/checkbox/Checkbox.tsx
|
|
2898
2903
|
var zn = 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, ...w }, T) => {
|
|
2899
|
-
let E =
|
|
2904
|
+
let E = _e(["forms"], S), D = p(null);
|
|
2900
2905
|
c(() => {
|
|
2901
2906
|
D.current && m !== void 0 && (D.current.indeterminate = m);
|
|
2902
2907
|
}, [m]), c(() => {
|
|
@@ -3049,7 +3054,7 @@ Kn.displayName = "PktHelptext";
|
|
|
3049
3054
|
//#endregion
|
|
3050
3055
|
//#region src/components/inputwrapper/InputWrapper.tsx
|
|
3051
3056
|
var qn = 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: f = null, hasError: p = !1, errorMessage: m, disabled: h = !1, inline: y = !1, ariaDescribedby: b, useWrapper: x = !0, children: S, className: C = "", hasFieldset: w = !1, role: T, counterPosition: E = "bottom", size: D = "medium", strings: O }, k) => {
|
|
3052
|
-
let A = Bn(k), j =
|
|
3057
|
+
let A = Bn(k), j = _e(["forms", "validation"], O), M = b || (n ? `${e}-helptext` : void 0), N = !!a, P = N && E === "top", ee = N && E === "bottom", te = [
|
|
3053
3058
|
"pkt-inputwrapper",
|
|
3054
3059
|
C,
|
|
3055
3060
|
p ? "pkt-inputwrapper--error" : "",
|
|
@@ -3068,7 +3073,7 @@ var qn = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
3068
3073
|
className: "pkt-sr-only",
|
|
3069
3074
|
id: Hn(e),
|
|
3070
3075
|
"aria-live": "polite",
|
|
3071
|
-
children: F ?
|
|
3076
|
+
children: F ? B(j.validation.counterExceeded, {
|
|
3072
3077
|
current: o,
|
|
3073
3078
|
max: s ?? 0
|
|
3074
3079
|
}) : ""
|
|
@@ -3122,7 +3127,7 @@ var qn = i(({ forId: e, label: t, helptext: n, helptextDropdown: r, helptextDrop
|
|
|
3122
3127
|
ee && /* @__PURE__ */ _(re, {}),
|
|
3123
3128
|
p && m && /* @__PURE__ */ _("div", {
|
|
3124
3129
|
className: "pkt-inputwrapper__alert-wrapper",
|
|
3125
|
-
children: /* @__PURE__ */ _(
|
|
3130
|
+
children: /* @__PURE__ */ _(ve, {
|
|
3126
3131
|
skin: "error",
|
|
3127
3132
|
size: se,
|
|
3128
3133
|
"aria-live": "assertive",
|
|
@@ -3407,7 +3412,7 @@ var Jn = (e, t) => t && (e.find((e) => e.value === t) || e.find((e) => e.label =
|
|
|
3407
3412
|
]
|
|
3408
3413
|
});
|
|
3409
3414
|
}, hr = ({ state: e }) => {
|
|
3410
|
-
let t =
|
|
3415
|
+
let t = _e(["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 = [
|
|
3411
3416
|
"pkt-listbox",
|
|
3412
3417
|
i && "pkt-listbox__open",
|
|
3413
3418
|
"pkt-txt-16-light"
|
|
@@ -3550,9 +3555,9 @@ function gr(e, t) {
|
|
|
3550
3555
|
}));
|
|
3551
3556
|
}
|
|
3552
3557
|
function _r(t, n) {
|
|
3553
|
-
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, className: se, onChange: I, onValueChange: L, children: R, strings:
|
|
3554
|
-
|
|
3555
|
-
}, [
|
|
3558
|
+
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, className: se, onChange: I, onValueChange: L, children: R, strings: ce } = t, z = `${r}-input`, B = `${r}-listbox`, le = v || b, V = p(null), ue = p(null), de = p(null), H = p(null), fe = p(null), U = o(() => {
|
|
3559
|
+
le ? V.current?.focus() : de.current?.focus();
|
|
3560
|
+
}, [le]), W = f(() => {
|
|
3556
3561
|
let t = [];
|
|
3557
3562
|
return e.forEach(R, (e) => {
|
|
3558
3563
|
if (a(e) && e.type === "option") {
|
|
@@ -3565,90 +3570,90 @@ function _r(t, n) {
|
|
|
3565
3570
|
});
|
|
3566
3571
|
}
|
|
3567
3572
|
}), t;
|
|
3568
|
-
}, [R]),
|
|
3573
|
+
}, [R]), G = f(() => h && h.length > 0 ? h.map((e) => ({
|
|
3569
3574
|
...e,
|
|
3570
3575
|
fulltext: Zn(e)
|
|
3571
3576
|
})) : d && d.length > 0 ? d.map((e) => ({
|
|
3572
3577
|
...e,
|
|
3573
3578
|
fulltext: Zn(e)
|
|
3574
|
-
})) :
|
|
3579
|
+
})) : W.length > 0 ? W.map((e) => ({
|
|
3575
3580
|
...e,
|
|
3576
3581
|
fulltext: Zn(e)
|
|
3577
3582
|
})) : [], [
|
|
3578
3583
|
h,
|
|
3579
3584
|
d,
|
|
3580
|
-
|
|
3581
|
-
]),
|
|
3585
|
+
W
|
|
3586
|
+
]), pe = s !== void 0, [K, me] = m(() => er(s ?? l, g)), he = p(K);
|
|
3582
3587
|
c(() => {
|
|
3583
|
-
|
|
3588
|
+
pe && me(er(s, g));
|
|
3584
3589
|
}, [
|
|
3585
3590
|
s,
|
|
3586
|
-
|
|
3591
|
+
pe,
|
|
3587
3592
|
g
|
|
3588
3593
|
]);
|
|
3589
|
-
let
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
]), [
|
|
3594
|
-
|
|
3595
|
-
|
|
3594
|
+
let q = pe ? er(s, g) : K, [J, ge] = m([]), Y = f(() => gr([...J.filter((e) => !G.some((t) => t.value === e.value)), ...G], q), [
|
|
3595
|
+
G,
|
|
3596
|
+
J,
|
|
3597
|
+
q
|
|
3598
|
+
]), [X, Z] = m(!1), [ve, ye] = m(""), [be, xe] = m(""), [Se, Ce] = m(""), [we, Te] = m(null), [Ee, De] = m(!1), [Oe, ke] = m(!1), [Ae, Q] = m(-1), je = p(!1), Me = _e(["combobox"], ce), Ne = Se ? Me.combobox[Se] : "", Pe = Qn(q.length, _ ?? null), Fe = ie ?? (g && _ != null), Ie = f(() => ve ? v ? tr(Y, ve).filtered : Xn(Y, ve) : Y, [
|
|
3599
|
+
Y,
|
|
3600
|
+
ve,
|
|
3596
3601
|
v
|
|
3597
|
-
]),
|
|
3598
|
-
let t =
|
|
3599
|
-
if (!t || !
|
|
3602
|
+
]), Le = f(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Re = o((e) => {
|
|
3603
|
+
let t = ue.current;
|
|
3604
|
+
if (!t || !Le) return;
|
|
3600
3605
|
let n = g ? e.join(",") : e[0] || "";
|
|
3601
|
-
|
|
3602
|
-
}, [
|
|
3606
|
+
Le.call(t, n), t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3607
|
+
}, [Le, g]), ze = g ? q.join(",") : q[0] || "";
|
|
3603
3608
|
c(() => {
|
|
3604
|
-
|
|
3605
|
-
}, [
|
|
3606
|
-
if (
|
|
3607
|
-
let e = !g &&
|
|
3608
|
-
|
|
3609
|
+
ue.current && (ue.current.value = ze);
|
|
3610
|
+
}, [ze]), c(() => {
|
|
3611
|
+
if (X || !V.current) return;
|
|
3612
|
+
let e = !g && q[0] ? ar(q[0], Y, x) : "";
|
|
3613
|
+
V.current.value !== e && (V.current.value = e);
|
|
3609
3614
|
}, [
|
|
3610
|
-
|
|
3611
|
-
|
|
3615
|
+
q,
|
|
3616
|
+
Y,
|
|
3612
3617
|
x,
|
|
3613
3618
|
g,
|
|
3614
|
-
|
|
3619
|
+
X
|
|
3615
3620
|
]);
|
|
3616
|
-
let
|
|
3617
|
-
|
|
3621
|
+
let Be = o((e, t = !0) => {
|
|
3622
|
+
pe || me(e), t && (L?.(e), Re(e));
|
|
3618
3623
|
}, [
|
|
3619
|
-
|
|
3624
|
+
pe,
|
|
3620
3625
|
L,
|
|
3621
|
-
|
|
3622
|
-
]),
|
|
3623
|
-
if (!e ||
|
|
3624
|
-
if (g && Qn(
|
|
3625
|
-
|
|
3626
|
+
Re
|
|
3627
|
+
]), Ve = o((e) => {
|
|
3628
|
+
if (!e || q.includes(e)) return;
|
|
3629
|
+
if (g && Qn(q.length, _ ?? null)) {
|
|
3630
|
+
Ce("maxSelected");
|
|
3626
3631
|
return;
|
|
3627
3632
|
}
|
|
3628
|
-
let t = g ? [...
|
|
3629
|
-
|
|
3633
|
+
let t = g ? [...q, e] : [e];
|
|
3634
|
+
Be(t);
|
|
3630
3635
|
}, [
|
|
3631
|
-
|
|
3636
|
+
q,
|
|
3632
3637
|
g,
|
|
3633
3638
|
_,
|
|
3634
|
-
|
|
3635
|
-
]),
|
|
3639
|
+
Be
|
|
3640
|
+
]), He = o((e) => {
|
|
3636
3641
|
if (!e) return;
|
|
3637
|
-
let t =
|
|
3638
|
-
Jn(
|
|
3642
|
+
let t = q.filter((t) => t !== e);
|
|
3643
|
+
Jn(Y, e)?.userAdded && ge((t) => t.filter((t) => t.value !== e)), Be(t);
|
|
3639
3644
|
}, [
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
]),
|
|
3644
|
-
|
|
3645
|
-
}, [
|
|
3645
|
+
q,
|
|
3646
|
+
Y,
|
|
3647
|
+
Be
|
|
3648
|
+
]), Ue = o(() => {
|
|
3649
|
+
ge([]), Be([]);
|
|
3650
|
+
}, [Be]), We = o((e) => {
|
|
3646
3651
|
if (!e || e.trim() === "") return;
|
|
3647
3652
|
let t;
|
|
3648
3653
|
if (!g) t = [e];
|
|
3649
3654
|
else {
|
|
3650
|
-
if (Jn(
|
|
3651
|
-
t = [...
|
|
3655
|
+
if (Jn(Y, e) || Qn(q.length, _ ?? null)) return;
|
|
3656
|
+
t = [...q, e];
|
|
3652
3657
|
}
|
|
3653
3658
|
let n = {
|
|
3654
3659
|
value: e,
|
|
@@ -3656,389 +3661,389 @@ function _r(t, n) {
|
|
|
3656
3661
|
userAdded: !0,
|
|
3657
3662
|
selected: !0
|
|
3658
3663
|
};
|
|
3659
|
-
|
|
3664
|
+
ge((t) => [n, ...t.filter((t) => t.value !== e)]), Be(t);
|
|
3660
3665
|
}, [
|
|
3661
3666
|
g,
|
|
3662
|
-
|
|
3663
|
-
|
|
3667
|
+
Y,
|
|
3668
|
+
q,
|
|
3664
3669
|
_,
|
|
3665
|
-
|
|
3666
|
-
]),
|
|
3667
|
-
if (
|
|
3668
|
-
|
|
3669
|
-
let e = t === void 0 ?
|
|
3670
|
-
!g && e ?
|
|
3670
|
+
Be
|
|
3671
|
+
]), Ge = o((e = !0, t) => {
|
|
3672
|
+
if (Te(null), e && V.current && V.current.type !== "hidden") {
|
|
3673
|
+
ye(""), xe("");
|
|
3674
|
+
let e = t === void 0 ? q[0] : t;
|
|
3675
|
+
!g && e ? V.current.value = ar(e, Y, x) : V.current.value = "", g || (ke(!1), Ce(""));
|
|
3671
3676
|
}
|
|
3672
3677
|
}, [
|
|
3673
3678
|
g,
|
|
3674
|
-
|
|
3675
|
-
|
|
3679
|
+
q,
|
|
3680
|
+
Y,
|
|
3676
3681
|
x
|
|
3677
|
-
]),
|
|
3682
|
+
]), Ke = o((e) => {
|
|
3678
3683
|
if (T) return;
|
|
3679
|
-
|
|
3680
|
-
let t = Jn(
|
|
3681
|
-
i || (!r && b && !a ? (
|
|
3682
|
-
|
|
3684
|
+
Ce(""), Te(null);
|
|
3685
|
+
let t = Jn(Y, e)?.value || null, n = q.includes(e || t || ""), r = !!t, i = Y.find((t) => t.value === e)?.disabled || !1, a = !e?.trim(), o = !g, s = g, c = Qn(q.length, _ ?? null), l = !1, u = !0, d = "", f = "", p;
|
|
3686
|
+
i || (!r && b && !a ? (We(e), d = "valueAdded", l = s, o && (p = e || "")) : !r && !b ? (o && q[0] && He(q[0]), u = !1, l = !0, d = "noResults") : n ? (He(t), l = !0, p = "", o && le && V.current && V.current.type !== "hidden" && (V.current.value = "")) : a && o ? (Ue(), l = !0, p = "") : o ? (q[0] && He(q[0]), Ve(t), l = !1, p = t || "") : s && !c ? (Ve(t), l = !0) : s && c ? (d = "maxSelected", u = !1, f = e || "") : (o && Ue(), d = "noValidValue", u = !1, l = !0, f = e || "", p = ""), Z(l), Ce(d), ye(f), Ge(u, p), l || (o && le && (je.current = !0), window.setTimeout(() => {
|
|
3687
|
+
U();
|
|
3683
3688
|
}, 0)));
|
|
3684
3689
|
}, [
|
|
3685
3690
|
T,
|
|
3686
|
-
|
|
3687
|
-
|
|
3691
|
+
Y,
|
|
3692
|
+
q,
|
|
3688
3693
|
g,
|
|
3689
3694
|
_,
|
|
3690
3695
|
b,
|
|
3696
|
+
We,
|
|
3697
|
+
He,
|
|
3691
3698
|
Ue,
|
|
3692
3699
|
Ve,
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
if (Te(!1), Ce(null), xe(""), _e(""), H.current && H.current.type !== "hidden") {
|
|
3699
|
-
let e = H.current.value, t = X[0];
|
|
3700
|
+
Ge,
|
|
3701
|
+
U
|
|
3702
|
+
]), qe = o(() => {
|
|
3703
|
+
if (De(!1), Te(null), Ce(""), ye(""), V.current && V.current.type !== "hidden") {
|
|
3704
|
+
let e = V.current.value, t = q[0];
|
|
3700
3705
|
if (!g) {
|
|
3701
|
-
if (!e)
|
|
3706
|
+
if (!e) q[0] && He(q[0]), t = void 0;
|
|
3702
3707
|
else {
|
|
3703
|
-
let n = Jn(
|
|
3704
|
-
n && n.value !==
|
|
3708
|
+
let n = Jn(Y, e);
|
|
3709
|
+
n && n.value !== q[0] ? (q[0] && He(q[0]), Ve(n.value), t = n.value) : !n && b && (q[0] && He(q[0]), We(e), t = e);
|
|
3705
3710
|
}
|
|
3706
3711
|
} else if (e !== "") {
|
|
3707
|
-
let { action: t, value: n } = ir(e,
|
|
3712
|
+
let { action: t, value: n } = ir(e, q, Y, b, g);
|
|
3708
3713
|
switch (t) {
|
|
3709
3714
|
case "addUserValue":
|
|
3710
|
-
|
|
3715
|
+
We(n);
|
|
3711
3716
|
break;
|
|
3712
3717
|
case "selectOption":
|
|
3713
|
-
|
|
3718
|
+
Ve(n);
|
|
3714
3719
|
break;
|
|
3715
|
-
case "removeValue":
|
|
3720
|
+
case "removeValue": He(n);
|
|
3716
3721
|
}
|
|
3717
3722
|
}
|
|
3718
|
-
!g && t ?
|
|
3723
|
+
!g && t ? V.current.value = ar(t, Y, x) : V.current.value = "";
|
|
3719
3724
|
}
|
|
3720
|
-
|
|
3725
|
+
Z(!1), ke(!1);
|
|
3721
3726
|
}, [
|
|
3722
|
-
|
|
3723
|
-
|
|
3727
|
+
q,
|
|
3728
|
+
Y,
|
|
3724
3729
|
b,
|
|
3725
3730
|
g,
|
|
3726
3731
|
x,
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
]),
|
|
3732
|
+
We,
|
|
3733
|
+
Ve,
|
|
3734
|
+
He
|
|
3735
|
+
]), Je = o((e) => {
|
|
3731
3736
|
if (!e.trim().toLowerCase()) {
|
|
3732
|
-
|
|
3737
|
+
Te(null), Ce(""), !g && q[0] && He(q[0]);
|
|
3733
3738
|
return;
|
|
3734
3739
|
}
|
|
3735
|
-
let t = nr(e,
|
|
3736
|
-
|
|
3740
|
+
let t = nr(e, q, Y, b);
|
|
3741
|
+
Te(t.addValueText), Ce(t.userInfoMessage);
|
|
3737
3742
|
}, [
|
|
3738
|
-
|
|
3739
|
-
|
|
3743
|
+
q,
|
|
3744
|
+
Y,
|
|
3740
3745
|
b,
|
|
3741
3746
|
g,
|
|
3742
|
-
|
|
3743
|
-
]),
|
|
3747
|
+
He
|
|
3748
|
+
]), Ye = o((e) => {
|
|
3744
3749
|
if (T) return;
|
|
3745
3750
|
let t = e.target.value;
|
|
3746
|
-
if (
|
|
3747
|
-
let { suggestion: n } = tr(
|
|
3748
|
-
n?.label &&
|
|
3751
|
+
if (xe(t), ye(t), Je(t), v && t) {
|
|
3752
|
+
let { suggestion: n } = tr(Y, t);
|
|
3753
|
+
n?.label && V.current && !e.nativeEvent.inputType?.includes("deleteContent") && (V.current.value = n.label, window.setTimeout(() => V.current?.setSelectionRange(t.length, n.label.length), 0));
|
|
3749
3754
|
}
|
|
3750
3755
|
}, [
|
|
3751
3756
|
T,
|
|
3752
3757
|
v,
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
]),
|
|
3758
|
+
Y,
|
|
3759
|
+
Je
|
|
3760
|
+
]), Xe = o((e) => {
|
|
3756
3761
|
if (e.key === "Backspace") {
|
|
3757
|
-
let t = !
|
|
3758
|
-
if (
|
|
3762
|
+
let t = !V.current?.value;
|
|
3763
|
+
if (!ve && t && g && q.length > 0) {
|
|
3759
3764
|
e.preventDefault();
|
|
3760
|
-
let t =
|
|
3761
|
-
|
|
3765
|
+
let t = q[q.length - 1];
|
|
3766
|
+
He(t);
|
|
3762
3767
|
}
|
|
3763
3768
|
return;
|
|
3764
3769
|
}
|
|
3765
|
-
if (e.key === "ArrowLeft" && g &&
|
|
3766
|
-
e.preventDefault(),
|
|
3770
|
+
if (e.key === "ArrowLeft" && g && q.length > 0 && (V.current?.selectionStart ?? 0) === 0 && !V.current?.value) {
|
|
3771
|
+
e.preventDefault(), Q(q.length - 1);
|
|
3767
3772
|
return;
|
|
3768
3773
|
}
|
|
3769
3774
|
let t = rr(e.key, e.shiftKey, g);
|
|
3770
|
-
if (t && !(e.key === "Tab" && !
|
|
3771
|
-
if (t === "focusListbox" && e.key === "Tab" && !
|
|
3772
|
-
|
|
3775
|
+
if (t && !(e.key === "Tab" && !X)) {
|
|
3776
|
+
if (t === "focusListbox" && e.key === "Tab" && !H.current?.querySelector("[role=\"option\"]:not([data-disabled]), [data-type=\"new-option\"]")) {
|
|
3777
|
+
qe();
|
|
3773
3778
|
return;
|
|
3774
3779
|
}
|
|
3775
3780
|
switch (e.preventDefault(), t) {
|
|
3776
3781
|
case "addValue": {
|
|
3777
|
-
let e =
|
|
3778
|
-
if (
|
|
3779
|
-
|
|
3782
|
+
let e = V.current?.value.trim() || "";
|
|
3783
|
+
if (ye(e), e && q.includes(e)) {
|
|
3784
|
+
Ge(!0), Ce("alreadySelected");
|
|
3780
3785
|
break;
|
|
3781
3786
|
}
|
|
3782
|
-
|
|
3787
|
+
Ke(e);
|
|
3783
3788
|
break;
|
|
3784
3789
|
}
|
|
3785
3790
|
case "focusListbox":
|
|
3786
|
-
|
|
3791
|
+
H.current && (X || Z(!0), dr(H.current, {
|
|
3787
3792
|
disabled: T,
|
|
3788
3793
|
allowUserInput: b,
|
|
3789
|
-
customUserInput:
|
|
3794
|
+
customUserInput: we,
|
|
3790
3795
|
includeSearch: y
|
|
3791
3796
|
}));
|
|
3792
3797
|
break;
|
|
3793
|
-
case "closeOptions":
|
|
3798
|
+
case "closeOptions": Z(!1);
|
|
3794
3799
|
}
|
|
3795
3800
|
}
|
|
3796
3801
|
}, [
|
|
3797
|
-
|
|
3798
|
-
|
|
3802
|
+
ve,
|
|
3803
|
+
q,
|
|
3799
3804
|
g,
|
|
3800
3805
|
T,
|
|
3801
3806
|
b,
|
|
3802
|
-
|
|
3807
|
+
we,
|
|
3803
3808
|
y,
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
]),
|
|
3809
|
+
X,
|
|
3810
|
+
He,
|
|
3811
|
+
Ke,
|
|
3812
|
+
U
|
|
3813
|
+
]), Ze = o(() => {
|
|
3809
3814
|
if (!T) {
|
|
3810
|
-
if (
|
|
3811
|
-
|
|
3815
|
+
if (je.current) {
|
|
3816
|
+
je.current = !1, De(!0);
|
|
3812
3817
|
return;
|
|
3813
3818
|
}
|
|
3814
|
-
!g &&
|
|
3819
|
+
!g && q[0] && V.current && V.current.type !== "hidden" && (ke(!0), V.current.value = ar(q[0], Y, x)), De(!0), ye(""), Z(!0);
|
|
3815
3820
|
}
|
|
3816
3821
|
}, [
|
|
3817
3822
|
T,
|
|
3818
3823
|
g,
|
|
3819
|
-
|
|
3820
|
-
|
|
3824
|
+
q,
|
|
3825
|
+
Y,
|
|
3821
3826
|
x
|
|
3822
|
-
]),
|
|
3823
|
-
|
|
3824
|
-
}, []),
|
|
3825
|
-
if (T || !
|
|
3826
|
-
let t = e.relatedTarget, n =
|
|
3827
|
-
n && t && n.contains(t) ||
|
|
3827
|
+
]), Qe = o(() => {
|
|
3828
|
+
De(!1), ke(!1);
|
|
3829
|
+
}, []), $e = o((e) => {
|
|
3830
|
+
if (T || !X) return;
|
|
3831
|
+
let t = e.relatedTarget, n = fe.current;
|
|
3832
|
+
n && t && n.contains(t) || qe();
|
|
3828
3833
|
}, [
|
|
3829
3834
|
T,
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
]),
|
|
3835
|
+
X,
|
|
3836
|
+
qe
|
|
3837
|
+
]), et = o((e) => {
|
|
3833
3838
|
if (T) {
|
|
3834
3839
|
e.preventDefault(), e.stopPropagation();
|
|
3835
3840
|
return;
|
|
3836
3841
|
}
|
|
3837
|
-
if (
|
|
3842
|
+
if (le) V.current?.focus();
|
|
3838
3843
|
else {
|
|
3839
3844
|
e.stopPropagation(), e.preventDefault();
|
|
3840
|
-
let t = !
|
|
3841
|
-
|
|
3845
|
+
let t = !X;
|
|
3846
|
+
Z(t), t && H.current && dr(H.current, {
|
|
3842
3847
|
disabled: T,
|
|
3843
3848
|
allowUserInput: b,
|
|
3844
|
-
customUserInput:
|
|
3849
|
+
customUserInput: we,
|
|
3845
3850
|
includeSearch: y
|
|
3846
3851
|
});
|
|
3847
3852
|
}
|
|
3848
3853
|
}, [
|
|
3849
3854
|
T,
|
|
3850
|
-
|
|
3851
|
-
|
|
3855
|
+
le,
|
|
3856
|
+
X,
|
|
3852
3857
|
b,
|
|
3853
|
-
|
|
3858
|
+
we,
|
|
3854
3859
|
y
|
|
3855
|
-
]),
|
|
3856
|
-
T || (e.stopPropagation(),
|
|
3857
|
-
}, [T,
|
|
3860
|
+
]), tt = o((e) => {
|
|
3861
|
+
T || (e.stopPropagation(), le && V.current ? (V.current.focus(), De(!0)) : Z((e) => !e));
|
|
3862
|
+
}, [T, le]), nt = o((e) => {
|
|
3858
3863
|
if (!T) switch (e.key) {
|
|
3859
3864
|
case "Enter":
|
|
3860
3865
|
case " ":
|
|
3861
3866
|
case "ArrowDown":
|
|
3862
3867
|
case "ArrowUp":
|
|
3863
|
-
e.preventDefault(),
|
|
3864
|
-
|
|
3868
|
+
e.preventDefault(), X ? Z(!1) : (Z(!0), H.current && window.setTimeout(() => {
|
|
3869
|
+
H.current && dr(H.current, {
|
|
3865
3870
|
disabled: T,
|
|
3866
|
-
allowUserInput: b && !
|
|
3867
|
-
customUserInput:
|
|
3871
|
+
allowUserInput: b && !Pe,
|
|
3872
|
+
customUserInput: we,
|
|
3868
3873
|
includeSearch: y
|
|
3869
3874
|
});
|
|
3870
3875
|
}, 0));
|
|
3871
3876
|
break;
|
|
3872
3877
|
case "Escape":
|
|
3873
|
-
|
|
3878
|
+
X && (e.preventDefault(), Z(!1));
|
|
3874
3879
|
break;
|
|
3875
3880
|
case "Home":
|
|
3876
3881
|
case "End":
|
|
3877
|
-
e.preventDefault(),
|
|
3878
|
-
|
|
3882
|
+
e.preventDefault(), X || Z(!0), H.current && window.setTimeout(() => {
|
|
3883
|
+
H.current && dr(H.current, {
|
|
3879
3884
|
disabled: T,
|
|
3880
|
-
allowUserInput: b && !
|
|
3881
|
-
customUserInput:
|
|
3885
|
+
allowUserInput: b && !Pe,
|
|
3886
|
+
customUserInput: we,
|
|
3882
3887
|
includeSearch: y
|
|
3883
3888
|
});
|
|
3884
3889
|
}, 0);
|
|
3885
3890
|
break;
|
|
3886
3891
|
case "ArrowLeft":
|
|
3887
|
-
g &&
|
|
3892
|
+
g && q.length > 0 && (e.preventDefault(), Q(q.length - 1));
|
|
3888
3893
|
break;
|
|
3889
3894
|
case "Backspace":
|
|
3890
|
-
case "Delete": if (g &&
|
|
3895
|
+
case "Delete": if (g && q.length > 0) {
|
|
3891
3896
|
e.preventDefault();
|
|
3892
|
-
let t =
|
|
3893
|
-
|
|
3897
|
+
let t = q[q.length - 1];
|
|
3898
|
+
He(t);
|
|
3894
3899
|
}
|
|
3895
3900
|
}
|
|
3896
3901
|
}, [
|
|
3897
3902
|
T,
|
|
3898
|
-
|
|
3903
|
+
X,
|
|
3899
3904
|
b,
|
|
3900
|
-
|
|
3901
|
-
|
|
3905
|
+
Pe,
|
|
3906
|
+
we,
|
|
3902
3907
|
y,
|
|
3903
3908
|
g,
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
]),
|
|
3907
|
-
|
|
3908
|
-
}, [
|
|
3909
|
+
q,
|
|
3910
|
+
He
|
|
3911
|
+
]), rt = o((e) => {
|
|
3912
|
+
Ke(e);
|
|
3913
|
+
}, [Ke]), it = o((e, t) => {
|
|
3909
3914
|
switch (e.key) {
|
|
3910
3915
|
case "Enter":
|
|
3911
3916
|
case " ":
|
|
3912
|
-
e.preventDefault(),
|
|
3917
|
+
e.preventDefault(), Ke(t);
|
|
3913
3918
|
break;
|
|
3914
3919
|
case "ArrowDown":
|
|
3915
3920
|
e.preventDefault(), cr(e.currentTarget);
|
|
3916
3921
|
break;
|
|
3917
3922
|
case "ArrowUp":
|
|
3918
|
-
e.preventDefault(),
|
|
3923
|
+
e.preventDefault(), H.current && lr(e.currentTarget, H.current, y);
|
|
3919
3924
|
break;
|
|
3920
3925
|
case "Escape":
|
|
3921
|
-
e.preventDefault(),
|
|
3926
|
+
e.preventDefault(), Z(!1), U();
|
|
3922
3927
|
break;
|
|
3923
|
-
case "Tab":
|
|
3928
|
+
case "Tab": qe();
|
|
3924
3929
|
}
|
|
3925
3930
|
}, [
|
|
3926
|
-
|
|
3931
|
+
Ke,
|
|
3927
3932
|
y,
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
]),
|
|
3931
|
-
|
|
3932
|
-
}, [
|
|
3933
|
+
U,
|
|
3934
|
+
qe
|
|
3935
|
+
]), at = o((e) => {
|
|
3936
|
+
He(e), Q(-1), le && V.current && (De(!0), V.current.focus());
|
|
3937
|
+
}, [He, le]), ot = o((e, t) => {
|
|
3933
3938
|
switch (e.stopPropagation(), e.key) {
|
|
3934
3939
|
case "ArrowLeft":
|
|
3935
|
-
e.preventDefault(), t > 0 &&
|
|
3940
|
+
e.preventDefault(), t > 0 && Q(t - 1);
|
|
3936
3941
|
break;
|
|
3937
3942
|
case "ArrowRight":
|
|
3938
|
-
e.preventDefault(), t <
|
|
3943
|
+
e.preventDefault(), t < q.length - 1 ? Q(t + 1) : (Q(-1), le && V.current ? V.current.focus() : de.current?.focus());
|
|
3939
3944
|
break;
|
|
3940
3945
|
case "Backspace":
|
|
3941
3946
|
case "Delete":
|
|
3942
3947
|
e.preventDefault();
|
|
3943
3948
|
{
|
|
3944
|
-
let e =
|
|
3945
|
-
|
|
3949
|
+
let e = q[t], n = t >= q.length - 1 ? t - 1 : t;
|
|
3950
|
+
He(e), n >= 0 ? Q(n) : (Q(-1), le && V.current ? V.current.focus() : de.current?.focus());
|
|
3946
3951
|
}
|
|
3947
3952
|
break;
|
|
3948
3953
|
case "Tab":
|
|
3949
|
-
|
|
3954
|
+
Q(-1);
|
|
3950
3955
|
break;
|
|
3951
|
-
case "Escape": e.preventDefault(),
|
|
3956
|
+
case "Escape": e.preventDefault(), Q(-1), le && V.current ? V.current.focus() : de.current?.focus();
|
|
3952
3957
|
}
|
|
3953
3958
|
}, [
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
]),
|
|
3958
|
-
|
|
3959
|
-
}, [
|
|
3959
|
+
q,
|
|
3960
|
+
le,
|
|
3961
|
+
He
|
|
3962
|
+
]), st = o((e) => {
|
|
3963
|
+
ye(e.target.value), Je(e.target.value);
|
|
3964
|
+
}, [Je]), $ = o((e) => {
|
|
3960
3965
|
switch (e.key) {
|
|
3961
3966
|
case "ArrowDown":
|
|
3962
|
-
e.preventDefault(),
|
|
3967
|
+
e.preventDefault(), H.current && H.current.querySelector("[role=\"option\"]:not([data-disabled]), [data-type=\"new-option\"]")?.focus();
|
|
3963
3968
|
break;
|
|
3964
3969
|
case "Tab":
|
|
3965
|
-
|
|
3970
|
+
qe();
|
|
3966
3971
|
break;
|
|
3967
|
-
case "Escape": e.preventDefault(),
|
|
3972
|
+
case "Escape": e.preventDefault(), Z(!1), U();
|
|
3968
3973
|
}
|
|
3969
|
-
}, [
|
|
3970
|
-
|
|
3971
|
-
}, [
|
|
3974
|
+
}, [U, qe]), ct = o((e) => {
|
|
3975
|
+
Ke(e);
|
|
3976
|
+
}, [Ke]), lt = o((e) => {
|
|
3972
3977
|
switch (e.key) {
|
|
3973
3978
|
case "Enter":
|
|
3974
3979
|
case " ":
|
|
3975
|
-
e.preventDefault(),
|
|
3980
|
+
e.preventDefault(), Ke(e.currentTarget.dataset.value || "");
|
|
3976
3981
|
break;
|
|
3977
3982
|
case "ArrowDown":
|
|
3978
|
-
e.preventDefault(),
|
|
3983
|
+
e.preventDefault(), H.current && ur(H.current);
|
|
3979
3984
|
break;
|
|
3980
3985
|
case "ArrowUp":
|
|
3981
|
-
e.preventDefault(),
|
|
3986
|
+
e.preventDefault(), H.current && lr(e.currentTarget, H.current, y);
|
|
3982
3987
|
break;
|
|
3983
|
-
case "Escape": e.preventDefault(),
|
|
3988
|
+
case "Escape": e.preventDefault(), Z(!1), U();
|
|
3984
3989
|
}
|
|
3985
3990
|
}, [
|
|
3986
|
-
|
|
3991
|
+
Ke,
|
|
3987
3992
|
y,
|
|
3988
|
-
|
|
3993
|
+
U
|
|
3989
3994
|
]);
|
|
3990
3995
|
return c(() => {
|
|
3991
|
-
if (!
|
|
3996
|
+
if (!X) return;
|
|
3992
3997
|
let e = (e) => {
|
|
3993
3998
|
let t = e.target;
|
|
3994
|
-
|
|
3999
|
+
fe.current && !fe.current.contains(t) && qe();
|
|
3995
4000
|
};
|
|
3996
4001
|
return document.addEventListener("click", e, !0), () => {
|
|
3997
4002
|
document.removeEventListener("click", e, !0);
|
|
3998
4003
|
};
|
|
3999
|
-
}, [
|
|
4000
|
-
let e =
|
|
4004
|
+
}, [X, qe]), c(() => {
|
|
4005
|
+
let e = fe.current?.closest("form");
|
|
4001
4006
|
if (!e) return;
|
|
4002
4007
|
let t = () => {
|
|
4003
4008
|
window.setTimeout(() => {
|
|
4004
|
-
if (
|
|
4005
|
-
let e = g ?
|
|
4006
|
-
|
|
4009
|
+
if (me(he.current), ge([]), xe(""), ye(""), Te(null), Ce(""), ue.current) {
|
|
4010
|
+
let e = g ? he.current.join(",") : he.current[0] || "";
|
|
4011
|
+
ue.current.value = e;
|
|
4007
4012
|
}
|
|
4008
4013
|
}, 0);
|
|
4009
4014
|
};
|
|
4010
4015
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
4011
4016
|
}, [g]), u(n, () => ({
|
|
4012
4017
|
get value() {
|
|
4013
|
-
return
|
|
4018
|
+
return ue.current?.value ?? "";
|
|
4014
4019
|
},
|
|
4015
4020
|
set value(e) {
|
|
4016
4021
|
let t = Array.isArray(e) ? e : e ? String(e).split(",").filter(Boolean) : [];
|
|
4017
|
-
|
|
4022
|
+
pe || me(t), ue.current && (ue.current.value = t.join(","));
|
|
4018
4023
|
},
|
|
4019
4024
|
focus() {
|
|
4020
|
-
|
|
4025
|
+
le ? V.current?.focus() : de.current?.focus();
|
|
4021
4026
|
},
|
|
4022
4027
|
blur() {
|
|
4023
|
-
|
|
4028
|
+
le ? V.current?.blur() : de.current?.blur();
|
|
4024
4029
|
}
|
|
4025
|
-
}), [
|
|
4030
|
+
}), [pe]), {
|
|
4026
4031
|
id: r,
|
|
4027
|
-
inputId:
|
|
4032
|
+
inputId: z,
|
|
4028
4033
|
listboxId: B,
|
|
4029
|
-
values:
|
|
4030
|
-
inputValue:
|
|
4031
|
-
searchValue:
|
|
4032
|
-
options:
|
|
4033
|
-
filteredOptions:
|
|
4034
|
-
isOpen:
|
|
4035
|
-
userInfoMessage:
|
|
4036
|
-
strings:
|
|
4037
|
-
addValueText:
|
|
4038
|
-
maxIsReached:
|
|
4039
|
-
editingSingleValue:
|
|
4040
|
-
inputFocus:
|
|
4041
|
-
focusedTagIndex:
|
|
4034
|
+
values: q,
|
|
4035
|
+
inputValue: be,
|
|
4036
|
+
searchValue: ve,
|
|
4037
|
+
options: Y,
|
|
4038
|
+
filteredOptions: Ie,
|
|
4039
|
+
isOpen: X,
|
|
4040
|
+
userInfoMessage: Ne,
|
|
4041
|
+
strings: ce,
|
|
4042
|
+
addValueText: we,
|
|
4043
|
+
maxIsReached: Pe,
|
|
4044
|
+
editingSingleValue: Oe,
|
|
4045
|
+
inputFocus: Ee,
|
|
4046
|
+
focusedTagIndex: Ae,
|
|
4042
4047
|
label: i,
|
|
4043
4048
|
multiple: g,
|
|
4044
4049
|
maxlength: _,
|
|
@@ -4067,26 +4072,26 @@ function _r(t, n) {
|
|
|
4067
4072
|
inputSize: ae,
|
|
4068
4073
|
name: oe,
|
|
4069
4074
|
className: se,
|
|
4070
|
-
hasCounter:
|
|
4071
|
-
inputRef:
|
|
4072
|
-
changeInputRef:
|
|
4073
|
-
triggerRef:
|
|
4074
|
-
listboxRef:
|
|
4075
|
-
wrapperRef:
|
|
4076
|
-
handleInputChange:
|
|
4077
|
-
handleInputKeydown:
|
|
4078
|
-
handleInputFocus:
|
|
4079
|
-
handleInputBlur:
|
|
4080
|
-
handleFocusOut:
|
|
4081
|
-
handleInputClick:
|
|
4082
|
-
handlePlaceholderClick:
|
|
4083
|
-
handleSelectOnlyKeydown:
|
|
4084
|
-
handleOptionClick:
|
|
4085
|
-
handleOptionKeydown:
|
|
4086
|
-
handleTagRemove:
|
|
4087
|
-
handleTagKeydown:
|
|
4088
|
-
handleSearchInput:
|
|
4089
|
-
handleSearchKeydown:
|
|
4075
|
+
hasCounter: Fe,
|
|
4076
|
+
inputRef: V,
|
|
4077
|
+
changeInputRef: ue,
|
|
4078
|
+
triggerRef: de,
|
|
4079
|
+
listboxRef: H,
|
|
4080
|
+
wrapperRef: fe,
|
|
4081
|
+
handleInputChange: Ye,
|
|
4082
|
+
handleInputKeydown: Xe,
|
|
4083
|
+
handleInputFocus: Ze,
|
|
4084
|
+
handleInputBlur: Qe,
|
|
4085
|
+
handleFocusOut: $e,
|
|
4086
|
+
handleInputClick: et,
|
|
4087
|
+
handlePlaceholderClick: tt,
|
|
4088
|
+
handleSelectOnlyKeydown: nt,
|
|
4089
|
+
handleOptionClick: rt,
|
|
4090
|
+
handleOptionKeydown: it,
|
|
4091
|
+
handleTagRemove: at,
|
|
4092
|
+
handleTagKeydown: ot,
|
|
4093
|
+
handleSearchInput: st,
|
|
4094
|
+
handleSearchKeydown: $,
|
|
4090
4095
|
handleNewOptionClick: ct,
|
|
4091
4096
|
handleNewOptionKeydown: lt,
|
|
4092
4097
|
onChange: I
|
|
@@ -4184,7 +4189,7 @@ var yr = null, br = () => yr || (yr = new Promise((e, t) => {
|
|
|
4184
4189
|
hotjarId: i,
|
|
4185
4190
|
googleAnalyticsId: a
|
|
4186
4191
|
};
|
|
4187
|
-
let g = p(() => {}), v = o in
|
|
4192
|
+
let g = p(() => {}), v = o in ge.i18n ? o : "nb", y = l ?? ge.i18n[v].contentPresentation.buttons.settings;
|
|
4188
4193
|
c(() => {
|
|
4189
4194
|
let e = !1, t, n = h.current;
|
|
4190
4195
|
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);
|
|
@@ -4234,7 +4239,7 @@ var yr = null, br = () => yr || (yr = new Promise((e, t) => {
|
|
|
4234
4239
|
"aria-haspopup": "dialog",
|
|
4235
4240
|
onClick: b,
|
|
4236
4241
|
children: y
|
|
4237
|
-
}) : s === "icon" ? /* @__PURE__ */ _(
|
|
4242
|
+
}) : s === "icon" ? /* @__PURE__ */ _(Y, {
|
|
4238
4243
|
ref: f,
|
|
4239
4244
|
skin: "tertiary",
|
|
4240
4245
|
variant: "icon-only",
|
|
@@ -4242,7 +4247,7 @@ var yr = null, br = () => yr || (yr = new Promise((e, t) => {
|
|
|
4242
4247
|
"aria-haspopup": "dialog",
|
|
4243
4248
|
onClick: b,
|
|
4244
4249
|
children: y
|
|
4245
|
-
}) : /* @__PURE__ */ _(
|
|
4250
|
+
}) : /* @__PURE__ */ _(Y, {
|
|
4246
4251
|
ref: f,
|
|
4247
4252
|
"aria-haspopup": "dialog",
|
|
4248
4253
|
onClick: b,
|
|
@@ -4314,7 +4319,7 @@ var wr = () => {
|
|
|
4314
4319
|
})
|
|
4315
4320
|
});
|
|
4316
4321
|
}, Pr = ({ dates: e, dateformat: t, idBase: n, strings: r, onDateRemoved: i }) => {
|
|
4317
|
-
let a = un(e), o =
|
|
4322
|
+
let a = un(e), o = _e(["datepicker"], r).datepicker.deleteDate;
|
|
4318
4323
|
return /* @__PURE__ */ _("div", {
|
|
4319
4324
|
className: "pkt-date-tags pkt-datepicker__tags",
|
|
4320
4325
|
"aria-live": "polite",
|
|
@@ -4335,9 +4340,9 @@ var wr = () => {
|
|
|
4335
4340
|
}, Fr = ({ state: e }) => {
|
|
4336
4341
|
let { id: t, inputId: n, values: r, dateformat: i, multiple: a, range: o, showRangeLabels: s, disabled: c, readOnly: l, required: u, label: d, name: f, placeholder: p, hasError: m, helptext: h, minStr: y, maxStr: b, inputType: x, isIOSDevice: S, strings: C, inputClasses: w, buttonClasses: T, rangeLabelClasses: E, datepickerInputsClasses: D, isInputDisabled: O, inputRef: k, inputRefTo: A, btnRef: j, toggleCalendar: M, handleFocus: N, handleSingleInputChange: P, handleRangeFromChange: ee, handleRangeToChange: te, handleRangeBlur: ne, handleMultipleBlur: F, handleTagRemoved: re, handleSingleKeydown: ie, handleRangeFromKeydown: ae, handleRangeToKeydown: oe, handleMultipleKeydown: se, restProps: I } = e, R = (e) => {
|
|
4337
4342
|
e.preventDefault(), M();
|
|
4338
|
-
},
|
|
4343
|
+
}, ce = (e) => {
|
|
4339
4344
|
e.preventDefault(), M();
|
|
4340
|
-
},
|
|
4345
|
+
}, z = () => /* @__PURE__ */ v("button", {
|
|
4341
4346
|
ref: j,
|
|
4342
4347
|
className: T,
|
|
4343
4348
|
type: "button",
|
|
@@ -4373,11 +4378,11 @@ var wr = () => {
|
|
|
4373
4378
|
"aria-invalid": m,
|
|
4374
4379
|
"aria-errormessage": m ? `${t}-error` : void 0,
|
|
4375
4380
|
onClick: R,
|
|
4376
|
-
onTouchEnd:
|
|
4381
|
+
onTouchEnd: ce,
|
|
4377
4382
|
onKeyDown: se,
|
|
4378
4383
|
onFocus: N,
|
|
4379
4384
|
onBlur: F
|
|
4380
|
-
}),
|
|
4385
|
+
}), z()]
|
|
4381
4386
|
})
|
|
4382
4387
|
})] }) : o ? /* @__PURE__ */ _("div", {
|
|
4383
4388
|
className: D,
|
|
@@ -4407,7 +4412,7 @@ var wr = () => {
|
|
|
4407
4412
|
"aria-invalid": m,
|
|
4408
4413
|
"aria-errormessage": m ? `${t}-error` : void 0,
|
|
4409
4414
|
onClick: R,
|
|
4410
|
-
onTouchEnd:
|
|
4415
|
+
onTouchEnd: ce,
|
|
4411
4416
|
onKeyDown: ae,
|
|
4412
4417
|
onFocus: N,
|
|
4413
4418
|
onBlur: ne,
|
|
@@ -4436,13 +4441,13 @@ var wr = () => {
|
|
|
4436
4441
|
"aria-label": `${d} ${C.generic.to}`,
|
|
4437
4442
|
"aria-invalid": m,
|
|
4438
4443
|
onClick: R,
|
|
4439
|
-
onTouchEnd:
|
|
4444
|
+
onTouchEnd: ce,
|
|
4440
4445
|
onKeyDown: oe,
|
|
4441
4446
|
onFocus: N,
|
|
4442
4447
|
onBlur: ne,
|
|
4443
4448
|
onChange: te
|
|
4444
4449
|
}),
|
|
4445
|
-
|
|
4450
|
+
z()
|
|
4446
4451
|
]
|
|
4447
4452
|
})
|
|
4448
4453
|
}) : /* @__PURE__ */ _("div", {
|
|
@@ -4467,12 +4472,12 @@ var wr = () => {
|
|
|
4467
4472
|
"aria-invalid": m,
|
|
4468
4473
|
"aria-errormessage": m ? `${t}-error` : void 0,
|
|
4469
4474
|
onClick: R,
|
|
4470
|
-
onTouchEnd:
|
|
4475
|
+
onTouchEnd: ce,
|
|
4471
4476
|
onKeyDown: ie,
|
|
4472
4477
|
onFocus: N,
|
|
4473
4478
|
onBlur: void 0,
|
|
4474
4479
|
onChange: P
|
|
4475
|
-
}),
|
|
4480
|
+
}), z()]
|
|
4476
4481
|
})
|
|
4477
4482
|
});
|
|
4478
4483
|
}, Ir = (e) => {
|
|
@@ -4487,24 +4492,24 @@ var wr = () => {
|
|
|
4487
4492
|
//#endregion
|
|
4488
4493
|
//#region src/components/datepicker/useDatepickerState.ts
|
|
4489
4494
|
function Lr(e, t) {
|
|
4490
|
-
let { id: n, label: r, value: i, defaultValue: a, dateformat: s = "dd.MM.yyyy", multiple: l = !1, maxlength: d, range: h = !1, showRangeLabels: g = !1, weeknumbers: _ = !1, withcontrols: v = !1, excludedates: y, excludeweekdays: b, currentmonth: x, today: S, calendarOpen: C, timezone: w, fullwidth: T = !1, inputSize: E = "medium", hasFieldset: D = !1, counter: O, inline: k = !1, helptext: A, helptextDropdown: j, helptextDropdownButton: M, hasError: N = !1, errorMessage: P, optionalTag: ee = !1, optionalText: te, requiredTag: ne = !1, requiredText: F, tagText: re, useWrapper: ie = !0, strings: ae, disabled: oe = !1, readOnly: se = !1, required: I = !1, name: L, min: R, max:
|
|
4495
|
+
let { id: n, label: r, value: i, defaultValue: a, dateformat: s = "dd.MM.yyyy", multiple: l = !1, maxlength: d, range: h = !1, showRangeLabels: g = !1, weeknumbers: _ = !1, withcontrols: v = !1, excludedates: y, excludeweekdays: b, currentmonth: x, today: S, calendarOpen: C, timezone: w, fullwidth: T = !1, inputSize: E = "medium", hasFieldset: D = !1, counter: O, inline: k = !1, helptext: A, helptextDropdown: j, helptextDropdownButton: M, hasError: N = !1, errorMessage: P, optionalTag: ee = !1, optionalText: te, requiredTag: ne = !1, requiredText: F, tagText: re, useWrapper: ie = !0, strings: ae, disabled: oe = !1, readOnly: se = !1, required: I = !1, name: L, min: R, max: ce, placeholder: z, onChange: B, onValueChange: le, className: V, ...ue } = e, de = o((e) => e === void 0 ? [] : Ir(e), []), H = i !== void 0, fe = typeof a == "number" ? void 0 : a, [U, W] = m(() => de(i ?? fe)), G = H ? de(i) : U, pe = p(U);
|
|
4491
4496
|
c(() => {
|
|
4492
|
-
|
|
4497
|
+
H && W(de(i));
|
|
4493
4498
|
}, [
|
|
4494
4499
|
i,
|
|
4495
|
-
|
|
4496
|
-
|
|
4500
|
+
H,
|
|
4501
|
+
de
|
|
4497
4502
|
]);
|
|
4498
|
-
let [
|
|
4503
|
+
let [K, me] = m(C ?? !1);
|
|
4499
4504
|
c(() => {
|
|
4500
|
-
C !== void 0 &&
|
|
4505
|
+
C !== void 0 && me(C);
|
|
4501
4506
|
}, [C]);
|
|
4502
|
-
let
|
|
4507
|
+
let he = p(null), q = p(null), J = p(null), ge = p(null), Y = p(null), X = f(() => Tr(), []), Z = f(() => wr(), []), ve = _e([
|
|
4503
4508
|
"generic",
|
|
4504
4509
|
"datepicker",
|
|
4505
4510
|
"validation"
|
|
4506
|
-
], ae),
|
|
4507
|
-
let e = Dr(T, g, l, h, se,
|
|
4511
|
+
], ae), ye = ae, be = typeof R == "string" ? R : R === void 0 ? void 0 : String(R), xe = typeof ce == "string" ? ce : ce === void 0 ? void 0 : String(ce), Se = f(() => {
|
|
4512
|
+
let e = Dr(T, g, l, h, se, X, E);
|
|
4508
4513
|
return Object.entries(e).filter(([, e]) => e).map(([e]) => e).join(" ");
|
|
4509
4514
|
}, [
|
|
4510
4515
|
T,
|
|
@@ -4512,150 +4517,150 @@ function Lr(e, t) {
|
|
|
4512
4517
|
l,
|
|
4513
4518
|
h,
|
|
4514
4519
|
se,
|
|
4515
|
-
|
|
4520
|
+
X,
|
|
4516
4521
|
E
|
|
4517
|
-
]),
|
|
4522
|
+
]), Ce = Object.entries(Or(E)).filter(([, e]) => e).map(([e]) => e).join(" "), we = f(() => {
|
|
4518
4523
|
let e = kr(g);
|
|
4519
4524
|
return Object.entries(e).filter(([, e]) => e).map(([e]) => e).join(" ");
|
|
4520
|
-
}, [g]),
|
|
4525
|
+
}, [g]), Te = f(() => ["pkt-datepicker__inputs", h && "pkt-input__range-inputs"].filter(Boolean).join(" "), [h, g]), Ee = f(() => {
|
|
4521
4526
|
if (x) return x;
|
|
4522
|
-
if (
|
|
4523
|
-
}, [x,
|
|
4527
|
+
if (xe) return xe.slice(0, 7);
|
|
4528
|
+
}, [x, xe]), De = oe || l && d != null && G.length >= d, Oe = O ?? (l && d != null), ke = `${n}-input`, Ae = G.join(",");
|
|
4524
4529
|
c(() => {
|
|
4525
|
-
|
|
4526
|
-
}, [
|
|
4530
|
+
J.current && (J.current.value = Ae);
|
|
4531
|
+
}, [Ae]), c(() => {
|
|
4527
4532
|
w && typeof window < "u" && w !== window.pktTz && (window.pktTz = w);
|
|
4528
4533
|
}, [w]);
|
|
4529
|
-
let
|
|
4530
|
-
|
|
4531
|
-
}, [
|
|
4532
|
-
let t =
|
|
4533
|
-
!t || !
|
|
4534
|
-
}, [
|
|
4535
|
-
oe ||
|
|
4536
|
-
}, [oe]),
|
|
4537
|
-
|
|
4534
|
+
let Q = o((e, t = !0) => {
|
|
4535
|
+
H || W(e), t && le?.(e);
|
|
4536
|
+
}, [H, le]), je = f(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Me = o((e) => {
|
|
4537
|
+
let t = J.current;
|
|
4538
|
+
!t || !je || (je.call(t, e.join(",")), t.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
4539
|
+
}, [je]), Ne = o(() => {
|
|
4540
|
+
oe || me((e) => !e);
|
|
4541
|
+
}, [oe]), Pe = o(() => {
|
|
4542
|
+
me(!1);
|
|
4538
4543
|
}, []);
|
|
4539
4544
|
c(() => {
|
|
4540
|
-
if (!
|
|
4545
|
+
if (!K) return;
|
|
4541
4546
|
let e = (e) => {
|
|
4542
4547
|
let t = e.target;
|
|
4543
|
-
|
|
4548
|
+
Y.current && !Y.current.contains(t) && !t.closest?.(".pkt-calendar-popup") && Pe();
|
|
4544
4549
|
}, t = (e) => {
|
|
4545
|
-
e.key === "Escape" && (
|
|
4550
|
+
e.key === "Escape" && (Pe(), he.current?.focus());
|
|
4546
4551
|
};
|
|
4547
4552
|
return document.addEventListener("click", e, !0), document.addEventListener("keydown", t), () => {
|
|
4548
4553
|
document.removeEventListener("click", e, !0), document.removeEventListener("keydown", t);
|
|
4549
4554
|
};
|
|
4550
|
-
}, [
|
|
4551
|
-
let
|
|
4552
|
-
|
|
4553
|
-
}, [
|
|
4555
|
+
}, [K, Pe]);
|
|
4556
|
+
let Fe = o(() => {
|
|
4557
|
+
Z && !K && me(!0);
|
|
4558
|
+
}, [Z, K]), Ie = o((e) => {
|
|
4554
4559
|
let t = Ir(Ar(e, l, h));
|
|
4555
|
-
|
|
4560
|
+
Q(t), Me(t), !l && !h && (Pe(), he.current?.focus());
|
|
4556
4561
|
}, [
|
|
4557
4562
|
l,
|
|
4558
4563
|
h,
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
]),
|
|
4563
|
-
|
|
4564
|
-
}, [
|
|
4564
|
+
Q,
|
|
4565
|
+
Me,
|
|
4566
|
+
Pe
|
|
4567
|
+
]), Le = o(() => {
|
|
4568
|
+
Pe(), he.current?.focus();
|
|
4569
|
+
}, [Pe]), Re = o((e) => {
|
|
4565
4570
|
let t = e.target.value, n = t ? [t] : [];
|
|
4566
|
-
|
|
4567
|
-
}, [
|
|
4568
|
-
let t = [e.target.value,
|
|
4569
|
-
|
|
4571
|
+
Q(n), Me(n);
|
|
4572
|
+
}, [Q, Me]), ze = o((e) => {
|
|
4573
|
+
let t = [e.target.value, G[1] ?? ""].filter(Boolean);
|
|
4574
|
+
Q(t), Me(t);
|
|
4570
4575
|
}, [
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
]),
|
|
4575
|
-
let t = [
|
|
4576
|
-
|
|
4576
|
+
G,
|
|
4577
|
+
Q,
|
|
4578
|
+
Me
|
|
4579
|
+
]), Be = o((e) => {
|
|
4580
|
+
let t = [G[0] ?? "", e.target.value].filter(Boolean);
|
|
4581
|
+
Q(t), Me(t);
|
|
4577
4582
|
}, [
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
]),
|
|
4582
|
-
|
|
4583
|
+
G,
|
|
4584
|
+
Q,
|
|
4585
|
+
Me
|
|
4586
|
+
]), Ve = o(() => {
|
|
4587
|
+
G.length === 2 && !Er(G) && (Q([G[0]]), Me([G[0]]));
|
|
4583
4588
|
}, [
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
]),
|
|
4588
|
-
let t = Qt(e), n =
|
|
4589
|
+
G,
|
|
4590
|
+
Q,
|
|
4591
|
+
Me
|
|
4592
|
+
]), He = o((e) => {
|
|
4593
|
+
let t = Qt(e), n = be ? Qt(be) : null, r = xe ? Qt(xe) : null;
|
|
4589
4594
|
if (t && !isNaN(t.getTime()) && (!n || t >= n) && (!r || t <= r)) {
|
|
4590
|
-
let t = ln([...
|
|
4591
|
-
|
|
4595
|
+
let t = ln([...G, e], be, xe, y, b), n = [...new Set(t)];
|
|
4596
|
+
Q(n), Me(n);
|
|
4592
4597
|
}
|
|
4593
4598
|
}, [
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4599
|
+
G,
|
|
4600
|
+
be,
|
|
4601
|
+
xe,
|
|
4597
4602
|
y,
|
|
4598
4603
|
b,
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
]),
|
|
4604
|
+
Q,
|
|
4605
|
+
Me
|
|
4606
|
+
]), Ue = o((e) => {
|
|
4602
4607
|
let t = e.target;
|
|
4603
|
-
t.value &&= (
|
|
4604
|
-
}, [
|
|
4608
|
+
t.value &&= (He(t.value.split(",")[0]), "");
|
|
4609
|
+
}, [He]), We = o((e) => {
|
|
4605
4610
|
let t = e.target;
|
|
4606
|
-
t.value &&= (
|
|
4607
|
-
}, [
|
|
4608
|
-
let t =
|
|
4609
|
-
|
|
4611
|
+
t.value &&= (He(t.value.split(",")[0]), "");
|
|
4612
|
+
}, [He]), Ge = o((e) => {
|
|
4613
|
+
let t = G.filter((t) => t !== e);
|
|
4614
|
+
Q(t), Me(t);
|
|
4610
4615
|
}, [
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
]),
|
|
4616
|
+
G,
|
|
4617
|
+
Q,
|
|
4618
|
+
Me
|
|
4619
|
+
]), Ke = o((e) => {
|
|
4615
4620
|
let t = e?.closest("form");
|
|
4616
4621
|
t ? t.requestSubmit() : e?.blur();
|
|
4617
|
-
}, []),
|
|
4618
|
-
Mr(e.nativeEvent, () =>
|
|
4619
|
-
}, [
|
|
4620
|
-
Mr(e.nativeEvent, () =>
|
|
4621
|
-
}, [
|
|
4622
|
-
Mr(e.nativeEvent, () =>
|
|
4623
|
-
}, [
|
|
4624
|
-
Mr(e.nativeEvent, () =>
|
|
4622
|
+
}, []), qe = o((e) => {
|
|
4623
|
+
Mr(e.nativeEvent, () => Ne(), () => Ke(he.current), void 0, () => he.current?.blur());
|
|
4624
|
+
}, [Ne, Ke]), Je = o((e) => {
|
|
4625
|
+
Mr(e.nativeEvent, () => Ne(), () => Ke(he.current), () => q.current?.focus(), () => he.current?.blur());
|
|
4626
|
+
}, [Ne, Ke]), Ye = o((e) => {
|
|
4627
|
+
Mr(e.nativeEvent, () => Ne(), () => Ke(q.current), void 0, () => q.current?.blur());
|
|
4628
|
+
}, [Ne, Ke]), Xe = o((e) => {
|
|
4629
|
+
Mr(e.nativeEvent, () => Ne(), () => Ke(he.current), void 0, () => he.current?.blur(), We);
|
|
4625
4630
|
}, [
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4631
|
+
Ne,
|
|
4632
|
+
Ke,
|
|
4633
|
+
We
|
|
4629
4634
|
]);
|
|
4630
4635
|
return c(() => {
|
|
4631
|
-
let e =
|
|
4636
|
+
let e = Y.current?.closest("form");
|
|
4632
4637
|
if (!e) return;
|
|
4633
4638
|
let t = () => {
|
|
4634
4639
|
window.setTimeout(() => {
|
|
4635
|
-
|
|
4640
|
+
W(pe.current), me(!1), J.current && (J.current.value = pe.current.join(","));
|
|
4636
4641
|
}, 0);
|
|
4637
4642
|
};
|
|
4638
4643
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
4639
4644
|
}, []), u(t, () => ({
|
|
4640
4645
|
get value() {
|
|
4641
|
-
return
|
|
4646
|
+
return J.current?.value ?? "";
|
|
4642
4647
|
},
|
|
4643
4648
|
set value(e) {
|
|
4644
4649
|
let t = e ? e.split(",").filter(Boolean) : [];
|
|
4645
|
-
|
|
4650
|
+
W(t), J.current && (J.current.value = e ?? "");
|
|
4646
4651
|
},
|
|
4647
4652
|
focus() {
|
|
4648
|
-
|
|
4653
|
+
he.current?.focus();
|
|
4649
4654
|
},
|
|
4650
4655
|
blur() {
|
|
4651
|
-
|
|
4656
|
+
he.current?.blur();
|
|
4652
4657
|
}
|
|
4653
4658
|
}), []), {
|
|
4654
4659
|
id: n,
|
|
4655
|
-
inputId:
|
|
4660
|
+
inputId: ke,
|
|
4656
4661
|
label: r,
|
|
4657
|
-
values:
|
|
4658
|
-
calendarOpen:
|
|
4662
|
+
values: G,
|
|
4663
|
+
calendarOpen: K,
|
|
4659
4664
|
dateformat: s,
|
|
4660
4665
|
multiple: l,
|
|
4661
4666
|
maxlength: d,
|
|
@@ -4669,7 +4674,7 @@ function Lr(e, t) {
|
|
|
4669
4674
|
readOnly: se,
|
|
4670
4675
|
required: I,
|
|
4671
4676
|
name: L,
|
|
4672
|
-
placeholder:
|
|
4677
|
+
placeholder: z,
|
|
4673
4678
|
fullwidth: T,
|
|
4674
4679
|
inputSize: E,
|
|
4675
4680
|
hasFieldset: D,
|
|
@@ -4685,43 +4690,43 @@ function Lr(e, t) {
|
|
|
4685
4690
|
requiredText: F,
|
|
4686
4691
|
tagText: re,
|
|
4687
4692
|
useWrapper: ie,
|
|
4688
|
-
className:
|
|
4689
|
-
minStr:
|
|
4690
|
-
maxStr:
|
|
4691
|
-
effectiveCurrentMonth:
|
|
4693
|
+
className: V,
|
|
4694
|
+
minStr: be,
|
|
4695
|
+
maxStr: xe,
|
|
4696
|
+
effectiveCurrentMonth: Ee,
|
|
4692
4697
|
today: S,
|
|
4693
|
-
inputType:
|
|
4694
|
-
isIOSDevice:
|
|
4695
|
-
strings:
|
|
4696
|
-
stringsOverride:
|
|
4697
|
-
inputClasses:
|
|
4698
|
-
buttonClasses:
|
|
4699
|
-
rangeLabelClasses:
|
|
4700
|
-
datepickerInputsClasses:
|
|
4701
|
-
isInputDisabled:
|
|
4702
|
-
hasCounter:
|
|
4703
|
-
inputRef:
|
|
4704
|
-
inputRefTo:
|
|
4705
|
-
changeInputRef:
|
|
4706
|
-
btnRef:
|
|
4707
|
-
wrapperRef:
|
|
4698
|
+
inputType: X,
|
|
4699
|
+
isIOSDevice: Z,
|
|
4700
|
+
strings: ve,
|
|
4701
|
+
stringsOverride: ye,
|
|
4702
|
+
inputClasses: Se,
|
|
4703
|
+
buttonClasses: Ce,
|
|
4704
|
+
rangeLabelClasses: we,
|
|
4705
|
+
datepickerInputsClasses: Te,
|
|
4706
|
+
isInputDisabled: De,
|
|
4707
|
+
hasCounter: Oe,
|
|
4708
|
+
inputRef: he,
|
|
4709
|
+
inputRefTo: q,
|
|
4710
|
+
changeInputRef: J,
|
|
4711
|
+
btnRef: ge,
|
|
4712
|
+
wrapperRef: Y,
|
|
4708
4713
|
onChange: B,
|
|
4709
|
-
toggleCalendar:
|
|
4710
|
-
hideCalendar:
|
|
4711
|
-
handleDateSelected:
|
|
4712
|
-
handleCalendarClose:
|
|
4713
|
-
handleFocus:
|
|
4714
|
-
handleSingleInputChange:
|
|
4715
|
-
handleRangeFromChange:
|
|
4716
|
-
handleRangeToChange:
|
|
4717
|
-
handleRangeBlur:
|
|
4718
|
-
handleMultipleBlur:
|
|
4719
|
-
handleTagRemoved:
|
|
4720
|
-
handleSingleKeydown:
|
|
4721
|
-
handleRangeFromKeydown:
|
|
4722
|
-
handleRangeToKeydown:
|
|
4723
|
-
handleMultipleKeydown:
|
|
4724
|
-
restProps:
|
|
4714
|
+
toggleCalendar: Ne,
|
|
4715
|
+
hideCalendar: Pe,
|
|
4716
|
+
handleDateSelected: Ie,
|
|
4717
|
+
handleCalendarClose: Le,
|
|
4718
|
+
handleFocus: Fe,
|
|
4719
|
+
handleSingleInputChange: Re,
|
|
4720
|
+
handleRangeFromChange: ze,
|
|
4721
|
+
handleRangeToChange: Be,
|
|
4722
|
+
handleRangeBlur: Ve,
|
|
4723
|
+
handleMultipleBlur: Ue,
|
|
4724
|
+
handleTagRemoved: Ge,
|
|
4725
|
+
handleSingleKeydown: qe,
|
|
4726
|
+
handleRangeFromKeydown: Je,
|
|
4727
|
+
handleRangeToKeydown: Ye,
|
|
4728
|
+
handleMultipleKeydown: Xe,
|
|
4729
|
+
restProps: ue
|
|
4725
4730
|
};
|
|
4726
4731
|
}
|
|
4727
4732
|
//#endregion
|
|
@@ -4855,12 +4860,12 @@ function Gr(e, t, n) {
|
|
|
4855
4860
|
function Kr(e, t) {
|
|
4856
4861
|
let n = Vr(t.allowedFormats);
|
|
4857
4862
|
if (n.length > 0 && !Ur(e, n)) {
|
|
4858
|
-
let e = n.join(", "), r =
|
|
4863
|
+
let e = n.join(", "), r = ce.fileupload.invalidFormat;
|
|
4859
4864
|
return Gr(t.formatErrorMessage, r, { formats: e });
|
|
4860
4865
|
}
|
|
4861
4866
|
let r = zr(t.maxFileSize);
|
|
4862
4867
|
if (r !== void 0 && e.size > r) {
|
|
4863
|
-
let e = Br(r), n =
|
|
4868
|
+
let e = Br(r), n = ce.fileupload.sizeTooLarge;
|
|
4864
4869
|
return Gr(t.sizeErrorMessage, n, { maxSize: e });
|
|
4865
4870
|
}
|
|
4866
4871
|
if (t.onFileValidation) {
|
|
@@ -4992,7 +4997,7 @@ function ai(e, t) {
|
|
|
4992
4997
|
//#endregion
|
|
4993
4998
|
//#region ../../shared-utils/fileupload/filename.ts
|
|
4994
4999
|
var oi = ".jpeg, .jpg, .png, .gif, .webp, .heic";
|
|
4995
|
-
function si(e, t =
|
|
5000
|
+
function si(e, t = ce.fileupload.unknownFilename) {
|
|
4996
5001
|
return e.attributes?.targetFilename || e.file?.name || t;
|
|
4997
5002
|
}
|
|
4998
5003
|
//#endregion
|
|
@@ -5010,7 +5015,7 @@ var ci = () => ("00000000000000000" + (Math.random() * 0x10000000000000000).toSt
|
|
|
5010
5015
|
}, di = n({}), fi = 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) => {
|
|
5011
5016
|
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]);
|
|
5012
5017
|
u(x, () => S.current);
|
|
5013
|
-
let [T, E] = m(!1), D =
|
|
5018
|
+
let [T, E] = m(!1), D = _e(["fileupload"], y), O = f(() => l ? t ? {
|
|
5014
5019
|
dragInactive: D.fileupload.dropZoneDragMultipleThumbnail,
|
|
5015
5020
|
dragActive: D.fileupload.dropZoneDragActiveMultipleThumbnail,
|
|
5016
5021
|
openFileDialog: D.fileupload.dropZoneOpenFileDialogMultipleThumbnail
|
|
@@ -5216,7 +5221,7 @@ var hi = "comments", gi = (e) => {
|
|
|
5216
5221
|
disabled: t,
|
|
5217
5222
|
defaultValue: i?.text
|
|
5218
5223
|
}),
|
|
5219
|
-
/* @__PURE__ */ _(
|
|
5224
|
+
/* @__PURE__ */ _(Y, {
|
|
5220
5225
|
skin: "secondary",
|
|
5221
5226
|
size: "small",
|
|
5222
5227
|
disabled: t,
|
|
@@ -5229,7 +5234,7 @@ var hi = "comments", gi = (e) => {
|
|
|
5229
5234
|
},
|
|
5230
5235
|
children: o ? "Lagre kommentar" : "Legg til kommentar"
|
|
5231
5236
|
}),
|
|
5232
|
-
/* @__PURE__ */ _(
|
|
5237
|
+
/* @__PURE__ */ _(Y, {
|
|
5233
5238
|
skin: "tertiary",
|
|
5234
5239
|
size: "small",
|
|
5235
5240
|
disabled: t,
|
|
@@ -5329,14 +5334,14 @@ var hi = "comments", gi = (e) => {
|
|
|
5329
5334
|
e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), o()), e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), r());
|
|
5330
5335
|
}
|
|
5331
5336
|
}),
|
|
5332
|
-
/* @__PURE__ */ _(
|
|
5337
|
+
/* @__PURE__ */ _(Y, {
|
|
5333
5338
|
skin: "secondary",
|
|
5334
5339
|
size: "small",
|
|
5335
5340
|
disabled: t,
|
|
5336
5341
|
onClick: o,
|
|
5337
5342
|
children: "Lagre"
|
|
5338
5343
|
}),
|
|
5339
|
-
/* @__PURE__ */ _(
|
|
5344
|
+
/* @__PURE__ */ _(Y, {
|
|
5340
5345
|
skin: "tertiary",
|
|
5341
5346
|
size: "small",
|
|
5342
5347
|
disabled: t,
|
|
@@ -5568,7 +5573,7 @@ var Pi = "is-scroll-locked", Fi = 0, Ii = 0, Li = () => typeof document < "u" &&
|
|
|
5568
5573
|
}) : /* @__PURE__ */ _("div", { className: "pkt-modal__headingText" }),
|
|
5569
5574
|
i ? /* @__PURE__ */ _("div", { className: "pkt-modal__noCloseButton" }) : /* @__PURE__ */ _("div", {
|
|
5570
5575
|
className: (0, M.default)("pkt-modal__closeButton", { [`pkt-modal__closeButton--${u}`]: !0 }),
|
|
5571
|
-
children: /* @__PURE__ */ _(
|
|
5576
|
+
children: /* @__PURE__ */ _(Y, {
|
|
5572
5577
|
onClick: C,
|
|
5573
5578
|
"aria-label": "close",
|
|
5574
5579
|
iconName: "close",
|
|
@@ -5755,7 +5760,7 @@ var Gi = n({ tail: 5 }), Ki = ({ children: e, tail: t }) => {
|
|
|
5755
5760
|
}), l = !!t;
|
|
5756
5761
|
return /* @__PURE__ */ v("div", {
|
|
5757
5762
|
className: `pkt-fileupload__queue-display__item__thumbnail${n && !i ? "" : " pkt-fileupload__queue-display__item__thumbnail--fallback"}`,
|
|
5758
|
-
children: [/* @__PURE__ */ v(
|
|
5763
|
+
children: [/* @__PURE__ */ v(Y, {
|
|
5759
5764
|
className: "pkt-fileupload__queue-display__item__thumbnail__image-wrapper",
|
|
5760
5765
|
"aria-label": `Forhåndsvis bilde ${e.attributes.targetFilename}`,
|
|
5761
5766
|
type: "button",
|
|
@@ -5811,7 +5816,7 @@ var Gi = n({ tail: 5 }), Ki = ({ children: e, tail: t }) => {
|
|
|
5811
5816
|
children: /* @__PURE__ */ v("div", {
|
|
5812
5817
|
className: "pkt-fileupload__image-preview",
|
|
5813
5818
|
children: [
|
|
5814
|
-
f && /* @__PURE__ */ _(
|
|
5819
|
+
f && /* @__PURE__ */ _(Y, {
|
|
5815
5820
|
variant: "icon-only",
|
|
5816
5821
|
iconName: "chevron-thin-left",
|
|
5817
5822
|
skin: "secondary",
|
|
@@ -5840,7 +5845,7 @@ var Gi = n({ tail: 5 }), Ki = ({ children: e, tail: t }) => {
|
|
|
5840
5845
|
t.length
|
|
5841
5846
|
]
|
|
5842
5847
|
}),
|
|
5843
|
-
f && /* @__PURE__ */ _(
|
|
5848
|
+
f && /* @__PURE__ */ _(Y, {
|
|
5844
5849
|
variant: "icon-only",
|
|
5845
5850
|
iconName: "chevron-thin-right",
|
|
5846
5851
|
skin: "secondary",
|
|
@@ -5980,20 +5985,20 @@ var Gi = n({ tail: 5 }), Ki = ({ children: e, tail: t }) => {
|
|
|
5980
5985
|
}, pa = {
|
|
5981
5986
|
filename: ta,
|
|
5982
5987
|
thumbnail: na
|
|
5983
|
-
}, ma = 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 = pa.filename, fullwidth: x = !1, allowedFormats: S, formatErrorMessage: C, maxFileSize: w, sizeErrorMessage: T, onFileValidation: E, onFileValidate: D, errorMessage: O, hasError: k = !1, disabled: A = !1, label: j, helptext: N, helptextDropdown: P, helptextDropdownButton: ee, optionalTag: te, optionalText: ne, requiredTag: F, requiredText: re, tagText: ie, required: ae = !1, enableImagePreview: oe = !1, "aria-describedby": se, "aria-invalid": I, strings: L, ...R },
|
|
5984
|
-
let
|
|
5985
|
-
u(
|
|
5986
|
-
let
|
|
5988
|
+
}, ma = 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 = pa.filename, fullwidth: x = !1, allowedFormats: S, formatErrorMessage: C, maxFileSize: w, sizeErrorMessage: T, onFileValidation: E, onFileValidate: D, errorMessage: O, hasError: k = !1, disabled: A = !1, label: j, helptext: N, helptextDropdown: P, helptextDropdownButton: ee, optionalTag: te, optionalText: ne, requiredTag: F, requiredText: re, tagText: ie, required: ae = !1, enableImagePreview: oe = !1, "aria-describedby": se, "aria-invalid": I, strings: L, ...R }, ce) => {
|
|
5989
|
+
let z = l(), V = n ?? `pkt-fileupload-${z}`, ue = p(null);
|
|
5990
|
+
u(ce, () => ue.current, []);
|
|
5991
|
+
let de = "transfers" in R ? R.transfers : void 0, H = _e(["fileupload"], L).fileupload, [fe, U] = m(null), [W, G] = m("");
|
|
5987
5992
|
c(() => {
|
|
5988
|
-
if (!
|
|
5989
|
-
let e = setTimeout(() =>
|
|
5993
|
+
if (!W) return;
|
|
5994
|
+
let e = setTimeout(() => G(""), 1500);
|
|
5990
5995
|
return () => clearTimeout(e);
|
|
5991
|
-
}, [
|
|
5992
|
-
let
|
|
5996
|
+
}, [W]);
|
|
5997
|
+
let pe = fe ?? O ?? null, K = k || !!fe || !!(O && O.trim()), me = pe ? `${V}-error` : void 0, he = [
|
|
5993
5998
|
se,
|
|
5994
5999
|
N ? `${V}-helptext` : void 0,
|
|
5995
|
-
|
|
5996
|
-
].filter(Boolean).join(" ") || void 0,
|
|
6000
|
+
me
|
|
6001
|
+
].filter(Boolean).join(" ") || void 0, q = K || I === !0 || I === "true", J = o((e) => {
|
|
5997
6002
|
let t = Kr(e, {
|
|
5998
6003
|
allowedFormats: S,
|
|
5999
6004
|
maxFileSize: w,
|
|
@@ -6019,65 +6024,65 @@ var Gi = n({ tail: 5 }), Ki = ({ children: e, tail: t }) => {
|
|
|
6019
6024
|
D
|
|
6020
6025
|
]);
|
|
6021
6026
|
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");
|
|
6022
|
-
let
|
|
6027
|
+
let ge = e !== void 0, [Y, X] = m(() => t ?? []), Z = ge ? e : Y;
|
|
6023
6028
|
Ai(ue, {
|
|
6024
6029
|
uploadStrategy: i,
|
|
6025
6030
|
required: ae,
|
|
6026
|
-
currentFileCount:
|
|
6027
|
-
onMissingFiles: o(() =>
|
|
6031
|
+
currentFileCount: Z.length,
|
|
6032
|
+
onMissingFiles: o(() => U(H.requiredMissing), [H])
|
|
6028
6033
|
});
|
|
6029
|
-
let
|
|
6034
|
+
let ye = typeof b == "string" ? pa[b] : b, be = b === "thumbnail", xe = typeof R.accept == "string" ? R.accept.trim() : void 0, Se = f(() => Wr(xe, S) || void 0, [xe, S]), Ce = s && !be, we = a && !be, Te = o((e) => {
|
|
6030
6035
|
for (let t of e) {
|
|
6031
|
-
let e =
|
|
6036
|
+
let e = J(t.file);
|
|
6032
6037
|
if (e) {
|
|
6033
|
-
|
|
6038
|
+
U(e);
|
|
6034
6039
|
return;
|
|
6035
6040
|
}
|
|
6036
6041
|
}
|
|
6037
|
-
|
|
6038
|
-
let t = r ? [
|
|
6039
|
-
|
|
6042
|
+
U(null);
|
|
6043
|
+
let t = r ? [...Z, ...e] : [e[0]], n = r ? e : [e[0]];
|
|
6044
|
+
G(n.length === 1 ? B(H.srFileAdded, { filename: n[0].attributes.targetFilename }) : B(H.srFilesAdded, { count: n.length })), ge || X(t), h?.(t), i === "custom" && g && e.forEach((e) => {
|
|
6040
6045
|
g?.(e);
|
|
6041
6046
|
});
|
|
6042
6047
|
}, [
|
|
6043
6048
|
h,
|
|
6044
|
-
|
|
6049
|
+
Z,
|
|
6045
6050
|
r,
|
|
6046
6051
|
i,
|
|
6047
6052
|
g,
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
]),
|
|
6052
|
-
let n =
|
|
6053
|
+
J,
|
|
6054
|
+
ge,
|
|
6055
|
+
H
|
|
6056
|
+
]), Ee = o((e, t) => {
|
|
6057
|
+
let n = Z.map((n) => n.fileId === e ? {
|
|
6053
6058
|
...n,
|
|
6054
6059
|
...t
|
|
6055
6060
|
} : n);
|
|
6056
|
-
|
|
6061
|
+
ge || X(n), h?.(n);
|
|
6057
6062
|
}, [
|
|
6058
6063
|
h,
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
]),
|
|
6062
|
-
let t =
|
|
6063
|
-
|
|
6064
|
+
Z,
|
|
6065
|
+
ge
|
|
6066
|
+
]), De = o((e) => {
|
|
6067
|
+
let t = Z.filter((t) => t.fileId !== e);
|
|
6068
|
+
ge || X(t), h?.(t), "onTransferCancelled" in R && R.onTransferCancelled && R.onTransferCancelled?.(e);
|
|
6064
6069
|
}, [
|
|
6065
6070
|
h,
|
|
6066
|
-
|
|
6071
|
+
Z,
|
|
6067
6072
|
R,
|
|
6068
|
-
|
|
6069
|
-
]), { buildAttributeAccessors:
|
|
6073
|
+
ge
|
|
6074
|
+
]), { buildAttributeAccessors: Oe } = Di(Z, Ee), ke = f(() => {
|
|
6070
6075
|
let e = [];
|
|
6071
|
-
return
|
|
6076
|
+
return Ce && e.push(Ei), we && e.push(xi), e.push(...y), e.push(Si(De)), e;
|
|
6072
6077
|
}, [
|
|
6073
|
-
|
|
6074
|
-
|
|
6078
|
+
Ce,
|
|
6079
|
+
we,
|
|
6075
6080
|
y,
|
|
6076
|
-
|
|
6077
|
-
]), { totalCount:
|
|
6081
|
+
De
|
|
6082
|
+
]), { totalCount: Ae, uploadedCount: Q, failedCount: je } = f(() => ai(Z, de), [Z, de]), Me = le(Ae, H.fileLabelOne, H.fileLabelOther), Ne = /* @__PURE__ */ _("div", {
|
|
6078
6083
|
className: (0, M.default)("pkt-fileupload", {
|
|
6079
6084
|
"pkt-fileupload--full-width": x,
|
|
6080
|
-
"pkt-fileupload--error":
|
|
6085
|
+
"pkt-fileupload--error": K,
|
|
6081
6086
|
"pkt-fileupload--disabled": A
|
|
6082
6087
|
}),
|
|
6083
6088
|
"aria-disabled": A,
|
|
@@ -6093,61 +6098,61 @@ var Gi = n({ tail: 5 }), Ki = ({ children: e, tail: t }) => {
|
|
|
6093
6098
|
className: "pkt-sr-only",
|
|
6094
6099
|
"aria-live": "polite",
|
|
6095
6100
|
"aria-atomic": "true",
|
|
6096
|
-
children:
|
|
6097
|
-
uploaded:
|
|
6098
|
-
total:
|
|
6099
|
-
label:
|
|
6101
|
+
children: W || (Ae > 0 && Q > 0 ? B(H.srFilesUploadedOfTotal, {
|
|
6102
|
+
uploaded: Q,
|
|
6103
|
+
total: Ae,
|
|
6104
|
+
label: Me
|
|
6100
6105
|
}) : "")
|
|
6101
6106
|
}),
|
|
6102
6107
|
/* @__PURE__ */ _("div", {
|
|
6103
6108
|
className: "pkt-sr-only",
|
|
6104
6109
|
"aria-live": "assertive",
|
|
6105
6110
|
"aria-atomic": "true",
|
|
6106
|
-
children:
|
|
6107
|
-
failed:
|
|
6108
|
-
total:
|
|
6109
|
-
label:
|
|
6111
|
+
children: Ae > 0 && je > 0 && B(H.srFilesFailedOfTotal, {
|
|
6112
|
+
failed: je,
|
|
6113
|
+
total: Ae,
|
|
6114
|
+
label: Me
|
|
6110
6115
|
})
|
|
6111
6116
|
}),
|
|
6112
6117
|
/* @__PURE__ */ _(fi, {
|
|
6113
6118
|
id: V,
|
|
6114
6119
|
name: R.name || "",
|
|
6115
|
-
value:
|
|
6116
|
-
onFilesAdded:
|
|
6120
|
+
value: Z,
|
|
6121
|
+
onFilesAdded: Te,
|
|
6117
6122
|
multiple: r,
|
|
6118
6123
|
uploadStrategy: i,
|
|
6119
6124
|
ref: ue,
|
|
6120
|
-
accept:
|
|
6121
|
-
isThumbnailView:
|
|
6125
|
+
accept: be ? oi : Se,
|
|
6126
|
+
isThumbnailView: be,
|
|
6122
6127
|
disabled: A,
|
|
6123
6128
|
required: ae && i === "form",
|
|
6124
6129
|
"aria-required": ae ? "true" : void 0,
|
|
6125
|
-
"aria-invalid":
|
|
6126
|
-
"aria-describedby":
|
|
6130
|
+
"aria-invalid": q ? "true" : void 0,
|
|
6131
|
+
"aria-describedby": he,
|
|
6127
6132
|
hasVisibleLabel: !!j,
|
|
6128
6133
|
strings: L
|
|
6129
6134
|
}),
|
|
6130
|
-
|
|
6135
|
+
K && pe && /* @__PURE__ */ _(ve, {
|
|
6131
6136
|
skin: "error",
|
|
6132
6137
|
"aria-live": "assertive",
|
|
6133
6138
|
role: "alert",
|
|
6134
6139
|
compact: !0,
|
|
6135
|
-
id:
|
|
6140
|
+
id: me,
|
|
6136
6141
|
className: "pkt-fileupload__error-alert",
|
|
6137
|
-
children:
|
|
6142
|
+
children: pe
|
|
6138
6143
|
}),
|
|
6139
|
-
|
|
6140
|
-
files:
|
|
6141
|
-
cancelTransfer:
|
|
6144
|
+
Z.length > 0 && /* @__PURE__ */ _(fa, {
|
|
6145
|
+
files: Z,
|
|
6146
|
+
cancelTransfer: De,
|
|
6142
6147
|
truncateTail: d,
|
|
6143
|
-
transfers:
|
|
6148
|
+
transfers: de,
|
|
6144
6149
|
uploadStrategy: i,
|
|
6145
|
-
ItemRenderer:
|
|
6146
|
-
enableImagePreview:
|
|
6150
|
+
ItemRenderer: ye,
|
|
6151
|
+
enableImagePreview: be && oe,
|
|
6147
6152
|
disabled: A,
|
|
6148
6153
|
inputName: R.name || "",
|
|
6149
|
-
buildAttributeAccessors:
|
|
6150
|
-
queueItemOperations:
|
|
6154
|
+
buildAttributeAccessors: Oe,
|
|
6155
|
+
queueItemOperations: ke
|
|
6151
6156
|
})
|
|
6152
6157
|
]
|
|
6153
6158
|
})
|
|
@@ -6162,18 +6167,18 @@ var Gi = n({ tail: 5 }), Ki = ({ children: e, tail: t }) => {
|
|
|
6162
6167
|
helptextDropdown: P,
|
|
6163
6168
|
helptextDropdownButton: ee,
|
|
6164
6169
|
disabled: A,
|
|
6165
|
-
hasError:
|
|
6170
|
+
hasError: K,
|
|
6166
6171
|
optionalTag: te,
|
|
6167
6172
|
optionalText: ne,
|
|
6168
6173
|
requiredTag: F,
|
|
6169
6174
|
requiredText: re,
|
|
6170
6175
|
tagText: ie,
|
|
6171
6176
|
className: (0, M.default)("pkt-fileupload-wrapper", { "pkt-fileupload-wrapper--full-width": x }),
|
|
6172
|
-
children:
|
|
6177
|
+
children: Ne
|
|
6173
6178
|
})
|
|
6174
6179
|
}) : /* @__PURE__ */ _("div", {
|
|
6175
6180
|
className: "pkt-fileupload-component",
|
|
6176
|
-
children:
|
|
6181
|
+
children: Ne
|
|
6177
6182
|
});
|
|
6178
6183
|
});
|
|
6179
6184
|
ma.displayName = "PktFileUpload";
|
|
@@ -6977,7 +6982,7 @@ so.displayName = "PktHeaderUserMenu";
|
|
|
6977
6982
|
//#endregion
|
|
6978
6983
|
//#region src/components/searchinput/SearchInput.tsx
|
|
6979
6984
|
var co = 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: f, onSearch: p, onSuggestionClick: m, strings: h, ...y }, b) => {
|
|
6980
|
-
let x =
|
|
6985
|
+
let x = _e(["searchinput"], h), S = s ?? x.searchinput.placeholder, C = (e, t) => {
|
|
6981
6986
|
e ? e() : m && m(t);
|
|
6982
6987
|
}, w = (e) => {
|
|
6983
6988
|
l = e.target.value;
|
|
@@ -7030,7 +7035,7 @@ var co = i(({ appearance: e = "local", inputSize: t = "medium", disabled: n = !1
|
|
|
7030
7035
|
e.key === "Enter" && (e.preventDefault(), p(l));
|
|
7031
7036
|
}),
|
|
7032
7037
|
...y
|
|
7033
|
-
}), /* @__PURE__ */ _(
|
|
7038
|
+
}), /* @__PURE__ */ _(Y, {
|
|
7034
7039
|
className: `pkt-searchinput__button ${e === "local" ? "pkt-input-icon" : ""}`,
|
|
7035
7040
|
variant: "icon-only",
|
|
7036
7041
|
iconName: "magnifying-glass-big",
|
|
@@ -7069,7 +7074,7 @@ var co = i(({ appearance: e = "local", inputSize: t = "medium", disabled: n = !1
|
|
|
7069
7074
|
co.displayName = "PktSearchInput";
|
|
7070
7075
|
//#endregion
|
|
7071
7076
|
//#region src/components/header/HeaderGlobal.tsx
|
|
7072
|
-
var lo = "https://punkt-cdn.oslo.kommune.no/18.
|
|
7077
|
+
var lo = "https://punkt-cdn.oslo.kommune.no/18.2/logos/";
|
|
7073
7078
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || lo);
|
|
7074
7079
|
var uo = "pkt-header-global-menu", fo = "pkt-header-global-menu-toggle", po = "pkt-header-global-search-panel", mo = "pkt-header-global-search-toggle", ho = i(({ className: e, "data-mode": t, dataUrl: n, data: r, locale: i = "nb-NO", logoLink: a = ga, logoClick: s, logoPath: l = typeof window < "u" ? window.pktLogoPath : lo, showSearch: u = !0, searchPlaceholder: h, onSearch: y, showContact: b = !0, user: x, userMenu: S, representing: C, canChangeRepresentation: w = !1, changeRepresentation: T, logOutButtonPlacement: E = "none", logOut: D, position: O = "fixed", scrollBehavior: k = "hide", mobileBreakpoint: A = 768, tabletBreakpoint: j = 1024, onDataLoaded: N, onDataError: P, strings: ee }, te) => {
|
|
7075
7080
|
let ne = k === "hide", [F, re] = m("none"), [ie, ae] = m(void 0), [oe, se] = m(!1), I = p(N), R = p(P);
|
|
@@ -7078,7 +7083,7 @@ var uo = "pkt-header-global-menu", fo = "pkt-header-global-menu-toggle", po = "p
|
|
|
7078
7083
|
}, [N]), c(() => {
|
|
7079
7084
|
R.current = P;
|
|
7080
7085
|
}, [P]);
|
|
7081
|
-
let { setRef: ce, isMobile:
|
|
7086
|
+
let { setRef: ce, isMobile: z, isTablet: B, isFixed: le, isSticky: V, hidden: ue, captureFocus: de, flagRestoreFocus: H, restoreFocus: fe } = Ka({
|
|
7082
7087
|
forwardedRef: te,
|
|
7083
7088
|
mobileBreakpoint: A,
|
|
7084
7089
|
tabletBreakpoint: j,
|
|
@@ -7087,17 +7092,17 @@ var uo = "pkt-header-global-menu", fo = "pkt-header-global-menu-toggle", po = "p
|
|
|
7087
7092
|
pauseScrollHide: F !== "none"
|
|
7088
7093
|
});
|
|
7089
7094
|
qa(F === "menu" || F === "search");
|
|
7090
|
-
let
|
|
7091
|
-
|
|
7095
|
+
let U = p(null), W = o((e) => {
|
|
7096
|
+
U.current = e, ce(e);
|
|
7092
7097
|
}, [ce]);
|
|
7093
7098
|
d(() => {
|
|
7094
7099
|
if (F !== "menu" && F !== "search") return;
|
|
7095
|
-
let e = document.getElementById(F === "menu" ? uo : po), t =
|
|
7100
|
+
let e = document.getElementById(F === "menu" ? uo : po), t = U.current?.getBoundingClientRect();
|
|
7096
7101
|
!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`));
|
|
7097
7102
|
}, [
|
|
7098
7103
|
F,
|
|
7099
|
-
|
|
7100
|
-
|
|
7104
|
+
z,
|
|
7105
|
+
B
|
|
7101
7106
|
]), c(() => {
|
|
7102
7107
|
r && I.current?.(r);
|
|
7103
7108
|
}, [r]), c(() => {
|
|
@@ -7109,22 +7114,22 @@ var uo = "pkt-header-global-menu", fo = "pkt-header-global-menu-toggle", po = "p
|
|
|
7109
7114
|
e.name !== "AbortError" && (se(!0), R.current?.(e));
|
|
7110
7115
|
}), () => e.abort();
|
|
7111
7116
|
}, [r, n]);
|
|
7112
|
-
let
|
|
7117
|
+
let G = r ?? ie, pe = f(() => Ca(G, i), [G, i]);
|
|
7113
7118
|
c(() => {
|
|
7114
7119
|
let e = (e) => {
|
|
7115
7120
|
let t = e.target;
|
|
7116
7121
|
F === "user" && !t.closest(".pkt-header-global__user-container") && !t.closest(".pkt-header-global__user-menu") && re("none"), F === "menu" && !t.closest(".pkt-header-menu") && !t.closest(`#${fo}`) && re("none"), F === "search" && !t.closest(".pkt-header-global__search-panel-inner") && !t.closest(`#${mo}`) && re("none");
|
|
7117
7122
|
}, t = (e) => {
|
|
7118
|
-
e.key === "Escape" && F !== "none" && (e.preventDefault(),
|
|
7123
|
+
e.key === "Escape" && F !== "none" && (e.preventDefault(), H(), re("none"));
|
|
7119
7124
|
};
|
|
7120
7125
|
if (F !== "none") return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
7121
7126
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
7122
7127
|
};
|
|
7123
|
-
|
|
7128
|
+
fe();
|
|
7124
7129
|
}, [
|
|
7125
7130
|
F,
|
|
7126
|
-
|
|
7127
|
-
|
|
7131
|
+
fe,
|
|
7132
|
+
H
|
|
7128
7133
|
]), c(() => {
|
|
7129
7134
|
if (F !== "menu" && F !== "search") return;
|
|
7130
7135
|
let e = F === "menu" ? uo : po, t = F === "menu" ? fo : mo, n = () => document.getElementById(e), r = () => document.getElementById(t), i = (e) => {
|
|
@@ -7153,18 +7158,18 @@ var uo = "pkt-header-global-menu", fo = "pkt-header-global-menu-toggle", po = "p
|
|
|
7153
7158
|
document.removeEventListener("keydown", a), document.removeEventListener("focusin", o);
|
|
7154
7159
|
};
|
|
7155
7160
|
}, [F]);
|
|
7156
|
-
let
|
|
7161
|
+
let K = f(() => {
|
|
7157
7162
|
if (x?.lastLoggedIn) return typeof x.lastLoggedIn == "string" ? x.lastLoggedIn : new Date(x.lastLoggedIn).toLocaleString("nb-NO", {
|
|
7158
7163
|
year: "numeric",
|
|
7159
7164
|
month: "long",
|
|
7160
7165
|
day: "numeric"
|
|
7161
7166
|
});
|
|
7162
|
-
}, [x?.lastLoggedIn]),
|
|
7163
|
-
re((t) => t === e ? "none" : (
|
|
7164
|
-
}, [
|
|
7165
|
-
className: (0, M.default)("pkt-header-global",
|
|
7167
|
+
}, [x?.lastLoggedIn]), me = o((e) => {
|
|
7168
|
+
re((t) => t === e ? "none" : (de(), e));
|
|
7169
|
+
}, [de]), he = E === "userMenu" || E === "both", q = _e(["header"], ee).header, J = pe?.search, ge = pe?.header?.contact, X = pe?.i18n?.menu || q.menu, Z = pe?.i18n?.search || q.search, ve = F === "menu", ye = F === "user", be = F === "search", xe = z, Se = !!(u && J), Ce = J?.input.id || "pkt-header-global-search", we = !pe && !oe, Te = /* @__PURE__ */ v("header", {
|
|
7170
|
+
className: (0, M.default)("pkt-header-global", z && "pkt-header-global--mobile", B && "pkt-header-global--tablet", le && "pkt-header-global--fixed", V && "pkt-header-global--sticky", ne && "pkt-header-global--scroll-to-hide", ue && "pkt-header-global--hidden", e),
|
|
7166
7171
|
"data-mode": t,
|
|
7167
|
-
ref:
|
|
7172
|
+
ref: W,
|
|
7168
7173
|
children: [
|
|
7169
7174
|
/* @__PURE__ */ _("div", {
|
|
7170
7175
|
className: "pkt-header-global__logo-area",
|
|
@@ -7185,56 +7190,56 @@ var uo = "pkt-header-global-menu", fo = "pkt-header-global-menu-toggle", po = "p
|
|
|
7185
7190
|
/* @__PURE__ */ v("div", {
|
|
7186
7191
|
className: "pkt-header-global__content",
|
|
7187
7192
|
children: [
|
|
7188
|
-
!
|
|
7193
|
+
!xe && Se && J && /* @__PURE__ */ _("div", {
|
|
7189
7194
|
className: "pkt-header-global__search",
|
|
7190
7195
|
children: /* @__PURE__ */ _(co, {
|
|
7191
7196
|
appearance: "global",
|
|
7192
|
-
inputSize:
|
|
7197
|
+
inputSize: B ? "small" : "medium",
|
|
7193
7198
|
fullwidth: !0,
|
|
7194
|
-
id:
|
|
7195
|
-
name:
|
|
7196
|
-
"aria-label":
|
|
7197
|
-
placeholder: h ??
|
|
7198
|
-
action:
|
|
7199
|
+
id: Ce,
|
|
7200
|
+
name: J.input.name,
|
|
7201
|
+
"aria-label": Z,
|
|
7202
|
+
placeholder: h ?? J.input.placeholder,
|
|
7203
|
+
action: J.endpoint,
|
|
7199
7204
|
method: "get",
|
|
7200
7205
|
onSearch: y,
|
|
7201
7206
|
onChange: () => {}
|
|
7202
7207
|
})
|
|
7203
7208
|
}),
|
|
7204
|
-
|
|
7209
|
+
xe && Se && /* @__PURE__ */ _(Y, {
|
|
7205
7210
|
id: mo,
|
|
7206
7211
|
className: "pkt-header-global__search-toggle",
|
|
7207
7212
|
skin: "primary",
|
|
7208
|
-
color:
|
|
7213
|
+
color: be ? void 0 : "yellow",
|
|
7209
7214
|
variant: "icon-only",
|
|
7210
|
-
iconName:
|
|
7211
|
-
size:
|
|
7212
|
-
state:
|
|
7213
|
-
"aria-expanded":
|
|
7215
|
+
iconName: be ? "close" : "magnifying-glass-big",
|
|
7216
|
+
size: z ? "small" : "medium",
|
|
7217
|
+
state: be ? "active" : "normal",
|
|
7218
|
+
"aria-expanded": be,
|
|
7214
7219
|
"aria-controls": po,
|
|
7215
|
-
onClick: () =>
|
|
7216
|
-
children:
|
|
7220
|
+
onClick: () => me("search"),
|
|
7221
|
+
children: Z
|
|
7217
7222
|
}),
|
|
7218
|
-
/* @__PURE__ */ _(
|
|
7223
|
+
/* @__PURE__ */ _(Y, {
|
|
7219
7224
|
id: fo,
|
|
7220
7225
|
className: "pkt-header-global__menu-toggle",
|
|
7221
|
-
skin:
|
|
7222
|
-
variant:
|
|
7223
|
-
iconName:
|
|
7224
|
-
size:
|
|
7225
|
-
state:
|
|
7226
|
-
"aria-expanded":
|
|
7226
|
+
skin: xe ? "tertiary" : "secondary",
|
|
7227
|
+
variant: xe ? "icon-only" : "icon-right",
|
|
7228
|
+
iconName: ve ? "close" : "menu",
|
|
7229
|
+
size: B ? "small" : "medium",
|
|
7230
|
+
state: ve ? "active" : "normal",
|
|
7231
|
+
"aria-expanded": ve,
|
|
7227
7232
|
"aria-controls": uo,
|
|
7228
|
-
disabled:
|
|
7229
|
-
onClick: () =>
|
|
7230
|
-
children:
|
|
7233
|
+
disabled: we,
|
|
7234
|
+
onClick: () => me("menu"),
|
|
7235
|
+
children: X
|
|
7231
7236
|
}),
|
|
7232
|
-
!
|
|
7233
|
-
className: (0, M.default)("pkt-header-global__contact", "pkt-btn", "pkt-btn--secondary", "pkt-btn--label-only",
|
|
7234
|
-
href:
|
|
7237
|
+
!xe && b && ge && !x && /* @__PURE__ */ _("a", {
|
|
7238
|
+
className: (0, M.default)("pkt-header-global__contact", "pkt-btn", "pkt-btn--secondary", "pkt-btn--label-only", B ? "pkt-btn--small" : "pkt-btn--medium"),
|
|
7239
|
+
href: ge.url,
|
|
7235
7240
|
children: /* @__PURE__ */ _("span", {
|
|
7236
7241
|
className: "pkt-btn__text",
|
|
7237
|
-
children:
|
|
7242
|
+
children: ge.text
|
|
7238
7243
|
})
|
|
7239
7244
|
})
|
|
7240
7245
|
]
|
|
@@ -7242,16 +7247,16 @@ var uo = "pkt-header-global-menu", fo = "pkt-header-global-menu-toggle", po = "p
|
|
|
7242
7247
|
x && /* @__PURE__ */ _("div", {
|
|
7243
7248
|
className: "pkt-header-global__user",
|
|
7244
7249
|
children: /* @__PURE__ */ v("div", {
|
|
7245
|
-
className: (0, M.default)("pkt-header-global__user-container",
|
|
7246
|
-
children: [/* @__PURE__ */ v(
|
|
7250
|
+
className: (0, M.default)("pkt-header-global__user-container", ye && "is-open"),
|
|
7251
|
+
children: [/* @__PURE__ */ v(Y, {
|
|
7247
7252
|
className: "pkt-header-global__user-button",
|
|
7248
7253
|
skin: "secondary",
|
|
7249
|
-
size:
|
|
7250
|
-
state:
|
|
7254
|
+
size: B ? "small" : "medium",
|
|
7255
|
+
state: ye ? "active" : "normal",
|
|
7251
7256
|
variant: "icons-right-and-left",
|
|
7252
7257
|
iconName: "user",
|
|
7253
|
-
secondIconName:
|
|
7254
|
-
onClick: () =>
|
|
7258
|
+
secondIconName: ye ? "chevron-thin-up" : "chevron-thin-down",
|
|
7259
|
+
onClick: () => me("user"),
|
|
7255
7260
|
children: [/* @__PURE__ */ _("span", {
|
|
7256
7261
|
className: "pkt-sr-only",
|
|
7257
7262
|
children: "Brukermeny: "
|
|
@@ -7259,26 +7264,26 @@ var uo = "pkt-header-global-menu", fo = "pkt-header-global-menu-toggle", po = "p
|
|
|
7259
7264
|
translate: "no",
|
|
7260
7265
|
children: C?.name || x.name
|
|
7261
7266
|
})]
|
|
7262
|
-
}),
|
|
7267
|
+
}), ye && /* @__PURE__ */ _("div", {
|
|
7263
7268
|
className: "pkt-header-global__user-menu is-open",
|
|
7264
7269
|
children: /* @__PURE__ */ _(so, {
|
|
7265
7270
|
user: x,
|
|
7266
|
-
formattedLastLoggedIn:
|
|
7271
|
+
formattedLastLoggedIn: K,
|
|
7267
7272
|
representing: C,
|
|
7268
7273
|
userMenu: S,
|
|
7269
7274
|
canChangeRepresentation: w,
|
|
7270
7275
|
changeRepresentation: T,
|
|
7271
|
-
logoutOnClick:
|
|
7276
|
+
logoutOnClick: he ? D : void 0
|
|
7272
7277
|
})
|
|
7273
7278
|
})]
|
|
7274
7279
|
})
|
|
7275
7280
|
})
|
|
7276
7281
|
]
|
|
7277
|
-
}),
|
|
7278
|
-
className: (0, M.default)("pkt-header-global__menu",
|
|
7282
|
+
}), Ee = ve && /* @__PURE__ */ _("div", {
|
|
7283
|
+
className: (0, M.default)("pkt-header-global__menu", z && "pkt-header-global__menu--mobile", B && !z && "pkt-header-global__menu--tablet"),
|
|
7279
7284
|
id: uo,
|
|
7280
|
-
children:
|
|
7281
|
-
data:
|
|
7285
|
+
children: pe ? /* @__PURE__ */ _(Ja, {
|
|
7286
|
+
data: G,
|
|
7282
7287
|
locale: i,
|
|
7283
7288
|
open: !0,
|
|
7284
7289
|
mobileBreakpoint: A
|
|
@@ -7289,19 +7294,19 @@ var uo = "pkt-header-global-menu", fo = "pkt-header-global-menu-toggle", po = "p
|
|
|
7289
7294
|
children: "Kunne ikke laste meny."
|
|
7290
7295
|
})
|
|
7291
7296
|
})
|
|
7292
|
-
}),
|
|
7293
|
-
className: (0, M.default)("pkt-header-global__search-panel",
|
|
7297
|
+
}), De = be && Se && J && /* @__PURE__ */ _("div", {
|
|
7298
|
+
className: (0, M.default)("pkt-header-global__search-panel", z && "pkt-header-global__search-panel--mobile", B && !z && "pkt-header-global__search-panel--tablet"),
|
|
7294
7299
|
id: po,
|
|
7295
7300
|
children: /* @__PURE__ */ _("div", {
|
|
7296
7301
|
className: "pkt-header-global__search-panel-inner",
|
|
7297
7302
|
children: /* @__PURE__ */ _(co, {
|
|
7298
7303
|
appearance: "global",
|
|
7299
7304
|
fullwidth: !0,
|
|
7300
|
-
id:
|
|
7301
|
-
name:
|
|
7302
|
-
"aria-label":
|
|
7303
|
-
placeholder: h ??
|
|
7304
|
-
action:
|
|
7305
|
+
id: Ce,
|
|
7306
|
+
name: J.input.name,
|
|
7307
|
+
"aria-label": Z,
|
|
7308
|
+
placeholder: h ?? J.input.placeholder,
|
|
7309
|
+
action: J.endpoint,
|
|
7305
7310
|
method: "get",
|
|
7306
7311
|
onSearch: y,
|
|
7307
7312
|
onChange: () => {},
|
|
@@ -7309,37 +7314,37 @@ var uo = "pkt-header-global-menu", fo = "pkt-header-global-menu-toggle", po = "p
|
|
|
7309
7314
|
})
|
|
7310
7315
|
})
|
|
7311
7316
|
});
|
|
7312
|
-
return
|
|
7317
|
+
return le ? /* @__PURE__ */ v("div", {
|
|
7313
7318
|
className: "pkt-header-global-wrapper",
|
|
7314
7319
|
children: [
|
|
7315
|
-
Ce,
|
|
7316
|
-
/* @__PURE__ */ _("div", { className: (0, M.default)("pkt-header-global-spacer", B && "pkt-header-global-spacer--mobile", V && !B && "pkt-header-global-spacer--tablet", x && "pkt-header-global-spacer--has-user") }),
|
|
7317
7320
|
Te,
|
|
7318
|
-
|
|
7321
|
+
/* @__PURE__ */ _("div", { className: (0, M.default)("pkt-header-global-spacer", z && "pkt-header-global-spacer--mobile", B && !z && "pkt-header-global-spacer--tablet", x && "pkt-header-global-spacer--has-user") }),
|
|
7322
|
+
De,
|
|
7323
|
+
Ee
|
|
7319
7324
|
]
|
|
7320
7325
|
}) : /* @__PURE__ */ v(g, { children: [
|
|
7321
|
-
Ce,
|
|
7322
7326
|
Te,
|
|
7323
|
-
|
|
7327
|
+
De,
|
|
7328
|
+
Ee
|
|
7324
7329
|
] });
|
|
7325
7330
|
});
|
|
7326
7331
|
ho.displayName = "PktHeaderGlobal";
|
|
7327
7332
|
//#endregion
|
|
7328
7333
|
//#region src/components/textinput/Textinput.tsx
|
|
7329
|
-
var go = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "off", counter: i, hasFieldset: a, counterMaxLength: o, className: s, disabled: l = !1, errorMessage: u, hasError: d = !1, helptext: f, helptextDropdown: p, helptextDropdownButton: h, iconNameRight: g, inline: y = !1, fullwidth: b = !1, label: x, name: S, optionalTag: C = !1, optionalText: w, requiredTag: T = !1, requiredText: E, tagText: D = null, placeholder: O, prefix: k, suffix: A, type: j = "text", useWrapper: M = !0, omitSearchIcon: N = !1, value: P, minLength: ee, maxLength: te, min: ne, max: F, step: re, size: ie, readonly: ae, required: oe, dataTestid: se, onChange: I, skipForwardTestid: R = !1, inputSize:
|
|
7330
|
-
let
|
|
7331
|
-
|
|
7334
|
+
var go = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "off", counter: i, hasFieldset: a, counterMaxLength: o, className: s, disabled: l = !1, errorMessage: u, hasError: d = !1, helptext: f, helptextDropdown: p, helptextDropdownButton: h, iconNameRight: g, inline: y = !1, fullwidth: b = !1, label: x, name: S, optionalTag: C = !1, optionalText: w, requiredTag: T = !1, requiredText: E, tagText: D = null, placeholder: O, prefix: k, suffix: A, type: j = "text", useWrapper: M = !0, omitSearchIcon: N = !1, value: P, minLength: ee, maxLength: te, min: ne, max: F, step: re, size: ie, readonly: ae, required: oe, dataTestid: se, onChange: I, skipForwardTestid: R = !1, inputSize: ce = "medium", strings: z, ...B }, le) => {
|
|
7335
|
+
let V = i ?? (o ?? 0) > 0, ue = [s, "pkt-textinput"].filter(Boolean).join(" "), de = j === "search" && !g && !N, H = j === "date" && P ? P.slice(0, 10) : P, [fe, U] = m(P?.length || 0), W = `${e}`, G = `${W}-label`, pe = n || G, K = (e) => {
|
|
7336
|
+
V && U(e.currentTarget?.value?.length || 0), I && I(e);
|
|
7332
7337
|
};
|
|
7333
7338
|
return c(() => {
|
|
7334
|
-
P !== void 0 &&
|
|
7339
|
+
P !== void 0 && U(P?.length || 0);
|
|
7335
7340
|
}, [P]), /* @__PURE__ */ _("div", {
|
|
7336
|
-
className:
|
|
7341
|
+
className: ue,
|
|
7337
7342
|
children: /* @__PURE__ */ _(qn, {
|
|
7338
|
-
strings:
|
|
7343
|
+
strings: z,
|
|
7339
7344
|
ariaDescribedby: t,
|
|
7340
7345
|
disabled: l,
|
|
7341
7346
|
errorMessage: u,
|
|
7342
|
-
forId:
|
|
7347
|
+
forId: W,
|
|
7343
7348
|
hasError: d,
|
|
7344
7349
|
helptext: f,
|
|
7345
7350
|
helptextDropdown: p,
|
|
@@ -7352,13 +7357,13 @@ var go = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
7352
7357
|
requiredText: E,
|
|
7353
7358
|
tagText: D,
|
|
7354
7359
|
useWrapper: M,
|
|
7355
|
-
counter:
|
|
7356
|
-
counterCurrent:
|
|
7360
|
+
counter: V,
|
|
7361
|
+
counterCurrent: fe,
|
|
7357
7362
|
counterMaxLength: o,
|
|
7358
7363
|
hasFieldset: a ?? !1,
|
|
7359
|
-
size:
|
|
7364
|
+
size: ce,
|
|
7360
7365
|
children: /* @__PURE__ */ v("div", {
|
|
7361
|
-
className: `pkt-input__container pkt-input__container--${
|
|
7366
|
+
className: `pkt-input__container pkt-input__container--${ce}`,
|
|
7362
7367
|
"data-testid": se,
|
|
7363
7368
|
"data-skip-forward-testid": R ? "true" : void 0,
|
|
7364
7369
|
children: [
|
|
@@ -7368,27 +7373,27 @@ var go = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
7368
7373
|
}),
|
|
7369
7374
|
/* @__PURE__ */ _("input", {
|
|
7370
7375
|
...B,
|
|
7371
|
-
ref:
|
|
7372
|
-
className: `pkt-input pkt-input--${
|
|
7376
|
+
ref: le,
|
|
7377
|
+
className: `pkt-input pkt-input--${ce} ${b ? "pkt-input--fullwidth" : ""} ${o && fe > o ? "pkt-input--counter-error" : ""}`,
|
|
7373
7378
|
type: j,
|
|
7374
7379
|
name: `${S || e}`,
|
|
7375
|
-
value:
|
|
7376
|
-
id:
|
|
7380
|
+
value: H,
|
|
7381
|
+
id: W,
|
|
7377
7382
|
placeholder: O,
|
|
7378
7383
|
autoComplete: r,
|
|
7379
7384
|
disabled: l,
|
|
7380
7385
|
"aria-invalid": d,
|
|
7381
7386
|
"aria-errormessage": d ? `${e}-error` : void 0,
|
|
7382
7387
|
"aria-describedby": Vn({
|
|
7383
|
-
id:
|
|
7388
|
+
id: W,
|
|
7384
7389
|
hasHelptext: !!f,
|
|
7385
|
-
hasCounter:
|
|
7390
|
+
hasCounter: V,
|
|
7386
7391
|
ariaDescribedby: t
|
|
7387
7392
|
}),
|
|
7388
|
-
"aria-labelledby":
|
|
7393
|
+
"aria-labelledby": pe,
|
|
7389
7394
|
min: ne,
|
|
7390
7395
|
max: F,
|
|
7391
|
-
onChange:
|
|
7396
|
+
onChange: K,
|
|
7392
7397
|
step: re,
|
|
7393
7398
|
minLength: ee,
|
|
7394
7399
|
maxLength: te,
|
|
@@ -7404,7 +7409,7 @@ var go = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
7404
7409
|
className: "pkt-input-suffix-icon",
|
|
7405
7410
|
name: g
|
|
7406
7411
|
}),
|
|
7407
|
-
|
|
7412
|
+
de && /* @__PURE__ */ _(L, {
|
|
7408
7413
|
className: "pkt-input-suffix-icon",
|
|
7409
7414
|
name: "magnifying-glass-big"
|
|
7410
7415
|
})
|
|
@@ -7414,7 +7419,7 @@ var go = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
7414
7419
|
className: "pkt-input-icon",
|
|
7415
7420
|
name: g
|
|
7416
7421
|
}),
|
|
7417
|
-
!A &&
|
|
7422
|
+
!A && de && /* @__PURE__ */ _(L, {
|
|
7418
7423
|
className: "pkt-input-icon",
|
|
7419
7424
|
name: "magnifying-glass-big"
|
|
7420
7425
|
})
|
|
@@ -7426,14 +7431,14 @@ var go = i(({ id: e, ariaDescribedby: t, ariaLabelledby: n, autocomplete: r = "o
|
|
|
7426
7431
|
go.displayName = "PktTextinput";
|
|
7427
7432
|
//#endregion
|
|
7428
7433
|
//#region src/components/header/HeaderService.tsx
|
|
7429
|
-
var _o = "https://punkt-cdn.oslo.kommune.no/18.
|
|
7434
|
+
var _o = "https://punkt-cdn.oslo.kommune.no/18.2/logos/";
|
|
7430
7435
|
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || _o);
|
|
7431
7436
|
var vo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n, className: r, compact: i = !1, "data-mode": a, logOutButtonPlacement: s = "none", logOut: l, openedMenu: u, showSearch: d = !1, onSearch: h, onSearchChange: y, searchValue: b, searchPlaceholder: x, representing: S, serviceLink: C, serviceClick: w, serviceName: T, user: E, userMenu: D, userMenuFooter: O, userOptions: k, canChangeRepresentation: A = !1, changeRepresentation: j, hideLogo: N = !1, logoLink: P = ga, logoClick: ee, logoPath: te = typeof window < "u" ? window.pktLogoPath : _o, position: ne = "fixed", scrollBehavior: F = "hide", slotMenuVariant: re = "icon-only", slotMenuText: ie = "Meny", strings: ae }, oe) => {
|
|
7432
7437
|
let se = F === "hide";
|
|
7433
7438
|
c(() => {
|
|
7434
7439
|
O && console.warn("PktHeaderService: The \"userMenuFooter\" prop is deprecated and will be removed in a future version. Please use \"userMenu\" instead.");
|
|
7435
7440
|
}, [O]);
|
|
7436
|
-
let I =
|
|
7441
|
+
let I = _e(["header"], ae).header, R = x ?? I.search;
|
|
7437
7442
|
c(() => {
|
|
7438
7443
|
k && console.warn("PktHeaderService: The \"userOptions\" prop is no longer available. Please use \"userMenu\" instead.");
|
|
7439
7444
|
}, [k]), c(() => {
|
|
@@ -7445,72 +7450,72 @@ var vo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7445
7450
|
month: "long",
|
|
7446
7451
|
day: "numeric"
|
|
7447
7452
|
});
|
|
7448
|
-
}, [E?.lastLoggedIn]), [
|
|
7453
|
+
}, [E?.lastLoggedIn]), [z, B] = m(u || "none");
|
|
7449
7454
|
c(() => {
|
|
7450
|
-
u !== void 0 &&
|
|
7455
|
+
u !== void 0 && B(u);
|
|
7451
7456
|
}, [u]);
|
|
7452
|
-
let [
|
|
7457
|
+
let [le, V] = m(!1), [ue, de] = m(!1), H = p(null), fe = p(null), U = p(null), W = p(null), G = p(null), { setRef: pe, isMobile: K, isTablet: me, isFixed: he, isSticky: q, hidden: J, captureFocus: ge, flagRestoreFocus: X, restoreFocus: Z } = Ka({
|
|
7453
7458
|
forwardedRef: oe,
|
|
7454
7459
|
mobileBreakpoint: e,
|
|
7455
7460
|
tabletBreakpoint: t,
|
|
7456
7461
|
position: ne,
|
|
7457
7462
|
scrollBehavior: F
|
|
7458
7463
|
});
|
|
7459
|
-
qa((
|
|
7460
|
-
let
|
|
7464
|
+
qa((he || q) && K && z !== "none");
|
|
7465
|
+
let ve = o((e, t) => {
|
|
7461
7466
|
let n = e.relatedTarget, r;
|
|
7462
7467
|
switch (t) {
|
|
7463
7468
|
case "user":
|
|
7464
|
-
r =
|
|
7469
|
+
r = H;
|
|
7465
7470
|
break;
|
|
7466
7471
|
case "slot":
|
|
7467
|
-
r =
|
|
7472
|
+
r = fe;
|
|
7468
7473
|
break;
|
|
7469
7474
|
case "search":
|
|
7470
|
-
r =
|
|
7475
|
+
r = U;
|
|
7471
7476
|
break;
|
|
7472
7477
|
default: return;
|
|
7473
7478
|
}
|
|
7474
7479
|
let i = r.current;
|
|
7475
|
-
i && (!n || !i.contains(n)) &&
|
|
7480
|
+
i && (!n || !i.contains(n)) && B("none");
|
|
7476
7481
|
}, []);
|
|
7477
7482
|
c(() => {
|
|
7478
7483
|
let e = (e) => {
|
|
7479
|
-
E &&
|
|
7484
|
+
E && z === "user" && !e.target.closest(".pkt-header-service__user-container") && B("none"), z === "slot" && !e.target.closest(".pkt-header-service__slot-container") && B("none"), z === "search" && !e.target.closest(".pkt-header-service__search-container") && !e.target.closest(".pkt-header-service__search-input") && B("none");
|
|
7480
7485
|
}, t = (e) => {
|
|
7481
|
-
e.key === "Escape" &&
|
|
7486
|
+
e.key === "Escape" && z !== "none" && (e.preventDefault(), X(), B("none"));
|
|
7482
7487
|
};
|
|
7483
|
-
if (
|
|
7488
|
+
if (z !== "none") return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
7484
7489
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
7485
7490
|
};
|
|
7486
|
-
|
|
7491
|
+
Z();
|
|
7487
7492
|
}, [
|
|
7488
|
-
|
|
7493
|
+
z,
|
|
7489
7494
|
E,
|
|
7490
|
-
|
|
7491
|
-
|
|
7495
|
+
Z,
|
|
7496
|
+
X
|
|
7492
7497
|
]);
|
|
7493
|
-
let
|
|
7494
|
-
let t = e === "slot" ?
|
|
7495
|
-
if (!t.current || !n.current || !
|
|
7498
|
+
let ye = o((e) => {
|
|
7499
|
+
let t = e === "slot" ? fe : U, n = e === "slot" ? W : G;
|
|
7500
|
+
if (!t.current || !n.current || !me || K) return;
|
|
7496
7501
|
let r = t.current.getBoundingClientRect(), i = n.current.offsetWidth, a = r.left + i > window.innerWidth;
|
|
7497
|
-
e === "slot" ?
|
|
7498
|
-
}, [
|
|
7499
|
-
if (!
|
|
7502
|
+
e === "slot" ? V(a) : de(a);
|
|
7503
|
+
}, [me, K]), be = o((e) => {
|
|
7504
|
+
if (!me || z !== "slot") return;
|
|
7500
7505
|
let t = e.target.closest("a[href], button, [role=\"link\"], [role=\"button\"], [role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]");
|
|
7501
|
-
!t || !
|
|
7502
|
-
}, [
|
|
7503
|
-
|
|
7504
|
-
}, [
|
|
7506
|
+
!t || !W.current?.contains(t) || t.closest("[data-pkt-header-keep-open]") || t.disabled || t.getAttribute("aria-disabled") === "true" || B("none");
|
|
7507
|
+
}, [me, z]), xe = o((e) => {
|
|
7508
|
+
z === "none" ? (ge(), B(e)) : B("none");
|
|
7509
|
+
}, [z, ge]);
|
|
7505
7510
|
c(() => {
|
|
7506
|
-
(
|
|
7507
|
-
|
|
7511
|
+
(z === "slot" || z === "search") && requestAnimationFrame(() => {
|
|
7512
|
+
ye(z);
|
|
7508
7513
|
});
|
|
7509
|
-
}, [
|
|
7510
|
-
let
|
|
7511
|
-
className: (0, M.default)("pkt-header-service", i && "pkt-header-service--compact",
|
|
7514
|
+
}, [z, ye]);
|
|
7515
|
+
let Se = /* @__PURE__ */ v("header", {
|
|
7516
|
+
className: (0, M.default)("pkt-header-service", i && "pkt-header-service--compact", K && "pkt-header-service--mobile", me && "pkt-header-service--tablet", he && "pkt-header-service--fixed", q && "pkt-header-service--sticky", se && "pkt-header-service--scroll-to-hide", J && "pkt-header-service--hidden", r),
|
|
7512
7517
|
"data-mode": a,
|
|
7513
|
-
ref:
|
|
7518
|
+
ref: pe,
|
|
7514
7519
|
children: [
|
|
7515
7520
|
/* @__PURE__ */ v("div", {
|
|
7516
7521
|
className: (0, M.default)("pkt-header-service__logo-area", (!T || T === "") && "pkt-header-service__logo-area--without-service"),
|
|
@@ -7543,56 +7548,56 @@ var vo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7543
7548
|
})
|
|
7544
7549
|
})]
|
|
7545
7550
|
}),
|
|
7546
|
-
n || d ||
|
|
7551
|
+
n || d || me && l && (s === "header" || s === "both") ? /* @__PURE__ */ v("div", {
|
|
7547
7552
|
className: "pkt-header-service__content",
|
|
7548
7553
|
children: [
|
|
7549
7554
|
/* @__PURE__ */ v("div", {
|
|
7550
|
-
className: (0, M.default)("pkt-header-service__slot-container",
|
|
7551
|
-
onBlur: (e) =>
|
|
7552
|
-
ref:
|
|
7553
|
-
children: [
|
|
7555
|
+
className: (0, M.default)("pkt-header-service__slot-container", z === "slot" && "is-open"),
|
|
7556
|
+
onBlur: (e) => ve(e, "slot"),
|
|
7557
|
+
ref: fe,
|
|
7558
|
+
children: [me && n && /* @__PURE__ */ _(Y, {
|
|
7554
7559
|
skin: "secondary",
|
|
7555
7560
|
variant: re,
|
|
7556
7561
|
iconName: "menu",
|
|
7557
|
-
size:
|
|
7558
|
-
state:
|
|
7559
|
-
onClick: () =>
|
|
7560
|
-
"aria-expanded":
|
|
7562
|
+
size: K ? "small" : "medium",
|
|
7563
|
+
state: z === "slot" ? "active" : "normal",
|
|
7564
|
+
onClick: () => xe("slot"),
|
|
7565
|
+
"aria-expanded": z === "slot",
|
|
7561
7566
|
"aria-controls": "mobile-slot-menu",
|
|
7562
7567
|
"aria-label": I.openMenu,
|
|
7563
7568
|
children: ie
|
|
7564
7569
|
}), /* @__PURE__ */ _("div", {
|
|
7565
|
-
className: (0, M.default)("pkt-header-service__slot-content",
|
|
7570
|
+
className: (0, M.default)("pkt-header-service__slot-content", le && "align-right"),
|
|
7566
7571
|
id: "mobile-slot-menu",
|
|
7567
|
-
role:
|
|
7568
|
-
"aria-label":
|
|
7569
|
-
ref:
|
|
7570
|
-
onClick:
|
|
7572
|
+
role: me ? "group" : void 0,
|
|
7573
|
+
"aria-label": me ? "Meny" : void 0,
|
|
7574
|
+
ref: W,
|
|
7575
|
+
onClick: be,
|
|
7571
7576
|
children: /* @__PURE__ */ _("div", {
|
|
7572
7577
|
className: "pkt-contents",
|
|
7573
7578
|
children: n
|
|
7574
7579
|
})
|
|
7575
7580
|
})]
|
|
7576
7581
|
}),
|
|
7577
|
-
d && /* @__PURE__ */ _(g, { children:
|
|
7578
|
-
className: (0, M.default)("pkt-header-service__search-container",
|
|
7579
|
-
onBlur: (e) =>
|
|
7580
|
-
ref:
|
|
7581
|
-
children: [/* @__PURE__ */ _(
|
|
7582
|
+
d && /* @__PURE__ */ _(g, { children: me ? /* @__PURE__ */ v("div", {
|
|
7583
|
+
className: (0, M.default)("pkt-header-service__search-container", z === "search" && "is-open"),
|
|
7584
|
+
onBlur: (e) => ve(e, "search"),
|
|
7585
|
+
ref: U,
|
|
7586
|
+
children: [/* @__PURE__ */ _(Y, {
|
|
7582
7587
|
skin: "secondary",
|
|
7583
7588
|
variant: "icon-only",
|
|
7584
7589
|
iconName: "magnifying-glass-big",
|
|
7585
|
-
size:
|
|
7586
|
-
onClick: () =>
|
|
7587
|
-
state:
|
|
7588
|
-
"aria-expanded":
|
|
7590
|
+
size: K ? "small" : "medium",
|
|
7591
|
+
onClick: () => xe("search"),
|
|
7592
|
+
state: z === "search" ? "active" : "normal",
|
|
7593
|
+
"aria-expanded": z === "search",
|
|
7589
7594
|
"aria-controls": "mobile-search-menu",
|
|
7590
7595
|
"aria-label": I.openSearch,
|
|
7591
7596
|
children: "Søk"
|
|
7592
7597
|
}), /* @__PURE__ */ _("div", {
|
|
7593
|
-
className: (0, M.default)("pkt-header-service__mobile-menu",
|
|
7594
|
-
ref:
|
|
7595
|
-
children:
|
|
7598
|
+
className: (0, M.default)("pkt-header-service__mobile-menu", z === "search" && "is-open", ue && "align-right"),
|
|
7599
|
+
ref: G,
|
|
7600
|
+
children: z === "search" && /* @__PURE__ */ _(go, {
|
|
7596
7601
|
id: "mobile-search-menu",
|
|
7597
7602
|
className: "pkt-header-service__search-input",
|
|
7598
7603
|
type: "search",
|
|
@@ -7621,9 +7626,9 @@ var vo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7621
7626
|
e.key === "Enter" && h?.(e.target.value);
|
|
7622
7627
|
}
|
|
7623
7628
|
}) }),
|
|
7624
|
-
|
|
7629
|
+
K && l && (s === "header" || s === "both") && /* @__PURE__ */ _(Y, {
|
|
7625
7630
|
skin: "secondary",
|
|
7626
|
-
size:
|
|
7631
|
+
size: K ? "small" : "medium",
|
|
7627
7632
|
variant: "icon-only",
|
|
7628
7633
|
iconName: "exit",
|
|
7629
7634
|
onClick: l,
|
|
@@ -7631,21 +7636,21 @@ var vo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7631
7636
|
})
|
|
7632
7637
|
]
|
|
7633
7638
|
}) : null,
|
|
7634
|
-
(E || !
|
|
7639
|
+
(E || !K && l && (s === "header" || s === "both")) && /* @__PURE__ */ v("div", {
|
|
7635
7640
|
className: "pkt-header-service__user",
|
|
7636
7641
|
children: [E && /* @__PURE__ */ v("div", {
|
|
7637
7642
|
className: "pkt-header-service__user-container",
|
|
7638
|
-
onBlur: (e) =>
|
|
7639
|
-
ref:
|
|
7640
|
-
children: [/* @__PURE__ */ v(
|
|
7641
|
-
className: (0, M.default)("pkt-header-service__user-button",
|
|
7643
|
+
onBlur: (e) => ve(e, "user"),
|
|
7644
|
+
ref: H,
|
|
7645
|
+
children: [/* @__PURE__ */ v(Y, {
|
|
7646
|
+
className: (0, M.default)("pkt-header-service__user-button", K && "pkt-header-service__user-button--mobile"),
|
|
7642
7647
|
skin: "secondary",
|
|
7643
|
-
size:
|
|
7644
|
-
state:
|
|
7648
|
+
size: K ? "small" : "medium",
|
|
7649
|
+
state: z === "user" ? "active" : "normal",
|
|
7645
7650
|
variant: "icons-right-and-left",
|
|
7646
7651
|
iconName: "user",
|
|
7647
|
-
secondIconName:
|
|
7648
|
-
onClick: () =>
|
|
7652
|
+
secondIconName: z === "user" ? "chevron-thin-up" : "chevron-thin-down",
|
|
7653
|
+
onClick: () => xe("user"),
|
|
7649
7654
|
children: [/* @__PURE__ */ _("span", {
|
|
7650
7655
|
className: "pkt-sr-only",
|
|
7651
7656
|
children: "Brukermeny: "
|
|
@@ -7653,8 +7658,8 @@ var vo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7653
7658
|
translate: "no",
|
|
7654
7659
|
children: S?.name || E.name
|
|
7655
7660
|
})]
|
|
7656
|
-
}),
|
|
7657
|
-
className: (0, M.default)(
|
|
7661
|
+
}), z === "user" && E && /* @__PURE__ */ _("div", {
|
|
7662
|
+
className: (0, M.default)(K ? "pkt-header-service__mobile-menu" : "pkt-header-service__user-menu", "is-open"),
|
|
7658
7663
|
children: /* @__PURE__ */ _(so, {
|
|
7659
7664
|
user: E,
|
|
7660
7665
|
formattedLastLoggedIn: ce,
|
|
@@ -7665,7 +7670,7 @@ var vo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7665
7670
|
logoutOnClick: s === "userMenu" || s === "both" ? l : void 0
|
|
7666
7671
|
})
|
|
7667
7672
|
})]
|
|
7668
|
-
}), !
|
|
7673
|
+
}), !K && l && (s === "header" || s === "both") && /* @__PURE__ */ _(Y, {
|
|
7669
7674
|
skin: "tertiary",
|
|
7670
7675
|
size: "medium",
|
|
7671
7676
|
variant: "icon-right",
|
|
@@ -7676,10 +7681,10 @@ var vo = i(({ mobileBreakpoint: e = 768, tabletBreakpoint: t = 1280, children: n
|
|
|
7676
7681
|
})
|
|
7677
7682
|
]
|
|
7678
7683
|
});
|
|
7679
|
-
return
|
|
7684
|
+
return he ? /* @__PURE__ */ v("div", {
|
|
7680
7685
|
className: "pkt-header-service-wrapper",
|
|
7681
|
-
children: [
|
|
7682
|
-
}) :
|
|
7686
|
+
children: [Se, /* @__PURE__ */ _("div", { className: (0, M.default)("pkt-header-service-spacer", i && "pkt-header-service-spacer--compact", E && "pkt-header-service-spacer--has-user", K && "pkt-header-service-spacer--mobile", me && "pkt-header-service-spacer--tablet") })]
|
|
7687
|
+
}) : Se;
|
|
7683
7688
|
});
|
|
7684
7689
|
vo.displayName = "PktHeaderService";
|
|
7685
7690
|
//#endregion
|
|
@@ -7773,7 +7778,7 @@ var wo = ({ children: e, skin: t, title: n, href: r, iconName: i, openInNewTab:
|
|
|
7773
7778
|
};
|
|
7774
7779
|
//#endregion
|
|
7775
7780
|
//#region src/components/loader/Loader.tsx
|
|
7776
|
-
wo.displayName = "PktLinkCard", typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/18.
|
|
7781
|
+
wo.displayName = "PktLinkCard", typeof window < "u" && (window.pktAnimationPath = window.pktAnimationPath || "https://punkt-cdn.oslo.kommune.no/18.2/animations/");
|
|
7777
7782
|
var To = (e) => {
|
|
7778
7783
|
switch (e) {
|
|
7779
7784
|
case "blue": return "spinner-blue";
|
|
@@ -7856,7 +7861,7 @@ Do.displayName = "PktMessagebox";
|
|
|
7856
7861
|
//#endregion
|
|
7857
7862
|
//#region src/components/radio/RadioButton.tsx
|
|
7858
7863
|
var Oo = 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, ...y }, b) => {
|
|
7859
|
-
let x =
|
|
7864
|
+
let x = _e(["forms"], m), S = [r, "pkt-input-check"].filter(Boolean).join(" "), C = [
|
|
7860
7865
|
"pkt-input-check__input",
|
|
7861
7866
|
i ? "pkt-input-check__input--tile" : "",
|
|
7862
7867
|
a && i ? "pkt-input-check__input--tile-disabled" : ""
|
|
@@ -8262,40 +8267,40 @@ function $o(e, t, n) {
|
|
|
8262
8267
|
let s = Xo(e), c = Go(o);
|
|
8263
8268
|
return i && s < Xo(String(i)) ? {
|
|
8264
8269
|
valid: !1,
|
|
8265
|
-
message:
|
|
8270
|
+
message: B(n.rangeUnderflowMin, { min: String(i) })
|
|
8266
8271
|
} : a && s > Xo(String(a)) ? {
|
|
8267
8272
|
valid: !1,
|
|
8268
|
-
message:
|
|
8273
|
+
message: B(n.rangeOverflowMax, { max: String(a) })
|
|
8269
8274
|
} : o && s % c !== 0 ? {
|
|
8270
8275
|
valid: !1,
|
|
8271
|
-
message: c === 60 ? n.timeStepMismatchHour : c === 30 ? n.timeStepMismatchHalfHour :
|
|
8276
|
+
message: c === 60 ? n.timeStepMismatchHour : c === 30 ? n.timeStepMismatchHalfHour : B(n.timeStepMismatch, { step: `${c}, ${c * 2}, ${c * 3}` })
|
|
8272
8277
|
} : { valid: !0 };
|
|
8273
8278
|
}
|
|
8274
8279
|
function es(e) {
|
|
8275
8280
|
return e === 3600 || e < 3600 && 3600 % e == 0 && e % 60 == 0;
|
|
8276
8281
|
}
|
|
8277
8282
|
function ts(e, t) {
|
|
8278
|
-
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, disabled: b = !1, required: x = !1, helptext: S, helptextDropdown: C, helptextDropdownButton: w, hasError: T = !1, errorMessage: E, optionalTag: D = !1, optionalText: O, requiredTag: k = !1, requiredText: A, tagText: j, inline: M = !1, useWrapper: N = !0, ariaDescribedby: P, strings: ee, className: te, inputSize: ne = "medium", onValueChange: F, onFocus: re, onBlur: ie } = e, ae =
|
|
8279
|
-
|
|
8280
|
-
}, []),
|
|
8281
|
-
|
|
8282
|
-
}, []), [
|
|
8283
|
+
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, disabled: b = !1, required: x = !1, helptext: S, helptextDropdown: C, helptextDropdownButton: w, hasError: T = !1, errorMessage: E, optionalTag: D = !1, optionalText: O, requiredTag: k = !1, requiredText: A, tagText: j, inline: M = !1, useWrapper: N = !0, ariaDescribedby: P, strings: ee, className: te, inputSize: ne = "medium", onValueChange: F, onFocus: re, onBlur: ie } = e, ae = _e(["timepicker", "validation"], ee), oe = ae.timepicker, se = ee, I = i !== void 0, L = i === void 0 ? a ?? "" : i ?? "", R = p(L), [ce, z] = m(() => L), B = I ? i ?? "" : ce, [le, V] = m(() => Zo(i === void 0 ? a : i)[0]), [ue, de] = m(() => Zo(i === void 0 ? a : i)[1]), H = p(le), fe = p(ue), U = o((e) => {
|
|
8284
|
+
H.current = e, V(e);
|
|
8285
|
+
}, []), W = o((e) => {
|
|
8286
|
+
fe.current = e, de(e);
|
|
8287
|
+
}, []), [G, pe] = m(!1), [K, me] = m(!1), he = p(i);
|
|
8283
8288
|
c(() => {
|
|
8284
|
-
if (!I || i ===
|
|
8285
|
-
|
|
8289
|
+
if (!I || i === he.current) return;
|
|
8290
|
+
he.current = i;
|
|
8286
8291
|
let [e, t] = Zo(i);
|
|
8287
|
-
|
|
8292
|
+
U(e), W(t);
|
|
8288
8293
|
}, [
|
|
8289
8294
|
i,
|
|
8290
8295
|
I,
|
|
8291
|
-
|
|
8292
|
-
|
|
8296
|
+
U,
|
|
8297
|
+
W
|
|
8293
8298
|
]), c(() => {
|
|
8294
8299
|
h != null && !es(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).`);
|
|
8295
8300
|
}, [h]);
|
|
8296
|
-
let
|
|
8301
|
+
let q = p(null), J = p(null), ge = p(null), Y = p(null), X = p(null), Z = p(null), ve = p(0), ye = p(-1), be = p(0), xe = p(-1), [Se, Ce] = m(!1), we = f(() => Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set, []), Te = f(() => Go(h), [h]), Ee = f(() => Ko(s, l), [s, l]), De = f(() => qo(h), [h]), Oe = `${n}-hours`, ke = `${n}-minutes`, Ae = `${n}-popup`, Q = `${n}-input`;
|
|
8297
8302
|
c(() => {
|
|
8298
|
-
let e =
|
|
8303
|
+
let e = q.current;
|
|
8299
8304
|
if (!e) return;
|
|
8300
8305
|
let t = $o(B, {
|
|
8301
8306
|
required: x,
|
|
@@ -8303,39 +8308,39 @@ function ts(e, t) {
|
|
|
8303
8308
|
max: l,
|
|
8304
8309
|
step: h
|
|
8305
8310
|
}, ae.validation);
|
|
8306
|
-
e.setCustomValidity(t.valid ? "" : t.message ?? ""),
|
|
8311
|
+
e.setCustomValidity(t.valid ? "" : t.message ?? ""), me(Se && !t.valid);
|
|
8307
8312
|
}, [
|
|
8308
8313
|
B,
|
|
8309
8314
|
x,
|
|
8310
8315
|
s,
|
|
8311
8316
|
l,
|
|
8312
8317
|
h,
|
|
8313
|
-
|
|
8318
|
+
Se,
|
|
8314
8319
|
ae.validation
|
|
8315
8320
|
]);
|
|
8316
|
-
let
|
|
8317
|
-
I ||
|
|
8318
|
-
let t =
|
|
8319
|
-
!t || !
|
|
8321
|
+
let je = o((e) => {
|
|
8322
|
+
I || z(e);
|
|
8323
|
+
let t = Z.current;
|
|
8324
|
+
!t || !we || (we.call(t, e), t.dispatchEvent(new Event("input", { bubbles: !0 })), F?.(e));
|
|
8320
8325
|
}, [
|
|
8321
8326
|
I,
|
|
8322
|
-
|
|
8327
|
+
we,
|
|
8323
8328
|
F
|
|
8324
|
-
]),
|
|
8325
|
-
let e =
|
|
8329
|
+
]), Me = o(() => {
|
|
8330
|
+
let e = H.current, t = fe.current;
|
|
8326
8331
|
if (e !== "" && t !== "") {
|
|
8327
8332
|
let n = Qo(e, t);
|
|
8328
|
-
n !== B &&
|
|
8329
|
-
} else B !== "" &&
|
|
8330
|
-
}, [B,
|
|
8331
|
-
let e =
|
|
8333
|
+
n !== B && je(n);
|
|
8334
|
+
} else B !== "" && je("");
|
|
8335
|
+
}, [B, je]), Ne = o(() => {
|
|
8336
|
+
let e = H.current, t = fe.current;
|
|
8332
8337
|
if (e !== "" && t !== "") {
|
|
8333
8338
|
let n = Qo(e, t);
|
|
8334
|
-
n === B ?
|
|
8335
|
-
} else B === "" ?
|
|
8336
|
-
}, [B,
|
|
8337
|
-
|
|
8338
|
-
let e =
|
|
8339
|
+
n === B ? Z.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : je(n);
|
|
8340
|
+
} else B === "" ? Z.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : je("");
|
|
8341
|
+
}, [B, je]), Pe = o(() => {
|
|
8342
|
+
Ce(!0), Me();
|
|
8343
|
+
let e = q.current, t = Z.current;
|
|
8339
8344
|
if (!e) return;
|
|
8340
8345
|
let n = $o(t?.value ?? "", {
|
|
8341
8346
|
required: x,
|
|
@@ -8345,7 +8350,7 @@ function ts(e, t) {
|
|
|
8345
8350
|
}, ae.validation);
|
|
8346
8351
|
e.setCustomValidity(n.valid ? "" : n.message ?? "");
|
|
8347
8352
|
}, [
|
|
8348
|
-
|
|
8353
|
+
Me,
|
|
8349
8354
|
x,
|
|
8350
8355
|
s,
|
|
8351
8356
|
l,
|
|
@@ -8353,7 +8358,7 @@ function ts(e, t) {
|
|
|
8353
8358
|
ae.validation
|
|
8354
8359
|
]);
|
|
8355
8360
|
c(() => {
|
|
8356
|
-
let e =
|
|
8361
|
+
let e = X.current?.closest("form");
|
|
8357
8362
|
if (!e) return;
|
|
8358
8363
|
let t = (t) => {
|
|
8359
8364
|
let n = t;
|
|
@@ -8361,18 +8366,18 @@ function ts(e, t) {
|
|
|
8361
8366
|
let r = n.closest("button, input[type=\"submit\"], input[type=\"image\"]");
|
|
8362
8367
|
return !r || !e.contains(r) ? !1 : r instanceof HTMLButtonElement ? r.type !== "button" && r.type !== "reset" : r instanceof HTMLInputElement;
|
|
8363
8368
|
}, n = (e) => {
|
|
8364
|
-
t(e.target) &&
|
|
8369
|
+
t(e.target) && Pe();
|
|
8365
8370
|
};
|
|
8366
8371
|
return e.addEventListener("pointerdown", n, !0), () => e.removeEventListener("pointerdown", n, !0);
|
|
8367
|
-
}, [
|
|
8368
|
-
|
|
8372
|
+
}, [Pe]), c(() => {
|
|
8373
|
+
Z.current && (Z.current.value = B);
|
|
8369
8374
|
}, [B]);
|
|
8370
|
-
let
|
|
8371
|
-
|
|
8372
|
-
}, [
|
|
8375
|
+
let Fe = o(() => {
|
|
8376
|
+
pe(!1), Me();
|
|
8377
|
+
}, [Me]);
|
|
8373
8378
|
d(() => {
|
|
8374
|
-
if (!
|
|
8375
|
-
let e =
|
|
8379
|
+
if (!G) return;
|
|
8380
|
+
let e = Y.current;
|
|
8376
8381
|
if (!e) return;
|
|
8377
8382
|
e.querySelectorAll(".pkt-timepicker-popup__col").forEach((e) => {
|
|
8378
8383
|
let t = e.querySelector(".pkt-timepicker-popup__option--selected");
|
|
@@ -8382,78 +8387,78 @@ function ts(e, t) {
|
|
|
8382
8387
|
if (!t) return;
|
|
8383
8388
|
let n = t.querySelector(".pkt-timepicker-popup__option--selected"), r = t.querySelector(".pkt-timepicker-popup__option");
|
|
8384
8389
|
(n || r)?.focus();
|
|
8385
|
-
}, [
|
|
8386
|
-
if (!
|
|
8390
|
+
}, [G]), c(() => {
|
|
8391
|
+
if (!G) return;
|
|
8387
8392
|
let e = (e) => {
|
|
8388
8393
|
let t = e.target;
|
|
8389
|
-
|
|
8394
|
+
X.current && !X.current.contains(t) && Fe();
|
|
8390
8395
|
};
|
|
8391
8396
|
return document.addEventListener("click", e, !0), () => document.removeEventListener("click", e, !0);
|
|
8392
|
-
}, [
|
|
8393
|
-
let
|
|
8394
|
-
let t =
|
|
8397
|
+
}, [G, Fe]);
|
|
8398
|
+
let Ie = o((e) => {
|
|
8399
|
+
let t = Y.current;
|
|
8395
8400
|
if (!t) return;
|
|
8396
8401
|
let n = t.querySelectorAll(".pkt-timepicker-popup__col"), r = e === "hour" ? n[0] : n[1];
|
|
8397
8402
|
if (!r) return;
|
|
8398
8403
|
let i = r.querySelector(".pkt-timepicker-popup__option--selected"), a = r.querySelector(".pkt-timepicker-popup__option");
|
|
8399
8404
|
(i || a)?.focus();
|
|
8400
|
-
}, []),
|
|
8405
|
+
}, []), Le = o((e, t) => {
|
|
8401
8406
|
let n = String(e).padStart(2, "0");
|
|
8402
|
-
if (t === "hour")
|
|
8407
|
+
if (t === "hour") U(n), requestAnimationFrame(() => Ie("minute"));
|
|
8403
8408
|
else {
|
|
8404
|
-
|
|
8405
|
-
let e =
|
|
8406
|
-
e !== "" &&
|
|
8409
|
+
W(n), pe(!1);
|
|
8410
|
+
let e = H.current;
|
|
8411
|
+
e !== "" && je(`${e}:${n}`), requestAnimationFrame(() => ge.current?.focus());
|
|
8407
8412
|
}
|
|
8408
8413
|
}, [
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
]),
|
|
8414
|
-
let t = Jo(
|
|
8415
|
-
|
|
8414
|
+
je,
|
|
8415
|
+
Ie,
|
|
8416
|
+
U,
|
|
8417
|
+
W
|
|
8418
|
+
]), Re = o((e) => {
|
|
8419
|
+
let t = Jo(H.current, fe.current, e, Te);
|
|
8420
|
+
U(t.hours), W(t.minutes), `${t.hours}:${t.minutes}` !== B && je(`${t.hours}:${t.minutes}`);
|
|
8416
8421
|
}, [
|
|
8417
|
-
|
|
8422
|
+
Te,
|
|
8418
8423
|
B,
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
]),
|
|
8423
|
-
|
|
8424
|
-
let t = e.currentTarget, n =
|
|
8424
|
+
je,
|
|
8425
|
+
U,
|
|
8426
|
+
W
|
|
8427
|
+
]), ze = o((e) => {
|
|
8428
|
+
q.current?.setCustomValidity("");
|
|
8429
|
+
let t = e.currentTarget, n = fe.current;
|
|
8425
8430
|
switch (e.key) {
|
|
8426
8431
|
case "ArrowUp": {
|
|
8427
8432
|
e.preventDefault();
|
|
8428
|
-
let t =
|
|
8429
|
-
if (
|
|
8433
|
+
let t = H.current === "" ? 0 : parseInt(H.current, 10), r = String((t + 1) % 24).padStart(2, "0");
|
|
8434
|
+
if (U(r), n !== "") {
|
|
8430
8435
|
let e = `${r}:${n}`;
|
|
8431
|
-
e === B ?
|
|
8436
|
+
e === B ? Z.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : je(e);
|
|
8432
8437
|
}
|
|
8433
8438
|
break;
|
|
8434
8439
|
}
|
|
8435
8440
|
case "ArrowDown": {
|
|
8436
8441
|
e.preventDefault();
|
|
8437
|
-
let t =
|
|
8438
|
-
if (
|
|
8442
|
+
let t = H.current === "" ? 0 : parseInt(H.current, 10), r = String((t - 1 + 24) % 24).padStart(2, "0");
|
|
8443
|
+
if (U(r), n !== "") {
|
|
8439
8444
|
let e = `${r}:${n}`;
|
|
8440
|
-
e === B ?
|
|
8445
|
+
e === B ? Z.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : je(e);
|
|
8441
8446
|
}
|
|
8442
8447
|
break;
|
|
8443
8448
|
}
|
|
8444
8449
|
case "ArrowRight":
|
|
8445
|
-
e.preventDefault(),
|
|
8450
|
+
e.preventDefault(), J.current?.focus();
|
|
8446
8451
|
break;
|
|
8447
8452
|
case "Backspace":
|
|
8448
8453
|
case "Delete": {
|
|
8449
|
-
e.preventDefault(),
|
|
8450
|
-
let t =
|
|
8451
|
-
t.length > 0 &&
|
|
8454
|
+
e.preventDefault(), ve.current = 0, ye.current = -1;
|
|
8455
|
+
let t = H.current;
|
|
8456
|
+
t.length > 0 && U(t.slice(0, -1)), Ne();
|
|
8452
8457
|
break;
|
|
8453
8458
|
}
|
|
8454
8459
|
case "Tab": break;
|
|
8455
8460
|
case "Enter": {
|
|
8456
|
-
e.preventDefault(),
|
|
8461
|
+
e.preventDefault(), Pe();
|
|
8457
8462
|
let n = t.form;
|
|
8458
8463
|
n ? n.requestSubmit() : t.blur();
|
|
8459
8464
|
break;
|
|
@@ -8461,63 +8466,63 @@ function ts(e, t) {
|
|
|
8461
8466
|
default: if (/^\d$/.test(e.key)) {
|
|
8462
8467
|
e.preventDefault();
|
|
8463
8468
|
let t = parseInt(e.key, 10);
|
|
8464
|
-
if (
|
|
8465
|
-
|
|
8469
|
+
if (ve.current === 0) {
|
|
8470
|
+
ye.current = t;
|
|
8466
8471
|
let e = String(t).padStart(2, "0");
|
|
8467
|
-
|
|
8472
|
+
U(e), ve.current = 1, Z.current?.dispatchEvent(new Event("input", { bubbles: !0 })), t >= 3 && (ye.current = -1, ve.current = 0, Ne(), J.current?.focus());
|
|
8468
8473
|
} else {
|
|
8469
|
-
let e =
|
|
8470
|
-
|
|
8474
|
+
let e = ye.current * 10 + t, n = e <= 23 ? String(e).padStart(2, "0") : String(t).padStart(2, "0");
|
|
8475
|
+
U(n), ye.current = -1, ve.current = 0, Ne(), J.current?.focus();
|
|
8471
8476
|
}
|
|
8472
8477
|
} else e.preventDefault();
|
|
8473
8478
|
}
|
|
8474
8479
|
}, [
|
|
8475
8480
|
B,
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
]),
|
|
8481
|
-
if (
|
|
8482
|
-
let e = String(parseInt(
|
|
8483
|
-
|
|
8481
|
+
je,
|
|
8482
|
+
U,
|
|
8483
|
+
Ne,
|
|
8484
|
+
Pe
|
|
8485
|
+
]), Be = o(() => {
|
|
8486
|
+
if (Ce(!0), H.current !== "") {
|
|
8487
|
+
let e = String(parseInt(H.current, 10)).padStart(2, "0");
|
|
8488
|
+
U(e);
|
|
8484
8489
|
}
|
|
8485
|
-
|
|
8486
|
-
}, [
|
|
8487
|
-
|
|
8488
|
-
let t = e.currentTarget, n =
|
|
8490
|
+
ve.current = 0, ye.current = -1, Me();
|
|
8491
|
+
}, [U, Me]), Ve = o((e) => {
|
|
8492
|
+
q.current?.setCustomValidity("");
|
|
8493
|
+
let t = e.currentTarget, n = H.current;
|
|
8489
8494
|
switch (e.key) {
|
|
8490
8495
|
case "ArrowUp": {
|
|
8491
8496
|
e.preventDefault();
|
|
8492
|
-
let t =
|
|
8493
|
-
if (
|
|
8497
|
+
let t = fe.current === "" ? 0 : parseInt(fe.current, 10), r = String((t + Te) % 60).padStart(2, "0");
|
|
8498
|
+
if (W(r), n !== "") {
|
|
8494
8499
|
let e = `${n}:${r}`;
|
|
8495
|
-
e === B ?
|
|
8500
|
+
e === B ? Z.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : je(e);
|
|
8496
8501
|
}
|
|
8497
8502
|
break;
|
|
8498
8503
|
}
|
|
8499
8504
|
case "ArrowDown": {
|
|
8500
8505
|
e.preventDefault();
|
|
8501
|
-
let t =
|
|
8502
|
-
if (
|
|
8506
|
+
let t = fe.current === "" ? 0 : parseInt(fe.current, 10), r = String((t - Te + 60) % 60).padStart(2, "0");
|
|
8507
|
+
if (W(r), n !== "") {
|
|
8503
8508
|
let e = `${n}:${r}`;
|
|
8504
|
-
e === B ?
|
|
8509
|
+
e === B ? Z.current?.dispatchEvent(new Event("input", { bubbles: !0 })) : je(e);
|
|
8505
8510
|
}
|
|
8506
8511
|
break;
|
|
8507
8512
|
}
|
|
8508
8513
|
case "ArrowLeft":
|
|
8509
|
-
e.preventDefault(),
|
|
8514
|
+
e.preventDefault(), q.current?.focus();
|
|
8510
8515
|
break;
|
|
8511
8516
|
case "Backspace":
|
|
8512
8517
|
case "Delete": {
|
|
8513
|
-
e.preventDefault(),
|
|
8514
|
-
let t =
|
|
8515
|
-
t.length > 0 &&
|
|
8518
|
+
e.preventDefault(), be.current = 0, xe.current = -1;
|
|
8519
|
+
let t = fe.current;
|
|
8520
|
+
t.length > 0 && W(t.slice(0, -1)), Ne();
|
|
8516
8521
|
break;
|
|
8517
8522
|
}
|
|
8518
8523
|
case "Tab": break;
|
|
8519
8524
|
case "Enter": {
|
|
8520
|
-
e.preventDefault(),
|
|
8525
|
+
e.preventDefault(), Pe();
|
|
8521
8526
|
let n = t.form;
|
|
8522
8527
|
n ? n.requestSubmit() : t.blur();
|
|
8523
8528
|
break;
|
|
@@ -8525,36 +8530,36 @@ function ts(e, t) {
|
|
|
8525
8530
|
default: if (/^\d$/.test(e.key)) {
|
|
8526
8531
|
e.preventDefault();
|
|
8527
8532
|
let t = parseInt(e.key, 10);
|
|
8528
|
-
if (
|
|
8529
|
-
|
|
8533
|
+
if (be.current === 0) {
|
|
8534
|
+
xe.current = t;
|
|
8530
8535
|
let e = String(t).padStart(2, "0");
|
|
8531
|
-
|
|
8536
|
+
W(e), be.current = 1, Z.current?.dispatchEvent(new Event("input", { bubbles: !0 })), t >= 6 && (xe.current = -1, be.current = 0, Ne());
|
|
8532
8537
|
} else {
|
|
8533
|
-
let e =
|
|
8534
|
-
|
|
8538
|
+
let e = xe.current * 10 + t, n = e <= 59 ? String(e).padStart(2, "0") : String(t).padStart(2, "0");
|
|
8539
|
+
W(n), xe.current = -1, be.current = 0, Ne();
|
|
8535
8540
|
}
|
|
8536
8541
|
} else e.preventDefault();
|
|
8537
8542
|
}
|
|
8538
8543
|
}, [
|
|
8539
|
-
|
|
8544
|
+
Te,
|
|
8540
8545
|
B,
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
]),
|
|
8546
|
-
if (
|
|
8547
|
-
let e = String(parseInt(
|
|
8548
|
-
|
|
8546
|
+
je,
|
|
8547
|
+
W,
|
|
8548
|
+
Ne,
|
|
8549
|
+
Pe
|
|
8550
|
+
]), He = o(() => {
|
|
8551
|
+
if (Ce(!0), fe.current !== "") {
|
|
8552
|
+
let e = String(parseInt(fe.current, 10)).padStart(2, "0");
|
|
8553
|
+
W(e);
|
|
8549
8554
|
}
|
|
8550
|
-
|
|
8551
|
-
}, [
|
|
8555
|
+
be.current = 0, xe.current = -1, Me();
|
|
8556
|
+
}, [W, Me]), Ue = o((e) => {
|
|
8552
8557
|
let t = document.activeElement, n = t.closest(".pkt-timepicker-popup__col");
|
|
8553
8558
|
if (!n) return;
|
|
8554
8559
|
let r = Array.from(n.querySelectorAll(".pkt-timepicker-popup__option")), i = r.indexOf(t), a = (e) => {
|
|
8555
8560
|
if (!e) return;
|
|
8556
8561
|
let n = parseInt(e.dataset.value ?? "0", 10), r = String(n).padStart(2, "0");
|
|
8557
|
-
t.dataset.type === "hour" ?
|
|
8562
|
+
t.dataset.type === "hour" ? U(r) : W(r), e.focus();
|
|
8558
8563
|
};
|
|
8559
8564
|
switch (e.key) {
|
|
8560
8565
|
case "ArrowDown":
|
|
@@ -8572,20 +8577,20 @@ function ts(e, t) {
|
|
|
8572
8577
|
case "ArrowRight":
|
|
8573
8578
|
if (e.preventDefault(), t.dataset.type === "hour") {
|
|
8574
8579
|
let e = parseInt(t.dataset.value ?? "0", 10);
|
|
8575
|
-
|
|
8576
|
-
|
|
8580
|
+
U(String(e).padStart(2, "0")), requestAnimationFrame(() => {
|
|
8581
|
+
Y.current?.querySelectorAll(".pkt-timepicker-popup__col").forEach((e) => {
|
|
8577
8582
|
e.querySelector(".pkt-timepicker-popup__option--selected")?.scrollIntoView({ block: "center" });
|
|
8578
|
-
}),
|
|
8583
|
+
}), Ie("minute");
|
|
8579
8584
|
});
|
|
8580
8585
|
}
|
|
8581
8586
|
break;
|
|
8582
8587
|
case "ArrowLeft":
|
|
8583
8588
|
if (e.preventDefault(), t.dataset.type === "minute") {
|
|
8584
8589
|
let e = parseInt(t.dataset.value ?? "0", 10);
|
|
8585
|
-
|
|
8586
|
-
|
|
8590
|
+
W(String(e).padStart(2, "0")), requestAnimationFrame(() => {
|
|
8591
|
+
Y.current?.querySelectorAll(".pkt-timepicker-popup__col").forEach((e) => {
|
|
8587
8592
|
e.querySelector(".pkt-timepicker-popup__option--selected")?.scrollIntoView({ block: "center" });
|
|
8588
|
-
}),
|
|
8593
|
+
}), Ie("hour");
|
|
8589
8594
|
});
|
|
8590
8595
|
}
|
|
8591
8596
|
break;
|
|
@@ -8593,72 +8598,72 @@ function ts(e, t) {
|
|
|
8593
8598
|
case " ":
|
|
8594
8599
|
e.preventDefault(), t.click();
|
|
8595
8600
|
break;
|
|
8596
|
-
case "Escape": e.preventDefault(),
|
|
8601
|
+
case "Escape": e.preventDefault(), Fe(), ge.current?.focus();
|
|
8597
8602
|
}
|
|
8598
8603
|
}, [
|
|
8599
|
-
Pe,
|
|
8600
8604
|
Fe,
|
|
8601
|
-
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
+
Ie,
|
|
8606
|
+
U,
|
|
8607
|
+
W
|
|
8608
|
+
]), We = o((e) => {
|
|
8609
|
+
let t = Y.current;
|
|
8605
8610
|
if (!t) return;
|
|
8606
8611
|
let n = e.relatedTarget;
|
|
8607
|
-
(!n || !t.contains(n)) &&
|
|
8608
|
-
}, [
|
|
8609
|
-
let t =
|
|
8612
|
+
(!n || !t.contains(n)) && Fe();
|
|
8613
|
+
}, [Fe]), Ge = o((e) => {
|
|
8614
|
+
let t = X.current;
|
|
8610
8615
|
if (!t) return;
|
|
8611
8616
|
let n = e.relatedTarget;
|
|
8612
8617
|
n && t.contains(n) || re?.(e);
|
|
8613
|
-
}, [re]),
|
|
8614
|
-
let t =
|
|
8618
|
+
}, [re]), Ke = o((e) => {
|
|
8619
|
+
let t = X.current;
|
|
8615
8620
|
if (!t) return;
|
|
8616
8621
|
let n = e.relatedTarget;
|
|
8617
8622
|
n && t.contains(n) || ie?.(e);
|
|
8618
|
-
}, [ie]),
|
|
8619
|
-
b || (
|
|
8623
|
+
}, [ie]), qe = o(() => {
|
|
8624
|
+
b || (G ? Fe() : pe(!0));
|
|
8620
8625
|
}, [
|
|
8621
8626
|
b,
|
|
8622
|
-
|
|
8623
|
-
|
|
8627
|
+
G,
|
|
8628
|
+
Fe
|
|
8624
8629
|
]);
|
|
8625
8630
|
return u(t, () => ({
|
|
8626
8631
|
get value() {
|
|
8627
|
-
return
|
|
8632
|
+
return Z.current?.value ?? "";
|
|
8628
8633
|
},
|
|
8629
8634
|
set value(e) {
|
|
8630
8635
|
let t = e ?? "";
|
|
8631
|
-
I ||
|
|
8636
|
+
I || z(t);
|
|
8632
8637
|
let [n, r] = Zo(t);
|
|
8633
|
-
|
|
8638
|
+
U(n), W(r), Z.current && (Z.current.value = t);
|
|
8634
8639
|
},
|
|
8635
8640
|
focus() {
|
|
8636
|
-
|
|
8641
|
+
q.current?.focus();
|
|
8637
8642
|
},
|
|
8638
8643
|
blur() {
|
|
8639
|
-
|
|
8644
|
+
q.current?.blur();
|
|
8640
8645
|
}
|
|
8641
8646
|
}), [
|
|
8642
8647
|
I,
|
|
8643
|
-
|
|
8644
|
-
|
|
8648
|
+
U,
|
|
8649
|
+
W
|
|
8645
8650
|
]), c(() => {
|
|
8646
|
-
let e =
|
|
8651
|
+
let e = X.current?.closest("form");
|
|
8647
8652
|
if (!e) return;
|
|
8648
8653
|
let t = () => {
|
|
8649
8654
|
window.setTimeout(() => {
|
|
8650
8655
|
let e = R.current, [t, n] = Zo(e);
|
|
8651
|
-
|
|
8656
|
+
U(t), W(n), I || z(e), Z.current && (Z.current.value = e), pe(!1), Ce(!1);
|
|
8652
8657
|
}, 0);
|
|
8653
8658
|
};
|
|
8654
8659
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
8655
8660
|
}, [
|
|
8656
8661
|
I,
|
|
8657
|
-
|
|
8658
|
-
|
|
8662
|
+
U,
|
|
8663
|
+
W
|
|
8659
8664
|
]), {
|
|
8660
8665
|
id: n,
|
|
8661
|
-
containerRef:
|
|
8666
|
+
containerRef: X,
|
|
8662
8667
|
outerClasses: [
|
|
8663
8668
|
"pkt-timepicker",
|
|
8664
8669
|
`pkt-timepicker--${ne}`,
|
|
@@ -8676,7 +8681,7 @@ function ts(e, t) {
|
|
|
8676
8681
|
helptextDropdown: C,
|
|
8677
8682
|
helptextDropdownButton: w,
|
|
8678
8683
|
hasError: T,
|
|
8679
|
-
isInvalid:
|
|
8684
|
+
isInvalid: K,
|
|
8680
8685
|
errorMessage: E,
|
|
8681
8686
|
optionalTag: D,
|
|
8682
8687
|
optionalText: O,
|
|
@@ -8691,33 +8696,33 @@ function ts(e, t) {
|
|
|
8691
8696
|
min: s,
|
|
8692
8697
|
max: l,
|
|
8693
8698
|
step: h,
|
|
8694
|
-
hours:
|
|
8695
|
-
minutes:
|
|
8696
|
-
hoursId:
|
|
8697
|
-
minutesId:
|
|
8698
|
-
popupId:
|
|
8699
|
-
hiddenInputId:
|
|
8699
|
+
hours: le,
|
|
8700
|
+
minutes: ue,
|
|
8701
|
+
hoursId: Oe,
|
|
8702
|
+
minutesId: ke,
|
|
8703
|
+
popupId: Ae,
|
|
8704
|
+
hiddenInputId: Q,
|
|
8700
8705
|
name: y ?? n,
|
|
8701
|
-
isOpen:
|
|
8702
|
-
hourOptions:
|
|
8703
|
-
minuteOptions:
|
|
8704
|
-
hoursInputRef:
|
|
8705
|
-
minutesInputRef:
|
|
8706
|
-
buttonRef:
|
|
8707
|
-
popupRef:
|
|
8708
|
-
changeInputRef:
|
|
8709
|
-
handleHoursKeydown:
|
|
8710
|
-
handleHoursBlur:
|
|
8711
|
-
handleMinutesKeydown:
|
|
8712
|
-
handleMinutesBlur:
|
|
8713
|
-
handlePopupKeydown:
|
|
8714
|
-
handlePopupFocusOut:
|
|
8715
|
-
handleFocusIn:
|
|
8716
|
-
handleFocusOut:
|
|
8717
|
-
handleOptionClick:
|
|
8718
|
-
handleClockButtonClick:
|
|
8719
|
-
closePopup:
|
|
8720
|
-
stepTimeDelta:
|
|
8706
|
+
isOpen: G,
|
|
8707
|
+
hourOptions: Ee,
|
|
8708
|
+
minuteOptions: De,
|
|
8709
|
+
hoursInputRef: q,
|
|
8710
|
+
minutesInputRef: J,
|
|
8711
|
+
buttonRef: ge,
|
|
8712
|
+
popupRef: Y,
|
|
8713
|
+
changeInputRef: Z,
|
|
8714
|
+
handleHoursKeydown: ze,
|
|
8715
|
+
handleHoursBlur: Be,
|
|
8716
|
+
handleMinutesKeydown: Ve,
|
|
8717
|
+
handleMinutesBlur: He,
|
|
8718
|
+
handlePopupKeydown: Ue,
|
|
8719
|
+
handlePopupFocusOut: We,
|
|
8720
|
+
handleFocusIn: Ge,
|
|
8721
|
+
handleFocusOut: Ke,
|
|
8722
|
+
handleOptionClick: Le,
|
|
8723
|
+
handleClockButtonClick: qe,
|
|
8724
|
+
closePopup: Fe,
|
|
8725
|
+
stepTimeDelta: Re,
|
|
8721
8726
|
effectiveValue: B
|
|
8722
8727
|
};
|
|
8723
8728
|
}
|
|
@@ -8931,4 +8936,4 @@ var ns = i((e, t) => {
|
|
|
8931
8936
|
});
|
|
8932
8937
|
ns.displayName = "PktTimepicker";
|
|
8933
8938
|
//#endregion
|
|
8934
|
-
export { ui as FileItem, pa as ItemRenderers, j as PktAccordion, R as PktAccordionItem,
|
|
8939
|
+
export { ui as FileItem, pa as ItemRenderers, j as PktAccordion, R as PktAccordionItem, ve as PktAlert, ye as PktBackLink, be as PktBreadcrumbs, Y as PktButton, In as PktCalendar, Rn as PktCard, zn as PktCheckbox, vr as PktCombobox, Cr as PktConsent, Rr as PktDatepicker, ma as PktFileUpload, Ha as PktFooter, Wa as PktFooterSimple, yo as PktHeader, ho as PktHeaderGlobal, Ja as PktHeaderMenu, vo as PktHeaderService, So as PktHeading, Kn as PktHelptext, L as PktIcon, Co as PktInput, qn as PktInputWrapper, ro as PktLink, wo as PktLinkCard, Eo as PktLoader, Do as PktMessagebox, Wi as PktModal, Ni as PktProgressbar, Oo as PktRadioButton, co as PktSearchInput, ko as PktSelect, No as PktStep, Po as PktStepper, Z as PktStringsProvider, Vo as PktTabItem, Fo as PktTable, Io as PktTableBody, Lo as PktTableDataCell, Ro as PktTableHeader, zo as PktTableHeaderCell, Bo as PktTableRow, Wo as PktTabs, Ln as PktTag, mi as PktTextarea, go as PktTextinput, ns as PktTimepicker, U as getPktStrings, ce as pktStringsNb, W as resetPktStrings, fe as setPktStrings, G as subscribePktStrings };
|