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