@oslokommune/punkt-react 20.0.4 → 20.1.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 +13 -0
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/defineProperty.js +1 -2
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPrimitive.js +1 -2
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPropertyKey.js +1 -2
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/typeof.js +1 -2
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/components/accordion/Accordion.js +1 -2
- package/dist/components/accordion/AccordionItem.js +9 -10
- package/dist/components/alert/Alert.js +7 -8
- package/dist/components/backlink/BackLink.js +1 -2
- package/dist/components/breadcrumbs/Breadcrumbs.js +1 -2
- package/dist/components/button/Button.js +35 -35
- package/dist/components/calendar/Calendar.js +1 -2
- package/dist/components/calendar/CalendarGrid.js +1 -2
- package/dist/components/calendar/CalendarNav.js +5 -6
- package/dist/components/calendar/calendar-utils.js +1 -2
- package/dist/components/calendar/useCalendarState.js +90 -91
- package/dist/components/card/Card.js +14 -15
- package/dist/components/checkbox/Checkbox.js +3 -8
- package/dist/components/checkboxgroup/CheckboxGroup.js +10 -11
- package/dist/components/checkboxgroup/CheckboxGroupContext.js +1 -2
- package/dist/components/combobox/Combobox.js +5 -6
- package/dist/components/combobox/ComboboxInput.js +6 -7
- package/dist/components/combobox/ComboboxTags.js +11 -12
- package/dist/components/combobox/Listbox.js +25 -26
- package/dist/components/combobox/useComboboxState.js +38 -39
- package/dist/components/consent/Consent.js +6 -7
- package/dist/components/datepicker/DateTags.js +14 -15
- package/dist/components/datepicker/Datepicker.js +1 -2
- package/dist/components/datepicker/DatepickerInputs.js +1 -2
- package/dist/components/datepicker/DatepickerPopup.js +5 -6
- package/dist/components/datepicker/useDatepickerState.js +20 -21
- package/dist/components/fileupload/DropZone.js +6 -7
- package/dist/components/fileupload/FileUpload.js +36 -37
- package/dist/components/fileupload/FileUploadContext.js +1 -2
- package/dist/components/fileupload/QueueDisplay.js +12 -13
- package/dist/components/fileupload/QueueItemContent.js +14 -15
- package/dist/components/fileupload/Subcomponents.js +70 -71
- package/dist/components/fileupload/Truncate.js +1 -2
- package/dist/components/fileupload/extensions/Comments.js +21 -22
- package/dist/components/fileupload/extensions/Remove.js +1 -2
- package/dist/components/fileupload/extensions/Rename.js +8 -9
- package/dist/components/fileupload/hooks/useFileAttributes.js +1 -2
- package/dist/components/fileupload/hooks/useImageObjectUrl.js +1 -2
- package/dist/components/fileupload/hooks/useImagePreview.js +1 -2
- package/dist/components/fileupload/hooks/useOperationState.js +1 -2
- package/dist/components/fileupload/hooks/useRequiredFormValidation.js +1 -2
- package/dist/components/fileupload/types.js +4 -5
- package/dist/components/footer/Footer.js +23 -24
- package/dist/components/footer/FooterGlobal.js +24 -25
- package/dist/components/footerSimple/FooterSimple.js +5 -6
- package/dist/components/header/Header.js +1 -2
- package/dist/components/header/HeaderGlobal.js +127 -128
- package/dist/components/header/HeaderService.js +84 -85
- package/dist/components/header-menu/HeaderMenu.js +34 -35
- package/dist/components/headerUserMenu/UserMenu.js +14 -15
- package/dist/components/heading/Heading.js +1 -2
- package/dist/components/helptext/Helptext.js +5 -6
- package/dist/components/icon/Icon.js +2 -3
- package/dist/components/input/Input.js +1 -2
- package/dist/components/inputwrapper/InputWrapper.js +12 -17
- package/dist/components/link/Link.js +1 -2
- package/dist/components/linkcard/LinkCard.js +2 -3
- package/dist/components/loader/Loader.js +2 -3
- package/dist/components/messagebox/Messagebox.js +6 -7
- package/dist/components/modal/Modal.js +13 -14
- package/dist/components/progressbar/Progressbar.js +5 -6
- package/dist/components/radio/RadioButton.js +3 -8
- package/dist/components/radiogroup/RadioGroup.js +1 -2
- package/dist/components/radiogroup/RadioGroupContext.js +1 -2
- package/dist/components/searchinput/SearchInput.js +11 -12
- package/dist/components/select/Select.js +6 -7
- package/dist/components/stepper/Step.js +1 -2
- package/dist/components/stepper/Stepper.js +1 -2
- package/dist/components/strings/PktStringsProvider.js +1 -2
- package/dist/components/table/Table.js +2 -3
- package/dist/components/table/TableBody.js +1 -2
- package/dist/components/table/TableDataCell.js +1 -2
- package/dist/components/table/TableHeader.js +1 -2
- package/dist/components/table/TableHeaderCell.js +1 -2
- package/dist/components/table/TableRow.js +1 -2
- package/dist/components/tabs/TabItem.js +1 -2
- package/dist/components/tabs/Tabs.js +5 -6
- package/dist/components/tag/Tag.js +6 -7
- package/dist/components/textarea/Textarea.js +5 -6
- package/dist/components/textinput/Textinput.js +6 -7
- package/dist/components/timepicker/Timepicker.js +6 -7
- package/dist/components/timepicker/useTimepickerState.js +27 -28
- package/dist/hooks/useElementWidth.js +1 -2
- package/dist/hooks/useFocusModality.js +1 -2
- package/dist/hooks/useGeneratedId.js +1 -2
- package/dist/hooks/useHeaderChrome.js +1 -2
- package/dist/hooks/useOptionGroupField.js +1 -2
- package/dist/hooks/useOwnerForm.js +1 -2
- package/dist/hooks/usePktStrings.js +1 -2
- package/dist/hooks/useScrollLock.js +1 -2
- package/dist/node_modules/@date-fns/tz/date/index.js +1 -2
- package/dist/node_modules/@date-fns/tz/date/mini.js +1 -2
- package/dist/node_modules/@date-fns/tz/index.js +3 -3
- package/dist/node_modules/@date-fns/tz/tzName/index.js +1 -2
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +1 -2
- package/dist/node_modules/classnames/index.js +1 -2
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +1 -2
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +1 -2
- package/dist/node_modules/date-fns/_lib/format/formatters.js +18 -19
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +1 -2
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +1 -2
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +1 -2
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +1 -2
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +1 -2
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +1 -2
- package/dist/node_modules/date-fns/addDays.js +1 -2
- package/dist/node_modules/date-fns/constants.js +1 -2
- package/dist/node_modules/date-fns/constructFrom.js +1 -2
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +6 -7
- package/dist/node_modules/date-fns/eachDayOfInterval.js +5 -6
- package/dist/node_modules/date-fns/endOfDay.js +1 -2
- package/dist/node_modules/date-fns/format.js +15 -16
- package/dist/node_modules/date-fns/getDayOfYear.js +6 -7
- package/dist/node_modules/date-fns/getISODay.js +1 -2
- package/dist/node_modules/date-fns/getISOWeek.js +5 -6
- package/dist/node_modules/date-fns/getISOWeekYear.js +6 -7
- package/dist/node_modules/date-fns/getWeek.js +5 -6
- package/dist/node_modules/date-fns/getWeekYear.js +8 -9
- package/dist/node_modules/date-fns/isDate.js +1 -2
- package/dist/node_modules/date-fns/isValid.js +4 -5
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +1 -2
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +1 -2
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +1 -2
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US.js +1 -2
- package/dist/node_modules/date-fns/startOfDay.js +1 -2
- package/dist/node_modules/date-fns/startOfISOWeek.js +1 -2
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +5 -6
- package/dist/node_modules/date-fns/startOfWeek.js +4 -5
- package/dist/node_modules/date-fns/startOfWeekYear.js +7 -8
- package/dist/node_modules/date-fns/startOfYear.js +1 -2
- package/dist/node_modules/date-fns/toDate.js +1 -2
- package/dist/punkt-react.cjs +1 -1
- package/dist/shared-strings/consent.js +1 -2
- package/dist/shared-strings/format.js +1 -2
- package/dist/shared-strings/nb.js +1 -2
- package/dist/shared-strings/resolve.js +1 -2
- package/dist/shared-strings/store.js +1 -2
- package/dist/shared-types/accordion.js +1 -2
- package/dist/shared-types/button.d.ts +13 -0
- package/dist/shared-types/button.js +14 -0
- package/dist/shared-types/calendar.js +1 -2
- package/dist/shared-types/card.js +1 -2
- package/dist/shared-types/checkbox.js +1 -2
- package/dist/shared-types/combobox.js +1 -2
- package/dist/shared-types/consent.js +1 -2
- package/dist/shared-types/footer.js +1 -2
- package/dist/shared-types/header-footer.js +1 -2
- package/dist/shared-types/icon.js +1 -2
- package/dist/shared-types/index.d.ts +1 -1
- package/dist/shared-types/index.js +11 -10
- package/dist/shared-types/input-wrapper.js +1 -2
- package/dist/shared-types/linkcard.js +1 -2
- package/dist/shared-types/loader.js +1 -2
- package/dist/shared-types/messagebox.js +1 -2
- package/dist/shared-types/option-group.js +1 -2
- package/dist/shared-types/progressbar.js +1 -2
- package/dist/shared-types/radiobutton.js +1 -2
- package/dist/shared-types/select.js +1 -2
- package/dist/shared-types/size.js +1 -2
- package/dist/shared-types/table.js +1 -2
- package/dist/shared-types/tag.js +1 -2
- package/dist/shared-types/textarea.js +1 -2
- package/dist/shared-types/textinput.js +1 -2
- package/dist/shared-utils/calendar/calendar-grid.js +4 -5
- package/dist/shared-utils/calendar/date-validation.js +1 -2
- package/dist/shared-utils/calendar/keyboard-navigation.js +1 -2
- package/dist/shared-utils/calendar/selection-manager.js +31 -32
- package/dist/shared-utils/combobox/input-utils.js +1 -2
- package/dist/shared-utils/combobox/keyboard-navigation.js +1 -2
- package/dist/shared-utils/combobox/option-utils.js +1 -2
- package/dist/shared-utils/date-utils.js +10 -11
- package/dist/shared-utils/datepicker-utils.js +4 -5
- package/dist/shared-utils/device-utils.js +1 -2
- package/dist/shared-utils/fileupload/announcements.js +1 -2
- package/dist/shared-utils/fileupload/filename.js +1 -2
- package/dist/shared-utils/fileupload/formats.js +1 -2
- package/dist/shared-utils/fileupload/navigation.js +1 -2
- package/dist/shared-utils/fileupload/size.js +1 -2
- package/dist/shared-utils/fileupload/transfers.js +1 -2
- package/dist/shared-utils/fileupload/truncate.js +1 -2
- package/dist/shared-utils/fileupload/validation.js +8 -9
- package/dist/shared-utils/focus-trap/index.js +13 -31
- package/dist/shared-utils/forms/described-by.js +1 -2
- package/dist/shared-utils/header-footer/external-domain.js +1 -2
- package/dist/shared-utils/header-footer/fetch-header-footer-data.js +1 -2
- package/dist/shared-utils/header-footer/icon-map.js +1 -2
- package/dist/shared-utils/header-footer/select-megamenu.js +1 -2
- package/dist/shared-utils/scroll-lock/index.js +1 -2
- package/dist/shared-utils/timepicker/options.js +1 -2
- package/dist/shared-utils/timepicker/stepper.js +1 -2
- package/dist/shared-utils/timepicker/time-utils.js +1 -2
- package/dist/shared-utils/value-utils.js +1 -2
- package/dist/utils/nativeInputValue.js +1 -2
- package/dist/utils/stableKeys.js +1 -2
- package/dist/utils/stringutils.js +1 -2
- package/package.json +20 -21
- package/src/components/accordion/Accordion.test.tsx +2 -4
- package/src/components/button/Button.tsx +11 -11
- package/src/components/tag/Tag.tsx +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { formatISODate as e, newDate as t, newDateFromDate as n, parseISODateString as r, todayInTz as i } from "../../shared-utils/date-utils.js";
|
|
2
|
+
import { CALENDAR_DEFAULTS as a } from "../../shared-types/calendar.js";
|
|
3
|
+
import { isDateExcluded as o, isDayDisabled as ee } from "../../shared-utils/calendar/date-validation.js";
|
|
4
|
+
import { addToSelection as te, convertSelectedToDates as ne, handleRangeSelection as re, isRangeAllowed as ie, removeFromSelection as ae, toggleSelection as s, updateRangeMap as c } from "../../shared-utils/calendar/selection-manager.js";
|
|
5
|
+
import { findNextSelectableDate as oe, getKeyDirection as se, shouldIgnoreKeyboardEvent as ce } from "../../shared-utils/calendar/keyboard-navigation.js";
|
|
6
|
+
import { usePktStrings as le } from "../../hooks/usePktStrings.js";
|
|
7
7
|
import { useCallback as l, useId as ue, useMemo as u, useRef as d, useState as f } from "react";
|
|
8
|
-
|
|
8
|
+
// src/components/calendar/useCalendarState.ts
|
|
9
9
|
function p(p) {
|
|
10
|
-
let { selected: m, multiple: h =
|
|
10
|
+
let { selected: m, multiple: h = a.multiple, maxMultiple: g = a.maxMultiple, range: _ = a.range, earliest: v = a.earliest, latest: y = a.latest, excludedates: b, excludeweekdays: x = [], weeknumbers: de = a.weeknumbers, withcontrols: fe = a.withcontrols, currentmonth: S, today: C, strings: pe, onDateSelected: w, onClose: T, id: me, className: he } = p, ge = ue(), _e = me ?? ge, E = le(["dates", "calendar"], pe), ve = u(() => ({
|
|
11
11
|
month: E.dates.month,
|
|
12
12
|
year: E.dates.year,
|
|
13
13
|
week: E.dates.week,
|
|
@@ -16,33 +16,33 @@ function p(p) {
|
|
|
16
16
|
months: E.dates.months,
|
|
17
17
|
prevMonth: E.calendar.prevMonth,
|
|
18
18
|
nextMonth: E.calendar.nextMonth
|
|
19
|
-
}), [E]), D = u(() => C ?
|
|
20
|
-
let e = j.length > 0 && j[0] !== "" ?
|
|
19
|
+
}), [E]), D = u(() => C ? r(C) : i(), [C]), O = u(() => b ? b.map((e) => typeof e == "string" ? r(e) : e) : [], [b]), k = m !== void 0, [ye, A] = f([]), j = k ? m : ye, M = u(() => ne(j), [j]), N = () => {
|
|
20
|
+
let e = j.length > 0 && j[0] !== "" ? r(j[j.length - 1]) : null;
|
|
21
21
|
if (e && !isNaN(e.getTime())) return e;
|
|
22
22
|
let t = null;
|
|
23
|
-
if (S instanceof Date ? t =
|
|
24
|
-
let e = typeof y == "string" ?
|
|
23
|
+
if (S instanceof Date ? t = n(S) : typeof S == "string" && (t = r(S)), (!t || isNaN(t.getTime())) && (t = n(D)), y) {
|
|
24
|
+
let e = typeof y == "string" ? r(y) : y;
|
|
25
25
|
!isNaN(e.getTime()) && t > e && (t = e);
|
|
26
26
|
}
|
|
27
27
|
if (v) {
|
|
28
|
-
let e = typeof v == "string" ?
|
|
28
|
+
let e = typeof v == "string" ? r(v) : v;
|
|
29
29
|
!isNaN(e.getTime()) && t < e && (t = e);
|
|
30
30
|
}
|
|
31
31
|
return t;
|
|
32
|
-
}, [P, F] = f(() => N().getFullYear()), [I, L] = f(() => N().getMonth()), [
|
|
33
|
-
if (j !==
|
|
34
|
-
let e =
|
|
32
|
+
}, [P, F] = f(() => N().getFullYear()), [I, L] = f(() => N().getMonth()), [be, R] = f(() => _ && M.length === 2 ? c(M[0], M[1]) : {}), [xe, z] = f(null), [B, V] = f(null), H = d(null), U = d([]), W = d(0), [Se, Ce] = f(!1), [we, Te] = f(j);
|
|
33
|
+
if (j !== we && (Te(j), !Se && j.length > 0 && j[0] !== "")) {
|
|
34
|
+
let e = r(j[j.length - 1]);
|
|
35
35
|
isNaN(e.getTime()) || (F(e.getFullYear()), L(e.getMonth()));
|
|
36
36
|
}
|
|
37
|
-
let [
|
|
37
|
+
let [G, Ee] = f({
|
|
38
38
|
range: _,
|
|
39
39
|
_selected: M
|
|
40
40
|
});
|
|
41
|
-
(_ !==
|
|
41
|
+
(_ !== G.range || M !== G._selected) && (Ee({
|
|
42
42
|
range: _,
|
|
43
43
|
_selected: M
|
|
44
|
-
}), _ && M.length === 2 ?
|
|
45
|
-
let
|
|
44
|
+
}), _ && M.length === 2 ? R(c(M[0], M[1])) : (!_ || M.length < 2) && R({}));
|
|
45
|
+
let K = u(() => ({
|
|
46
46
|
earliest: v,
|
|
47
47
|
latest: y,
|
|
48
48
|
excludedates: O,
|
|
@@ -52,109 +52,109 @@ function p(p) {
|
|
|
52
52
|
y,
|
|
53
53
|
O,
|
|
54
54
|
x
|
|
55
|
-
]),
|
|
55
|
+
]), q = l((e) => {
|
|
56
56
|
k || A(e), w?.(e);
|
|
57
|
-
}, [k, w]),
|
|
57
|
+
}, [k, w]), J = l(() => {
|
|
58
58
|
T?.();
|
|
59
|
-
}, [T]),
|
|
60
|
-
F(typeof e == "string" ? parseInt(e) : e), L(typeof t == "string" ? parseInt(t) : t),
|
|
61
|
-
}, []),
|
|
59
|
+
}, [T]), Y = l((e, t) => {
|
|
60
|
+
F(typeof e == "string" ? parseInt(e) : e), L(typeof t == "string" ? parseInt(t) : t), W.current = 0, V(null), U.current = [], Ce(!0);
|
|
61
|
+
}, []), De = l(() => {
|
|
62
62
|
let e = I === 0 ? 11 : I - 1, t = I === 0 ? P - 1 : P;
|
|
63
|
-
|
|
63
|
+
Y(t, e);
|
|
64
64
|
}, [
|
|
65
65
|
P,
|
|
66
66
|
I,
|
|
67
|
-
|
|
68
|
-
]),
|
|
67
|
+
Y
|
|
68
|
+
]), Oe = l(() => {
|
|
69
69
|
let e = I === 11 ? 0 : I + 1, t = I === 11 ? P + 1 : P;
|
|
70
|
-
|
|
70
|
+
Y(t, e);
|
|
71
71
|
}, [
|
|
72
72
|
P,
|
|
73
73
|
I,
|
|
74
|
-
|
|
75
|
-
]),
|
|
74
|
+
Y
|
|
75
|
+
]), ke = l((e) => o(e, K), [K]), Ae = l((e, t) => ee(e, t, K, {
|
|
76
76
|
multiple: h,
|
|
77
77
|
maxMultiple: g,
|
|
78
78
|
selectedCount: j.length
|
|
79
79
|
}), [
|
|
80
|
-
|
|
80
|
+
K,
|
|
81
81
|
h,
|
|
82
82
|
g,
|
|
83
83
|
j.length
|
|
84
|
-
]),
|
|
85
|
-
!_ || M.length !== 1 || !
|
|
84
|
+
]), X = l(() => typeof j == "string" ? j.split(",") : j, [j]), je = l((e) => {
|
|
85
|
+
!_ || M.length !== 1 || !ie(e, M, O, x) || M[0] >= e ? z(null) : (z(e), R(c(M[0], e)));
|
|
86
86
|
}, [
|
|
87
87
|
_,
|
|
88
88
|
M,
|
|
89
89
|
O,
|
|
90
90
|
x
|
|
91
|
-
]),
|
|
92
|
-
if (!
|
|
93
|
-
let
|
|
94
|
-
if (_)
|
|
91
|
+
]), Me = l((t) => {
|
|
92
|
+
if (!t) return;
|
|
93
|
+
let n;
|
|
94
|
+
if (_) n = re(t, X(), {
|
|
95
95
|
excludedates: O,
|
|
96
96
|
excludeweekdays: x
|
|
97
|
-
}), k || A(
|
|
98
|
-
else if (h)
|
|
97
|
+
}), k || A(n), n.length === 2 ? (w?.(n), J()) : (n.length === 1 && R({}), w?.(n));
|
|
98
|
+
else if (h) n = s(t, X(), g), q(n);
|
|
99
99
|
else {
|
|
100
|
-
let r =
|
|
101
|
-
|
|
100
|
+
let r = e(t);
|
|
101
|
+
n = j.includes(r) ? [] : [r], q(n), J();
|
|
102
102
|
}
|
|
103
103
|
}, [
|
|
104
104
|
_,
|
|
105
105
|
h,
|
|
106
106
|
g,
|
|
107
|
-
|
|
107
|
+
X,
|
|
108
108
|
j,
|
|
109
109
|
O,
|
|
110
110
|
x,
|
|
111
111
|
k,
|
|
112
|
+
q,
|
|
112
113
|
J,
|
|
113
|
-
Y,
|
|
114
114
|
w
|
|
115
|
-
]),
|
|
116
|
-
let t =
|
|
117
|
-
k || A(t), _ && t.length === 2 && (w?.(t),
|
|
115
|
+
]), Z = l((e) => {
|
|
116
|
+
let t = te(e, X());
|
|
117
|
+
k || A(t), _ && t.length === 2 && (w?.(t), J());
|
|
118
118
|
}, [
|
|
119
|
-
|
|
119
|
+
X,
|
|
120
120
|
k,
|
|
121
121
|
_,
|
|
122
122
|
w,
|
|
123
|
-
|
|
123
|
+
J
|
|
124
124
|
]), Ne = l((e) => {
|
|
125
|
-
let t =
|
|
125
|
+
let t = ae(e, X());
|
|
126
126
|
k || A(t);
|
|
127
|
-
}, [
|
|
128
|
-
let t = s(e,
|
|
127
|
+
}, [X, k]), Pe = l((e) => {
|
|
128
|
+
let t = s(e, X(), g);
|
|
129
129
|
k || A(t);
|
|
130
130
|
}, [
|
|
131
|
-
|
|
131
|
+
X,
|
|
132
132
|
g,
|
|
133
133
|
k
|
|
134
134
|
]), Q = l(() => {
|
|
135
|
-
let
|
|
136
|
-
if (
|
|
137
|
-
|
|
135
|
+
let t = e(n(D)), r = H.current?.querySelector(`button[data-date="${t}"]`);
|
|
136
|
+
if (r instanceof HTMLButtonElement) {
|
|
137
|
+
V(t), r.focus();
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
|
-
let
|
|
141
|
-
if (
|
|
142
|
-
let e =
|
|
143
|
-
e instanceof HTMLButtonElement && (
|
|
140
|
+
let i = U.current.find((e) => !e.isDisabled);
|
|
141
|
+
if (i) {
|
|
142
|
+
let e = H.current?.querySelector(`button[data-date="${i.currentDateISO}"]`);
|
|
143
|
+
e instanceof HTMLButtonElement && (V(i.currentDateISO), e.focus());
|
|
144
144
|
}
|
|
145
|
-
}, []), $ = l((
|
|
146
|
-
let i =
|
|
147
|
-
if (
|
|
148
|
-
if (
|
|
145
|
+
}, []), $ = l((n, r) => {
|
|
146
|
+
let i = n.target;
|
|
147
|
+
if (ce(i)) return;
|
|
148
|
+
if (n.preventDefault(), !B) {
|
|
149
149
|
Q();
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
|
-
let a =
|
|
152
|
+
let a = t(B), o = oe(a, r, H.current.querySelector.bind(H.current));
|
|
153
153
|
if (o) {
|
|
154
|
-
let
|
|
155
|
-
|
|
154
|
+
let t = H.current.querySelector(`button[data-date="${e(o)}"]`);
|
|
155
|
+
t instanceof HTMLButtonElement && !t.dataset.disabled && (V(e(o)), t.focus());
|
|
156
156
|
}
|
|
157
|
-
}, [
|
|
157
|
+
}, [B, Q]);
|
|
158
158
|
return {
|
|
159
159
|
componentId: _e,
|
|
160
160
|
strings: ve,
|
|
@@ -163,9 +163,9 @@ function p(p) {
|
|
|
163
163
|
month: I,
|
|
164
164
|
activeSelected: j,
|
|
165
165
|
_selected: M,
|
|
166
|
-
inRange:
|
|
167
|
-
rangeHovered:
|
|
168
|
-
focusedDate:
|
|
166
|
+
inRange: be,
|
|
167
|
+
rangeHovered: xe,
|
|
168
|
+
focusedDate: B,
|
|
169
169
|
range: _,
|
|
170
170
|
multiple: h,
|
|
171
171
|
weeknumbers: de,
|
|
@@ -175,36 +175,35 @@ function p(p) {
|
|
|
175
175
|
excludedates: O,
|
|
176
176
|
excludeweekdays: x,
|
|
177
177
|
className: he,
|
|
178
|
-
dateConstraints:
|
|
179
|
-
calendarRef:
|
|
180
|
-
selectableDatesRef:
|
|
181
|
-
tabIndexSetRef:
|
|
182
|
-
prevMonth:
|
|
183
|
-
nextMonth:
|
|
184
|
-
changeMonth:
|
|
185
|
-
handleDateSelect:
|
|
186
|
-
addToSelected:
|
|
178
|
+
dateConstraints: K,
|
|
179
|
+
calendarRef: H,
|
|
180
|
+
selectableDatesRef: U,
|
|
181
|
+
tabIndexSetRef: W,
|
|
182
|
+
prevMonth: De,
|
|
183
|
+
nextMonth: Oe,
|
|
184
|
+
changeMonth: Y,
|
|
185
|
+
handleDateSelect: Me,
|
|
186
|
+
addToSelected: Z,
|
|
187
187
|
removeFromSelected: Ne,
|
|
188
188
|
toggleSelectedDate: Pe,
|
|
189
|
-
handleRangeHover:
|
|
190
|
-
isExcluded:
|
|
191
|
-
isDayDisabled:
|
|
189
|
+
handleRangeHover: je,
|
|
190
|
+
isExcluded: ke,
|
|
191
|
+
isDayDisabled: Ae,
|
|
192
192
|
focusOnCurrentDate: Q,
|
|
193
193
|
handleKeydown: l((e) => {
|
|
194
194
|
if (e.key === "Escape") {
|
|
195
|
-
e.preventDefault(),
|
|
195
|
+
e.preventDefault(), J();
|
|
196
196
|
return;
|
|
197
197
|
}
|
|
198
|
-
let t =
|
|
198
|
+
let t = se(e.key);
|
|
199
199
|
t !== null && $(e.nativeEvent, t);
|
|
200
|
-
}, [
|
|
200
|
+
}, [J, $]),
|
|
201
201
|
handleFocusOut: l((e) => {
|
|
202
202
|
let t = e.target, n = e.relatedTarget;
|
|
203
|
-
|
|
204
|
-
}, [
|
|
205
|
-
close:
|
|
206
|
-
setFocusedDate:
|
|
203
|
+
H.current && H.current.contains(n) || t.classList.contains("pkt-hide") || t.closest(".pkt-cal-month-picker") || J();
|
|
204
|
+
}, [J]),
|
|
205
|
+
close: J,
|
|
206
|
+
setFocusedDate: V
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
|
-
//#endregion
|
|
210
209
|
export { p as useCalendarState };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
|
|
3
3
|
import { CARD_DEFAULTS as t, CARD_LIGHT_ONLY_SKINS as n } from "../../shared-types/card.js";
|
|
4
|
-
import "../../shared-types/index.js";
|
|
5
4
|
import { require_classnames as r } from "../../node_modules/classnames/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
5
|
+
import { plural as i } from "../../shared-strings/format.js";
|
|
6
|
+
import "../../shared-types/index.js";
|
|
7
|
+
import { PktHeading as a } from "../heading/Heading.js";
|
|
8
|
+
import { PktIcon as o } from "../icon/Icon.js";
|
|
9
|
+
import { PktTag as s } from "../tag/Tag.js";
|
|
10
|
+
import { usePktStrings as c } from "../../hooks/usePktStrings.js";
|
|
11
|
+
import { withStableKeys as l } from "../../utils/stableKeys.js";
|
|
12
12
|
import { forwardRef as u } from "react";
|
|
13
13
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
14
|
-
|
|
14
|
+
// src/components/card/Card.tsx
|
|
15
15
|
var p = /* @__PURE__ */ e(r(), 1), m = u(({ children: e, className: r, ariaLabel: u, metaLead: m, metaTrail: h, layout: g = t.layout, heading: _ = "", headingLevel: v = t.headingLevel, image: y, imageAspect: b, clickCardLink: x, openLinkInNewTab: S = t.openLinkInNewTab, skin: C = t.skin, subheading: w = "", tagPosition: T = t.tagPosition, zoom: E = t.zoom, tags: D = [], strings: O, ...k }, A) => {
|
|
16
|
-
let j =
|
|
16
|
+
let j = c(["card"], O), M = (0, p.default)({
|
|
17
17
|
"pkt-card": !0,
|
|
18
18
|
[`pkt-card--${C}`]: C,
|
|
19
19
|
[`pkt-card--${g}`]: g,
|
|
@@ -28,8 +28,8 @@ var p = /* @__PURE__ */ e(r(), 1), m = u(({ children: e, className: r, ariaLabel
|
|
|
28
28
|
}) : null, I = () => D.length === 0 ? null : /* @__PURE__ */ d("div", {
|
|
29
29
|
className: (0, p.default)("pkt-card__tags", `pkt-card__tags-${T}`),
|
|
30
30
|
role: "list",
|
|
31
|
-
"aria-label":
|
|
32
|
-
children:
|
|
31
|
+
"aria-label": i(D.length, j.card.tagsLabelOne, j.card.tagsLabelOther),
|
|
32
|
+
children: l(D, (e) => e.text).map(({ item: e, key: t }) => /* @__PURE__ */ d(s, {
|
|
33
33
|
role: "listitem",
|
|
34
34
|
textStyle: "normal-text",
|
|
35
35
|
size: "medium",
|
|
@@ -37,13 +37,13 @@ var p = /* @__PURE__ */ e(r(), 1), m = u(({ children: e, className: r, ariaLabel
|
|
|
37
37
|
iconName: e.iconName,
|
|
38
38
|
children: /* @__PURE__ */ d("span", { children: e.text })
|
|
39
39
|
}, t))
|
|
40
|
-
}), L = () => !_ || x ? null : /* @__PURE__ */ d(
|
|
40
|
+
}), L = () => !_ || x ? null : /* @__PURE__ */ d(a, {
|
|
41
41
|
className: "pkt-card__heading",
|
|
42
42
|
level: v,
|
|
43
43
|
size: "medium",
|
|
44
44
|
weight: "medium",
|
|
45
45
|
children: _
|
|
46
|
-
}), R = () => x ? /* @__PURE__ */ f(
|
|
46
|
+
}), R = () => x ? /* @__PURE__ */ f(a, {
|
|
47
47
|
className: "pkt-card__link-heading pkt-card__heading",
|
|
48
48
|
level: v,
|
|
49
49
|
size: "medium",
|
|
@@ -54,7 +54,7 @@ var p = /* @__PURE__ */ e(r(), 1), m = u(({ children: e, className: r, ariaLabel
|
|
|
54
54
|
target: S ? "_blank" : "_self",
|
|
55
55
|
rel: S ? "noopener noreferrer" : void 0,
|
|
56
56
|
children: _
|
|
57
|
-
}), /* @__PURE__ */ d(
|
|
57
|
+
}), /* @__PURE__ */ d(o, {
|
|
58
58
|
className: "pkt-card__link-icon",
|
|
59
59
|
name: "arrow-link"
|
|
60
60
|
})]
|
|
@@ -103,5 +103,4 @@ var p = /* @__PURE__ */ e(r(), 1), m = u(({ children: e, className: r, ariaLabel
|
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
105
|
m.displayName = "PktCard";
|
|
106
|
-
//#endregion
|
|
107
106
|
export { m as PktCard };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { CHECKBOX_DEFAULTS as e } from "../../shared-types/checkbox.js";
|
|
3
|
-
import "../../shared-types/index.js";
|
|
4
3
|
import { usePktStrings as t } from "../../hooks/usePktStrings.js";
|
|
5
4
|
import { useGeneratedId as n } from "../../hooks/useGeneratedId.js";
|
|
5
|
+
import "../../shared-types/index.js";
|
|
6
6
|
import { useCheckboxGroupContext as ee } from "../checkboxgroup/CheckboxGroupContext.js";
|
|
7
7
|
import { forwardRef as r, useEffect as i, useRef as a } from "react";
|
|
8
8
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
-
|
|
9
|
+
// src/components/checkbox/Checkbox.tsx
|
|
10
10
|
var l = r(({ id: r, hasTile: l = e.hasTile, disabled: u = e.disabled, label: d, checkHelptext: f, hasError: p = e.hasError, className: m, isSwitch: h = e.isSwitch, hideLabel: g = e.hideLabel, labelPosition: _ = e.labelPosition, inputSize: v, defaultChecked: te, checked: y, indeterminate: b, optionalTag: x, optionalText: S, requiredTag: C, requiredText: w, strings: T, tagText: E, name: D, value: O, onChange: k, "aria-describedby": A, ...j }, M) => {
|
|
11
11
|
let N = t(["forms"], T), P = n(r), F = a(null), I = ee(), L = O ?? "on", R = I?.value, z = R !== void 0, B = z ? R.includes(L) : y, V = te ?? (I?.defaultValue === void 0 ? void 0 : I.defaultValue.includes(L)), H = l || !!I?.hasTile, U = p || !!I?.hasError, W = u || !!I?.disabled;
|
|
12
12
|
i(() => {
|
|
@@ -38,11 +38,7 @@ var l = r(({ id: r, hasTile: l = e.hasTile, disabled: u = e.disabled, label: d,
|
|
|
38
38
|
"pkt-input-check__input",
|
|
39
39
|
H ? "pkt-input-check__input--tile" : "",
|
|
40
40
|
W && H ? "pkt-input-check__input--tile-disabled" : ""
|
|
41
|
-
].filter(Boolean).join(" "), Y = [
|
|
42
|
-
"pkt-tag",
|
|
43
|
-
"pkt-tag--small",
|
|
44
|
-
"pkt-tag--thin-text"
|
|
45
|
-
].join(" "), X = () => /* @__PURE__ */ c(o, { children: [
|
|
41
|
+
].filter(Boolean).join(" "), Y = "pkt-tag pkt-tag--small pkt-tag--thin-text", X = () => /* @__PURE__ */ c(o, { children: [
|
|
46
42
|
E && /* @__PURE__ */ s("span", {
|
|
47
43
|
className: Y + " pkt-tag--gray",
|
|
48
44
|
children: E
|
|
@@ -98,5 +94,4 @@ var l = r(({ id: r, hasTile: l = e.hasTile, disabled: u = e.disabled, label: d,
|
|
|
98
94
|
});
|
|
99
95
|
});
|
|
100
96
|
l.displayName = "PktCheckbox";
|
|
101
|
-
//#endregion
|
|
102
97
|
export { l as PktCheckbox };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { OPTION_GROUP_DEFAULTS as e } from "../../shared-types/option-group.js";
|
|
3
3
|
import "../../shared-types/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { useGeneratedId as t } from "../../hooks/useGeneratedId.js";
|
|
5
|
+
import { isActiveOption as n, useOptionGroupField as r } from "../../hooks/useOptionGroupField.js";
|
|
6
|
+
import { usePktStrings as i } from "../../hooks/usePktStrings.js";
|
|
7
|
+
import { PktInputWrapper as a } from "../inputwrapper/InputWrapper.js";
|
|
8
|
+
import { CheckboxGroupContext as o } from "./CheckboxGroupContext.js";
|
|
9
9
|
import { forwardRef as s, useEffect as c, useMemo as l, useRef as u } from "react";
|
|
10
10
|
import { jsx as d } from "react/jsx-runtime";
|
|
11
|
-
|
|
11
|
+
// src/components/checkboxgroup/CheckboxGroup.tsx
|
|
12
12
|
var f = s(({ id: s, name: f, label: p, helptext: m, helptextDropdown: h, helptextDropdownButton: g, value: _, defaultValue: v, layout: y = e.layout, inputSize: b = e.inputSize, hasTile: x = e.hasTile, required: S = e.required, disabled: C = e.disabled, hasError: w = e.hasError, errorMessage: T, useWrapper: E = e.useWrapper, optionalTag: D = e.optionalTag, optionalText: O, requiredTag: k = e.requiredTag, requiredText: A, tagText: j, strings: M, className: N, children: P, onChange: F, onValueChange: I, onFocus: L, onBlur: R }, z) => {
|
|
13
|
-
let B =
|
|
13
|
+
let B = t(s), V = f || B, H = i(["validation"], M).validation.checkboxGroupValueMissing, U = u(!1), W = r({
|
|
14
14
|
type: "checkbox",
|
|
15
15
|
name: V,
|
|
16
16
|
forwardedRef: z,
|
|
@@ -22,7 +22,7 @@ var f = s(({ id: s, name: f, label: p, helptext: m, helptextDropdown: h, helptex
|
|
|
22
22
|
}), G = () => {
|
|
23
23
|
if (!S && !U.current) return;
|
|
24
24
|
U.current = S;
|
|
25
|
-
let e = W.options(), t = S && !e.some((e) => e.checked &&
|
|
25
|
+
let e = W.options(), t = S && !e.some((e) => e.checked && n(e));
|
|
26
26
|
e.forEach((e) => e.setCustomValidity(t ? H : ""));
|
|
27
27
|
};
|
|
28
28
|
c(() => {
|
|
@@ -54,9 +54,9 @@ var f = s(({ id: s, name: f, label: p, helptext: m, helptextDropdown: h, helptex
|
|
|
54
54
|
v,
|
|
55
55
|
W
|
|
56
56
|
]);
|
|
57
|
-
return /* @__PURE__ */ d(
|
|
57
|
+
return /* @__PURE__ */ d(o.Provider, {
|
|
58
58
|
value: K,
|
|
59
|
-
children: /* @__PURE__ */ d(
|
|
59
|
+
children: /* @__PURE__ */ d(a, {
|
|
60
60
|
ref: W.mergedRef,
|
|
61
61
|
onFocus: W.onRootFocus,
|
|
62
62
|
onBlur: W.onRootBlur,
|
|
@@ -85,5 +85,4 @@ var f = s(({ id: s, name: f, label: p, helptext: m, helptextDropdown: h, helptex
|
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
87
|
f.displayName = "PktCheckboxGroup";
|
|
88
|
-
//#endregion
|
|
89
88
|
export { f as PktCheckboxGroup };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createContext as e, useContext as t } from "react";
|
|
2
|
-
|
|
2
|
+
// src/components/checkboxgroup/CheckboxGroupContext.ts
|
|
3
3
|
var n = e(null), r = () => t(n);
|
|
4
|
-
//#endregion
|
|
5
4
|
export { n as CheckboxGroupContext, r as useCheckboxGroupContext };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { PktInputWrapper as e } from "../inputwrapper/InputWrapper.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ComboboxInput as t } from "./ComboboxInput.js";
|
|
4
|
+
import { ComboboxTags as n } from "./ComboboxTags.js";
|
|
5
5
|
import { Listbox as r } from "./Listbox.js";
|
|
6
6
|
import { useComboboxState as i } from "./useComboboxState.js";
|
|
7
7
|
import { forwardRef as a } from "react";
|
|
8
8
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
|
-
|
|
9
|
+
// src/components/combobox/Combobox.tsx
|
|
10
10
|
var c = a((a, c) => {
|
|
11
11
|
let l = i(a, c), u = [
|
|
12
12
|
"pkt-combobox-component",
|
|
@@ -43,8 +43,8 @@ var c = a((a, c) => {
|
|
|
43
43
|
children: [/* @__PURE__ */ s("div", {
|
|
44
44
|
className: "pkt-combobox",
|
|
45
45
|
onBlur: l.handleFocusOut,
|
|
46
|
-
children: [/* @__PURE__ */ o(
|
|
47
|
-
}), l.tagPlacement === "outside" && l.multiple && /* @__PURE__ */ o(
|
|
46
|
+
children: [/* @__PURE__ */ o(t, { state: l }), /* @__PURE__ */ o(r, { state: l })]
|
|
47
|
+
}), l.tagPlacement === "outside" && l.multiple && /* @__PURE__ */ o(n, {
|
|
48
48
|
state: l,
|
|
49
49
|
outside: !0
|
|
50
50
|
})]
|
|
@@ -61,5 +61,4 @@ var c = a((a, c) => {
|
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
63
|
c.displayName = "PktCombobox";
|
|
64
|
-
//#endregion
|
|
65
64
|
export { c as PktCombobox };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { describedByIds as
|
|
4
|
-
import {
|
|
2
|
+
import { findOptionByValue as e, findOptionIndex as t } from "../../shared-utils/combobox/option-utils.js";
|
|
3
|
+
import { describedByIds as n } from "../../shared-utils/forms/described-by.js";
|
|
4
|
+
import { PktIcon as r } from "../icon/Icon.js";
|
|
5
5
|
import { ComboboxTags as i, SingleValueDisplay as a } from "./ComboboxTags.js";
|
|
6
6
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/components/combobox/ComboboxInput.tsx
|
|
8
8
|
var c = ({ state: c }) => {
|
|
9
9
|
let { id: l, inputId: u, listboxId: d, values: f, options: p, isOpen: m, multiple: h, typeahead: g, allowUserInput: _, tagPlacement: v, placeholder: y, disabled: b, fullwidth: x, hasError: S, label: C, inputFocus: w, skipInputTab: T, restoreInputTab: E, inputRef: D, triggerRef: O, handleInputChange: k, handleInputKeydown: A, handleInputFocus: j, handleInputBlur: M, handleInputClick: N, handlePlaceholderClick: P, handleSelectOnlyKeydown: F, name: I, inputSize: L } = c, R = [
|
|
10
10
|
"pkt-combobox__input",
|
|
@@ -13,7 +13,7 @@ var c = ({ state: c }) => {
|
|
|
13
13
|
m && "pkt-combobox__input--open",
|
|
14
14
|
S && "pkt-combobox__input--error",
|
|
15
15
|
b && "pkt-combobox__input--disabled"
|
|
16
|
-
].filter(Boolean).join(" "), z = ["pkt-combobox__arrow-icon", m && "pkt-combobox__arrow-icon--open"].filter(Boolean).join(" "), B = g || _, V = !B && y && (!f.length || h && v === "outside") && !w, H = v !== "outside", U = m && f[0] &&
|
|
16
|
+
].filter(Boolean).join(" "), z = ["pkt-combobox__arrow-icon", m && "pkt-combobox__arrow-icon--open"].filter(Boolean).join(" "), B = g || _, V = !B && y && (!f.length || h && v === "outside") && !w, H = v !== "outside", U = m && f[0] && e(p, f[0]) ? `${d}-${t(p, f[0])}` : void 0, W = h && f.length > 0 ? `${f.length} valgt` : void 0, G = n({
|
|
17
17
|
id: B ? u : `${l}-combobox`,
|
|
18
18
|
hasHelptext: !!c.helptext,
|
|
19
19
|
ariaDescribedby: c.ariaDescribedby
|
|
@@ -75,7 +75,7 @@ var c = ({ state: c }) => {
|
|
|
75
75
|
name: `${I || l}-input`,
|
|
76
76
|
value: f.join(",")
|
|
77
77
|
}),
|
|
78
|
-
/* @__PURE__ */ o(
|
|
78
|
+
/* @__PURE__ */ o(r, {
|
|
79
79
|
className: z,
|
|
80
80
|
name: "chevron-thin-down",
|
|
81
81
|
"aria-hidden": "true"
|
|
@@ -83,5 +83,4 @@ var c = ({ state: c }) => {
|
|
|
83
83
|
]
|
|
84
84
|
});
|
|
85
85
|
};
|
|
86
|
-
//#endregion
|
|
87
86
|
export { c as ComboboxInput };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { findOptionByValue as e, getOptionDisplayText as t } from "../../shared-utils/combobox/option-utils.js";
|
|
3
|
+
import { PktTag as n } from "../tag/Tag.js";
|
|
4
4
|
import { useEffect as r, useRef as i } from "react";
|
|
5
5
|
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/components/combobox/ComboboxTags.tsx
|
|
7
7
|
var o = ({ state: o, outside: s = !1 }) => {
|
|
8
8
|
let { values: c, options: l, disabled: u, displayValueAs: d, handleTagRemove: f, handleTagKeydown: p, focusedTagIndex: m } = o, h = i([]);
|
|
9
9
|
if (r(() => {
|
|
@@ -14,10 +14,10 @@ var o = ({ state: o, outside: s = !1 }) => {
|
|
|
14
14
|
c.length
|
|
15
15
|
]), c.length === 0) return null;
|
|
16
16
|
let g = c.map((r, i) => {
|
|
17
|
-
let o =
|
|
17
|
+
let o = e(l, r), c = o?.tagSkinColor, g = o ? t(o, d) : r;
|
|
18
18
|
return u ? /* @__PURE__ */ a("li", {
|
|
19
19
|
role: "listitem",
|
|
20
|
-
children: /* @__PURE__ */ a(
|
|
20
|
+
children: /* @__PURE__ */ a(n, {
|
|
21
21
|
skin: c || "blue",
|
|
22
22
|
children: /* @__PURE__ */ a("span", {
|
|
23
23
|
className: "pkt-combobox__value",
|
|
@@ -26,7 +26,7 @@ var o = ({ state: o, outside: s = !1 }) => {
|
|
|
26
26
|
})
|
|
27
27
|
}, r) : s ? /* @__PURE__ */ a("li", {
|
|
28
28
|
role: "listitem",
|
|
29
|
-
children: /* @__PURE__ */ a(
|
|
29
|
+
children: /* @__PURE__ */ a(n, {
|
|
30
30
|
skin: c || "blue",
|
|
31
31
|
closeTag: !0,
|
|
32
32
|
onClose: () => f(r),
|
|
@@ -39,7 +39,7 @@ var o = ({ state: o, outside: s = !1 }) => {
|
|
|
39
39
|
role: "listitem",
|
|
40
40
|
onClick: (e) => e.stopPropagation(),
|
|
41
41
|
onMouseDown: (e) => e.preventDefault(),
|
|
42
|
-
children: /* @__PURE__ */ a(
|
|
42
|
+
children: /* @__PURE__ */ a(n, {
|
|
43
43
|
ref: (e) => {
|
|
44
44
|
h.current[i] = e;
|
|
45
45
|
},
|
|
@@ -67,16 +67,15 @@ var o = ({ state: o, outside: s = !1 }) => {
|
|
|
67
67
|
className: "pkt-combobox__tag-list",
|
|
68
68
|
children: g
|
|
69
69
|
});
|
|
70
|
-
}, s = ({ state:
|
|
71
|
-
let { values: r, options: i, editingSingleValue: o, displayValueAs: s } =
|
|
70
|
+
}, s = ({ state: n }) => {
|
|
71
|
+
let { values: r, options: i, editingSingleValue: o, displayValueAs: s } = n;
|
|
72
72
|
if (o || r.length === 0) return null;
|
|
73
|
-
let c =
|
|
73
|
+
let c = e(i, r[0]);
|
|
74
74
|
if (!c) return null;
|
|
75
|
-
let l =
|
|
75
|
+
let l = t(c, s);
|
|
76
76
|
return /* @__PURE__ */ a("span", {
|
|
77
77
|
className: "pkt-combobox__value",
|
|
78
78
|
children: l
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
|
-
//#endregion
|
|
82
81
|
export { o as ComboboxTags, s as SingleValueDisplay };
|