@commercelayer/app-elements 1.14.6 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{InputDateComponent-BeBbgM-L.js → InputDateComponent-BifqVA3t.js} +64 -64
- package/dist/helpers/route.d.ts +27 -1
- package/dist/{main-DdnJpreu.js → main-B_P2rWFk.js} +8211 -8132
- package/dist/main.d.ts +2 -0
- package/dist/main.js +150 -148
- package/dist/providers/TokenProvider/MockTokenProvider.d.ts +1 -1
- package/dist/providers/TokenProvider/TokenProvider.d.ts +11 -1
- package/dist/providers/TokenProvider/reducer.d.ts +0 -1
- package/dist/providers/TokenProvider/types.d.ts +30 -1
- package/dist/providers/createApp.d.ts +57 -0
- package/dist/style.css +1 -1
- package/dist/ui/atoms/PageHeading.d.ts +7 -7
- package/dist/ui/composite/HomePageLayout.d.ts +16 -0
- package/dist/ui/composite/HomePageLayout.test.d.ts +1 -0
- package/dist/ui/composite/PageLayout.d.ts +1 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var ur = Object.defineProperty;
|
|
3
3
|
var lr = (a, n, e) => n in a ? ur(a, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[n] = e;
|
|
4
4
|
var D = (a, n, e) => (lr(a, typeof n != "symbol" ? n + "" : n, e), e);
|
|
5
|
-
import { a as Ut, c as pr, i as Fe, p as dr, b as hr, f as fr, o as mr, d as q, j as be, I as gr, g as yr, w as wr, X as Dr } from "./main-
|
|
5
|
+
import { a as Ut, c as pr, i as Fe, p as dr, b as hr, f as fr, o as mr, d as q, j as be, I as gr, g as yr, w as wr, X as Dr } from "./main-B_P2rWFk.js";
|
|
6
6
|
import * as C from "react";
|
|
7
7
|
import f, { createElement as vr, Component as br, useLayoutEffect as On, useEffect as Nn, createRef as kr, forwardRef as Mr } from "react";
|
|
8
8
|
import * as _r from "react-dom";
|
|
@@ -337,11 +337,11 @@ function Kr(a) {
|
|
|
337
337
|
return { value: o, rest: i };
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
|
-
const Vr = /^(\d+)(th|st|nd|rd)?/i, Ur = /\d+/i,
|
|
340
|
+
const Vr = /^(\d+)(th|st|nd|rd)?/i, Ur = /\d+/i, $r = {
|
|
341
341
|
narrow: /^(b|a)/i,
|
|
342
342
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
343
343
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
344
|
-
},
|
|
344
|
+
}, Xr = {
|
|
345
345
|
any: [/^b/i, /^(a|c)/i]
|
|
346
346
|
}, Gr = {
|
|
347
347
|
narrow: /^[1234]/i,
|
|
@@ -411,9 +411,9 @@ const Vr = /^(\d+)(th|st|nd|rd)?/i, Ur = /\d+/i, Xr = {
|
|
|
411
411
|
valueCallback: (a) => parseInt(a, 10)
|
|
412
412
|
}),
|
|
413
413
|
era: Ae({
|
|
414
|
-
matchPatterns:
|
|
414
|
+
matchPatterns: $r,
|
|
415
415
|
defaultMatchWidth: "wide",
|
|
416
|
-
parsePatterns:
|
|
416
|
+
parsePatterns: Xr,
|
|
417
417
|
defaultParseWidth: "any"
|
|
418
418
|
}),
|
|
419
419
|
quarter: Ae({
|
|
@@ -600,7 +600,7 @@ const he = {
|
|
|
600
600
|
afternoon: "afternoon",
|
|
601
601
|
evening: "evening",
|
|
602
602
|
night: "night"
|
|
603
|
-
},
|
|
603
|
+
}, $t = {
|
|
604
604
|
// Era
|
|
605
605
|
G: function(a, n, e) {
|
|
606
606
|
const t = a.getFullYear() > 0 ? 1 : 0;
|
|
@@ -1058,7 +1058,7 @@ const he = {
|
|
|
1058
1058
|
case "O":
|
|
1059
1059
|
case "OO":
|
|
1060
1060
|
case "OOO":
|
|
1061
|
-
return "GMT" +
|
|
1061
|
+
return "GMT" + Xt(t, ":");
|
|
1062
1062
|
case "OOOO":
|
|
1063
1063
|
default:
|
|
1064
1064
|
return "GMT" + ke(t, ":");
|
|
@@ -1071,7 +1071,7 @@ const he = {
|
|
|
1071
1071
|
case "z":
|
|
1072
1072
|
case "zz":
|
|
1073
1073
|
case "zzz":
|
|
1074
|
-
return "GMT" +
|
|
1074
|
+
return "GMT" + Xt(t, ":");
|
|
1075
1075
|
case "zzzz":
|
|
1076
1076
|
default:
|
|
1077
1077
|
return "GMT" + ke(t, ":");
|
|
@@ -1088,7 +1088,7 @@ const he = {
|
|
|
1088
1088
|
return N(t, n.length);
|
|
1089
1089
|
}
|
|
1090
1090
|
};
|
|
1091
|
-
function
|
|
1091
|
+
function Xt(a, n = "") {
|
|
1092
1092
|
const e = a > 0 ? "-" : "+", t = Math.abs(a), r = Math.trunc(t / 60), s = t % 60;
|
|
1093
1093
|
return s === 0 ? e + String(r) : e + String(r) + n + N(s, 2);
|
|
1094
1094
|
}
|
|
@@ -1182,7 +1182,7 @@ function Zt(a, n, e) {
|
|
|
1182
1182
|
const _ = v[0];
|
|
1183
1183
|
if (_ === "'")
|
|
1184
1184
|
return { isToken: !1, value: ba(v) };
|
|
1185
|
-
if (
|
|
1185
|
+
if ($t[_])
|
|
1186
1186
|
return { isToken: !0, value: v };
|
|
1187
1187
|
if (_.match(va))
|
|
1188
1188
|
throw new RangeError(
|
|
@@ -1201,7 +1201,7 @@ function Zt(a, n, e) {
|
|
|
1201
1201
|
return v.value;
|
|
1202
1202
|
const _ = v.value;
|
|
1203
1203
|
(!(e != null && e.useAdditionalWeekYearTokens) && Wn(_) || !(e != null && e.useAdditionalDayOfYearTokens) && Fn(_)) && Pt(_, n, String(a));
|
|
1204
|
-
const E =
|
|
1204
|
+
const E = $t[_[0]];
|
|
1205
1205
|
return E(i, _, r.localize, u);
|
|
1206
1206
|
}).join("");
|
|
1207
1207
|
}
|
|
@@ -1279,7 +1279,7 @@ function Ca(a) {
|
|
|
1279
1279
|
function tn(a) {
|
|
1280
1280
|
return b(a).getDate();
|
|
1281
1281
|
}
|
|
1282
|
-
function
|
|
1282
|
+
function $(a) {
|
|
1283
1283
|
return b(a).getMonth();
|
|
1284
1284
|
}
|
|
1285
1285
|
function Te(a) {
|
|
@@ -1893,7 +1893,7 @@ class Ua extends O {
|
|
|
1893
1893
|
return e.setMonth((r - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
1894
1894
|
}
|
|
1895
1895
|
}
|
|
1896
|
-
class
|
|
1896
|
+
class $a extends O {
|
|
1897
1897
|
constructor() {
|
|
1898
1898
|
super(...arguments);
|
|
1899
1899
|
D(this, "incompatibleTokens", [
|
|
@@ -1955,7 +1955,7 @@ class Xa extends O {
|
|
|
1955
1955
|
return e.setMonth(r, 1), e.setHours(0, 0, 0, 0), e;
|
|
1956
1956
|
}
|
|
1957
1957
|
}
|
|
1958
|
-
class
|
|
1958
|
+
class Xa extends O {
|
|
1959
1959
|
constructor() {
|
|
1960
1960
|
super(...arguments);
|
|
1961
1961
|
D(this, "priority", 110);
|
|
@@ -2849,8 +2849,8 @@ const Co = {
|
|
|
2849
2849
|
u: new Ka(),
|
|
2850
2850
|
Q: new Va(),
|
|
2851
2851
|
q: new Ua(),
|
|
2852
|
-
M: new
|
|
2853
|
-
L: new
|
|
2852
|
+
M: new $a(),
|
|
2853
|
+
L: new Xa(),
|
|
2854
2854
|
w: new za(),
|
|
2855
2855
|
I: new Ja(),
|
|
2856
2856
|
d: new no(),
|
|
@@ -3045,7 +3045,7 @@ function Qo(a) {
|
|
|
3045
3045
|
if (!n)
|
|
3046
3046
|
return 0;
|
|
3047
3047
|
const e = n[1] === "+" ? -1 : 1, t = parseInt(n[2]), r = n[3] && parseInt(n[3]) || 0;
|
|
3048
|
-
return
|
|
3048
|
+
return $o(t, r) ? e * (t * dt + r * pt) : NaN;
|
|
3049
3049
|
}
|
|
3050
3050
|
function Bo(a, n, e) {
|
|
3051
3051
|
const t = /* @__PURE__ */ new Date(0);
|
|
@@ -3069,10 +3069,10 @@ function Vo(a, n, e) {
|
|
|
3069
3069
|
function Uo(a, n, e) {
|
|
3070
3070
|
return a === 24 ? n === 0 && e === 0 : e >= 0 && e < 60 && n >= 0 && n < 60 && a >= 0 && a < 25;
|
|
3071
3071
|
}
|
|
3072
|
-
function
|
|
3072
|
+
function $o(a, n) {
|
|
3073
3073
|
return n >= 0 && n <= 59;
|
|
3074
3074
|
}
|
|
3075
|
-
function
|
|
3075
|
+
function Xo(a, n) {
|
|
3076
3076
|
a.prototype = Object.create(n.prototype), a.prototype.constructor = a, Yt(a, n);
|
|
3077
3077
|
}
|
|
3078
3078
|
function Yt(a, n) {
|
|
@@ -3133,7 +3133,7 @@ function on(a, n) {
|
|
|
3133
3133
|
function ht(a, n) {
|
|
3134
3134
|
var e, t, r = a.displayName || a.name || "Component";
|
|
3135
3135
|
return t = e = /* @__PURE__ */ function(s) {
|
|
3136
|
-
|
|
3136
|
+
Xo(o, s);
|
|
3137
3137
|
function o(c) {
|
|
3138
3138
|
var u;
|
|
3139
3139
|
return u = s.call(this, c) || this, u.__outsideClickHandler = function(d) {
|
|
@@ -3303,21 +3303,21 @@ function ss(a) {
|
|
|
3303
3303
|
isPositioned: !1
|
|
3304
3304
|
}), [g, m] = C.useState(t);
|
|
3305
3305
|
ct(g, t) || m(t);
|
|
3306
|
-
const [y, w] = C.useState(null), [x, S] = C.useState(null), v = C.useCallback((
|
|
3307
|
-
|
|
3308
|
-
}, []), _ = C.useCallback((
|
|
3309
|
-
|
|
3306
|
+
const [y, w] = C.useState(null), [x, S] = C.useState(null), v = C.useCallback((X) => {
|
|
3307
|
+
X !== W.current && (W.current = X, w(X));
|
|
3308
|
+
}, []), _ = C.useCallback((X) => {
|
|
3309
|
+
X !== M.current && (M.current = X, S(X));
|
|
3310
3310
|
}, []), E = s || y, L = o || x, W = C.useRef(null), M = C.useRef(null), k = C.useRef(d), A = c != null, z = cn(c), ce = cn(r), te = C.useCallback(() => {
|
|
3311
3311
|
if (!W.current || !M.current)
|
|
3312
3312
|
return;
|
|
3313
|
-
const
|
|
3313
|
+
const X = {
|
|
3314
3314
|
placement: n,
|
|
3315
3315
|
strategy: e,
|
|
3316
3316
|
middleware: g
|
|
3317
3317
|
};
|
|
3318
|
-
ce.current && (
|
|
3318
|
+
ce.current && (X.platform = ce.current), pr(W.current, M.current, X).then((Xe) => {
|
|
3319
3319
|
const Ee = {
|
|
3320
|
-
|
|
3320
|
+
...Xe,
|
|
3321
3321
|
isPositioned: !0
|
|
3322
3322
|
};
|
|
3323
3323
|
ue.current && !ct(k.current, Ee) && (k.current = Ee, _r.flushSync(() => {
|
|
@@ -3326,8 +3326,8 @@ function ss(a) {
|
|
|
3326
3326
|
});
|
|
3327
3327
|
}, [g, n, e, ce]);
|
|
3328
3328
|
et(() => {
|
|
3329
|
-
u === !1 && k.current.isPositioned && (k.current.isPositioned = !1, h((
|
|
3330
|
-
|
|
3329
|
+
u === !1 && k.current.isPositioned && (k.current.isPositioned = !1, h((X) => ({
|
|
3330
|
+
...X,
|
|
3331
3331
|
isPositioned: !1
|
|
3332
3332
|
})));
|
|
3333
3333
|
}, [u]);
|
|
@@ -3341,7 +3341,7 @@ function ss(a) {
|
|
|
3341
3341
|
te();
|
|
3342
3342
|
}
|
|
3343
3343
|
}, [E, L, te, z, A]);
|
|
3344
|
-
const
|
|
3344
|
+
const $e = C.useMemo(() => ({
|
|
3345
3345
|
reference: W,
|
|
3346
3346
|
floating: M,
|
|
3347
3347
|
setReference: v,
|
|
@@ -3350,33 +3350,33 @@ function ss(a) {
|
|
|
3350
3350
|
reference: E,
|
|
3351
3351
|
floating: L
|
|
3352
3352
|
}), [E, L]), Vt = C.useMemo(() => {
|
|
3353
|
-
const
|
|
3353
|
+
const X = {
|
|
3354
3354
|
position: e,
|
|
3355
3355
|
left: 0,
|
|
3356
3356
|
top: 0
|
|
3357
3357
|
};
|
|
3358
3358
|
if (!ve.floating)
|
|
3359
|
-
return
|
|
3360
|
-
const
|
|
3359
|
+
return X;
|
|
3360
|
+
const Xe = sn(ve.floating, d.x), Ee = sn(ve.floating, d.y);
|
|
3361
3361
|
return i ? {
|
|
3362
|
-
|
|
3363
|
-
transform: "translate(" +
|
|
3362
|
+
...X,
|
|
3363
|
+
transform: "translate(" + Xe + "px, " + Ee + "px)",
|
|
3364
3364
|
...Un(ve.floating) >= 1.5 && {
|
|
3365
3365
|
willChange: "transform"
|
|
3366
3366
|
}
|
|
3367
3367
|
} : {
|
|
3368
3368
|
position: e,
|
|
3369
|
-
left:
|
|
3369
|
+
left: Xe,
|
|
3370
3370
|
top: Ee
|
|
3371
3371
|
};
|
|
3372
3372
|
}, [e, i, ve.floating, d.x, d.y]);
|
|
3373
3373
|
return C.useMemo(() => ({
|
|
3374
3374
|
...d,
|
|
3375
3375
|
update: te,
|
|
3376
|
-
refs:
|
|
3376
|
+
refs: $e,
|
|
3377
3377
|
elements: ve,
|
|
3378
3378
|
floatingStyles: Vt
|
|
3379
|
-
}), [d, te,
|
|
3379
|
+
}), [d, te, $e, ve, Vt]);
|
|
3380
3380
|
}
|
|
3381
3381
|
const is = C.useInsertionEffect, cs = is || ((a) => a());
|
|
3382
3382
|
function us(a) {
|
|
@@ -3392,7 +3392,7 @@ function us(a) {
|
|
|
3392
3392
|
return n.current == null ? void 0 : n.current(...t);
|
|
3393
3393
|
}, []);
|
|
3394
3394
|
}
|
|
3395
|
-
var
|
|
3395
|
+
var $n = typeof document < "u" ? On : Nn;
|
|
3396
3396
|
function Rt() {
|
|
3397
3397
|
return Rt = Object.assign ? Object.assign.bind() : function(a) {
|
|
3398
3398
|
for (var n = 1; n < arguments.length; n++) {
|
|
@@ -3407,13 +3407,13 @@ let vt = !1, ls = 0;
|
|
|
3407
3407
|
const un = () => "floating-ui-" + ls++;
|
|
3408
3408
|
function ps() {
|
|
3409
3409
|
const [a, n] = C.useState(() => vt ? un() : void 0);
|
|
3410
|
-
return
|
|
3410
|
+
return $n(() => {
|
|
3411
3411
|
a == null && n(un());
|
|
3412
3412
|
}, []), C.useEffect(() => {
|
|
3413
3413
|
vt || (vt = !0);
|
|
3414
3414
|
}, []), a;
|
|
3415
3415
|
}
|
|
3416
|
-
const ds = C.useId,
|
|
3416
|
+
const ds = C.useId, Xn = ds || ps, hs = /* @__PURE__ */ C.forwardRef(function(n, e) {
|
|
3417
3417
|
let {
|
|
3418
3418
|
context: {
|
|
3419
3419
|
placement: t,
|
|
@@ -3438,7 +3438,7 @@ const ds = C.useId, $n = ds || ps, hs = /* @__PURE__ */ C.forwardRef(function(n,
|
|
|
3438
3438
|
...w
|
|
3439
3439
|
} = n;
|
|
3440
3440
|
process.env.NODE_ENV !== "production" && (e || console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`", "component."));
|
|
3441
|
-
const x =
|
|
3441
|
+
const x = Xn();
|
|
3442
3442
|
if (!r)
|
|
3443
3443
|
return null;
|
|
3444
3444
|
u *= 2;
|
|
@@ -3446,7 +3446,7 @@ const ds = C.useId, $n = ds || ps, hs = /* @__PURE__ */ C.forwardRef(function(n,
|
|
|
3446
3446
|
let z = d && L === "end" ? "right" : "left";
|
|
3447
3447
|
d && W && (z = L === "end" ? "left" : "right");
|
|
3448
3448
|
const ce = (s == null ? void 0 : s.x) != null ? d || s.x : "", te = (s == null ? void 0 : s.y) != null ? d || s.y : "", ue = g || // biome-ignore lint/style/useTemplate: readability
|
|
3449
|
-
"M0,0" + (" H" + o) + (" L" + (o - v) + "," + (i - _)) + (" Q" + o / 2 + "," + i + " " + v + "," + (i - _)) + " Z",
|
|
3449
|
+
"M0,0" + (" H" + o) + (" L" + (o - v) + "," + (i - _)) + (" Q" + o / 2 + "," + i + " " + v + "," + (i - _)) + " Z", $e = {
|
|
3450
3450
|
top: M ? "rotate(180deg)" : "",
|
|
3451
3451
|
left: M ? "rotate(90deg)" : "rotate(-90deg)",
|
|
3452
3452
|
bottom: M ? "" : "rotate(180deg)",
|
|
@@ -3464,7 +3464,7 @@ const ds = C.useId, $n = ds || ps, hs = /* @__PURE__ */ C.forwardRef(function(n,
|
|
|
3464
3464
|
[z]: ce,
|
|
3465
3465
|
[A]: te,
|
|
3466
3466
|
[E]: k || M ? "100%" : "calc(100% - " + u / 2 + "px)",
|
|
3467
|
-
transform: "" +
|
|
3467
|
+
transform: "" + $e + (m ?? ""),
|
|
3468
3468
|
...y
|
|
3469
3469
|
}
|
|
3470
3470
|
}), u > 0 && /* @__PURE__ */ C.createElement("path", {
|
|
@@ -3533,7 +3533,7 @@ function Ds(a) {
|
|
|
3533
3533
|
reason: z,
|
|
3534
3534
|
nested: m
|
|
3535
3535
|
}), t == null || t(k, A, z);
|
|
3536
|
-
}), w = C.useRef(null), x = C.useRef({}), S = C.useState(() => fs())[0], v =
|
|
3536
|
+
}), w = C.useRef(null), x = C.useRef({}), S = C.useState(() => fs())[0], v = Xn(), _ = C.useCallback((k) => {
|
|
3537
3537
|
const A = Fe(k) ? {
|
|
3538
3538
|
getBoundingClientRect: () => k.getBoundingClientRect(),
|
|
3539
3539
|
contextElement: k
|
|
@@ -3563,7 +3563,7 @@ function Ds(a) {
|
|
|
3563
3563
|
open: e,
|
|
3564
3564
|
onOpenChange: y
|
|
3565
3565
|
}), [h, r, v, S, e, y, L, W]);
|
|
3566
|
-
return
|
|
3566
|
+
return $n(() => {
|
|
3567
3567
|
const k = g == null ? void 0 : g.nodesRef.current.find((A) => A.id === r);
|
|
3568
3568
|
k && (k.context = M);
|
|
3569
3569
|
}), C.useMemo(() => ({
|
|
@@ -3823,7 +3823,7 @@ function Jn(a) {
|
|
|
3823
3823
|
}) || o && !o(I(a)) || !1;
|
|
3824
3824
|
}
|
|
3825
3825
|
function kt(a, n, e, t) {
|
|
3826
|
-
var r = P(a), s =
|
|
3826
|
+
var r = P(a), s = $(a), o = P(n), i = $(n), c = P(t);
|
|
3827
3827
|
return r === o && r === c ? s <= e && e <= i : r < o ? c === r && s <= e || c === o && i >= e || c < o && c > r : void 0;
|
|
3828
3828
|
}
|
|
3829
3829
|
function ks(a) {
|
|
@@ -4277,9 +4277,9 @@ var Ns = ht(function(a) {
|
|
|
4277
4277
|
var o = Ca(e.props.day);
|
|
4278
4278
|
return o === 0 || o === 6;
|
|
4279
4279
|
}), l(p(e), "isAfterMonth", function() {
|
|
4280
|
-
return e.props.month !== void 0 && (e.props.month + 1) % 12 ===
|
|
4280
|
+
return e.props.month !== void 0 && (e.props.month + 1) % 12 === $(e.props.day);
|
|
4281
4281
|
}), l(p(e), "isBeforeMonth", function() {
|
|
4282
|
-
return e.props.month !== void 0 && (
|
|
4282
|
+
return e.props.month !== void 0 && ($(e.props.day) + 1) % 12 === e.props.month;
|
|
4283
4283
|
}), l(p(e), "isCurrentDay", function() {
|
|
4284
4284
|
return e.isSameDay(I());
|
|
4285
4285
|
}), l(p(e), "isSelected", function() {
|
|
@@ -4443,15 +4443,15 @@ var Ls = function(a) {
|
|
|
4443
4443
|
var i = e.props.day, c = De(o, 6);
|
|
4444
4444
|
return Z(o, i) || Z(c, i);
|
|
4445
4445
|
}), l(p(e), "isCurrentMonth", function(o, i) {
|
|
4446
|
-
return P(o) === P(I()) && i ===
|
|
4446
|
+
return P(o) === P(I()) && i === $(I());
|
|
4447
4447
|
}), l(p(e), "isCurrentQuarter", function(o, i) {
|
|
4448
4448
|
return P(o) === P(I()) && i === Te(I());
|
|
4449
4449
|
}), l(p(e), "isSelectedMonth", function(o, i, c) {
|
|
4450
|
-
return
|
|
4450
|
+
return $(c) === i && P(o) === P(c);
|
|
4451
4451
|
}), l(p(e), "isSelectedQuarter", function(o, i, c) {
|
|
4452
4452
|
return Te(o) === i && P(o) === P(c);
|
|
4453
4453
|
}), l(p(e), "renderWeeks", function() {
|
|
4454
|
-
for (var o = [], i = e.props.fixedHeight, c = 0, u = !1, d = J(ge(e.props.day), e.props.locale, e.props.calendarStartDay); o.push(f.createElement(Rs, { ariaLabelPrefix: e.props.weekAriaLabelPrefix, chooseDayAriaLabelPrefix: e.props.chooseDayAriaLabelPrefix, disabledDayAriaLabelPrefix: e.props.disabledDayAriaLabelPrefix, key: c, day: d, month:
|
|
4454
|
+
for (var o = [], i = e.props.fixedHeight, c = 0, u = !1, d = J(ge(e.props.day), e.props.locale, e.props.calendarStartDay); o.push(f.createElement(Rs, { ariaLabelPrefix: e.props.weekAriaLabelPrefix, chooseDayAriaLabelPrefix: e.props.chooseDayAriaLabelPrefix, disabledDayAriaLabelPrefix: e.props.disabledDayAriaLabelPrefix, key: c, day: d, month: $(e.props.day), onDayClick: e.handleDayClick, onDayMouseEnter: e.handleDayMouseEnter, onWeekSelect: e.props.onWeekSelect, formatWeekNumber: e.props.formatWeekNumber, locale: e.props.locale, minDate: e.props.minDate, maxDate: e.props.maxDate, excludeDates: e.props.excludeDates, excludeDateIntervals: e.props.excludeDateIntervals, includeDates: e.props.includeDates, includeDateIntervals: e.props.includeDateIntervals, inline: e.props.inline, shouldFocusDayInline: e.props.shouldFocusDayInline, highlightDates: e.props.highlightDates, holidays: e.props.holidays, selectingDate: e.props.selectingDate, filterDate: e.props.filterDate, preSelection: e.props.preSelection, selected: e.props.selected, selectsStart: e.props.selectsStart, selectsEnd: e.props.selectsEnd, selectsRange: e.props.selectsRange, selectsDisabledDaysInRange: e.props.selectsDisabledDaysInRange, showWeekNumber: e.props.showWeekNumbers, showWeekPicker: e.props.showWeekPicker, startDate: e.props.startDate, endDate: e.props.endDate, dayClassName: e.props.dayClassName, setOpen: e.props.setOpen, shouldCloseOnSelect: e.props.shouldCloseOnSelect, disabledKeyboardNavigation: e.props.disabledKeyboardNavigation, renderDayContents: e.props.renderDayContents, handleOnKeyDown: e.props.handleOnKeyDown, isInputFocused: e.props.isInputFocused, containerRef: e.props.containerRef, calendarStartDay: e.props.calendarStartDay, monthShowsDuplicateDaysEnd: e.props.monthShowsDuplicateDaysEnd, monthShowsDuplicateDaysStart: e.props.monthShowsDuplicateDaysStart })), !u; ) {
|
|
4455
4455
|
c++, d = at(d, 1);
|
|
4456
4456
|
var h = i && c >= 6, g = !i && !e.isWeekInMonth(d);
|
|
4457
4457
|
if (h || g) {
|
|
@@ -4509,9 +4509,9 @@ var Ls = function(a) {
|
|
|
4509
4509
|
}
|
|
4510
4510
|
}), l(p(e), "getMonthClassNames", function(o) {
|
|
4511
4511
|
var i = e.props, c = i.day, u = i.startDate, d = i.endDate, h = i.selected, g = i.minDate, m = i.maxDate, y = i.preSelection, w = i.monthClassName, x = i.excludeDates, S = i.includeDates, v = w ? w(G(c, o)) : void 0, _ = G(c, o);
|
|
4512
|
-
return q("react-datepicker__month-text", "react-datepicker__month-".concat(o), v, { "react-datepicker__month-text--disabled": (g || m || x || S) && Jn(_, e.props), "react-datepicker__month-text--selected": e.isSelectedMonth(c, o, h), "react-datepicker__month-text--keyboard-selected": !e.props.disabledKeyboardNavigation &&
|
|
4512
|
+
return q("react-datepicker__month-text", "react-datepicker__month-".concat(o), v, { "react-datepicker__month-text--disabled": (g || m || x || S) && Jn(_, e.props), "react-datepicker__month-text--selected": e.isSelectedMonth(c, o, h), "react-datepicker__month-text--keyboard-selected": !e.props.disabledKeyboardNavigation && $(y) === o, "react-datepicker__month-text--in-selecting-range": e.isInSelectingRangeMonth(o), "react-datepicker__month-text--in-range": kt(u, d, o, c), "react-datepicker__month-text--range-start": e.isRangeStartMonth(o), "react-datepicker__month-text--range-end": e.isRangeEndMonth(o), "react-datepicker__month-text--selecting-range-start": e.isSelectingMonthRangeStart(o), "react-datepicker__month-text--selecting-range-end": e.isSelectingMonthRangeEnd(o), "react-datepicker__month-text--today": e.isCurrentMonth(c, o) });
|
|
4513
4513
|
}), l(p(e), "getTabIndex", function(o) {
|
|
4514
|
-
var i =
|
|
4514
|
+
var i = $(e.props.preSelection);
|
|
4515
4515
|
return e.props.disabledKeyboardNavigation || o !== i ? "-1" : "0";
|
|
4516
4516
|
}), l(p(e), "getQuarterTabIndex", function(o) {
|
|
4517
4517
|
var i = Te(e.props.preSelection);
|
|
@@ -4808,7 +4808,7 @@ var Hs = ["react-datepicker__year-select", "react-datepicker__month-select", "re
|
|
|
4808
4808
|
}), l(p(t), "changeMonthYear", function(r) {
|
|
4809
4809
|
t.setState(function(s) {
|
|
4810
4810
|
var o = s.date;
|
|
4811
|
-
return { date: le(G(o,
|
|
4811
|
+
return { date: le(G(o, $(r)), P(r)) };
|
|
4812
4812
|
}, function() {
|
|
4813
4813
|
return t.handleMonthYearChange(t.state.date);
|
|
4814
4814
|
});
|
|
@@ -4900,7 +4900,7 @@ var Hs = ["react-datepicker__year-select", "react-datepicker__month-select", "re
|
|
|
4900
4900
|
}), l(p(t), "renderMonthDropdown", function() {
|
|
4901
4901
|
var r = arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
|
|
4902
4902
|
if (t.props.showMonthDropdown && !r)
|
|
4903
|
-
return f.createElement(Es, { dropdownMode: t.props.dropdownMode, locale: t.props.locale, onChange: t.changeMonth, month:
|
|
4903
|
+
return f.createElement(Es, { dropdownMode: t.props.dropdownMode, locale: t.props.locale, onChange: t.changeMonth, month: $(t.state.date), useShortMonthInDropdown: t.props.useShortMonthInDropdown });
|
|
4904
4904
|
}), l(p(t), "renderMonthYearDropdown", function() {
|
|
4905
4905
|
var r = arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
|
|
4906
4906
|
if (t.props.showMonthYearDropdown && !r)
|
|
@@ -4956,7 +4956,7 @@ var Hs = ["react-datepicker__year-select", "react-datepicker__month-select", "re
|
|
|
4956
4956
|
return f.createElement(Ws, { date: r, timeString: s, timeInputLabel: t.props.timeInputLabel, onChange: t.props.onTimeChange, customTimeInput: t.props.customTimeInput });
|
|
4957
4957
|
}), l(p(t), "renderAriaLiveRegion", function() {
|
|
4958
4958
|
var r, s = Ye(t.state.date, t.props.yearItemNumber), o = s.startPeriod, i = s.endPeriod;
|
|
4959
|
-
return r = t.props.showYearPicker ? "".concat(o, " - ").concat(i) : t.props.showMonthYearPicker || t.props.showQuarterYearPicker ? P(t.state.date) : "".concat(jt(
|
|
4959
|
+
return r = t.props.showYearPicker ? "".concat(o, " - ").concat(i) : t.props.showMonthYearPicker || t.props.showQuarterYearPicker ? P(t.state.date) : "".concat(jt($(t.state.date), t.props.locale), " ").concat(P(t.state.date)), f.createElement("span", { role: "alert", "aria-live": "polite", className: "react-datepicker__aria-live" }, t.state.isRenderAriaLiveMessage && r);
|
|
4960
4960
|
}), l(p(t), "renderChildren", function() {
|
|
4961
4961
|
if (t.props.children)
|
|
4962
4962
|
return f.createElement("div", { className: "react-datepicker__children-container" }, t.props.children);
|
|
@@ -5220,7 +5220,7 @@ var Hs = ["react-datepicker__year-select", "react-datepicker__month-select", "re
|
|
|
5220
5220
|
if (!c)
|
|
5221
5221
|
return void (t.props.onInputError && t.props.onInputError({ code: 1, msg: xt }));
|
|
5222
5222
|
if (r.preventDefault(), t.setState({ lastPreSelectChange: St }), t.props.adjustDateOnChange && t.setSelected(c), t.setPreSelection(c), t.props.inline) {
|
|
5223
|
-
var u =
|
|
5223
|
+
var u = $(i), d = $(c), h = P(i), g = P(c);
|
|
5224
5224
|
u !== d || h !== g ? t.setState({ shouldFocusDayInline: !0 }) : t.setState({ shouldFocusDayInline: !1 });
|
|
5225
5225
|
}
|
|
5226
5226
|
}
|
|
@@ -5258,7 +5258,7 @@ var Hs = ["react-datepicker__year-select", "react-datepicker__month-select", "re
|
|
|
5258
5258
|
window.addEventListener("scroll", this.onScroll, !0);
|
|
5259
5259
|
} }, { key: "componentDidUpdate", value: function(e, t) {
|
|
5260
5260
|
var r, s;
|
|
5261
|
-
e.inline && (r = e.selected, s = this.props.selected, r && s ?
|
|
5261
|
+
e.inline && (r = e.selected, s = this.props.selected, r && s ? $(r) !== $(s) || P(r) !== P(s) : r !== s) && this.setPreSelection(this.props.selected), this.state.monthSelectedIn !== void 0 && e.monthsShown !== this.props.monthsShown && this.setState({ monthSelectedIn: 0 }), e.highlightDates !== this.props.highlightDates && this.setState({ highlightDates: kn(this.props.highlightDates) }), t.focused || Me(e.selected, this.props.selected) || this.setState({ inputValue: null }), t.open !== this.state.open && (t.open === !1 && this.state.open === !0 && this.props.onCalendarOpen(), t.open === !0 && this.state.open === !1 && this.props.onCalendarClose());
|
|
5262
5262
|
} }, { key: "componentWillUnmount", value: function() {
|
|
5263
5263
|
this.clearPreventFocusTimeout(), window.removeEventListener("scroll", this.onScroll, !0);
|
|
5264
5264
|
} }, { key: "renderInputContainer", value: function() {
|
|
@@ -5289,7 +5289,7 @@ var Hs = ["react-datepicker__year-select", "react-datepicker__month-select", "re
|
|
|
5289
5289
|
}, monthsShown: 1, readOnly: !1, withPortal: !1, selectsDisabledDaysInRange: !1, shouldCloseOnSelect: !0, showTimeSelect: !1, showTimeInput: !1, showPreviousMonths: !1, showMonthYearPicker: !1, showFullMonthYearPicker: !1, showTwoColumnMonthYearPicker: !1, showFourColumnMonthYearPicker: !1, showYearPicker: !1, showQuarterYearPicker: !1, showWeekPicker: !1, strictParsing: !1, timeIntervals: 30, timeCaption: "Time", previousMonthAriaLabel: "Previous Month", previousMonthButtonLabel: "Previous Month", nextMonthAriaLabel: "Next Month", nextMonthButtonLabel: "Next Month", previousYearAriaLabel: "Previous Year", previousYearButtonLabel: "Previous Year", nextYearAriaLabel: "Next Year", nextYearButtonLabel: "Next Year", timeInputLabel: "Time", enableTabLoop: !0, yearItemNumber: Be, focusSelectedMonth: !1, showPopperArrow: !0, excludeScrollbar: !0, customTimeInput: null, calendarStartDay: void 0, toggleCalendarOnIconClick: !1 };
|
|
5290
5290
|
} }]), n;
|
|
5291
5291
|
}(), Us = "input", St = "navigate";
|
|
5292
|
-
const
|
|
5292
|
+
const $s = Mr(
|
|
5293
5293
|
({
|
|
5294
5294
|
onChange: a,
|
|
5295
5295
|
value: n,
|
|
@@ -5307,7 +5307,7 @@ const Xs = Mr(
|
|
|
5307
5307
|
preventOpenOnFocus: m,
|
|
5308
5308
|
...y
|
|
5309
5309
|
}, w) => {
|
|
5310
|
-
const x = s ??
|
|
5310
|
+
const x = s ?? Xs(r);
|
|
5311
5311
|
return /* @__PURE__ */ be.jsx(
|
|
5312
5312
|
gr,
|
|
5313
5313
|
{
|
|
@@ -5354,10 +5354,10 @@ const Xs = Mr(
|
|
|
5354
5354
|
);
|
|
5355
5355
|
}
|
|
5356
5356
|
);
|
|
5357
|
-
|
|
5358
|
-
function
|
|
5357
|
+
$s.displayName = "InputDateComponent";
|
|
5358
|
+
function Xs(a) {
|
|
5359
5359
|
return `${new Date(2023, 11, 15).toLocaleDateString().replace("15", "dd").replace("12", "MM").replace("2023", "yyyy")}${a ? ", h:mm aa" : ""}`;
|
|
5360
5360
|
}
|
|
5361
5361
|
export {
|
|
5362
|
-
|
|
5362
|
+
$s as InputDateComponent
|
|
5363
5363
|
};
|
package/dist/helpers/route.d.ts
CHANGED
|
@@ -33,12 +33,38 @@ export declare const createTypedRoute: <Parameters_1 extends Record<string, any>
|
|
|
33
33
|
* name?: string | undefined;
|
|
34
34
|
* }
|
|
35
35
|
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const route = createTypedRoute<{ type: 'A' | 42; enabled?: boolean }>()(
|
|
40
|
+
* '/orders/:type/:enabled?/'
|
|
41
|
+
* )
|
|
42
|
+
*
|
|
43
|
+
* type Params = GetParams<typeof route>
|
|
44
|
+
*
|
|
45
|
+
* // equivalent to
|
|
46
|
+
*
|
|
47
|
+
* type Params = {
|
|
48
|
+
* type: 'A' | '42';
|
|
49
|
+
* enabled?: "false" | "true" | undefined;
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
36
52
|
*/
|
|
37
53
|
export type GetParams<R extends {
|
|
38
54
|
makePath: (...arg: any[]) => string;
|
|
39
55
|
}> = {
|
|
40
|
-
[K in keyof Parameters<R['makePath']>[0]]:
|
|
56
|
+
[K in keyof Parameters<R['makePath']>[0]]: Exclude<ToLiteral<Parameters<R['makePath']>[0][K]>, 'undefined' | 'null'>;
|
|
41
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Cast a valid `string | number | bigint | boolean | null | undefined` to literal.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* type N = ToLiteral<42> //= '42'
|
|
64
|
+
* type B = ToLiteral<boolean> //= 'false' | 'true'
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
type ToLiteral<V extends string | number | bigint | boolean | null | undefined> = `${V}`;
|
|
42
68
|
interface Route<Path extends `/${string}/` | `/`, Parameters extends Record<string, unknown> = ExtractParameters<Path>> {
|
|
43
69
|
path: Path extends `/${infer P}/` ? `/${P}` : '/';
|
|
44
70
|
makePath: (parameters: Parameters, searchParams?: string | URLSearchParams) => string;
|