@mattilsynet/design 3.1.13 → 3.1.15
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/mtds/atlas/atlas-element.js +1 -1
- package/mtds/field/field.js +122 -124
- package/mtds/field/field.js.map +1 -1
- package/mtds/index.iife.js +14 -14
- package/mtds/package.json.js +1 -1
- package/mtds/popover/popover-observer.js +11 -8
- package/mtds/popover/popover-observer.js.map +1 -1
- package/mtds/print/print.css.js +3 -3
- package/mtds/print/print.css.js.map +1 -1
- package/mtds/styles.css +1 -1
- package/mtds/validation/validation-observer.js +29 -31
- package/mtds/validation/validation-observer.js.map +1 -1
- package/package.json +8 -9
|
@@ -20,7 +20,7 @@ class c extends C {
|
|
|
20
20
|
}
|
|
21
21
|
constructor() {
|
|
22
22
|
super(), this.attachShadow({ mode: "open" }).append(p("figure")), v(this, `@layer leaflet{${f}}
|
|
23
|
-
@layer mt.v3-1-
|
|
23
|
+
@layer mt.v3-1-15design{${k}`);
|
|
24
24
|
}
|
|
25
25
|
connectedCallback() {
|
|
26
26
|
const t = this.shadowRoot?.lastElementChild, o = a(this, "data-cluster") ?? "false", e = new i.TileLayer(S, {
|
package/mtds/field/field.js
CHANGED
|
@@ -1,180 +1,178 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as e, Fragment as
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
2
|
+
import { jsx as e, Fragment as k, jsxs as W } from "react/jsx-runtime";
|
|
3
|
+
import P from "clsx";
|
|
4
|
+
import { forwardRef as s, useRef as z, useImperativeHandle as $, useEffect as ee } from "react";
|
|
5
5
|
import { HelpText as te } from "../helptext/helptext.js";
|
|
6
6
|
import { Input as ne } from "../input/input.js";
|
|
7
7
|
import v from "../styles.module.css.js";
|
|
8
|
-
import { toCustomElementProps as
|
|
9
|
-
import { Validation as
|
|
10
|
-
const
|
|
8
|
+
import { toCustomElementProps as A } from "../utils.js";
|
|
9
|
+
import { Validation as T } from "../validation/validation.js";
|
|
10
|
+
const V = (r) => typeof r == "string" ? { label: r, value: r } : r, ie = s(function({
|
|
11
11
|
"data-size": t,
|
|
12
|
-
"data-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
helpTextLabel: w,
|
|
12
|
+
"data-required": n,
|
|
13
|
+
as: i,
|
|
14
|
+
className: d,
|
|
15
|
+
count: c,
|
|
16
|
+
description: m,
|
|
17
|
+
error: y,
|
|
18
|
+
helpText: g,
|
|
19
|
+
helpTextLabel: C,
|
|
21
20
|
label: b,
|
|
22
|
-
prefix:
|
|
23
|
-
style:
|
|
24
|
-
suffix:
|
|
25
|
-
validation:
|
|
26
|
-
...
|
|
27
|
-
},
|
|
28
|
-
const
|
|
21
|
+
prefix: p,
|
|
22
|
+
style: D,
|
|
23
|
+
suffix: h,
|
|
24
|
+
validation: O,
|
|
25
|
+
...a
|
|
26
|
+
}, F) {
|
|
27
|
+
const x = i || "ds-field", j = !!h || !!p, w = O || y, u = {
|
|
29
28
|
"data-size": t,
|
|
30
|
-
"data-
|
|
31
|
-
|
|
32
|
-
class: T(v.field, f),
|
|
29
|
+
"data-required": n,
|
|
30
|
+
class: P(v.field, d),
|
|
33
31
|
suppressHydrationWarning: !0,
|
|
34
|
-
style:
|
|
32
|
+
style: D
|
|
35
33
|
};
|
|
36
|
-
return
|
|
34
|
+
return i === "select" && !a.children && Object.assign(a, {
|
|
37
35
|
options: void 0,
|
|
38
36
|
// Ensure options is not passed to DOM
|
|
39
|
-
children: /* @__PURE__ */ e(
|
|
40
|
-
}),
|
|
41
|
-
!!b && /* @__PURE__ */ e(
|
|
42
|
-
!!
|
|
43
|
-
!!
|
|
44
|
-
|
|
45
|
-
!!
|
|
37
|
+
children: /* @__PURE__ */ e(k, { children: a.options?.map(V).map(({ label: L, value: H }) => /* @__PURE__ */ e("option", { value: H, children: L }, H)) })
|
|
38
|
+
}), i ? /* @__PURE__ */ W("ds-field", { ...u, children: [
|
|
39
|
+
!!b && /* @__PURE__ */ e(M, { children: b }),
|
|
40
|
+
!!g && /* @__PURE__ */ e(te, { "aria-label": C, children: g }),
|
|
41
|
+
!!m && /* @__PURE__ */ e(Q, { children: m }),
|
|
42
|
+
j ? /* @__PURE__ */ W(G, { children: [
|
|
43
|
+
!!p && /* @__PURE__ */ e("span", { children: p }),
|
|
46
44
|
/* @__PURE__ */ e(
|
|
47
|
-
|
|
45
|
+
x,
|
|
48
46
|
{
|
|
49
|
-
className: typeof
|
|
47
|
+
className: typeof i == "string" ? v.input : void 0,
|
|
50
48
|
suppressHydrationWarning: !0,
|
|
51
|
-
ref:
|
|
52
|
-
...
|
|
49
|
+
ref: F,
|
|
50
|
+
...a
|
|
53
51
|
}
|
|
54
52
|
),
|
|
55
|
-
!!
|
|
53
|
+
!!h && /* @__PURE__ */ e("span", { children: h })
|
|
56
54
|
] }) : /* @__PURE__ */ e(
|
|
57
|
-
|
|
55
|
+
x,
|
|
58
56
|
{
|
|
59
|
-
className: typeof
|
|
57
|
+
className: typeof i == "string" ? v.input : void 0,
|
|
60
58
|
suppressHydrationWarning: !0,
|
|
61
|
-
ref:
|
|
62
|
-
...
|
|
59
|
+
ref: F,
|
|
60
|
+
...a
|
|
63
61
|
}
|
|
64
62
|
),
|
|
65
|
-
!!
|
|
66
|
-
!!
|
|
67
|
-
] }) : /* @__PURE__ */ e("ds-field", { ref:
|
|
68
|
-
}),
|
|
69
|
-
function({ className: t, ...n },
|
|
70
|
-
return /* @__PURE__ */ e("div", { className:
|
|
63
|
+
!!w && /* @__PURE__ */ e(T, { children: w }),
|
|
64
|
+
!!c && /* @__PURE__ */ e(U, { "data-limit": c })
|
|
65
|
+
] }) : /* @__PURE__ */ e("ds-field", { ref: F, ...u, ...a });
|
|
66
|
+
}), G = s(
|
|
67
|
+
function({ className: t, ...n }, i) {
|
|
68
|
+
return /* @__PURE__ */ e("div", { className: P(v.affixes, t), ref: i, ...n });
|
|
71
69
|
}
|
|
72
|
-
),
|
|
73
|
-
function({ "data-position": t, "data-nofilter": n, ...
|
|
70
|
+
), J = s(
|
|
71
|
+
function({ "data-position": t, "data-nofilter": n, ...i }, d) {
|
|
74
72
|
return /* @__PURE__ */ e(
|
|
75
73
|
"u-datalist",
|
|
76
74
|
{
|
|
77
75
|
"data-placement": t,
|
|
78
76
|
"data-nofilter": !!n || void 0,
|
|
79
|
-
ref:
|
|
80
|
-
...
|
|
77
|
+
ref: d,
|
|
78
|
+
...A(i)
|
|
81
79
|
}
|
|
82
80
|
);
|
|
83
81
|
}
|
|
84
|
-
),
|
|
82
|
+
), K = s(
|
|
85
83
|
function(t, n) {
|
|
86
|
-
return /* @__PURE__ */ e("u-option", { ref: n, ...
|
|
84
|
+
return /* @__PURE__ */ e("u-option", { ref: n, ...A(t) });
|
|
87
85
|
}
|
|
88
|
-
),
|
|
86
|
+
), I = s(
|
|
89
87
|
function({
|
|
90
88
|
"aria-required": t,
|
|
91
89
|
"data-position": n,
|
|
92
|
-
"data-placement":
|
|
93
|
-
"data-nofilter":
|
|
94
|
-
"data-multiple":
|
|
90
|
+
"data-placement": i,
|
|
91
|
+
"data-nofilter": d,
|
|
92
|
+
"data-multiple": c,
|
|
95
93
|
onAfterChange: m,
|
|
96
94
|
// Backwards compatibility
|
|
97
|
-
onAfterSelect:
|
|
98
|
-
onBeforeChange:
|
|
95
|
+
onAfterSelect: y,
|
|
96
|
+
onBeforeChange: g,
|
|
99
97
|
// Backwards compatibility
|
|
100
|
-
onBeforeMatch:
|
|
101
|
-
onBeforeSelect:
|
|
102
|
-
onSelectedChange:
|
|
103
|
-
onInput:
|
|
104
|
-
onChange:
|
|
105
|
-
children:
|
|
106
|
-
disabled:
|
|
107
|
-
name:
|
|
108
|
-
options:
|
|
109
|
-
placeholder:
|
|
110
|
-
readOnly:
|
|
111
|
-
selected:
|
|
112
|
-
type:
|
|
113
|
-
...
|
|
114
|
-
},
|
|
115
|
-
const
|
|
116
|
-
return
|
|
98
|
+
onBeforeMatch: C,
|
|
99
|
+
onBeforeSelect: b,
|
|
100
|
+
onSelectedChange: p,
|
|
101
|
+
onInput: D,
|
|
102
|
+
onChange: h,
|
|
103
|
+
children: O,
|
|
104
|
+
disabled: a,
|
|
105
|
+
name: F,
|
|
106
|
+
options: x,
|
|
107
|
+
placeholder: j,
|
|
108
|
+
readOnly: w,
|
|
109
|
+
selected: u,
|
|
110
|
+
type: L,
|
|
111
|
+
...H
|
|
112
|
+
}, X) {
|
|
113
|
+
const q = z(null), B = z(p);
|
|
114
|
+
return B.current = p, m && (y = m, window.dsWarnings === !1 || console.warn(
|
|
117
115
|
"\x1B[1m@mattilsynet/design - deprecation warning:\x1B[m onAfterChange is deprecated, please use onAfterSelect instead"
|
|
118
|
-
)),
|
|
116
|
+
)), g && (b = g, window.dsWarnings === !1 || console.warn(
|
|
119
117
|
"\x1B[1m@mattilsynet/design - deprecation warning:\x1B[m onBeforeChange is deprecated, please use onBeforeSelect instead"
|
|
120
|
-
)), $(
|
|
121
|
-
const
|
|
122
|
-
const
|
|
123
|
-
if (!
|
|
124
|
-
|
|
125
|
-
const { isConnected: Y, textContent: Z, value:
|
|
126
|
-
|
|
118
|
+
)), $(X, () => q.current), ee(() => {
|
|
119
|
+
const f = q.current, l = (o) => {
|
|
120
|
+
const E = B.current;
|
|
121
|
+
if (!B) return;
|
|
122
|
+
o.preventDefault();
|
|
123
|
+
const { isConnected: Y, textContent: Z, value: S } = o.detail, N = Z?.trim() || "", R = u || [];
|
|
124
|
+
E?.(Y ? R.filter((_) => _.value !== S) : c ? [...R, { value: S, label: N }] : [{ value: S, label: N }]);
|
|
127
125
|
};
|
|
128
|
-
return
|
|
129
|
-
}, [
|
|
126
|
+
return f?.addEventListener("comboboxbeforeselect", l), () => f?.removeEventListener("comboboxbeforeselect", l);
|
|
127
|
+
}, [c, u]), /* @__PURE__ */ W(
|
|
130
128
|
"ds-suggestion",
|
|
131
129
|
{
|
|
132
|
-
"data-multiple":
|
|
133
|
-
...
|
|
130
|
+
"data-multiple": c || void 0,
|
|
131
|
+
...A(
|
|
134
132
|
{
|
|
135
|
-
oncomboboxbeforeselect:
|
|
136
|
-
oncomboboxbeforematch:
|
|
137
|
-
oncomboboxafterselect:
|
|
138
|
-
ref:
|
|
139
|
-
...
|
|
133
|
+
oncomboboxbeforeselect: b,
|
|
134
|
+
oncomboboxbeforematch: C,
|
|
135
|
+
oncomboboxafterselect: y,
|
|
136
|
+
ref: q,
|
|
137
|
+
...H
|
|
140
138
|
},
|
|
141
139
|
v.suggestion
|
|
142
140
|
),
|
|
143
141
|
children: [
|
|
144
|
-
|
|
145
|
-
|
|
142
|
+
u?.map(({ children: f, label: l, value: o }) => /* @__PURE__ */ e("data", { value: o, suppressHydrationWarning: !0, children: f ?? l }, o)),
|
|
143
|
+
O || /* @__PURE__ */ W(k, { children: [
|
|
146
144
|
/* @__PURE__ */ e(
|
|
147
145
|
ne,
|
|
148
146
|
{
|
|
149
147
|
"aria-required": t,
|
|
150
|
-
disabled:
|
|
151
|
-
name:
|
|
152
|
-
onInput:
|
|
153
|
-
onChange:
|
|
154
|
-
placeholder:
|
|
155
|
-
readOnly:
|
|
156
|
-
type:
|
|
148
|
+
disabled: a,
|
|
149
|
+
name: F,
|
|
150
|
+
onInput: D,
|
|
151
|
+
onChange: h,
|
|
152
|
+
placeholder: j,
|
|
153
|
+
readOnly: w,
|
|
154
|
+
type: L
|
|
157
155
|
}
|
|
158
156
|
),
|
|
159
157
|
/* @__PURE__ */ e("del", { "aria-label": "Fjern tekst", suppressHydrationWarning: !0 })
|
|
160
158
|
] }),
|
|
161
|
-
!!
|
|
162
|
-
|
|
159
|
+
!!x && /* @__PURE__ */ e(
|
|
160
|
+
J,
|
|
163
161
|
{
|
|
164
|
-
"data-nofilter":
|
|
165
|
-
"data-placement":
|
|
166
|
-
children:
|
|
162
|
+
"data-nofilter": d,
|
|
163
|
+
"data-placement": i || n,
|
|
164
|
+
children: x.map(V).map(({ children: f, label: l, value: o }) => /* @__PURE__ */ e(K, { value: o, label: l, children: f ?? l }, o))
|
|
167
165
|
}
|
|
168
166
|
)
|
|
169
167
|
]
|
|
170
168
|
}
|
|
171
169
|
);
|
|
172
170
|
}
|
|
173
|
-
),
|
|
171
|
+
), M = s(
|
|
174
172
|
function(t, n) {
|
|
175
173
|
return /* @__PURE__ */ e("label", { suppressHydrationWarning: !0, ref: n, ...t });
|
|
176
174
|
}
|
|
177
|
-
),
|
|
175
|
+
), Q = s(function(t, n) {
|
|
178
176
|
return /* @__PURE__ */ e(
|
|
179
177
|
"div",
|
|
180
178
|
{
|
|
@@ -184,31 +182,31 @@ const G = (i) => typeof i == "string" ? { label: i, value: i } : i, ie = d(funct
|
|
|
184
182
|
...t
|
|
185
183
|
}
|
|
186
184
|
);
|
|
187
|
-
}),
|
|
188
|
-
function({ "data-count": t, "data-limit": n, ...
|
|
185
|
+
}), U = s(
|
|
186
|
+
function({ "data-count": t, "data-limit": n, ...i }, d) {
|
|
189
187
|
return /* @__PURE__ */ e(
|
|
190
|
-
|
|
188
|
+
T,
|
|
191
189
|
{
|
|
192
190
|
"data-field": "counter",
|
|
193
191
|
"data-limit": n || t,
|
|
194
|
-
ref:
|
|
195
|
-
...
|
|
192
|
+
ref: d,
|
|
193
|
+
...i
|
|
196
194
|
}
|
|
197
195
|
);
|
|
198
196
|
}
|
|
199
197
|
), ue = Object.assign(ie, {
|
|
200
|
-
Affixes:
|
|
198
|
+
Affixes: G,
|
|
201
199
|
/**
|
|
202
200
|
* @deprecated Use Field.Suggestion instead
|
|
203
201
|
*/
|
|
204
|
-
Combobox:
|
|
202
|
+
Combobox: I,
|
|
205
203
|
// Backwards compatibility
|
|
206
|
-
Suggestion:
|
|
207
|
-
Datalist:
|
|
208
|
-
Option:
|
|
209
|
-
Description:
|
|
210
|
-
Label:
|
|
211
|
-
Count:
|
|
204
|
+
Suggestion: I,
|
|
205
|
+
Datalist: J,
|
|
206
|
+
Option: K,
|
|
207
|
+
Description: Q,
|
|
208
|
+
Label: M,
|
|
209
|
+
Count: U
|
|
212
210
|
});
|
|
213
211
|
export {
|
|
214
212
|
ue as Field,
|
package/mtds/field/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../../designsystem/field/field.tsx"],"sourcesContent":["\"use client\";\nimport type { DSSuggestionElement } from \"@digdir/designsystemet-web\";\nimport type { Placement } from \"@floating-ui/dom\";\nimport clsx from \"clsx\";\nimport type { JSX } from \"react\";\nimport { forwardRef, useEffect, useImperativeHandle, useRef } from \"react\";\nimport { HelpText } from \"../helptext/helptext\";\nimport { Input, type InputProps } from \"../input/input\";\nimport type {\n\tCustomReactElementProps,\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\nimport { Validation } from \"../validation/validation\";\n\ntype FieldBaseProps = {\n\t\"data-required\"?: \"hidden\";\n\tcount?: number;\n\tdescription?: React.ReactNode;\n\terror?: React.ReactNode; // Kept for backwards compatibility\n\thelpText?: React.ReactNode;\n\thelpTextLabel?: string;\n\tlabel?: React.ReactNode;\n\toptions?: string[] | FieldSuggestionSelected;\n\tprefix?: string;\n\treadOnly?: boolean; // Allow readoOnly also on <select>\n\tsuffix?: string;\n\tvalidation?: React.ReactNode;\n};\n\nexport type FieldProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As, FieldBaseProps>;\n\ntype FieldComponent = <As extends React.ElementType = \"div\">(\n\tprops: FieldProps<As>,\n) => JSX.Element;\n\nconst toOption = (\n\to: FieldSuggestionSelected[number] | string,\n): FieldSuggestionSelected[number] =>\n\ttypeof o === \"string\" ? { label: o, value: o } : o;\n\nexport const FieldComp: FieldComponent = forwardRef<null>(function Field<\n\tAs extends React.ElementType = \"div\",\n>(\n\t{\n\t\t\"data-size\": size,\n\t\t\"data-validation\": dataValidation,\n\t\t\"data-required\": dataRequired,\n\t\tas,\n\t\tclassName,\n\t\tcount,\n\t\tdescription,\n\t\terror,\n\t\thelpText,\n\t\thelpTextLabel,\n\t\tlabel,\n\t\tprefix,\n\t\tstyle,\n\t\tsuffix,\n\t\tvalidation: validationContent,\n\t\t...rest\n\t}: FieldProps<As>,\n\tref?: PolymorphicRef<As>,\n) {\n\tconst Tag = as || \"ds-field\";\n\tconst affixes = !!suffix || !!prefix;\n\tconst validation = validationContent || error; // error kept for backwards compatibility\n\tconst shared = {\n\t\t\"data-size\": size,\n\t\t\"data-validation\": dataValidation,\n\t\t\"data-required\": dataRequired,\n\t\tclass: clsx(styles.field, className),\n\t\tsuppressHydrationWarning: true,\n\t\tstyle,\n\t};\n\n\t// Render options if select\n\tif (as === \"select\" && !rest.children)\n\t\tObject.assign(rest, {\n\t\t\toptions: undefined, // Ensure options is not passed to DOM\n\t\t\tchildren: (\n\t\t\t\t<>\n\t\t\t\t\t{(rest.options as FieldBaseProps[\"options\"])\n\t\t\t\t\t\t?.map(toOption)\n\t\t\t\t\t\t.map(({ label, value }) => (\n\t\t\t\t\t\t\t<option key={value} value={value}>\n\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t),\n\t\t});\n\n\t// Using suppressHydrationWarning to avoid Next.js vs field-observer.ts hydration conflict\n\treturn as ? (\n\t\t<ds-field {...shared}>\n\t\t\t{!!label && <FieldLabel>{label}</FieldLabel>}\n\t\t\t{!!helpText && <HelpText aria-label={helpTextLabel}>{helpText}</HelpText>}\n\t\t\t{!!description && <FieldDescription>{description}</FieldDescription>}\n\t\t\t{affixes ? (\n\t\t\t\t<FieldAffixes>\n\t\t\t\t\t{!!prefix && <span>{prefix}</span>}\n\t\t\t\t\t<Tag\n\t\t\t\t\t\tclassName={typeof as === \"string\" ? styles.input : undefined}\n\t\t\t\t\t\tsuppressHydrationWarning\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\t{...rest}\n\t\t\t\t\t/>\n\t\t\t\t\t{!!suffix && <span>{suffix}</span>}\n\t\t\t\t</FieldAffixes>\n\t\t\t) : (\n\t\t\t\t<Tag\n\t\t\t\t\tclassName={typeof as === \"string\" ? styles.input : undefined}\n\t\t\t\t\tsuppressHydrationWarning\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{!!validation && <Validation>{validation}</Validation>}\n\t\t\t{!!count && <FieldCount data-limit={count} />}\n\t\t</ds-field>\n\t) : (\n\t\t<ds-field ref={ref} {...shared} {...rest} />\n\t);\n}) as FieldComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type FieldAffixProps = React.ComponentPropsWithoutRef<\"div\">;\nconst FieldAffixes = forwardRef<HTMLDivElement, FieldAffixProps>(\n\tfunction FieldAffixes({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<div className={clsx(styles.affixes, className)} ref={ref} {...rest} />\n\t\t);\n\t},\n);\n\nexport type FieldDatalistProps = React.ComponentPropsWithoutRef<\"datalist\"> & {\n\t\"data-nofilter\"?: boolean;\n\t/**\n\t * @deprecated Use `data-placement` instead.\n\t */\n\t\"data-position\"?: Placement;\n\t\"data-placement\"?: Placement;\n};\n\nconst FieldDatalist = forwardRef<HTMLDataListElement, FieldDatalistProps>(\n\tfunction FieldDatalist(\n\t\t{ \"data-position\": placement, \"data-nofilter\": filter, ...rest },\n\t\tref,\n\t) {\n\t\treturn (\n\t\t\t<u-datalist\n\t\t\t\tdata-placement={placement} // Backward compatibility\n\t\t\t\tdata-nofilter={!!filter || undefined} // Ensure data-nofilter is set correctly\n\t\t\t\tref={ref}\n\t\t\t\t{...toCustomElementProps(rest)}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport type FieldOptionProps = React.ComponentPropsWithoutRef<\"option\">;\nconst FieldOption = forwardRef<HTMLOptionElement, FieldOptionProps>(\n\tfunction FieldOption(props, ref) {\n\t\treturn <u-option ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport type FieldComboboxSelected = FieldSuggestionSelected; // Backwards compatibility\nexport type FieldComboboxProps = FieldSuggestionProps; // Backwards compatibility\n\nexport type FieldSuggestionSelected = {\n\tlabel: string;\n\tvalue: string;\n\tchildren?: React.ReactNode;\n}[];\nexport type FieldSuggestionProps = Omit<\n\tCustomReactElementProps<DSSuggestionElement>,\n\t\"onChange\" | \"onInput\"\n> & {\n\t\"data-creatable\"?: boolean;\n\t\"data-multiple\"?: boolean;\n\t\"data-variant\"?: \"inside\";\n\tonAfterChange?: (e: CustomEvent<HTMLDataElement>) => void; // Backwards compatibility\n\tonAfterSelect?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonBeforeChange?: (e: CustomEvent<HTMLDataElement>) => void; // Backwards compatibility\n\tonBeforeMatch?: (e: CustomEvent<HTMLOptionElement>) => void; // Custom event to handle before change\n\tonBeforeSelect?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonSelectedChange?: (selected: FieldSuggestionSelected) => void; // Allow onChange to be a function that returns void\n\toptions?: FieldSuggestionSelected;\n\tselected?: FieldSuggestionSelected; // Allow value to be a string or an array of strings for multiple select\n} & Pick<\n\t\tInputProps,\n\t\t| \"disabled\"\n\t\t| \"name\"\n\t\t| \"onChange\"\n\t\t| \"onInput\"\n\t\t| \"placeholder\"\n\t\t| \"readOnly\"\n\t\t| \"type\"\n\t\t| \"value\"\n\t> & // Allow input props to be passed down\n\tPick<\n\t\tFieldDatalistProps,\n\t\t\"data-position\" | \"data-placement\" | \"data-nofilter\"\n\t>; // Allow datalist props to be passed down\n\nconst FieldSuggestion = forwardRef<DSSuggestionElement, FieldSuggestionProps>(\n\tfunction FieldSuggestion(\n\t\t{\n\t\t\t\"aria-required\": required,\n\t\t\t\"data-position\": position,\n\t\t\t\"data-placement\": placement,\n\t\t\t\"data-nofilter\": nofilter,\n\t\t\t\"data-multiple\": multiple,\n\t\t\tonAfterChange, // Backwards compatibility\n\t\t\tonAfterSelect,\n\t\t\tonBeforeChange, // Backwards compatibility\n\t\t\tonBeforeMatch,\n\t\t\tonBeforeSelect,\n\t\t\tonSelectedChange,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\tchildren,\n\t\t\tdisabled,\n\t\t\tname,\n\t\t\toptions,\n\t\t\tplaceholder,\n\t\t\treadOnly,\n\t\t\tselected,\n\t\t\ttype,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) {\n\t\tconst innerRef = useRef<DSSuggestionElement>(null);\n\t\tconst onSelected = useRef(onSelectedChange);\n\t\tonSelected.current = onSelectedChange; // Sync the latest onSelectedChange function\n\n\t\t// Deprecated props\n\t\tif (onAfterChange) {\n\t\t\tonAfterSelect = onAfterChange;\n\t\t\twindow.dsWarnings === false ||\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`\\x1B[1m@mattilsynet/design - deprecation warning:\\x1B[m onAfterChange is deprecated, please use onAfterSelect instead`,\n\t\t\t\t);\n\t\t}\n\n\t\tif (onBeforeChange) {\n\t\t\tonBeforeSelect = onBeforeChange;\n\t\t\twindow.dsWarnings === false ||\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`\\x1B[1m@mattilsynet/design - deprecation warning:\\x1B[m onBeforeChange is deprecated, please use onBeforeSelect instead`,\n\t\t\t\t);\n\t\t}\n\n\t\t// Using useEffect for React 18 and lower compatibility\n\t\tuseImperativeHandle(ref, () => innerRef.current as DSSuggestionElement); // Forward innerRef\n\t\tuseEffect(() => {\n\t\t\tconst self = innerRef.current;\n\t\t\tconst handleChange = (event: CustomEvent<HTMLDataElement>) => {\n\t\t\t\tconst handleSelected = onSelected.current;\n\t\t\t\tif (!onSelected) return; // No onSelectedChange function provided, let ds-suggestion handle it\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst { isConnected: remove, textContent, value } = event.detail;\n\t\t\t\tconst label = textContent?.trim() || \"\";\n\t\t\t\tconst prev = selected || [];\n\n\t\t\t\tif (remove) handleSelected?.(prev.filter((i) => i.value !== value));\n\t\t\t\telse if (multiple) handleSelected?.([...prev, { value, label }]);\n\t\t\t\telse handleSelected?.([{ value, label }]);\n\t\t\t};\n\n\t\t\tself?.addEventListener(\"comboboxbeforeselect\", handleChange);\n\t\t\treturn () =>\n\t\t\t\tself?.removeEventListener(\"comboboxbeforeselect\", handleChange);\n\t\t}, [multiple, selected]);\n\n\t\treturn (\n\t\t\t<ds-suggestion\n\t\t\t\tdata-multiple={multiple || undefined}\n\t\t\t\t{...toCustomElementProps(\n\t\t\t\t\t{\n\t\t\t\t\t\toncomboboxbeforeselect: onBeforeSelect,\n\t\t\t\t\t\toncomboboxbeforematch: onBeforeMatch,\n\t\t\t\t\t\toncomboboxafterselect: onAfterSelect,\n\t\t\t\t\t\tref: innerRef,\n\t\t\t\t\t\t...props,\n\t\t\t\t\t},\n\t\t\t\t\tstyles.suggestion,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{selected?.map(({ children, label, value }) => (\n\t\t\t\t\t<data key={value} value={value} suppressHydrationWarning>\n\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t</data>\n\t\t\t\t))}\n\t\t\t\t{children || (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\taria-required={required}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\tname={name}\n\t\t\t\t\t\t\tonInput={onInput}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\ttype={type}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<del aria-label=\"Fjern tekst\" suppressHydrationWarning />\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t{!!options && (\n\t\t\t\t\t<FieldDatalist\n\t\t\t\t\t\tdata-nofilter={nofilter}\n\t\t\t\t\t\tdata-placement={placement || position}\n\t\t\t\t\t>\n\t\t\t\t\t\t{options.map(toOption).map(({ children, label, value }) => (\n\t\t\t\t\t\t\t<FieldOption key={value} value={value} label={label}>\n\t\t\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t\t\t</FieldOption>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</FieldDatalist>\n\t\t\t\t)}\n\t\t\t</ds-suggestion>\n\t\t);\n\t},\n);\n\nexport type FieldLabelProps = React.ComponentPropsWithoutRef<\"label\">;\nconst FieldLabel = forwardRef<HTMLLabelElement, FieldLabelProps>(\n\tfunction FieldLabel(rest, ref) {\n\t\treturn <label suppressHydrationWarning ref={ref} {...rest} />;\n\t},\n);\n\nexport type FieldDescriptionProps = React.ComponentPropsWithoutRef<\"p\">;\nconst FieldDescription = forwardRef<\n\tHTMLParagraphElement,\n\tFieldDescriptionProps\n>(function FieldDescription(rest, ref) {\n\treturn (\n\t\t<div\n\t\t\tsuppressHydrationWarning\n\t\t\tdata-field=\"description\"\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n});\n\nexport type FieldCountProps = React.ComponentPropsWithoutRef<\"p\"> & {\n\t/**\n\t * @deprecated Use \"data-limit\" instead\n\t */\n\t\"data-count\"?: number;\n\t\"data-limit\": number;\n};\nconst FieldCount = forwardRef<HTMLParagraphElement, FieldCountProps>(\n\tfunction FieldCount(\n\t\t{ \"data-count\": count, \"data-limit\": limit, ...rest },\n\t\tref,\n\t) {\n\t\treturn (\n\t\t\t<Validation\n\t\t\t\tdata-field=\"counter\"\n\t\t\t\tdata-limit={limit || count}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport const Field = Object.assign(FieldComp, {\n\tAffixes: FieldAffixes,\n\t/**\n\t * @deprecated Use Field.Suggestion instead\n\t */\n\tCombobox: FieldSuggestion, // Backwards compatibility\n\tSuggestion: FieldSuggestion,\n\tDatalist: FieldDatalist,\n\tOption: FieldOption,\n\tDescription: FieldDescription,\n\tLabel: FieldLabel,\n\tCount: FieldCount,\n});\n"],"names":["toOption","o","FieldComp","forwardRef","size","dataValidation","dataRequired","as","className","count","description","error","helpText","helpTextLabel","label","prefix","style","suffix","validationContent","rest","ref","Tag","affixes","validation","shared","clsx","styles","value","jsx","jsxs","FieldLabel","HelpText","FieldDescription","FieldAffixes","Validation","FieldCount","FieldDatalist","placement","filter","toCustomElementProps","FieldOption","props","FieldSuggestion","required","position","nofilter","multiple","onAfterChange","onAfterSelect","onBeforeChange","onBeforeMatch","onBeforeSelect","onSelectedChange","onInput","onChange","children","disabled","name","options","placeholder","readOnly","selected","type","innerRef","useRef","onSelected","useImperativeHandle","useEffect","self","handleChange","event","handleSelected","remove","textContent","prev","i","Fragment","Input","limit","Field"],"mappings":";;;;;;;;AAuCA,MAAMA,IAAW,CAChBC,MAEA,OAAOA,KAAM,WAAW,EAAE,OAAOA,GAAG,OAAOA,EAAA,IAAMA,GAErCC,KAA4BC,EAAiB,SAGzD;AAAA,EACC,aAAaC;AAAA,EACb,mBAAmBC;AAAA,EACnB,iBAAiBC;AAAA,EACjB,IAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAYC;AAAA,EACZ,GAAGC;AACJ,GACAC,GACC;AACD,QAAMC,IAAMd,KAAM,YACZe,IAAU,CAAC,CAACL,KAAU,CAAC,CAACF,GACxBQ,IAAaL,KAAqBP,GAClCa,IAAS;AAAA,IACd,aAAapB;AAAA,IACb,mBAAmBC;AAAA,IACnB,iBAAiBC;AAAA,IACjB,OAAOmB,EAAKC,EAAO,OAAOlB,CAAS;AAAA,IACnC,0BAA0B;AAAA,IAC1B,OAAAQ;AAAA,EAAA;AAID,SAAIT,MAAO,YAAY,CAACY,EAAK,YAC5B,OAAO,OAAOA,GAAM;AAAA,IAC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AClB,SACC,EAAE,cAAcM,GAAO,cAAcqE,GAAO,GAAG3D,EAAA,GAC/CC,GACC;AACD,WACC,gBAAAQ;AAAA,MAACM;AAAA,MAAA;AAAA,QACA,cAAW;AAAA,QACX,cAAY4C,KAASrE;AAAA,QACrB,KAAAW;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACD,GAEa4D,KAAQ,OAAO,OAAO7E,IAAW;AAAA,EAC7C,SAAS+B;AAAA;AAAA;AAAA;AAAA,EAIT,UAAUS;AAAA;AAAA,EACV,YAAYA;AAAA,EACZ,UAAUN;AAAA,EACV,QAAQI;AAAA,EACR,aAAaR;AAAA,EACb,OAAOF;AAAA,EACP,OAAOK;AACR,CAAC;"}
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../../designsystem/field/field.tsx"],"sourcesContent":["\"use client\";\nimport type { DSSuggestionElement } from \"@digdir/designsystemet-web\";\nimport type { Placement } from \"@floating-ui/dom\";\nimport clsx from \"clsx\";\nimport type { JSX } from \"react\";\nimport { forwardRef, useEffect, useImperativeHandle, useRef } from \"react\";\nimport { HelpText } from \"../helptext/helptext\";\nimport { Input, type InputProps } from \"../input/input\";\nimport type {\n\tCustomReactElementProps,\n\tPolymorphicComponentPropWithRef,\n\tPolymorphicRef,\n} from \"../react-types\";\nimport styles from \"../styles.module.css\";\nimport { toCustomElementProps } from \"../utils\";\nimport { Validation } from \"../validation/validation\";\n\ntype FieldBaseProps = {\n\t\"data-required\"?: \"hidden\";\n\tcount?: number;\n\tdescription?: React.ReactNode;\n\terror?: React.ReactNode; // Kept for backwards compatibility\n\thelpText?: React.ReactNode;\n\thelpTextLabel?: string;\n\tlabel?: React.ReactNode;\n\toptions?: string[] | FieldSuggestionSelected;\n\tprefix?: string;\n\treadOnly?: boolean; // Allow readoOnly also on <select>\n\tsuffix?: string;\n\tvalidation?: React.ReactNode;\n};\n\nexport type FieldProps<As extends React.ElementType = \"div\"> =\n\tPolymorphicComponentPropWithRef<As, FieldBaseProps>;\n\ntype FieldComponent = <As extends React.ElementType = \"div\">(\n\tprops: FieldProps<As>,\n) => JSX.Element;\n\nconst toOption = (\n\to: FieldSuggestionSelected[number] | string,\n): FieldSuggestionSelected[number] =>\n\ttypeof o === \"string\" ? { label: o, value: o } : o;\n\nexport const FieldComp: FieldComponent = forwardRef<null>(function Field<\n\tAs extends React.ElementType = \"div\",\n>(\n\t{\n\t\t\"data-size\": size,\n\t\t\"data-required\": dataRequired,\n\t\tas,\n\t\tclassName,\n\t\tcount,\n\t\tdescription,\n\t\terror,\n\t\thelpText,\n\t\thelpTextLabel,\n\t\tlabel,\n\t\tprefix,\n\t\tstyle,\n\t\tsuffix,\n\t\tvalidation: validationContent,\n\t\t...rest\n\t}: FieldProps<As>,\n\tref?: PolymorphicRef<As>,\n) {\n\tconst Tag = as || \"ds-field\";\n\tconst affixes = !!suffix || !!prefix;\n\tconst validation = validationContent || error; // error kept for backwards compatibility\n\tconst shared = {\n\t\t\"data-size\": size,\n\t\t\"data-required\": dataRequired,\n\t\tclass: clsx(styles.field, className),\n\t\tsuppressHydrationWarning: true,\n\t\tstyle,\n\t};\n\n\t// Render options if select\n\tif (as === \"select\" && !rest.children)\n\t\tObject.assign(rest, {\n\t\t\toptions: undefined, // Ensure options is not passed to DOM\n\t\t\tchildren: (\n\t\t\t\t<>\n\t\t\t\t\t{(rest.options as FieldBaseProps[\"options\"])\n\t\t\t\t\t\t?.map(toOption)\n\t\t\t\t\t\t.map(({ label, value }) => (\n\t\t\t\t\t\t\t<option key={value} value={value}>\n\t\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t\t</option>\n\t\t\t\t\t\t))}\n\t\t\t\t</>\n\t\t\t),\n\t\t});\n\n\t// Using suppressHydrationWarning to avoid Next.js vs field-observer.ts hydration conflict\n\treturn as ? (\n\t\t<ds-field {...shared}>\n\t\t\t{!!label && <FieldLabel>{label}</FieldLabel>}\n\t\t\t{!!helpText && <HelpText aria-label={helpTextLabel}>{helpText}</HelpText>}\n\t\t\t{!!description && <FieldDescription>{description}</FieldDescription>}\n\t\t\t{affixes ? (\n\t\t\t\t<FieldAffixes>\n\t\t\t\t\t{!!prefix && <span>{prefix}</span>}\n\t\t\t\t\t<Tag\n\t\t\t\t\t\tclassName={typeof as === \"string\" ? styles.input : undefined}\n\t\t\t\t\t\tsuppressHydrationWarning\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\t{...rest}\n\t\t\t\t\t/>\n\t\t\t\t\t{!!suffix && <span>{suffix}</span>}\n\t\t\t\t</FieldAffixes>\n\t\t\t) : (\n\t\t\t\t<Tag\n\t\t\t\t\tclassName={typeof as === \"string\" ? styles.input : undefined}\n\t\t\t\t\tsuppressHydrationWarning\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{!!validation && <Validation>{validation}</Validation>}\n\t\t\t{!!count && <FieldCount data-limit={count} />}\n\t\t</ds-field>\n\t) : (\n\t\t<ds-field ref={ref} {...shared} {...rest} />\n\t);\n}) as FieldComponent; // Needed to tell Typescript this does not return ReactNode but acutally JSX.Element\n\nexport type FieldAffixProps = React.ComponentPropsWithoutRef<\"div\">;\nconst FieldAffixes = forwardRef<HTMLDivElement, FieldAffixProps>(\n\tfunction FieldAffixes({ className, ...rest }, ref) {\n\t\treturn (\n\t\t\t<div className={clsx(styles.affixes, className)} ref={ref} {...rest} />\n\t\t);\n\t},\n);\n\nexport type FieldDatalistProps = React.ComponentPropsWithoutRef<\"datalist\"> & {\n\t\"data-nofilter\"?: boolean;\n\t/**\n\t * @deprecated Use `data-placement` instead.\n\t */\n\t\"data-position\"?: Placement;\n\t\"data-placement\"?: Placement;\n};\n\nconst FieldDatalist = forwardRef<HTMLDataListElement, FieldDatalistProps>(\n\tfunction FieldDatalist(\n\t\t{ \"data-position\": placement, \"data-nofilter\": filter, ...rest },\n\t\tref,\n\t) {\n\t\treturn (\n\t\t\t<u-datalist\n\t\t\t\tdata-placement={placement} // Backward compatibility\n\t\t\t\tdata-nofilter={!!filter || undefined} // Ensure data-nofilter is set correctly\n\t\t\t\tref={ref}\n\t\t\t\t{...toCustomElementProps(rest)}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport type FieldOptionProps = React.ComponentPropsWithoutRef<\"option\">;\nconst FieldOption = forwardRef<HTMLOptionElement, FieldOptionProps>(\n\tfunction FieldOption(props, ref) {\n\t\treturn <u-option ref={ref} {...toCustomElementProps(props)} />;\n\t},\n);\n\nexport type FieldComboboxSelected = FieldSuggestionSelected; // Backwards compatibility\nexport type FieldComboboxProps = FieldSuggestionProps; // Backwards compatibility\n\nexport type FieldSuggestionSelected = {\n\tlabel: string;\n\tvalue: string;\n\tchildren?: React.ReactNode;\n}[];\nexport type FieldSuggestionProps = Omit<\n\tCustomReactElementProps<DSSuggestionElement>,\n\t\"onChange\" | \"onInput\"\n> & {\n\t\"data-creatable\"?: boolean;\n\t\"data-multiple\"?: boolean;\n\t\"data-variant\"?: \"inside\";\n\tonAfterChange?: (e: CustomEvent<HTMLDataElement>) => void; // Backwards compatibility\n\tonAfterSelect?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonBeforeChange?: (e: CustomEvent<HTMLDataElement>) => void; // Backwards compatibility\n\tonBeforeMatch?: (e: CustomEvent<HTMLOptionElement>) => void; // Custom event to handle before change\n\tonBeforeSelect?: (e: CustomEvent<HTMLDataElement>) => void; // Custom event to handle before change\n\tonSelectedChange?: (selected: FieldSuggestionSelected) => void; // Allow onChange to be a function that returns void\n\toptions?: FieldSuggestionSelected;\n\tselected?: FieldSuggestionSelected; // Allow value to be a string or an array of strings for multiple select\n} & Pick<\n\t\tInputProps,\n\t\t| \"disabled\"\n\t\t| \"name\"\n\t\t| \"onChange\"\n\t\t| \"onInput\"\n\t\t| \"placeholder\"\n\t\t| \"readOnly\"\n\t\t| \"type\"\n\t\t| \"value\"\n\t> & // Allow input props to be passed down\n\tPick<\n\t\tFieldDatalistProps,\n\t\t\"data-position\" | \"data-placement\" | \"data-nofilter\"\n\t>; // Allow datalist props to be passed down\n\nconst FieldSuggestion = forwardRef<DSSuggestionElement, FieldSuggestionProps>(\n\tfunction FieldSuggestion(\n\t\t{\n\t\t\t\"aria-required\": required,\n\t\t\t\"data-position\": position,\n\t\t\t\"data-placement\": placement,\n\t\t\t\"data-nofilter\": nofilter,\n\t\t\t\"data-multiple\": multiple,\n\t\t\tonAfterChange, // Backwards compatibility\n\t\t\tonAfterSelect,\n\t\t\tonBeforeChange, // Backwards compatibility\n\t\t\tonBeforeMatch,\n\t\t\tonBeforeSelect,\n\t\t\tonSelectedChange,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\tchildren,\n\t\t\tdisabled,\n\t\t\tname,\n\t\t\toptions,\n\t\t\tplaceholder,\n\t\t\treadOnly,\n\t\t\tselected,\n\t\t\ttype,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) {\n\t\tconst innerRef = useRef<DSSuggestionElement>(null);\n\t\tconst onSelected = useRef(onSelectedChange);\n\t\tonSelected.current = onSelectedChange; // Sync the latest onSelectedChange function\n\n\t\t// Deprecated props\n\t\tif (onAfterChange) {\n\t\t\tonAfterSelect = onAfterChange;\n\t\t\twindow.dsWarnings === false ||\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`\\x1B[1m@mattilsynet/design - deprecation warning:\\x1B[m onAfterChange is deprecated, please use onAfterSelect instead`,\n\t\t\t\t);\n\t\t}\n\n\t\tif (onBeforeChange) {\n\t\t\tonBeforeSelect = onBeforeChange;\n\t\t\twindow.dsWarnings === false ||\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`\\x1B[1m@mattilsynet/design - deprecation warning:\\x1B[m onBeforeChange is deprecated, please use onBeforeSelect instead`,\n\t\t\t\t);\n\t\t}\n\n\t\t// Using useEffect for React 18 and lower compatibility\n\t\tuseImperativeHandle(ref, () => innerRef.current as DSSuggestionElement); // Forward innerRef\n\t\tuseEffect(() => {\n\t\t\tconst self = innerRef.current;\n\t\t\tconst handleChange = (event: CustomEvent<HTMLDataElement>) => {\n\t\t\t\tconst handleSelected = onSelected.current;\n\t\t\t\tif (!onSelected) return; // No onSelectedChange function provided, let ds-suggestion handle it\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst { isConnected: remove, textContent, value } = event.detail;\n\t\t\t\tconst label = textContent?.trim() || \"\";\n\t\t\t\tconst prev = selected || [];\n\n\t\t\t\tif (remove) handleSelected?.(prev.filter((i) => i.value !== value));\n\t\t\t\telse if (multiple) handleSelected?.([...prev, { value, label }]);\n\t\t\t\telse handleSelected?.([{ value, label }]);\n\t\t\t};\n\n\t\t\tself?.addEventListener(\"comboboxbeforeselect\", handleChange);\n\t\t\treturn () =>\n\t\t\t\tself?.removeEventListener(\"comboboxbeforeselect\", handleChange);\n\t\t}, [multiple, selected]);\n\n\t\treturn (\n\t\t\t<ds-suggestion\n\t\t\t\tdata-multiple={multiple || undefined}\n\t\t\t\t{...toCustomElementProps(\n\t\t\t\t\t{\n\t\t\t\t\t\toncomboboxbeforeselect: onBeforeSelect,\n\t\t\t\t\t\toncomboboxbeforematch: onBeforeMatch,\n\t\t\t\t\t\toncomboboxafterselect: onAfterSelect,\n\t\t\t\t\t\tref: innerRef,\n\t\t\t\t\t\t...props,\n\t\t\t\t\t},\n\t\t\t\t\tstyles.suggestion,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{selected?.map(({ children, label, value }) => (\n\t\t\t\t\t<data key={value} value={value} suppressHydrationWarning>\n\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t</data>\n\t\t\t\t))}\n\t\t\t\t{children || (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\taria-required={required}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\tname={name}\n\t\t\t\t\t\t\tonInput={onInput}\n\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\t\ttype={type}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<del aria-label=\"Fjern tekst\" suppressHydrationWarning />\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t{!!options && (\n\t\t\t\t\t<FieldDatalist\n\t\t\t\t\t\tdata-nofilter={nofilter}\n\t\t\t\t\t\tdata-placement={placement || position}\n\t\t\t\t\t>\n\t\t\t\t\t\t{options.map(toOption).map(({ children, label, value }) => (\n\t\t\t\t\t\t\t<FieldOption key={value} value={value} label={label}>\n\t\t\t\t\t\t\t\t{children ?? label}\n\t\t\t\t\t\t\t</FieldOption>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</FieldDatalist>\n\t\t\t\t)}\n\t\t\t</ds-suggestion>\n\t\t);\n\t},\n);\n\nexport type FieldLabelProps = React.ComponentPropsWithoutRef<\"label\">;\nconst FieldLabel = forwardRef<HTMLLabelElement, FieldLabelProps>(\n\tfunction FieldLabel(rest, ref) {\n\t\treturn <label suppressHydrationWarning ref={ref} {...rest} />;\n\t},\n);\n\nexport type FieldDescriptionProps = React.ComponentPropsWithoutRef<\"p\">;\nconst FieldDescription = forwardRef<\n\tHTMLParagraphElement,\n\tFieldDescriptionProps\n>(function FieldDescription(rest, ref) {\n\treturn (\n\t\t<div\n\t\t\tsuppressHydrationWarning\n\t\t\tdata-field=\"description\"\n\t\t\tref={ref}\n\t\t\t{...rest}\n\t\t/>\n\t);\n});\n\nexport type FieldCountProps = React.ComponentPropsWithoutRef<\"p\"> & {\n\t/**\n\t * @deprecated Use \"data-limit\" instead\n\t */\n\t\"data-count\"?: number;\n\t\"data-limit\": number;\n};\nconst FieldCount = forwardRef<HTMLParagraphElement, FieldCountProps>(\n\tfunction FieldCount(\n\t\t{ \"data-count\": count, \"data-limit\": limit, ...rest },\n\t\tref,\n\t) {\n\t\treturn (\n\t\t\t<Validation\n\t\t\t\tdata-field=\"counter\"\n\t\t\t\tdata-limit={limit || count}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport const Field = Object.assign(FieldComp, {\n\tAffixes: FieldAffixes,\n\t/**\n\t * @deprecated Use Field.Suggestion instead\n\t */\n\tCombobox: FieldSuggestion, // Backwards compatibility\n\tSuggestion: FieldSuggestion,\n\tDatalist: FieldDatalist,\n\tOption: FieldOption,\n\tDescription: FieldDescription,\n\tLabel: FieldLabel,\n\tCount: FieldCount,\n});\n"],"names":["toOption","o","FieldComp","forwardRef","size","dataRequired","as","className","count","description","error","helpText","helpTextLabel","label","prefix","style","suffix","validationContent","rest","ref","Tag","affixes","validation","shared","clsx","styles","value","jsx","jsxs","FieldLabel","HelpText","FieldDescription","FieldAffixes","Validation","FieldCount","FieldDatalist","placement","filter","toCustomElementProps","FieldOption","props","FieldSuggestion","required","position","nofilter","multiple","onAfterChange","onAfterSelect","onBeforeChange","onBeforeMatch","onBeforeSelect","onSelectedChange","onInput","onChange","children","disabled","name","options","placeholder","readOnly","selected","type","innerRef","useRef","onSelected","useImperativeHandle","useEffect","self","handleChange","event","handleSelected","remove","textContent","prev","i","Fragment","Input","limit","Field"],"mappings":";;;;;;;;AAuCA,MAAMA,IAAW,CAChBC,MAEA,OAAOA,KAAM,WAAW,EAAE,OAAOA,GAAG,OAAOA,EAAA,IAAMA,GAErCC,KAA4BC,EAAiB,SAGzD;AAAA,EACC,aAAaC;AAAA,EACb,iBAAiBC;AAAA,EACjB,IAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,YAAYC;AAAA,EACZ,GAAGC;AACJ,GACAC,GACC;AACD,QAAMC,IAAMd,KAAM,YACZe,IAAU,CAAC,CAACL,KAAU,CAAC,CAACF,GACxBQ,IAAaL,KAAqBP,GACl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