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