rk-designsystem 1.1.21 → 1.1.27
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/dist/componentlibrary.es.js +360 -349
- package/dist/componentlibrary.umd.js +4 -4
- package/dist/index.d.ts +23 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ye, { forwardRef as
|
|
2
|
-
import { Alert as
|
|
3
|
-
import { startOfMonth as F, isValid as ce, isSameMonth as me, startOfWeek as xe, format as
|
|
4
|
-
var
|
|
1
|
+
import ye, { forwardRef as W, useState as _e, useEffect as we, useMemo as se, useCallback as V, useRef as Ne } from "react";
|
|
2
|
+
import { Alert as Te, Avatar as Se, Badge as $e, BadgePosition as De, Breadcrumbs as Me, BreadcrumbsList as Ae, BreadcrumbsItem as Oe, BreadcrumbsLink as We, Button as ue, Card as Le, CardBlock as Be, Checkbox as Ie, Fieldset as Ce, useCheckboxGroup as Fe, Chip as Ye, Details as Ve, Dialog as He, Divider as ze, Dropdown as Ge, ErrorSummary as qe, FieldDescription as Ke, FieldCounter as Xe, Field as Je, Heading as Ue, Input as Qe, Label as Ze, Link as et, List as tt, Pagination as rt, usePagination as at, Paragraph as nt, Popover as ot, Radio as st, useRadioGroup as it, Search as lt, Select as ct, Skeleton as dt, SkipLink as ut, Spinner as mt, Switch as ft, Table as ht, Tabs as pt, Tag as bt, Textarea as vt, Textfield as gt, ToggleGroup as kt, Tooltip as yt } from "@digdir/designsystemet-react";
|
|
3
|
+
import { startOfMonth as F, isValid as ce, isSameMonth as me, startOfWeek as xe, format as X, addDays as Pe, subMonths as _t, addMonths as wt, isSameDay as Ct, isToday as xt, eachDayOfInterval as Pt } from "date-fns";
|
|
4
|
+
var ie = { exports: {} }, J = {};
|
|
5
5
|
/**
|
|
6
6
|
* @license React
|
|
7
7
|
* react-jsx-runtime.production.js
|
|
@@ -12,28 +12,28 @@ var se = { exports: {} }, X = {};
|
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
14
|
var fe;
|
|
15
|
-
function
|
|
16
|
-
if (fe) return
|
|
15
|
+
function Et() {
|
|
16
|
+
if (fe) return J;
|
|
17
17
|
fe = 1;
|
|
18
|
-
var e = Symbol.for("react.transitional.element"),
|
|
19
|
-
function
|
|
20
|
-
var
|
|
21
|
-
if (
|
|
22
|
-
|
|
18
|
+
var e = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
19
|
+
function a(o, s, u) {
|
|
20
|
+
var d = null;
|
|
21
|
+
if (u !== void 0 && (d = "" + u), s.key !== void 0 && (d = "" + s.key), "key" in s) {
|
|
22
|
+
u = {};
|
|
23
23
|
for (var m in s)
|
|
24
|
-
m !== "key" && (
|
|
25
|
-
} else
|
|
26
|
-
return s =
|
|
24
|
+
m !== "key" && (u[m] = s[m]);
|
|
25
|
+
} else u = s;
|
|
26
|
+
return s = u.ref, {
|
|
27
27
|
$$typeof: e,
|
|
28
28
|
type: o,
|
|
29
|
-
key:
|
|
29
|
+
key: d,
|
|
30
30
|
ref: s !== void 0 ? s : null,
|
|
31
|
-
props:
|
|
31
|
+
props: u
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return J.Fragment = r, J.jsx = a, J.jsxs = a, J;
|
|
35
35
|
}
|
|
36
|
-
var
|
|
36
|
+
var U = {};
|
|
37
37
|
/**
|
|
38
38
|
* @license React
|
|
39
39
|
* react-jsx-runtime.development.js
|
|
@@ -44,7 +44,7 @@ var J = {};
|
|
|
44
44
|
* LICENSE file in the root directory of this source tree.
|
|
45
45
|
*/
|
|
46
46
|
var he;
|
|
47
|
-
function
|
|
47
|
+
function jt() {
|
|
48
48
|
return he || (he = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
49
49
|
function e(t) {
|
|
50
50
|
if (t == null) return null;
|
|
@@ -54,13 +54,13 @@ function xt() {
|
|
|
54
54
|
switch (t) {
|
|
55
55
|
case S:
|
|
56
56
|
return "Fragment";
|
|
57
|
-
case
|
|
57
|
+
case N:
|
|
58
58
|
return "Profiler";
|
|
59
59
|
case i:
|
|
60
60
|
return "StrictMode";
|
|
61
|
-
case
|
|
61
|
+
case L:
|
|
62
62
|
return "Suspense";
|
|
63
|
-
case
|
|
63
|
+
case ee:
|
|
64
64
|
return "SuspenseList";
|
|
65
65
|
case le:
|
|
66
66
|
return "Activity";
|
|
@@ -69,18 +69,18 @@ function xt() {
|
|
|
69
69
|
switch (typeof t.tag == "number" && console.error(
|
|
70
70
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
71
71
|
), t.$$typeof) {
|
|
72
|
-
case
|
|
72
|
+
case H:
|
|
73
73
|
return "Portal";
|
|
74
74
|
case $:
|
|
75
75
|
return (t.displayName || "Context") + ".Provider";
|
|
76
76
|
case P:
|
|
77
77
|
return (t._context.displayName || "Context") + ".Consumer";
|
|
78
|
-
case
|
|
78
|
+
case z:
|
|
79
79
|
var n = t.render;
|
|
80
80
|
return t = t.displayName, t || (t = n.displayName || n.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
81
|
-
case
|
|
81
|
+
case G:
|
|
82
82
|
return n = t.displayName || null, n !== null ? n : e(t.type) || "Memo";
|
|
83
|
-
case
|
|
83
|
+
case T:
|
|
84
84
|
n = t._payload, t = t._init;
|
|
85
85
|
try {
|
|
86
86
|
return e(t(n));
|
|
@@ -89,12 +89,12 @@ function xt() {
|
|
|
89
89
|
}
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function r(t) {
|
|
93
93
|
return "" + t;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function a(t) {
|
|
96
96
|
try {
|
|
97
|
-
|
|
97
|
+
r(t);
|
|
98
98
|
var n = !1;
|
|
99
99
|
} catch {
|
|
100
100
|
n = !0;
|
|
@@ -106,12 +106,12 @@ function xt() {
|
|
|
106
106
|
n,
|
|
107
107
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
108
108
|
f
|
|
109
|
-
),
|
|
109
|
+
), r(t);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
function o(t) {
|
|
113
113
|
if (t === S) return "<>";
|
|
114
|
-
if (typeof t == "object" && t !== null && t.$$typeof ===
|
|
114
|
+
if (typeof t == "object" && t !== null && t.$$typeof === T)
|
|
115
115
|
return "<...>";
|
|
116
116
|
try {
|
|
117
117
|
var n = e(t);
|
|
@@ -124,10 +124,10 @@ function xt() {
|
|
|
124
124
|
var t = g.A;
|
|
125
125
|
return t === null ? null : t.getOwner();
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function u() {
|
|
128
128
|
return Error("react-stack-top-frame");
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function d(t) {
|
|
131
131
|
if (D.call(t, "key")) {
|
|
132
132
|
var n = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
133
133
|
if (n && n.isReactWarning) return !1;
|
|
@@ -136,7 +136,7 @@ function xt() {
|
|
|
136
136
|
}
|
|
137
137
|
function m(t, n) {
|
|
138
138
|
function c() {
|
|
139
|
-
|
|
139
|
+
te || (te = !0, console.error(
|
|
140
140
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
141
141
|
n
|
|
142
142
|
));
|
|
@@ -148,11 +148,11 @@ function xt() {
|
|
|
148
148
|
}
|
|
149
149
|
function y() {
|
|
150
150
|
var t = e(this.type);
|
|
151
|
-
return
|
|
151
|
+
return re[t] || (re[t] = !0, console.error(
|
|
152
152
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
153
153
|
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
154
154
|
}
|
|
155
|
-
function _(t, n, c, f, h, b, A,
|
|
155
|
+
function _(t, n, c, f, h, b, A, q) {
|
|
156
156
|
return c = b.ref, t = {
|
|
157
157
|
$$typeof: C,
|
|
158
158
|
type: t,
|
|
@@ -181,10 +181,10 @@ function xt() {
|
|
|
181
181
|
configurable: !1,
|
|
182
182
|
enumerable: !1,
|
|
183
183
|
writable: !0,
|
|
184
|
-
value:
|
|
184
|
+
value: q
|
|
185
185
|
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
186
186
|
}
|
|
187
|
-
function w(t, n, c, f, h, b, A,
|
|
187
|
+
function w(t, n, c, f, h, b, A, q) {
|
|
188
188
|
var p = n.children;
|
|
189
189
|
if (p !== void 0)
|
|
190
190
|
if (f)
|
|
@@ -199,10 +199,10 @@ function xt() {
|
|
|
199
199
|
else v(p);
|
|
200
200
|
if (D.call(n, "key")) {
|
|
201
201
|
p = e(t);
|
|
202
|
-
var E = Object.keys(n).filter(function(
|
|
203
|
-
return
|
|
202
|
+
var E = Object.keys(n).filter(function(j) {
|
|
203
|
+
return j !== "key";
|
|
204
204
|
});
|
|
205
|
-
f = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
205
|
+
f = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", oe[p + f] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
206
|
`A props object containing a "key" prop is being spread into JSX:
|
|
207
207
|
let props = %s;
|
|
208
208
|
<%s {...props} />
|
|
@@ -213,9 +213,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
213
213
|
p,
|
|
214
214
|
E,
|
|
215
215
|
p
|
|
216
|
-
),
|
|
216
|
+
), oe[p + f] = !0);
|
|
217
217
|
}
|
|
218
|
-
if (p = null, c !== void 0 && (
|
|
218
|
+
if (p = null, c !== void 0 && (a(c), p = "" + c), d(n) && (a(n.key), p = "" + n.key), "key" in n) {
|
|
219
219
|
c = {};
|
|
220
220
|
for (var x in n)
|
|
221
221
|
x !== "key" && (c[x] = n[x]);
|
|
@@ -231,25 +231,25 @@ React keys must be passed directly to JSX without using spread:
|
|
|
231
231
|
s(),
|
|
232
232
|
c,
|
|
233
233
|
A,
|
|
234
|
-
|
|
234
|
+
q
|
|
235
235
|
);
|
|
236
236
|
}
|
|
237
237
|
function v(t) {
|
|
238
238
|
typeof t == "object" && t !== null && t.$$typeof === C && t._store && (t._store.validated = 1);
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var R = ye, C = Symbol.for("react.transitional.element"), H = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), N = Symbol.for("react.profiler"), P = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), z = Symbol.for("react.forward_ref"), L = Symbol.for("react.suspense"), ee = Symbol.for("react.suspense_list"), G = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), B = Symbol.for("react.client.reference"), g = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, D = Object.prototype.hasOwnProperty, M = Array.isArray, I = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
|
-
|
|
243
|
+
R = {
|
|
244
244
|
react_stack_bottom_frame: function(t) {
|
|
245
245
|
return t();
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
|
-
var
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
)(),
|
|
252
|
-
|
|
248
|
+
var te, re = {}, ae = R.react_stack_bottom_frame.bind(
|
|
249
|
+
R,
|
|
250
|
+
u
|
|
251
|
+
)(), ne = I(o(u)), oe = {};
|
|
252
|
+
U.Fragment = S, U.jsx = function(t, n, c, f, h) {
|
|
253
253
|
var b = 1e4 > g.recentlyCreatedOwnerStacks++;
|
|
254
254
|
return w(
|
|
255
255
|
t,
|
|
@@ -258,10 +258,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
258
258
|
!1,
|
|
259
259
|
f,
|
|
260
260
|
h,
|
|
261
|
-
b ? Error("react-stack-top-frame") :
|
|
262
|
-
b ? I(o(t)) :
|
|
261
|
+
b ? Error("react-stack-top-frame") : ae,
|
|
262
|
+
b ? I(o(t)) : ne
|
|
263
263
|
);
|
|
264
|
-
},
|
|
264
|
+
}, U.jsxs = function(t, n, c, f, h) {
|
|
265
265
|
var b = 1e4 > g.recentlyCreatedOwnerStacks++;
|
|
266
266
|
return w(
|
|
267
267
|
t,
|
|
@@ -270,93 +270,93 @@ React keys must be passed directly to JSX without using spread:
|
|
|
270
270
|
!0,
|
|
271
271
|
f,
|
|
272
272
|
h,
|
|
273
|
-
b ? Error("react-stack-top-frame") :
|
|
274
|
-
b ? I(o(t)) :
|
|
273
|
+
b ? Error("react-stack-top-frame") : ae,
|
|
274
|
+
b ? I(o(t)) : ne
|
|
275
275
|
);
|
|
276
276
|
};
|
|
277
|
-
})()),
|
|
277
|
+
})()), U;
|
|
278
278
|
}
|
|
279
279
|
var pe;
|
|
280
|
-
function
|
|
281
|
-
return pe || (pe = 1, process.env.NODE_ENV === "production" ?
|
|
280
|
+
function Rt() {
|
|
281
|
+
return pe || (pe = 1, process.env.NODE_ENV === "production" ? ie.exports = Et() : ie.exports = jt()), ie.exports;
|
|
282
282
|
}
|
|
283
|
-
var l =
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
function
|
|
299
|
-
return (
|
|
300
|
-
const
|
|
301
|
-
return e.formats[
|
|
283
|
+
var l = Rt();
|
|
284
|
+
const Nt = W((e, r) => /* @__PURE__ */ l.jsx(Te, { ref: r, ...e }));
|
|
285
|
+
Nt.displayName = "Alert";
|
|
286
|
+
const Tt = W((e, r) => /* @__PURE__ */ l.jsx(Se, { ref: r, ...e }));
|
|
287
|
+
Tt.displayName = "Avatar";
|
|
288
|
+
const St = W((e, r) => /* @__PURE__ */ l.jsx($e, { ref: r, ...e }));
|
|
289
|
+
St.displayName = "Badge";
|
|
290
|
+
const Fr = De, Yr = Me, Vr = Ae, Hr = Oe, zr = We, $t = ue;
|
|
291
|
+
$t.displayName = "Button";
|
|
292
|
+
const Dt = Le, Gr = Be;
|
|
293
|
+
Dt.displayName = "Card";
|
|
294
|
+
const Mt = Ie, At = Ce, qr = Fe;
|
|
295
|
+
Mt.displayName = "Checkbox";
|
|
296
|
+
At.displayName = "Fieldset";
|
|
297
|
+
const Kr = Ye;
|
|
298
|
+
function de(e) {
|
|
299
|
+
return (r = {}) => {
|
|
300
|
+
const a = r.width ? String(r.width) : e.defaultWidth;
|
|
301
|
+
return e.formats[a] || e.formats[e.defaultWidth];
|
|
302
302
|
};
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
return (
|
|
306
|
-
const o =
|
|
304
|
+
function Q(e) {
|
|
305
|
+
return (r, a) => {
|
|
306
|
+
const o = a != null && a.context ? String(a.context) : "standalone";
|
|
307
307
|
let s;
|
|
308
308
|
if (o === "formatting" && e.formattingValues) {
|
|
309
|
-
const
|
|
310
|
-
s = e.formattingValues[m] || e.formattingValues[
|
|
309
|
+
const d = e.defaultFormattingWidth || e.defaultWidth, m = a != null && a.width ? String(a.width) : d;
|
|
310
|
+
s = e.formattingValues[m] || e.formattingValues[d];
|
|
311
311
|
} else {
|
|
312
|
-
const
|
|
313
|
-
s = e.values[m] || e.values[
|
|
312
|
+
const d = e.defaultWidth, m = a != null && a.width ? String(a.width) : e.defaultWidth;
|
|
313
|
+
s = e.values[m] || e.values[d];
|
|
314
314
|
}
|
|
315
|
-
const
|
|
316
|
-
return s[
|
|
315
|
+
const u = e.argumentCallback ? e.argumentCallback(r) : r;
|
|
316
|
+
return s[u];
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
return (
|
|
321
|
-
const o =
|
|
322
|
-
if (!
|
|
319
|
+
function Z(e) {
|
|
320
|
+
return (r, a = {}) => {
|
|
321
|
+
const o = a.width, s = o && e.matchPatterns[o] || e.matchPatterns[e.defaultMatchWidth], u = r.match(s);
|
|
322
|
+
if (!u)
|
|
323
323
|
return null;
|
|
324
|
-
const
|
|
324
|
+
const d = u[0], m = o && e.parsePatterns[o] || e.parsePatterns[e.defaultParseWidth], y = Array.isArray(m) ? Wt(m, (v) => v.test(d)) : (
|
|
325
325
|
// [TODO] -- I challenge you to fix the type
|
|
326
|
-
|
|
326
|
+
Ot(m, (v) => v.test(d))
|
|
327
327
|
);
|
|
328
328
|
let _;
|
|
329
|
-
_ = e.valueCallback ? e.valueCallback(y) : y, _ =
|
|
329
|
+
_ = e.valueCallback ? e.valueCallback(y) : y, _ = a.valueCallback ? (
|
|
330
330
|
// [TODO] -- I challenge you to fix the type
|
|
331
|
-
|
|
331
|
+
a.valueCallback(_)
|
|
332
332
|
) : _;
|
|
333
|
-
const w =
|
|
333
|
+
const w = r.slice(d.length);
|
|
334
334
|
return { value: _, rest: w };
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
for (const
|
|
339
|
-
if (Object.prototype.hasOwnProperty.call(e,
|
|
340
|
-
return
|
|
337
|
+
function Ot(e, r) {
|
|
338
|
+
for (const a in e)
|
|
339
|
+
if (Object.prototype.hasOwnProperty.call(e, a) && r(e[a]))
|
|
340
|
+
return a;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
for (let
|
|
344
|
-
if (
|
|
345
|
-
return
|
|
342
|
+
function Wt(e, r) {
|
|
343
|
+
for (let a = 0; a < e.length; a++)
|
|
344
|
+
if (r(e[a]))
|
|
345
|
+
return a;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
return (
|
|
349
|
-
const o =
|
|
347
|
+
function Lt(e) {
|
|
348
|
+
return (r, a = {}) => {
|
|
349
|
+
const o = r.match(e.matchPattern);
|
|
350
350
|
if (!o) return null;
|
|
351
|
-
const s = o[0],
|
|
352
|
-
if (!
|
|
353
|
-
let
|
|
354
|
-
|
|
355
|
-
const m =
|
|
356
|
-
return { value:
|
|
351
|
+
const s = o[0], u = r.match(e.parsePattern);
|
|
352
|
+
if (!u) return null;
|
|
353
|
+
let d = e.valueCallback ? e.valueCallback(u[0]) : u[0];
|
|
354
|
+
d = a.valueCallback ? a.valueCallback(d) : d;
|
|
355
|
+
const m = r.slice(s.length);
|
|
356
|
+
return { value: d, rest: m };
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
|
-
const
|
|
359
|
+
const Bt = {
|
|
360
360
|
lessThanXSeconds: {
|
|
361
361
|
one: "mindre enn ett sekund",
|
|
362
362
|
other: "mindre enn {{count}} sekunder"
|
|
@@ -418,54 +418,54 @@ const Ot = {
|
|
|
418
418
|
one: "nesten ett år",
|
|
419
419
|
other: "nesten {{count}} år"
|
|
420
420
|
}
|
|
421
|
-
},
|
|
421
|
+
}, It = (e, r, a) => {
|
|
422
422
|
let o;
|
|
423
|
-
const s =
|
|
424
|
-
return typeof s == "string" ? o = s :
|
|
425
|
-
},
|
|
423
|
+
const s = Bt[e];
|
|
424
|
+
return typeof s == "string" ? o = s : r === 1 ? o = s.one : o = s.other.replace("{{count}}", String(r)), a != null && a.addSuffix ? a.comparison && a.comparison > 0 ? "om " + o : o + " siden" : o;
|
|
425
|
+
}, Ft = {
|
|
426
426
|
full: "EEEE d. MMMM y",
|
|
427
427
|
long: "d. MMMM y",
|
|
428
428
|
medium: "d. MMM y",
|
|
429
429
|
short: "dd.MM.y"
|
|
430
|
-
},
|
|
430
|
+
}, Yt = {
|
|
431
431
|
full: "'kl'. HH:mm:ss zzzz",
|
|
432
432
|
long: "HH:mm:ss z",
|
|
433
433
|
medium: "HH:mm:ss",
|
|
434
434
|
short: "HH:mm"
|
|
435
|
-
},
|
|
435
|
+
}, Vt = {
|
|
436
436
|
full: "{{date}} 'kl.' {{time}}",
|
|
437
437
|
long: "{{date}} 'kl.' {{time}}",
|
|
438
438
|
medium: "{{date}} {{time}}",
|
|
439
439
|
short: "{{date}} {{time}}"
|
|
440
|
-
},
|
|
441
|
-
date:
|
|
442
|
-
formats:
|
|
440
|
+
}, Ht = {
|
|
441
|
+
date: de({
|
|
442
|
+
formats: Ft,
|
|
443
443
|
defaultWidth: "full"
|
|
444
444
|
}),
|
|
445
|
-
time:
|
|
446
|
-
formats:
|
|
445
|
+
time: de({
|
|
446
|
+
formats: Yt,
|
|
447
447
|
defaultWidth: "full"
|
|
448
448
|
}),
|
|
449
|
-
dateTime:
|
|
450
|
-
formats:
|
|
449
|
+
dateTime: de({
|
|
450
|
+
formats: Vt,
|
|
451
451
|
defaultWidth: "full"
|
|
452
452
|
})
|
|
453
|
-
},
|
|
453
|
+
}, zt = {
|
|
454
454
|
lastWeek: "'forrige' eeee 'kl.' p",
|
|
455
455
|
yesterday: "'i går kl.' p",
|
|
456
456
|
today: "'i dag kl.' p",
|
|
457
457
|
tomorrow: "'i morgen kl.' p",
|
|
458
458
|
nextWeek: "EEEE 'kl.' p",
|
|
459
459
|
other: "P"
|
|
460
|
-
},
|
|
460
|
+
}, Gt = (e, r, a, o) => zt[e], qt = {
|
|
461
461
|
narrow: ["f.Kr.", "e.Kr."],
|
|
462
462
|
abbreviated: ["f.Kr.", "e.Kr."],
|
|
463
463
|
wide: ["før Kristus", "etter Kristus"]
|
|
464
|
-
},
|
|
464
|
+
}, Kt = {
|
|
465
465
|
narrow: ["1", "2", "3", "4"],
|
|
466
466
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
467
467
|
wide: ["1. kvartal", "2. kvartal", "3. kvartal", "4. kvartal"]
|
|
468
|
-
},
|
|
468
|
+
}, Xt = {
|
|
469
469
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
470
470
|
abbreviated: [
|
|
471
471
|
"jan.",
|
|
@@ -495,7 +495,7 @@ const Ot = {
|
|
|
495
495
|
"november",
|
|
496
496
|
"desember"
|
|
497
497
|
]
|
|
498
|
-
},
|
|
498
|
+
}, Jt = {
|
|
499
499
|
narrow: ["S", "M", "T", "O", "T", "F", "L"],
|
|
500
500
|
short: ["sø", "ma", "ti", "on", "to", "fr", "lø"],
|
|
501
501
|
abbreviated: ["søn", "man", "tir", "ons", "tor", "fre", "lør"],
|
|
@@ -508,7 +508,7 @@ const Ot = {
|
|
|
508
508
|
"fredag",
|
|
509
509
|
"lørdag"
|
|
510
510
|
]
|
|
511
|
-
},
|
|
511
|
+
}, Ut = {
|
|
512
512
|
narrow: {
|
|
513
513
|
am: "a",
|
|
514
514
|
pm: "p",
|
|
@@ -539,46 +539,46 @@ const Ot = {
|
|
|
539
539
|
evening: "på kvelden",
|
|
540
540
|
night: "på natten"
|
|
541
541
|
}
|
|
542
|
-
},
|
|
543
|
-
ordinalNumber:
|
|
544
|
-
era:
|
|
545
|
-
values:
|
|
542
|
+
}, Qt = (e, r) => Number(e) + ".", Zt = {
|
|
543
|
+
ordinalNumber: Qt,
|
|
544
|
+
era: Q({
|
|
545
|
+
values: qt,
|
|
546
546
|
defaultWidth: "wide"
|
|
547
547
|
}),
|
|
548
|
-
quarter:
|
|
549
|
-
values:
|
|
548
|
+
quarter: Q({
|
|
549
|
+
values: Kt,
|
|
550
550
|
defaultWidth: "wide",
|
|
551
551
|
argumentCallback: (e) => e - 1
|
|
552
552
|
}),
|
|
553
|
-
month:
|
|
554
|
-
values:
|
|
553
|
+
month: Q({
|
|
554
|
+
values: Xt,
|
|
555
555
|
defaultWidth: "wide"
|
|
556
556
|
}),
|
|
557
|
-
day:
|
|
558
|
-
values:
|
|
557
|
+
day: Q({
|
|
558
|
+
values: Jt,
|
|
559
559
|
defaultWidth: "wide"
|
|
560
560
|
}),
|
|
561
|
-
dayPeriod:
|
|
562
|
-
values:
|
|
561
|
+
dayPeriod: Q({
|
|
562
|
+
values: Ut,
|
|
563
563
|
defaultWidth: "wide"
|
|
564
564
|
})
|
|
565
|
-
},
|
|
565
|
+
}, er = /^(\d+)\.?/i, tr = /\d+/i, rr = {
|
|
566
566
|
narrow: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
|
|
567
567
|
abbreviated: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
|
|
568
568
|
wide: /^(før Kristus|før vår tid|etter Kristus|vår tid)/i
|
|
569
|
-
},
|
|
569
|
+
}, ar = {
|
|
570
570
|
any: [/^f/i, /^e/i]
|
|
571
|
-
},
|
|
571
|
+
}, nr = {
|
|
572
572
|
narrow: /^[1234]/i,
|
|
573
573
|
abbreviated: /^q[1234]/i,
|
|
574
574
|
wide: /^[1234](\.)? kvartal/i
|
|
575
|
-
},
|
|
575
|
+
}, or = {
|
|
576
576
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
577
|
-
},
|
|
577
|
+
}, sr = {
|
|
578
578
|
narrow: /^[jfmasond]/i,
|
|
579
579
|
abbreviated: /^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,
|
|
580
580
|
wide: /^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i
|
|
581
|
-
},
|
|
581
|
+
}, ir = {
|
|
582
582
|
narrow: [
|
|
583
583
|
/^j/i,
|
|
584
584
|
/^f/i,
|
|
@@ -607,17 +607,17 @@ const Ot = {
|
|
|
607
607
|
/^n/i,
|
|
608
608
|
/^d/i
|
|
609
609
|
]
|
|
610
|
-
},
|
|
610
|
+
}, lr = {
|
|
611
611
|
narrow: /^[smtofl]/i,
|
|
612
612
|
short: /^(sø|ma|ti|on|to|fr|lø)/i,
|
|
613
613
|
abbreviated: /^(søn|man|tir|ons|tor|fre|lør)/i,
|
|
614
614
|
wide: /^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i
|
|
615
|
-
},
|
|
615
|
+
}, cr = {
|
|
616
616
|
any: [/^s/i, /^m/i, /^ti/i, /^o/i, /^to/i, /^f/i, /^l/i]
|
|
617
|
-
},
|
|
617
|
+
}, dr = {
|
|
618
618
|
narrow: /^(midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten)|[ap])/i,
|
|
619
619
|
any: /^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten))/i
|
|
620
|
-
},
|
|
620
|
+
}, ur = {
|
|
621
621
|
any: {
|
|
622
622
|
am: /^a(\.?\s?m\.?)?$/i,
|
|
623
623
|
pm: /^p(\.?\s?m\.?)?$/i,
|
|
@@ -628,55 +628,55 @@ const Ot = {
|
|
|
628
628
|
evening: /kveld/i,
|
|
629
629
|
night: /natt/i
|
|
630
630
|
}
|
|
631
|
-
},
|
|
632
|
-
ordinalNumber:
|
|
633
|
-
matchPattern:
|
|
634
|
-
parsePattern:
|
|
631
|
+
}, mr = {
|
|
632
|
+
ordinalNumber: Lt({
|
|
633
|
+
matchPattern: er,
|
|
634
|
+
parsePattern: tr,
|
|
635
635
|
valueCallback: (e) => parseInt(e, 10)
|
|
636
636
|
}),
|
|
637
|
-
era:
|
|
638
|
-
matchPatterns:
|
|
637
|
+
era: Z({
|
|
638
|
+
matchPatterns: rr,
|
|
639
639
|
defaultMatchWidth: "wide",
|
|
640
|
-
parsePatterns:
|
|
640
|
+
parsePatterns: ar,
|
|
641
641
|
defaultParseWidth: "any"
|
|
642
642
|
}),
|
|
643
|
-
quarter:
|
|
644
|
-
matchPatterns:
|
|
643
|
+
quarter: Z({
|
|
644
|
+
matchPatterns: nr,
|
|
645
645
|
defaultMatchWidth: "wide",
|
|
646
|
-
parsePatterns:
|
|
646
|
+
parsePatterns: or,
|
|
647
647
|
defaultParseWidth: "any",
|
|
648
648
|
valueCallback: (e) => e + 1
|
|
649
649
|
}),
|
|
650
|
-
month:
|
|
651
|
-
matchPatterns:
|
|
650
|
+
month: Z({
|
|
651
|
+
matchPatterns: sr,
|
|
652
652
|
defaultMatchWidth: "wide",
|
|
653
|
-
parsePatterns:
|
|
653
|
+
parsePatterns: ir,
|
|
654
654
|
defaultParseWidth: "any"
|
|
655
655
|
}),
|
|
656
|
-
day:
|
|
657
|
-
matchPatterns:
|
|
656
|
+
day: Z({
|
|
657
|
+
matchPatterns: lr,
|
|
658
658
|
defaultMatchWidth: "wide",
|
|
659
|
-
parsePatterns:
|
|
659
|
+
parsePatterns: cr,
|
|
660
660
|
defaultParseWidth: "any"
|
|
661
661
|
}),
|
|
662
|
-
dayPeriod:
|
|
663
|
-
matchPatterns:
|
|
662
|
+
dayPeriod: Z({
|
|
663
|
+
matchPatterns: dr,
|
|
664
664
|
defaultMatchWidth: "any",
|
|
665
|
-
parsePatterns:
|
|
665
|
+
parsePatterns: ur,
|
|
666
666
|
defaultParseWidth: "any"
|
|
667
667
|
})
|
|
668
|
-
},
|
|
668
|
+
}, Y = {
|
|
669
669
|
code: "nb",
|
|
670
|
-
formatDistance:
|
|
671
|
-
formatLong:
|
|
672
|
-
formatRelative:
|
|
673
|
-
localize:
|
|
674
|
-
match:
|
|
670
|
+
formatDistance: It,
|
|
671
|
+
formatLong: Ht,
|
|
672
|
+
formatRelative: Gt,
|
|
673
|
+
localize: Zt,
|
|
674
|
+
match: mr,
|
|
675
675
|
options: {
|
|
676
676
|
weekStartsOn: 1,
|
|
677
677
|
firstWeekContainsDate: 4
|
|
678
678
|
}
|
|
679
|
-
}, Ee = ({ title: e, ...
|
|
679
|
+
}, Ee = ({ title: e, ...r }) => /* @__PURE__ */ l.jsxs(
|
|
680
680
|
"svg",
|
|
681
681
|
{
|
|
682
682
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -686,7 +686,7 @@ const Ot = {
|
|
|
686
686
|
fill: "none",
|
|
687
687
|
"aria-hidden": e ? void 0 : !0,
|
|
688
688
|
focusable: "false",
|
|
689
|
-
...
|
|
689
|
+
...r,
|
|
690
690
|
children: [
|
|
691
691
|
e && /* @__PURE__ */ l.jsx("title", { children: e }),
|
|
692
692
|
/* @__PURE__ */ l.jsx(
|
|
@@ -702,7 +702,7 @@ const Ot = {
|
|
|
702
702
|
}
|
|
703
703
|
);
|
|
704
704
|
Ee.displayName = "ChevronLeftIcon";
|
|
705
|
-
const
|
|
705
|
+
const je = ({ title: e, ...r }) => /* @__PURE__ */ l.jsxs(
|
|
706
706
|
"svg",
|
|
707
707
|
{
|
|
708
708
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -712,7 +712,7 @@ const Re = ({ title: e, ...a }) => /* @__PURE__ */ l.jsxs(
|
|
|
712
712
|
fill: "none",
|
|
713
713
|
"aria-hidden": e ? void 0 : !0,
|
|
714
714
|
focusable: "false",
|
|
715
|
-
...
|
|
715
|
+
...r,
|
|
716
716
|
children: [
|
|
717
717
|
e && /* @__PURE__ */ l.jsx("title", { children: e }),
|
|
718
718
|
/* @__PURE__ */ l.jsx(
|
|
@@ -727,93 +727,93 @@ const Re = ({ title: e, ...a }) => /* @__PURE__ */ l.jsxs(
|
|
|
727
727
|
]
|
|
728
728
|
}
|
|
729
729
|
);
|
|
730
|
-
|
|
731
|
-
const
|
|
732
|
-
calendarContainer:
|
|
733
|
-
calendarHeader:
|
|
734
|
-
monthYear:
|
|
735
|
-
navigationButtons:
|
|
736
|
-
grid:
|
|
737
|
-
dayNameCell:
|
|
738
|
-
dateCell:
|
|
739
|
-
dateNumberContainer:
|
|
740
|
-
otherMonth:
|
|
741
|
-
selectedDate:
|
|
742
|
-
},
|
|
743
|
-
const
|
|
744
|
-
return
|
|
745
|
-
}, be = (e) => e && e.charAt(0).toUpperCase() + e.slice(1),
|
|
730
|
+
je.displayName = "ChevronRightIcon";
|
|
731
|
+
const fr = "_calendarContainer_160wn_3", hr = "_calendarHeader_160wn_17", pr = "_monthYear_160wn_24", br = "_navigationButtons_160wn_36", vr = "_grid_160wn_45", gr = "_dayNameCell_160wn_53", kr = "_dateCell_160wn_72", yr = "_dateNumberContainer_160wn_107", _r = "_otherMonth_160wn_125", wr = "_selectedDate_160wn_157", k = {
|
|
732
|
+
calendarContainer: fr,
|
|
733
|
+
calendarHeader: hr,
|
|
734
|
+
monthYear: pr,
|
|
735
|
+
navigationButtons: br,
|
|
736
|
+
grid: vr,
|
|
737
|
+
dayNameCell: gr,
|
|
738
|
+
dateCell: kr,
|
|
739
|
+
dateNumberContainer: yr,
|
|
740
|
+
otherMonth: _r,
|
|
741
|
+
selectedDate: wr
|
|
742
|
+
}, Cr = (e) => {
|
|
743
|
+
const r = F(e), a = xe(r, { locale: Y }), o = Pe(a, 41);
|
|
744
|
+
return Pt({ start: a, end: o });
|
|
745
|
+
}, be = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), xr = ({
|
|
746
746
|
initialDate: e = /* @__PURE__ */ new Date(),
|
|
747
|
-
selectedDate:
|
|
747
|
+
selectedDate: r = null,
|
|
748
748
|
// Prop for selected date
|
|
749
|
-
onDateSelect:
|
|
749
|
+
onDateSelect: a
|
|
750
750
|
}) => {
|
|
751
751
|
const [o, s] = _e(
|
|
752
752
|
// Initialize with selectedDate's month if valid, otherwise initialDate's month
|
|
753
|
-
F(
|
|
753
|
+
F(r && ce(r) ? r : e)
|
|
754
754
|
);
|
|
755
755
|
we(() => {
|
|
756
|
-
if (
|
|
757
|
-
const i = F(
|
|
756
|
+
if (r && ce(r)) {
|
|
757
|
+
const i = F(r);
|
|
758
758
|
me(i, o) || s(i);
|
|
759
759
|
}
|
|
760
|
-
}, [
|
|
761
|
-
const
|
|
762
|
-
() =>
|
|
760
|
+
}, [r]);
|
|
761
|
+
const u = se(() => F(/* @__PURE__ */ new Date()), []), d = se(() => !1, [o, u]), m = se(
|
|
762
|
+
() => Cr(o),
|
|
763
763
|
[o]
|
|
764
|
-
), y =
|
|
765
|
-
const i = xe(/* @__PURE__ */ new Date(), { locale:
|
|
766
|
-
return Array.from({ length: 7 }).map((
|
|
767
|
-
const $ =
|
|
764
|
+
), y = se(() => {
|
|
765
|
+
const i = xe(/* @__PURE__ */ new Date(), { locale: Y });
|
|
766
|
+
return Array.from({ length: 7 }).map((N, P) => {
|
|
767
|
+
const $ = X(Pe(i, P), "EEEEEE", { locale: Y });
|
|
768
768
|
return be($);
|
|
769
769
|
});
|
|
770
|
-
}, []), _ =
|
|
771
|
-
|
|
772
|
-
}, [
|
|
773
|
-
s((i) => F(
|
|
774
|
-
}, []), v =
|
|
770
|
+
}, []), _ = V(() => {
|
|
771
|
+
d || s((i) => F(_t(i, 1)));
|
|
772
|
+
}, [d]), w = V(() => {
|
|
773
|
+
s((i) => F(wt(i, 1)));
|
|
774
|
+
}, []), v = V(
|
|
775
775
|
(i) => {
|
|
776
|
-
|
|
776
|
+
a && a(i);
|
|
777
777
|
},
|
|
778
|
-
[
|
|
779
|
-
),
|
|
780
|
-
(i,
|
|
781
|
-
(i.key === "Enter" || i.key === " ") && (i.preventDefault(), v(
|
|
778
|
+
[a]
|
|
779
|
+
), R = V(
|
|
780
|
+
(i, N) => {
|
|
781
|
+
(i.key === "Enter" || i.key === " ") && (i.preventDefault(), v(N));
|
|
782
782
|
},
|
|
783
783
|
[v]
|
|
784
|
-
), C =
|
|
784
|
+
), C = X(o, "MMMM", { locale: Y }), H = X(o, "yyyy", { locale: Y }), S = `${be(C)} ${H}`;
|
|
785
785
|
return /* @__PURE__ */ l.jsxs("div", { className: k.calendarContainer, children: [
|
|
786
786
|
/* @__PURE__ */ l.jsxs("div", { className: k.calendarHeader, children: [
|
|
787
787
|
/* @__PURE__ */ l.jsx("span", { className: k.monthYear, children: S }),
|
|
788
788
|
/* @__PURE__ */ l.jsxs("div", { className: k.navigationButtons, children: [
|
|
789
789
|
/* @__PURE__ */ l.jsx(
|
|
790
|
-
|
|
790
|
+
ue,
|
|
791
791
|
{
|
|
792
792
|
variant: "tertiary",
|
|
793
793
|
icon: !0,
|
|
794
794
|
onClick: _,
|
|
795
795
|
"aria-label": "Forrige måned",
|
|
796
|
-
disabled:
|
|
796
|
+
disabled: d,
|
|
797
797
|
children: /* @__PURE__ */ l.jsx(Ee, {})
|
|
798
798
|
}
|
|
799
799
|
),
|
|
800
800
|
/* @__PURE__ */ l.jsx(
|
|
801
|
-
|
|
801
|
+
ue,
|
|
802
802
|
{
|
|
803
803
|
variant: "tertiary",
|
|
804
804
|
icon: !0,
|
|
805
805
|
onClick: w,
|
|
806
806
|
"aria-label": "Neste måned",
|
|
807
|
-
children: /* @__PURE__ */ l.jsx(
|
|
807
|
+
children: /* @__PURE__ */ l.jsx(je, {})
|
|
808
808
|
}
|
|
809
809
|
)
|
|
810
810
|
] })
|
|
811
811
|
] }),
|
|
812
812
|
/* @__PURE__ */ l.jsx("div", { className: k.grid, children: y.map((i) => /* @__PURE__ */ l.jsx("div", { className: k.dayNameCell, children: i }, i)) }),
|
|
813
813
|
/* @__PURE__ */ l.jsx("div", { className: k.grid, children: m.map((i) => {
|
|
814
|
-
const
|
|
814
|
+
const N = me(i, o), P = r && ce(r) && Ct(i, r), $ = xt(i), z = [
|
|
815
815
|
k.dateCell,
|
|
816
|
-
|
|
816
|
+
N ? "" : k.otherMonth,
|
|
817
817
|
P ? k.selectedDate : "",
|
|
818
818
|
// Highlighting based on prop
|
|
819
819
|
$ && !P ? k.todayDate : ""
|
|
@@ -821,52 +821,52 @@ const ur = "_calendarContainer_160wn_3", dr = "_calendarHeader_160wn_17", mr = "
|
|
|
821
821
|
return /* @__PURE__ */ l.jsx(
|
|
822
822
|
"div",
|
|
823
823
|
{
|
|
824
|
-
className:
|
|
824
|
+
className: z,
|
|
825
825
|
onClick: () => v(i),
|
|
826
|
-
onKeyDown: (
|
|
826
|
+
onKeyDown: (L) => R(L, i),
|
|
827
827
|
role: "button",
|
|
828
828
|
tabIndex: 0,
|
|
829
829
|
"aria-pressed": P ?? !1,
|
|
830
|
-
"aria-label":
|
|
831
|
-
children: /* @__PURE__ */ l.jsx("span", { className: k.dateNumberContainer, children:
|
|
830
|
+
"aria-label": X(i, "PPP", { locale: Y }),
|
|
831
|
+
children: /* @__PURE__ */ l.jsx("span", { className: k.dateNumberContainer, children: X(i, "d") })
|
|
832
832
|
},
|
|
833
833
|
i.toISOString()
|
|
834
834
|
);
|
|
835
835
|
}) })
|
|
836
836
|
] });
|
|
837
837
|
};
|
|
838
|
-
|
|
839
|
-
const
|
|
840
|
-
fieldset:
|
|
841
|
-
description:
|
|
842
|
-
error:
|
|
843
|
-
inputWrapper:
|
|
844
|
-
inputWrapperError:
|
|
845
|
-
suffixButton:
|
|
846
|
-
suffixButtonInteractive:
|
|
838
|
+
xr.displayName = "DatePicker";
|
|
839
|
+
const Pr = "_fieldset_17wt1_4", Er = "_description_17wt1_15", jr = "_error_17wt1_22", Rr = "_inputWrapper_17wt1_30", Nr = "_inputWrapperError_17wt1_42", Tr = "_suffixButton_17wt1_100", Sr = "_suffixButtonInteractive_17wt1_120", O = {
|
|
840
|
+
fieldset: Pr,
|
|
841
|
+
description: Er,
|
|
842
|
+
error: jr,
|
|
843
|
+
inputWrapper: Rr,
|
|
844
|
+
inputWrapperError: Nr,
|
|
845
|
+
suffixButton: Tr,
|
|
846
|
+
suffixButtonInteractive: Sr
|
|
847
847
|
}, ve = (e) => {
|
|
848
|
-
const
|
|
849
|
-
return e.length > 4 ? `${
|
|
848
|
+
const r = e.slice(0, 2), a = e.slice(2, 4), o = e.slice(4, 8);
|
|
849
|
+
return e.length > 4 ? `${r}.${a}.${o}` : e.length > 2 ? `${r}.${a}` : e.length > 0 ? r : "";
|
|
850
850
|
}, ge = (e) => (e || "").replace(/\D/g, ""), ke = (e) => {
|
|
851
|
-
let
|
|
852
|
-
if (
|
|
853
|
-
const
|
|
854
|
-
!isNaN(
|
|
851
|
+
let r = e;
|
|
852
|
+
if (r.length >= 2) {
|
|
853
|
+
const a = parseInt(r.substring(0, 2), 10);
|
|
854
|
+
!isNaN(a) && a > 31 && (r = "31" + r.substring(2));
|
|
855
855
|
}
|
|
856
|
-
if (
|
|
857
|
-
const
|
|
858
|
-
!isNaN(
|
|
856
|
+
if (r.length >= 4) {
|
|
857
|
+
const a = parseInt(r.substring(2, 4), 10);
|
|
858
|
+
!isNaN(a) && a > 12 && (r = r.substring(0, 2) + "12" + r.substring(4));
|
|
859
859
|
}
|
|
860
|
-
return
|
|
861
|
-
},
|
|
862
|
-
(e,
|
|
860
|
+
return r.slice(0, 8);
|
|
861
|
+
}, $r = W(
|
|
862
|
+
(e, r) => {
|
|
863
863
|
const {
|
|
864
|
-
label:
|
|
864
|
+
label: a,
|
|
865
865
|
suffixIcon: o,
|
|
866
866
|
onSuffixClick: s,
|
|
867
|
-
className:
|
|
867
|
+
className: u,
|
|
868
868
|
// For outer fieldset
|
|
869
|
-
inputWrapperClassName:
|
|
869
|
+
inputWrapperClassName: d,
|
|
870
870
|
// For input wrapper div
|
|
871
871
|
inputClassName: m,
|
|
872
872
|
// For the actual input element
|
|
@@ -874,29 +874,29 @@ const wr = "_fieldset_17wt1_4", Cr = "_description_17wt1_15", xr = "_error_17wt1
|
|
|
874
874
|
defaultValue: _,
|
|
875
875
|
onChange: w,
|
|
876
876
|
readOnly: v,
|
|
877
|
-
placeholder:
|
|
877
|
+
placeholder: R = "dd.mm.åååå",
|
|
878
878
|
id: C,
|
|
879
|
-
name:
|
|
879
|
+
name: H,
|
|
880
880
|
required: S,
|
|
881
881
|
disabled: i,
|
|
882
|
-
onClick:
|
|
882
|
+
onClick: N,
|
|
883
883
|
onFocus: P,
|
|
884
884
|
// Pass external onFocus
|
|
885
885
|
onBlur: $,
|
|
886
886
|
// Pass external onBlur
|
|
887
|
-
autoComplete:
|
|
888
|
-
"aria-label":
|
|
889
|
-
"aria-labelledby":
|
|
890
|
-
description:
|
|
891
|
-
error:
|
|
887
|
+
autoComplete: z = "off",
|
|
888
|
+
"aria-label": L,
|
|
889
|
+
"aria-labelledby": ee,
|
|
890
|
+
description: G,
|
|
891
|
+
error: T,
|
|
892
892
|
// Use error prop for styling
|
|
893
893
|
...le
|
|
894
|
-
} = e, B = y !== void 0, g =
|
|
894
|
+
} = e, B = y !== void 0, g = Ne(null);
|
|
895
895
|
ye.useImperativeHandle(
|
|
896
|
-
|
|
896
|
+
r,
|
|
897
897
|
() => g.current
|
|
898
898
|
);
|
|
899
|
-
const D =
|
|
899
|
+
const D = V(
|
|
900
900
|
(h) => {
|
|
901
901
|
const b = ge(h), A = ke(b);
|
|
902
902
|
return ve(A);
|
|
@@ -911,37 +911,37 @@ const wr = "_fieldset_17wt1_4", Cr = "_description_17wt1_15", xr = "_error_17wt1
|
|
|
911
911
|
h !== M && (I(h), g.current && g.current.value !== h && (g.current.value = h));
|
|
912
912
|
}
|
|
913
913
|
}, [y, B, M, D]);
|
|
914
|
-
const
|
|
914
|
+
const te = V(
|
|
915
915
|
(h) => {
|
|
916
|
-
const b = h.target, A = b.value,
|
|
917
|
-
let
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
if (g.current && (I(x), g.current.value = x, g.current.setSelectionRange(
|
|
921
|
-
const
|
|
916
|
+
const b = h.target, A = b.value, q = M, p = ge(A).slice(0, 8), E = ke(p), x = ve(E);
|
|
917
|
+
let j = 0;
|
|
918
|
+
const K = E.length;
|
|
919
|
+
K <= 2 ? j = K : K <= 4 ? j = K + 1 : j = K + 2, j = Math.min(j, x.length), requestAnimationFrame(() => {
|
|
920
|
+
if (g.current && (I(x), g.current.value = x, g.current.setSelectionRange(j, j), (x !== q || B) && w)) {
|
|
921
|
+
const Re = {
|
|
922
922
|
...h,
|
|
923
923
|
target: { ...b, value: x }
|
|
924
924
|
};
|
|
925
|
-
w(
|
|
925
|
+
w(Re, x);
|
|
926
926
|
}
|
|
927
927
|
});
|
|
928
928
|
},
|
|
929
929
|
[M, B, w, D]
|
|
930
930
|
// Added isControlled and getFormattedValue
|
|
931
|
-
),
|
|
931
|
+
), re = [O.fieldset, u].filter(Boolean).join(" "), ae = [
|
|
932
932
|
O.inputWrapper,
|
|
933
933
|
// Base style from InputField CSS
|
|
934
|
-
|
|
934
|
+
d,
|
|
935
935
|
// Allow external override/extension
|
|
936
|
-
|
|
936
|
+
T ? O.inputWrapperError : ""
|
|
937
937
|
// Apply error class based on prop
|
|
938
938
|
// Add disabled class if your CSS defines one for the wrapper
|
|
939
939
|
// disabled ? styles.inputWrapperDisabled : '',
|
|
940
|
-
].filter(Boolean).join(" "),
|
|
940
|
+
].filter(Boolean).join(" "), ne = [
|
|
941
941
|
// styles.input, // This class might not exist in InputField/styles.module.css
|
|
942
942
|
m
|
|
943
943
|
// Allow external override/extension
|
|
944
|
-
].filter(Boolean).join(" "),
|
|
944
|
+
].filter(Boolean).join(" "), oe = [
|
|
945
945
|
O.suffixButton,
|
|
946
946
|
// Base style from InputField CSS
|
|
947
947
|
s ? O.suffixButtonInteractive : ""
|
|
@@ -949,17 +949,17 @@ const wr = "_fieldset_17wt1_4", Cr = "_description_17wt1_15", xr = "_error_17wt1
|
|
|
949
949
|
// Add disabled class if your CSS defines one for the button
|
|
950
950
|
// disabled ? styles.suffixButtonDisabled : '',
|
|
951
951
|
].filter(Boolean).join(" ");
|
|
952
|
-
!
|
|
953
|
-
const t =
|
|
952
|
+
!a && !L && !ee && console.warn("Warning: DateInput component should have a label, aria-label, or aria-labelledby for accessibility.");
|
|
953
|
+
const t = a && typeof a == "string" ? ee || `${C}-label` : void 0, n = G ? `${C}-desc` : void 0, c = T ? `${C}-err` : void 0, f = [n, c].filter(Boolean).join(" ") || void 0;
|
|
954
954
|
return (
|
|
955
955
|
// Use the fieldset structure and classes from InputField CSS
|
|
956
|
-
/* @__PURE__ */ l.jsxs("div", { className:
|
|
957
|
-
|
|
958
|
-
|
|
956
|
+
/* @__PURE__ */ l.jsxs("div", { className: re, children: [
|
|
957
|
+
a && typeof a == "string" ? /* @__PURE__ */ l.jsx("label", { id: t, htmlFor: C, children: a }) : a,
|
|
958
|
+
G && /* @__PURE__ */ l.jsxs("p", { id: n, className: O.description, children: [
|
|
959
959
|
" ",
|
|
960
|
-
|
|
960
|
+
G
|
|
961
961
|
] }),
|
|
962
|
-
/* @__PURE__ */ l.jsxs("div", { className:
|
|
962
|
+
/* @__PURE__ */ l.jsxs("div", { className: ae, children: [
|
|
963
963
|
/* @__PURE__ */ l.jsx(
|
|
964
964
|
"input",
|
|
965
965
|
{
|
|
@@ -970,21 +970,21 @@ const wr = "_fieldset_17wt1_4", Cr = "_description_17wt1_15", xr = "_error_17wt1
|
|
|
970
970
|
maxLength: 10,
|
|
971
971
|
value: M,
|
|
972
972
|
readOnly: v,
|
|
973
|
-
placeholder:
|
|
973
|
+
placeholder: R,
|
|
974
974
|
id: C,
|
|
975
|
-
name:
|
|
975
|
+
name: H,
|
|
976
976
|
required: S,
|
|
977
977
|
disabled: i,
|
|
978
|
-
onClick:
|
|
979
|
-
onChange:
|
|
978
|
+
onClick: N,
|
|
979
|
+
onChange: te,
|
|
980
980
|
onFocus: P,
|
|
981
981
|
onBlur: $,
|
|
982
|
-
autoComplete:
|
|
983
|
-
"aria-label":
|
|
982
|
+
autoComplete: z,
|
|
983
|
+
"aria-label": L,
|
|
984
984
|
"aria-labelledby": t,
|
|
985
985
|
"aria-describedby": f,
|
|
986
|
-
"aria-invalid": !!
|
|
987
|
-
className:
|
|
986
|
+
"aria-invalid": !!T,
|
|
987
|
+
className: ne,
|
|
988
988
|
...le
|
|
989
989
|
}
|
|
990
990
|
),
|
|
@@ -992,7 +992,7 @@ const wr = "_fieldset_17wt1_4", Cr = "_description_17wt1_15", xr = "_error_17wt1
|
|
|
992
992
|
"button",
|
|
993
993
|
{
|
|
994
994
|
type: "button",
|
|
995
|
-
className:
|
|
995
|
+
className: oe,
|
|
996
996
|
onClick: i ? void 0 : s,
|
|
997
997
|
tabIndex: s && !i ? 0 : -1,
|
|
998
998
|
"aria-hidden": !s,
|
|
@@ -1002,61 +1002,72 @@ const wr = "_fieldset_17wt1_4", Cr = "_description_17wt1_15", xr = "_error_17wt1
|
|
|
1002
1002
|
}
|
|
1003
1003
|
)
|
|
1004
1004
|
] }),
|
|
1005
|
-
|
|
1005
|
+
T && /* @__PURE__ */ l.jsx("p", { id: c, className: O.error, role: "alert", children: T })
|
|
1006
1006
|
] })
|
|
1007
1007
|
);
|
|
1008
1008
|
}
|
|
1009
1009
|
);
|
|
1010
|
-
|
|
1011
|
-
const
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
const
|
|
1010
|
+
$r.displayName = "DateInput";
|
|
1011
|
+
const Xr = Ve, Jr = He, Ur = ze, Qr = Ge, Zr = qe, ea = Je, Dr = Ke, Mr = Xe;
|
|
1012
|
+
Dr.displayName = "Field.Description";
|
|
1013
|
+
Mr.displayName = "Field.Counter";
|
|
1014
|
+
const ta = Ce, Ar = W((e, r) => /* @__PURE__ */ l.jsx(Ue, { ref: r, ...e }));
|
|
1015
|
+
Ar.displayName = "Heading";
|
|
1016
|
+
const ra = Qe, Or = W((e, r) => /* @__PURE__ */ l.jsx(Ze, { ref: r, ...e }));
|
|
1017
|
+
Or.displayName = "Label";
|
|
1018
|
+
const aa = et, na = tt, oa = rt, sa = at, Wr = W(
|
|
1019
|
+
(e, r) => /* @__PURE__ */ l.jsx(nt, { ref: r, ...e })
|
|
1020
|
+
);
|
|
1021
|
+
Wr.displayName = "Paragraph";
|
|
1022
|
+
const ia = ot, la = st, ca = it, da = lt, ua = ct, ma = dt, fa = ut, ha = mt, pa = ft, ba = ht, va = pt, ga = bt, ka = vt, ya = gt, _a = kt, wa = yt;
|
|
1015
1023
|
export {
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1024
|
+
Nt as Alert,
|
|
1025
|
+
Tt as Avatar,
|
|
1026
|
+
St as Badge,
|
|
1027
|
+
Fr as BadgePosition,
|
|
1028
|
+
Yr as Breadcrumbs,
|
|
1029
|
+
Hr as BreadcrumbsItem,
|
|
1030
|
+
zr as BreadcrumbsLink,
|
|
1031
|
+
Vr as BreadcrumbsList,
|
|
1032
|
+
$t as Button,
|
|
1033
|
+
Dt as Card,
|
|
1034
|
+
Gr as CardBlock,
|
|
1035
|
+
Mt as Checkbox,
|
|
1036
|
+
Kr as Chip,
|
|
1037
|
+
$r as DateInput,
|
|
1038
|
+
xr as DatePicker,
|
|
1039
|
+
Xr as Details,
|
|
1040
|
+
Jr as Dialog,
|
|
1041
|
+
Ur as Divider,
|
|
1042
|
+
Qr as Dropdown,
|
|
1043
|
+
Zr as ErrorSummary,
|
|
1044
|
+
ea as Field,
|
|
1045
|
+
Mr as FieldCounter,
|
|
1046
|
+
Dr as FieldDescription,
|
|
1047
|
+
ta as Fieldset,
|
|
1048
|
+
Ar as Heading,
|
|
1049
|
+
ra as Input,
|
|
1050
|
+
Or as Label,
|
|
1051
|
+
aa as Link,
|
|
1052
|
+
na as List,
|
|
1053
|
+
oa as Pagination,
|
|
1054
|
+
Wr as Paragraph,
|
|
1055
|
+
ia as Popover,
|
|
1056
|
+
la as Radio,
|
|
1057
|
+
da as Search,
|
|
1058
|
+
ua as Select,
|
|
1059
|
+
ma as SkeletonLoader,
|
|
1060
|
+
fa as SkipLink,
|
|
1061
|
+
ha as Spinner,
|
|
1062
|
+
pa as Switch,
|
|
1063
|
+
ba as Table,
|
|
1064
|
+
va as Tabs,
|
|
1065
|
+
ga as Tag,
|
|
1066
|
+
ka as Textarea,
|
|
1067
|
+
ya as Textfield,
|
|
1068
|
+
_a as ToggleGroup,
|
|
1069
|
+
wa as Tooltip,
|
|
1070
|
+
qr as useCheckboxGroup,
|
|
1071
|
+
sa as usePagination,
|
|
1072
|
+
ca as useRadioGroup
|
|
1062
1073
|
};
|