Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@helsenorge/datepicker

Package Overview
Dependencies
Maintainers
0
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@helsenorge/datepicker - npm Package Compare versions

Comparing version 8.6.0 to 8.8.0

2

components/DatePicker/DateTime.d.ts
import React from 'react';
export type TimeUnit = 'hours' | 'minutes';
export interface DateTimeProps extends Pick<React.InputHTMLAttributes<HTMLInputElement>, 'name' | 'aria-describedby' | 'aria-labelledby' | 'onChange' | 'disabled' | 'autoComplete'> {
export interface DateTimeProps extends Pick<React.InputHTMLAttributes<HTMLInputElement>, 'name' | 'aria-describedby' | 'aria-labelledby' | 'onBlur' | 'onChange' | 'disabled' | 'autoComplete'> {
/** Default value that is set on the input field */

@@ -5,0 +5,0 @@ defaultValue?: number;

@@ -1,4 +0,4 @@

import { jsx as s, jsxs as B, Fragment as Y } from "react/jsx-runtime";
import Z, { createContext as Q, forwardRef as Ut, useContext as z, useState as F, useEffect as $, useLayoutEffect as Xt, useRef as re } from "react";
import { isSameDay as C, subDays as Ce, addDays as E, differenceInCalendarDays as U, startOfMonth as R, endOfMonth as Fe, startOfDay as nt, addMonths as V, differenceInCalendarMonths as se, isSameMonth as Ae, isBefore as He, isAfter as ye, getUnixTime as Zt, getWeeksInMonth as Gt, addWeeks as Ee, isSameYear as $t, setMonth as Pe, setYear as rt, startOfYear as qt, max as Jt, min as Qt, endOfISOWeek as ht, endOfWeek as mt, startOfISOWeek as Ye, startOfWeek as je, getISOWeek as zt, getWeek as en, format as W, isDate as pt, addYears as tn, isValid as de, parse as le, isWithinInterval as nn } from "date-fns";
import { jsx as s, jsxs as R, Fragment as Y } from "react/jsx-runtime";
import $, { createContext as ee, forwardRef as Ut, useContext as te, useState as F, useEffect as J, useLayoutEffect as Xt, useRef as ae } from "react";
import { isSameDay as C, subDays as Ce, addDays as L, differenceInCalendarDays as X, startOfMonth as E, endOfMonth as Fe, startOfDay as nt, addMonths as K, differenceInCalendarMonths as se, isSameMonth as Ae, isBefore as He, isAfter as ye, getUnixTime as Zt, getWeeksInMonth as Gt, addWeeks as Ee, isSameYear as $t, setMonth as Pe, setYear as rt, startOfYear as qt, max as Jt, min as Qt, endOfISOWeek as ht, endOfWeek as mt, startOfISOWeek as Ye, startOfWeek as je, getISOWeek as zt, getWeek as en, format as O, isDate as pt, addYears as tn, isValid as de, parse as le, isWithinInterval as nn } from "date-fns";
import { enUS as rn, nb as an } from "date-fns/locale";

@@ -24,3 +24,3 @@ import on from "@helsenorge/designsystem-react/components/Button";

import { getSpacer as bn } from "@helsenorge/designsystem-react/theme/currys/spacing";
import I from "./styles.module.scss";
import x from "./styles.module.scss";
import gn from "@helsenorge/designsystem-react/components/ErrorWrapper";

@@ -104,9 +104,9 @@ import { useUuid as _n } from "@helsenorge/designsystem-react/hooks/useUuid";

function Mn(e, n) {
return W(e, "LLLL y", n);
return O(e, "LLLL y", n);
}
function kn(e, n) {
return W(e, "d", n);
return O(e, "d", n);
}
function Nn(e, n) {
return W(e, "LLLL", n);
return O(e, "LLLL", n);
}

@@ -117,6 +117,6 @@ function Cn(e) {

function Pn(e, n) {
return W(e, "cccccc", n);
return O(e, "cccccc", n);
}
function xn(e, n) {
return W(e, "yyyy", n);
return O(e, "yyyy", n);
}

@@ -132,3 +132,3 @@ var In = /* @__PURE__ */ Object.freeze({

}), On = function(e, n, t) {
return W(e, "do MMMM (EEEE)", t);
return O(e, "do MMMM (EEEE)", t);
}, Wn = function() {

@@ -141,3 +141,3 @@ return "Month: ";

}, En = function(e, n) {
return W(e, "cccc", n);
return O(e, "cccc", n);
}, Rn = function(e) {

@@ -175,3 +175,3 @@ return "Week n. ".concat(e);

var n = e.fromYear, t = e.toYear, r = e.fromMonth, a = e.toMonth, o = e.fromDate, i = e.toDate;
return r ? o = R(r) : n && (o = new Date(n, 0, 1)), a ? i = Fe(a) : t && (i = new Date(t, 11, 31)), {
return r ? o = E(r) : n && (o = new Date(n, 0, 1)), a ? i = Fe(a) : t && (i = new Date(t, 11, 31)), {
fromDate: o ? nt(o) : void 0,

@@ -181,3 +181,3 @@ toDate: i ? nt(i) : void 0

}
var wt = Q(void 0);
var wt = ee(void 0);
function Hn(e) {

@@ -188,7 +188,7 @@ var n, t = e.initialProps, r = Fn(), a = An(t), o = a.fromDate, i = a.toDate, l = (n = t.captionLayout) !== null && n !== void 0 ? n : r.captionLayout;

(ge(t) || ue(t) || ce(t)) && (d = t.onSelect);
var c = g(g(g({}, r), t), { captionLayout: l, classNames: g(g({}, r.classNames), t.classNames), components: g({}, t.components), formatters: g(g({}, r.formatters), t.formatters), fromDate: o, labels: g(g({}, r.labels), t.labels), mode: t.mode || r.mode, modifiers: g(g({}, r.modifiers), t.modifiers), modifiersClassNames: g(g({}, r.modifiersClassNames), t.modifiersClassNames), onSelect: d, styles: g(g({}, r.styles), t.styles), toDate: i });
return s(wt.Provider, { value: c, children: e.children });
var u = g(g(g({}, r), t), { captionLayout: l, classNames: g(g({}, r.classNames), t.classNames), components: g({}, t.components), formatters: g(g({}, r.formatters), t.formatters), fromDate: o, labels: g(g({}, r.labels), t.labels), mode: t.mode || r.mode, modifiers: g(g({}, r.modifiers), t.modifiers), modifiersClassNames: g(g({}, r.modifiersClassNames), t.modifiersClassNames), onSelect: d, styles: g(g({}, r.styles), t.styles), toDate: i });
return s(wt.Provider, { value: u, children: e.children });
}
function k() {
var e = z(wt);
var e = te(wt);
if (!e)

@@ -206,7 +206,7 @@ throw new Error("useDayPicker must be used within a DayPickerProvider.");

function Mt(e) {
var n, t, r = e.onChange, a = e.value, o = e.children, i = e.caption, l = e.className, d = e.style, c = k(), u = (t = (n = c.components) === null || n === void 0 ? void 0 : n.IconDropdown) !== null && t !== void 0 ? t : Yn;
return B("div", { className: l, style: d, children: [s("span", { className: c.classNames.vhidden, children: e["aria-label"] }), s("select", { name: e.name, "aria-label": e["aria-label"], className: c.classNames.dropdown, style: c.styles.dropdown, value: a, onChange: r, children: o }), B("div", { className: c.classNames.caption_label, style: c.styles.caption_label, "aria-hidden": "true", children: [i, s(u, { className: c.classNames.dropdown_icon, style: c.styles.dropdown_icon })] })] });
var n, t, r = e.onChange, a = e.value, o = e.children, i = e.caption, l = e.className, d = e.style, u = k(), c = (t = (n = u.components) === null || n === void 0 ? void 0 : n.IconDropdown) !== null && t !== void 0 ? t : Yn;
return R("div", { className: l, style: d, children: [s("span", { className: u.classNames.vhidden, children: e["aria-label"] }), s("select", { name: e.name, "aria-label": e["aria-label"], className: u.classNames.dropdown, style: u.styles.dropdown, value: a, onChange: r, children: o }), R("div", { className: u.classNames.caption_label, style: u.styles.caption_label, "aria-hidden": "true", children: [i, s(c, { className: u.classNames.dropdown_icon, style: u.styles.dropdown_icon })] })] });
}
function jn(e) {
var n, t = k(), r = t.fromDate, a = t.toDate, o = t.styles, i = t.locale, l = t.formatters.formatMonthCaption, d = t.classNames, c = t.components, u = t.labels.labelMonthDropdown;
var n, t = k(), r = t.fromDate, a = t.toDate, o = t.styles, i = t.locale, l = t.formatters.formatMonthCaption, d = t.classNames, u = t.components, c = t.labels.labelMonthDropdown;
if (!r)

@@ -218,12 +218,12 @@ return s(Y, {});

if ($t(r, a))
for (var v = R(r), h = r.getMonth(); h <= a.getMonth(); h++)
for (var v = E(r), h = r.getMonth(); h <= a.getMonth(); h++)
f.push(Pe(v, h));
else
for (var v = R(/* @__PURE__ */ new Date()), h = 0; h <= 11; h++)
for (var v = E(/* @__PURE__ */ new Date()), h = 0; h <= 11; h++)
f.push(Pe(v, h));
var y = function(b) {
var M = Number(b.target.value), D = Pe(R(e.displayMonth), M);
var M = Number(b.target.value), D = Pe(E(e.displayMonth), M);
e.onChange(D);
}, _ = (n = c == null ? void 0 : c.Dropdown) !== null && n !== void 0 ? n : Mt;
return s(_, { name: "months", "aria-label": u(), className: d.dropdown_month, style: o.dropdown_month, onChange: y, value: e.displayMonth.getMonth(), caption: l(e.displayMonth, { locale: i }), children: f.map(function(b) {
}, _ = (n = u == null ? void 0 : u.Dropdown) !== null && n !== void 0 ? n : Mt;
return s(_, { name: "months", "aria-label": c(), className: d.dropdown_month, style: o.dropdown_month, onChange: y, value: e.displayMonth.getMonth(), caption: l(e.displayMonth, { locale: i }), children: f.map(function(b) {
return s("option", { value: b.getMonth(), children: l(b, { locale: i }) }, b.getMonth());

@@ -233,3 +233,3 @@ }) });

function Vn(e) {
var n, t = e.displayMonth, r = k(), a = r.fromDate, o = r.toDate, i = r.locale, l = r.styles, d = r.classNames, c = r.components, u = r.formatters.formatYearCaption, f = r.labels.labelYearDropdown, v = [];
var n, t = e.displayMonth, r = k(), a = r.fromDate, o = r.toDate, i = r.locale, l = r.styles, d = r.classNames, u = r.components, c = r.formatters.formatYearCaption, f = r.labels.labelYearDropdown, v = [];
if (!a)

@@ -242,7 +242,7 @@ return s(Y, {});

var b = function(D) {
var S = rt(R(t), Number(D.target.value));
e.onChange(S);
}, M = (n = c == null ? void 0 : c.Dropdown) !== null && n !== void 0 ? n : Mt;
return s(M, { name: "years", "aria-label": f(), className: d.dropdown_year, style: l.dropdown_year, onChange: b, value: t.getFullYear(), caption: u(t, { locale: i }), children: v.map(function(D) {
return s("option", { value: D.getFullYear(), children: u(D, { locale: i }) }, D.getFullYear());
var W = rt(E(t), Number(D.target.value));
e.onChange(W);
}, M = (n = u == null ? void 0 : u.Dropdown) !== null && n !== void 0 ? n : Mt;
return s(M, { name: "years", "aria-label": f(), className: d.dropdown_year, style: l.dropdown_year, onChange: b, value: t.getFullYear(), caption: c(t, { locale: i }), children: v.map(function(D) {
return s("option", { value: D.getFullYear(), children: c(D, { locale: i }) }, D.getFullYear());
}) });

@@ -257,6 +257,6 @@ }

if (o && se(o, a) < 0) {
var c = -1 * (d - 1);
a = V(o, c);
var u = -1 * (d - 1);
a = K(o, u);
}
return i && se(a, i) < 0 && (a = i), R(a);
return i && se(a, i) < 0 && (a = i), E(a);
}

@@ -267,3 +267,3 @@ function Xn() {

if (!e.disableNavigation) {
var d = R(i);
var d = E(i);
a(d), (l = e.onMonthChange) === null || l === void 0 || l.call(e, d);

@@ -275,5 +275,5 @@ }

function Zn(e, n) {
for (var t = n.reverseMonths, r = n.numberOfMonths, a = R(e), o = R(V(a, r)), i = se(o, a), l = [], d = 0; d < i; d++) {
var c = V(a, d);
l.push(c);
for (var t = n.reverseMonths, r = n.numberOfMonths, a = E(e), o = E(K(a, r)), i = se(o, a), l = [], d = 0; d < i; d++) {
var u = K(a, d);
l.push(u);
}

@@ -284,8 +284,8 @@ return t && (l = l.reverse()), l;

if (!n.disableNavigation) {
var t = n.toDate, r = n.pagedNavigation, a = n.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l = R(e);
var t = n.toDate, r = n.pagedNavigation, a = n.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l = E(e);
if (!t)
return V(l, i);
return K(l, i);
var d = se(t, e);
if (!(d < o))
return V(l, i);
return K(l, i);
}

@@ -295,11 +295,11 @@ }

if (!n.disableNavigation) {
var t = n.fromDate, r = n.pagedNavigation, a = n.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l = R(e);
var t = n.fromDate, r = n.pagedNavigation, a = n.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, l = E(e);
if (!t)
return V(l, -i);
return K(l, -i);
var d = se(l, t);
if (!(d <= 0))
return V(l, -i);
return K(l, -i);
}
}
var kt = Q(void 0);
var kt = ee(void 0);
function qn(e) {

@@ -310,9 +310,9 @@ var n = k(), t = Xn(), r = t[0], a = t[1], o = Zn(r, n), i = Gn(r, n), l = $n(r, n), d = function(f) {

});
}, c = function(f, v) {
d(f) || (v && He(f, v) ? a(V(f, 1 + n.numberOfMonths * -1)) : a(f));
}, u = {
}, u = function(f, v) {
d(f) || (v && He(f, v) ? a(K(f, 1 + n.numberOfMonths * -1)) : a(f));
}, c = {
currentMonth: r,
displayMonths: o,
goToMonth: a,
goToDate: c,
goToDate: u,
previousMonth: l,

@@ -322,6 +322,6 @@ nextMonth: i,

};
return s(kt.Provider, { value: u, children: e.children });
return s(kt.Provider, { value: c, children: e.children });
}
function fe() {
var e = z(kt);
var e = te(kt);
if (!e)

@@ -332,6 +332,6 @@ throw new Error("useNavigation must be used within a NavigationProvider");

function lt(e) {
var n, t = k(), r = t.classNames, a = t.styles, o = t.components, i = fe().goToMonth, l = function(u) {
i(V(u, e.displayIndex ? -e.displayIndex : 0));
}, d = (n = o == null ? void 0 : o.CaptionLabel) !== null && n !== void 0 ? n : Dt, c = s(d, { id: e.id, displayMonth: e.displayMonth });
return B("div", { className: r.caption_dropdowns, style: a.caption_dropdowns, children: [s("div", { className: r.vhidden, children: c }), s(jn, { onChange: l, displayMonth: e.displayMonth }), s(Vn, { onChange: l, displayMonth: e.displayMonth })] });
var n, t = k(), r = t.classNames, a = t.styles, o = t.components, i = fe().goToMonth, l = function(c) {
i(K(c, e.displayIndex ? -e.displayIndex : 0));
}, d = (n = o == null ? void 0 : o.CaptionLabel) !== null && n !== void 0 ? n : Dt, u = s(d, { id: e.id, displayMonth: e.displayMonth });
return R("div", { className: r.caption_dropdowns, style: a.caption_dropdowns, children: [s("div", { className: r.vhidden, children: u }), s(jn, { onChange: l, displayMonth: e.displayMonth }), s(Vn, { onChange: l, displayMonth: e.displayMonth })] });
}

@@ -351,13 +351,13 @@ function Jn(e) {

function zn(e) {
var n, t, r = k(), a = r.dir, o = r.locale, i = r.classNames, l = r.styles, d = r.labels, c = d.labelPrevious, u = d.labelNext, f = r.components;
var n, t, r = k(), a = r.dir, o = r.locale, i = r.classNames, l = r.styles, d = r.labels, u = d.labelPrevious, c = d.labelNext, f = r.components;
if (!e.nextMonth && !e.previousMonth)
return s(Y, {});
var v = c(e.previousMonth, { locale: o }), h = [
var v = u(e.previousMonth, { locale: o }), h = [
i.nav_button,
i.nav_button_previous
].join(" "), y = u(e.nextMonth, { locale: o }), _ = [
].join(" "), y = c(e.nextMonth, { locale: o }), _ = [
i.nav_button,
i.nav_button_next
].join(" "), b = (n = f == null ? void 0 : f.IconRight) !== null && n !== void 0 ? n : Qn, M = (t = f == null ? void 0 : f.IconLeft) !== null && t !== void 0 ? t : Jn;
return B("div", { className: i.nav, style: l.nav, children: [!e.hidePrevious && s(be, { name: "previous-month", "aria-label": v, className: h, style: l.nav_button_previous, disabled: !e.previousMonth, onClick: e.onPreviousClick, children: a === "rtl" ? s(b, { className: i.nav_icon, style: l.nav_icon }) : s(M, { className: i.nav_icon, style: l.nav_icon }) }), !e.hideNext && s(be, { name: "next-month", "aria-label": y, className: _, style: l.nav_button_next, disabled: !e.nextMonth, onClick: e.onNextClick, children: a === "rtl" ? s(M, { className: i.nav_icon, style: l.nav_icon }) : s(b, { className: i.nav_icon, style: l.nav_icon }) })] });
return R("div", { className: i.nav, style: l.nav, children: [!e.hidePrevious && s(be, { name: "previous-month", "aria-label": v, className: h, style: l.nav_button_previous, disabled: !e.previousMonth, onClick: e.onPreviousClick, children: a === "rtl" ? s(b, { className: i.nav_icon, style: l.nav_icon }) : s(M, { className: i.nav_icon, style: l.nav_icon }) }), !e.hideNext && s(be, { name: "next-month", "aria-label": y, className: _, style: l.nav_button_next, disabled: !e.nextMonth, onClick: e.onNextClick, children: a === "rtl" ? s(M, { className: i.nav_icon, style: l.nav_icon }) : s(b, { className: i.nav_icon, style: l.nav_icon }) })] });
}

@@ -367,3 +367,3 @@ function st(e) {

return Ae(e.displayMonth, y);
}), d = l === 0, c = l === i.length - 1, u = n > 1 && (d || !c), f = n > 1 && (c || !d), v = function() {
}), d = l === 0, u = l === i.length - 1, c = n > 1 && (d || !u), f = n > 1 && (u || !d), v = function() {
r && o(r);

@@ -373,7 +373,7 @@ }, h = function() {

};
return s(zn, { displayMonth: e.displayMonth, hideNext: u, hidePrevious: f, nextMonth: a, previousMonth: r, onPreviousClick: v, onNextClick: h });
return s(zn, { displayMonth: e.displayMonth, hideNext: c, hidePrevious: f, nextMonth: a, previousMonth: r, onPreviousClick: v, onNextClick: h });
}
function er(e) {
var n, t = k(), r = t.classNames, a = t.disableNavigation, o = t.styles, i = t.captionLayout, l = t.components, d = (n = l == null ? void 0 : l.CaptionLabel) !== null && n !== void 0 ? n : Dt, c;
return a ? c = s(d, { id: e.id, displayMonth: e.displayMonth }) : i === "dropdown" ? c = s(lt, { displayMonth: e.displayMonth, id: e.id }) : i === "dropdown-buttons" ? c = B(Y, { children: [s(lt, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id }), s(st, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id })] }) : c = B(Y, { children: [s(d, { id: e.id, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), s(st, { displayMonth: e.displayMonth, id: e.id })] }), s("div", { className: r.caption, style: o.caption, children: c });
var n, t = k(), r = t.classNames, a = t.disableNavigation, o = t.styles, i = t.captionLayout, l = t.components, d = (n = l == null ? void 0 : l.CaptionLabel) !== null && n !== void 0 ? n : Dt, u;
return a ? u = s(d, { id: e.id, displayMonth: e.displayMonth }) : i === "dropdown" ? u = s(lt, { displayMonth: e.displayMonth, id: e.id }) : i === "dropdown-buttons" ? u = R(Y, { children: [s(lt, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id }), s(st, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id })] }) : u = R(Y, { children: [s(d, { id: e.id, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), s(st, { displayMonth: e.displayMonth, id: e.id })] }), s("div", { className: r.caption, style: o.caption, children: u });
}

@@ -386,3 +386,3 @@ function tr(e) {

for (var r = t ? Ye(/* @__PURE__ */ new Date()) : je(/* @__PURE__ */ new Date(), { locale: e, weekStartsOn: n }), a = [], o = 0; o < 7; o++) {
var i = E(r, o);
var i = L(r, o);
a.push(i);

@@ -393,5 +393,5 @@ }

function rr() {
var e = k(), n = e.classNames, t = e.styles, r = e.showWeekNumber, a = e.locale, o = e.weekStartsOn, i = e.ISOWeek, l = e.formatters.formatWeekdayName, d = e.labels.labelWeekday, c = nr(a, o, i);
return B("tr", { style: t.head_row, className: n.head_row, children: [r && s("td", { style: t.head_cell, className: n.head_cell }), c.map(function(u, f) {
return s("th", { scope: "col", className: n.head_cell, style: t.head_cell, "aria-label": d(u, { locale: a }), children: l(u, { locale: a }) }, f);
var e = k(), n = e.classNames, t = e.styles, r = e.showWeekNumber, a = e.locale, o = e.weekStartsOn, i = e.ISOWeek, l = e.formatters.formatWeekdayName, d = e.labels.labelWeekday, u = nr(a, o, i);
return R("tr", { style: t.head_row, className: n.head_row, children: [r && s("td", { style: t.head_cell, className: n.head_cell }), u.map(function(c, f) {
return s("th", { scope: "col", className: n.head_cell, style: t.head_cell, "aria-label": d(c, { locale: a }), children: l(c, { locale: a }) }, f);
})] });

@@ -407,3 +407,3 @@ }

}
var Ve = Q(void 0);
var Ve = ee(void 0);
function ir(e) {

@@ -422,18 +422,18 @@ if (!ue(e.initialProps)) {

function lr(e) {
var n = e.initialProps, t = e.children, r = n.selected, a = n.min, o = n.max, i = function(c, u, f) {
var n = e.initialProps, t = e.children, r = n.selected, a = n.min, o = n.max, i = function(u, c, f) {
var v, h;
(v = n.onDayClick) === null || v === void 0 || v.call(n, c, u, f);
var y = !!(u.selected && a && (r == null ? void 0 : r.length) === a);
(v = n.onDayClick) === null || v === void 0 || v.call(n, u, c, f);
var y = !!(c.selected && a && (r == null ? void 0 : r.length) === a);
if (!y) {
var _ = !!(!u.selected && o && (r == null ? void 0 : r.length) === o);
var _ = !!(!c.selected && o && (r == null ? void 0 : r.length) === o);
if (!_) {
var b = r ? _t([], r) : [];
if (u.selected) {
if (c.selected) {
var M = b.findIndex(function(D) {
return C(c, D);
return C(u, D);
});
b.splice(M, 1);
} else
b.push(c);
(h = n.onSelect) === null || h === void 0 || h.call(n, b, c, u, f);
b.push(u);
(h = n.onSelect) === null || h === void 0 || h.call(n, b, u, c, f);
}

@@ -444,7 +444,7 @@ }

};
r && l.disabled.push(function(c) {
var u = o && r.length > o - 1, f = r.some(function(v) {
return C(v, c);
r && l.disabled.push(function(u) {
var c = o && r.length > o - 1, f = r.some(function(v) {
return C(v, u);
});
return !!(u && !f);
return !!(c && !f);
});

@@ -459,3 +459,3 @@ var d = {

function Ke() {
var e = z(Ve);
var e = te(Ve);
if (!e)

@@ -469,3 +469,3 @@ throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");

}
var Ue = Q(void 0);
var Ue = ee(void 0);
function dr(e) {

@@ -487,3 +487,3 @@ if (!ce(e.initialProps)) {

function ur(e) {
var n = e.initialProps, t = e.children, r = n.selected, a = r || {}, o = a.from, i = a.to, l = n.min, d = n.max, c = function(h, y, _) {
var n = e.initialProps, t = e.children, r = n.selected, a = r || {}, o = a.from, i = a.to, l = n.min, d = n.max, u = function(h, y, _) {
var b, M;

@@ -493,3 +493,3 @@ (b = n.onDayClick) === null || b === void 0 || b.call(n, h, y, _);

(M = n.onSelect) === null || M === void 0 || M.call(n, D, h, y, _);
}, u = {
}, c = {
range_start: [],

@@ -500,3 +500,3 @@ range_end: [],

};
if (o ? (u.range_start = [o], i ? (u.range_end = [i], C(o, i) || (u.range_middle = [
if (o ? (c.range_start = [o], i ? (c.range_end = [i], C(o, i) || (c.range_middle = [
{

@@ -506,34 +506,34 @@ after: o,

}
])) : u.range_end = [o]) : i && (u.range_start = [i], u.range_end = [i]), l && (o && !i && u.disabled.push({
])) : c.range_end = [o]) : i && (c.range_start = [i], c.range_end = [i]), l && (o && !i && c.disabled.push({
after: Ce(o, l - 1),
before: E(o, l - 1)
}), o && i && u.disabled.push({
before: L(o, l - 1)
}), o && i && c.disabled.push({
after: o,
before: E(o, l - 1)
}), !o && i && u.disabled.push({
before: L(o, l - 1)
}), !o && i && c.disabled.push({
after: Ce(i, l - 1),
before: E(i, l - 1)
before: L(i, l - 1)
})), d) {
if (o && !i && (u.disabled.push({
before: E(o, -d + 1)
}), u.disabled.push({
after: E(o, d - 1)
if (o && !i && (c.disabled.push({
before: L(o, -d + 1)
}), c.disabled.push({
after: L(o, d - 1)
})), o && i) {
var f = U(i, o) + 1, v = d - f;
u.disabled.push({
var f = X(i, o) + 1, v = d - f;
c.disabled.push({
before: Ce(o, v)
}), u.disabled.push({
after: E(i, v)
}), c.disabled.push({
after: L(i, v)
});
}
!o && i && (u.disabled.push({
before: E(i, -d + 1)
}), u.disabled.push({
after: E(i, d - 1)
!o && i && (c.disabled.push({
before: L(i, -d + 1)
}), c.disabled.push({
after: L(i, d - 1)
}));
}
return s(Ue.Provider, { value: { selected: r, onDayClick: c, modifiers: u }, children: t });
return s(Ue.Provider, { value: { selected: r, onDayClick: u, modifiers: c }, children: t });
}
function Xe() {
var e = z(Ue);
var e = te(Ue);
if (!e)

@@ -557,8 +557,8 @@ throw new Error("useSelectRange must be used within a SelectRangeProvider");

})(j || (j = {}));
var fr = j.Selected, K = j.Disabled, vr = j.Hidden, hr = j.Today, xe = j.RangeEnd, Ie = j.RangeMiddle, Oe = j.RangeStart, mr = j.Outside;
var fr = j.Selected, U = j.Disabled, vr = j.Hidden, hr = j.Today, xe = j.RangeEnd, Ie = j.RangeMiddle, Oe = j.RangeStart, mr = j.Outside;
function pr(e, n, t) {
var r, a = (r = {}, r[fr] = pe(e.selected), r[K] = pe(e.disabled), r[vr] = pe(e.hidden), r[hr] = [e.today], r[xe] = [], r[Ie] = [], r[Oe] = [], r[mr] = [], r);
return e.fromDate && a[K].push({ before: e.fromDate }), e.toDate && a[K].push({ after: e.toDate }), ue(e) ? a[K] = a[K].concat(n.modifiers[K]) : ce(e) && (a[K] = a[K].concat(t.modifiers[K]), a[Oe] = t.modifiers[Oe], a[Ie] = t.modifiers[Ie], a[xe] = t.modifiers[xe]), a;
var r, a = (r = {}, r[fr] = pe(e.selected), r[U] = pe(e.disabled), r[vr] = pe(e.hidden), r[hr] = [e.today], r[xe] = [], r[Ie] = [], r[Oe] = [], r[mr] = [], r);
return e.fromDate && a[U].push({ before: e.fromDate }), e.toDate && a[U].push({ after: e.toDate }), ue(e) ? a[U] = a[U].concat(n.modifiers[U]) : ce(e) && (a[U] = a[U].concat(t.modifiers[U]), a[Oe] = t.modifiers[Oe], a[Ie] = t.modifiers[Ie], a[xe] = t.modifiers[xe]), a;
}
var Nt = Q(void 0);
var Nt = ee(void 0);
function yr(e) {

@@ -569,3 +569,3 @@ var n = k(), t = Ke(), r = Xe(), a = pr(n, t, r), o = cr(n.modifiers), i = g(g({}, a), o);

function Ct() {
var e = z(Nt);
var e = te(Nt);
if (!e)

@@ -593,5 +593,5 @@ throw new Error("useModifiers must be used within a ModifiersProvider");

if (r && a) {
var o = U(a, r) < 0;
var o = X(a, r) < 0;
o && (t = [a, r], r = t[0], a = t[1]);
var i = U(e, r) >= 0 && U(a, e) >= 0;
var i = X(e, r) >= 0 && X(a, e) >= 0;
return i;

@@ -620,6 +620,6 @@ }

if (br(t)) {
var r = U(t.before, e), a = U(t.after, e), o = r > 0, i = a < 0, l = ye(t.before, t.after);
var r = X(t.before, e), a = X(t.after, e), o = r > 0, i = a < 0, l = ye(t.before, t.after);
return l ? i && o : o || i;
}
return _r(t) ? U(e, t.after) > 0 : wr(t) ? U(t.before, e) > 0 : typeof t == "function" ? t(e) : !1;
return _r(t) ? X(e, t.after) > 0 : wr(t) ? X(t.before, e) > 0 : typeof t == "function" ? t(e) : !1;
});

@@ -637,6 +637,6 @@ }

function Pr(e, n) {
for (var t = R(e[0]), r = Fe(e[e.length - 1]), a, o, i = t; i <= r; ) {
for (var t = E(e[0]), r = Fe(e[e.length - 1]), a, o, i = t; i <= r; ) {
var l = Ze(i, n), d = !l.disabled && !l.hidden;
if (!d) {
i = E(i, 1);
i = L(i, 1);
continue;

@@ -646,3 +646,3 @@ }

return i;
l.today && !o && (o = i), a || (a = i), i = E(i, 1);
l.today && !o && (o = i), a || (a = i), i = L(i, 1);
}

@@ -653,6 +653,6 @@ return o || a;

function Pt(e, n) {
var t = n.moveBy, r = n.direction, a = n.context, o = n.modifiers, i = n.retry, l = i === void 0 ? { count: 0, lastFocused: e } : i, d = a.weekStartsOn, c = a.fromDate, u = a.toDate, f = a.locale, v = {
day: E,
var t = n.moveBy, r = n.direction, a = n.context, o = n.modifiers, i = n.retry, l = i === void 0 ? { count: 0, lastFocused: e } : i, d = a.weekStartsOn, u = a.fromDate, c = a.toDate, f = a.locale, v = {
day: L,
week: Ee,
month: V,
month: K,
year: tn,

@@ -666,3 +666,3 @@ startOfWeek: function(b) {

}, h = v[t](e, r === "after" ? 1 : -1);
r === "before" && c ? h = Jt([c, h]) : r === "after" && u && (h = Qt([u, h]));
r === "before" && u ? h = Jt([u, h]) : r === "after" && c && (h = Qt([c, h]));
var y = !0;

@@ -681,5 +681,5 @@ if (o) {

}
var xt = Q(void 0);
var xt = ee(void 0);
function Ir(e) {
var n = fe(), t = Ct(), r = F(), a = r[0], o = r[1], i = F(), l = i[0], d = i[1], c = Pr(n.displayMonths, t), u = a ?? (l && n.isDateDisplayed(l)) ? l : c, f = function() {
var n = fe(), t = Ct(), r = F(), a = r[0], o = r[1], i = F(), l = i[0], d = i[1], u = Pr(n.displayMonths, t), c = a ?? (l && n.isDateDisplayed(l)) ? l : u, f = function() {
d(a), o(void 0);

@@ -700,3 +700,3 @@ }, v = function(b) {

focusedDay: a,
focusTarget: u,
focusTarget: c,
blur: f,

@@ -738,3 +738,3 @@ focus: v,

function Ge() {
var e = z(xt);
var e = te(xt);
if (!e)

@@ -748,3 +748,3 @@ throw new Error("useFocusContext must be used within a FocusProvider");

}
var $e = Q(void 0);
var $e = ee(void 0);
function Wr(e) {

@@ -761,8 +761,8 @@ if (!ge(e.initialProps)) {

var n = e.initialProps, t = e.children, r = function(o, i, l) {
var d, c, u;
var d, u, c;
if ((d = n.onDayClick) === null || d === void 0 || d.call(n, o, i, l), i.selected && !n.required) {
(c = n.onSelect) === null || c === void 0 || c.call(n, void 0, o, i, l);
(u = n.onSelect) === null || u === void 0 || u.call(n, void 0, o, i, l);
return;
}
(u = n.onSelect) === null || u === void 0 || u.call(n, o, o, i, l);
(c = n.onSelect) === null || c === void 0 || c.call(n, o, o, i, l);
}, a = {

@@ -775,3 +775,3 @@ selected: n.selected,

function It() {
var e = z($e);
var e = te($e);
if (!e)

@@ -782,18 +782,18 @@ throw new Error("useSelectSingle must be used within a SelectSingleProvider");

function Lr(e, n) {
var t = k(), r = It(), a = Ke(), o = Xe(), i = Ge(), l = i.focusDayAfter, d = i.focusDayBefore, c = i.focusWeekAfter, u = i.focusWeekBefore, f = i.blur, v = i.focus, h = i.focusMonthBefore, y = i.focusMonthAfter, _ = i.focusYearBefore, b = i.focusYearAfter, M = i.focusStartOfWeek, D = i.focusEndOfWeek, S = function(p) {
var m, L, J, ne;
ge(t) ? (m = r.onDayClick) === null || m === void 0 || m.call(r, e, n, p) : ue(t) ? (L = a.onDayClick) === null || L === void 0 || L.call(a, e, n, p) : ce(t) ? (J = o.onDayClick) === null || J === void 0 || J.call(o, e, n, p) : (ne = t.onDayClick) === null || ne === void 0 || ne.call(t, e, n, p);
var t = k(), r = It(), a = Ke(), o = Xe(), i = Ge(), l = i.focusDayAfter, d = i.focusDayBefore, u = i.focusWeekAfter, c = i.focusWeekBefore, f = i.blur, v = i.focus, h = i.focusMonthBefore, y = i.focusMonthAfter, _ = i.focusYearBefore, b = i.focusYearAfter, M = i.focusStartOfWeek, D = i.focusEndOfWeek, W = function(p) {
var m, S, z, re;
ge(t) ? (m = r.onDayClick) === null || m === void 0 || m.call(r, e, n, p) : ue(t) ? (S = a.onDayClick) === null || S === void 0 || S.call(a, e, n, p) : ce(t) ? (z = o.onDayClick) === null || z === void 0 || z.call(o, e, n, p) : (re = t.onDayClick) === null || re === void 0 || re.call(t, e, n, p);
}, A = function(p) {
var m;
v(e), (m = t.onDayFocus) === null || m === void 0 || m.call(t, e, n, p);
}, N = function(p) {
}, B = function(p) {
var m;
f(), (m = t.onDayBlur) === null || m === void 0 || m.call(t, e, n, p);
}, P = function(p) {
}, N = function(p) {
var m;
(m = t.onDayMouseEnter) === null || m === void 0 || m.call(t, e, n, p);
}, ae = function(p) {
}, V = function(p) {
var m;
(m = t.onDayMouseLeave) === null || m === void 0 || m.call(t, e, n, p);
}, ee = function(p) {
}, Z = function(p) {
var m;

@@ -810,6 +810,6 @@ (m = t.onDayPointerEnter) === null || m === void 0 || m.call(t, e, n, p);

(m = t.onDayTouchEnd) === null || m === void 0 || m.call(t, e, n, p);
}, X = function(p) {
}, G = function(p) {
var m;
(m = t.onDayTouchMove) === null || m === void 0 || m.call(t, e, n, p);
}, q = function(p) {
}, Q = function(p) {
var m;

@@ -820,3 +820,3 @@ (m = t.onDayTouchStart) === null || m === void 0 || m.call(t, e, n, p);

(m = t.onDayKeyUp) === null || m === void 0 || m.call(t, e, n, p);
}, te = function(p) {
}, ne = function(p) {
var m;

@@ -831,6 +831,6 @@ switch (p.key) {

case "ArrowDown":
p.preventDefault(), p.stopPropagation(), c();
p.preventDefault(), p.stopPropagation(), u();
break;
case "ArrowUp":
p.preventDefault(), p.stopPropagation(), u();
p.preventDefault(), p.stopPropagation(), c();
break;

@@ -852,15 +852,15 @@ case "PageUp":

}, ke = {
onClick: S,
onClick: W,
onFocus: A,
onBlur: N,
onKeyDown: te,
onBlur: B,
onKeyDown: ne,
onKeyUp: Me,
onMouseEnter: P,
onMouseLeave: ae,
onPointerEnter: ee,
onMouseEnter: N,
onMouseLeave: V,
onPointerEnter: Z,
onPointerLeave: we,
onTouchCancel: De,
onTouchEnd: ve,
onTouchMove: X,
onTouchStart: q
onTouchMove: G,
onTouchStart: Q
};

@@ -896,6 +896,6 @@ return ke;

function Fr(e, n, t) {
var r, a, o, i = k(), l = Ge(), d = Or(e, n), c = Lr(e, d), u = Er(), f = !!(i.onDayClick || i.mode !== "default");
$(function() {
var P;
d.outside || l.focusedDay && f && C(l.focusedDay, e) && ((P = t.current) === null || P === void 0 || P.focus());
var r, a, o, i = k(), l = Ge(), d = Or(e, n), u = Lr(e, d), c = Er(), f = !!(i.onDayClick || i.mode !== "default");
J(function() {
var N;
d.outside || l.focusedDay && f && C(l.focusedDay, e) && ((N = t.current) === null || N === void 0 || N.focus());
}, [

@@ -913,28 +913,28 @@ l.focusedDay,

role: "gridcell"
}, D = l.focusTarget && C(l.focusTarget, e) && !d.outside, S = l.focusedDay && C(l.focusedDay, e), A = g(g(g({}, M), (r = { disabled: d.disabled, role: "gridcell" }, r["aria-selected"] = d.selected, r.tabIndex = S || D ? 0 : -1, r)), c), N = {
}, D = l.focusTarget && C(l.focusTarget, e) && !d.outside, W = l.focusedDay && C(l.focusedDay, e), A = g(g(g({}, M), (r = { disabled: d.disabled, role: "gridcell" }, r["aria-selected"] = d.selected, r.tabIndex = W || D ? 0 : -1, r)), u), B = {
isButton: f,
isHidden: y,
activeModifiers: d,
selectedDays: u,
selectedDays: c,
buttonProps: A,
divProps: M
};
return N;
return B;
}
function Ar(e) {
var n = re(null), t = Fr(e.date, e.displayMonth, n);
var n = ae(null), t = Fr(e.date, e.displayMonth, n);
return t.isHidden ? s("div", { role: "gridcell" }) : t.isButton ? s(be, g({ name: "day", ref: n }, t.buttonProps)) : s("div", g({}, t.divProps));
}
function Hr(e) {
var n = e.number, t = e.dates, r = k(), a = r.onWeekNumberClick, o = r.styles, i = r.classNames, l = r.locale, d = r.labels.labelWeekNumber, c = r.formatters.formatWeekNumber, u = c(Number(n), { locale: l });
var n = e.number, t = e.dates, r = k(), a = r.onWeekNumberClick, o = r.styles, i = r.classNames, l = r.locale, d = r.labels.labelWeekNumber, u = r.formatters.formatWeekNumber, c = u(Number(n), { locale: l });
if (!a)
return s("span", { className: i.weeknumber, style: o.weeknumber, children: u });
return s("span", { className: i.weeknumber, style: o.weeknumber, children: c });
var f = d(Number(n), { locale: l }), v = function(h) {
a(n, t, h);
};
return s(be, { name: "week-number", "aria-label": f, className: i.weeknumber, style: o.weeknumber, onClick: v, children: u });
return s(be, { name: "week-number", "aria-label": f, className: i.weeknumber, style: o.weeknumber, onClick: v, children: c });
}
function Yr(e) {
var n, t, r = k(), a = r.styles, o = r.classNames, i = r.showWeekNumber, l = r.components, d = (n = l == null ? void 0 : l.Day) !== null && n !== void 0 ? n : Ar, c = (t = l == null ? void 0 : l.WeekNumber) !== null && t !== void 0 ? t : Hr, u;
return i && (u = s("td", { className: o.cell, style: a.cell, children: s(c, { number: e.weekNumber, dates: e.dates }) })), B("tr", { className: o.row, style: a.row, children: [u, e.dates.map(function(f) {
var n, t, r = k(), a = r.styles, o = r.classNames, i = r.showWeekNumber, l = r.components, d = (n = l == null ? void 0 : l.Day) !== null && n !== void 0 ? n : Ar, u = (t = l == null ? void 0 : l.WeekNumber) !== null && t !== void 0 ? t : Hr, c;
return i && (c = s("td", { className: o.cell, style: a.cell, children: s(u, { number: e.weekNumber, dates: e.dates }) })), R("tr", { className: o.row, style: a.row, children: [c, e.dates.map(function(f) {
return s("td", { className: o.cell, style: a.cell, role: "presentation", children: s(d, { displayMonth: e.displayMonth, date: f }) }, Zt(f));

@@ -944,12 +944,12 @@ })] });

function dt(e, n, t) {
for (var r = t != null && t.ISOWeek ? ht(n) : mt(n, t), a = t != null && t.ISOWeek ? Ye(e) : je(e, t), o = U(r, a), i = [], l = 0; l <= o; l++)
i.push(E(a, l));
var d = i.reduce(function(c, u) {
var f = t != null && t.ISOWeek ? zt(u) : en(u, t), v = c.find(function(h) {
for (var r = t != null && t.ISOWeek ? ht(n) : mt(n, t), a = t != null && t.ISOWeek ? Ye(e) : je(e, t), o = X(r, a), i = [], l = 0; l <= o; l++)
i.push(L(a, l));
var d = i.reduce(function(u, c) {
var f = t != null && t.ISOWeek ? zt(c) : en(c, t), v = u.find(function(h) {
return h.weekNumber === f;
});
return v ? (v.dates.push(u), c) : (c.push({
return v ? (v.dates.push(c), u) : (u.push({
weekNumber: f,
dates: [u]
}), c);
dates: [c]
}), u);
}, []);

@@ -959,3 +959,3 @@ return d;

function jr(e, n) {
var t = dt(R(e), Fe(e), n);
var t = dt(E(e), Fe(e), n);
if (n != null && n.useFixedWeeks) {

@@ -971,4 +971,4 @@ var r = Gt(e, n);

function Vr(e) {
var n, t, r, a = k(), o = a.locale, i = a.classNames, l = a.styles, d = a.hideHead, c = a.fixedWeeks, u = a.components, f = a.weekStartsOn, v = a.firstWeekContainsDate, h = a.ISOWeek, y = jr(e.displayMonth, {
useFixedWeeks: !!c,
var n, t, r, a = k(), o = a.locale, i = a.classNames, l = a.styles, d = a.hideHead, u = a.fixedWeeks, c = a.components, f = a.weekStartsOn, v = a.firstWeekContainsDate, h = a.ISOWeek, y = jr(e.displayMonth, {
useFixedWeeks: !!u,
ISOWeek: h,

@@ -978,4 +978,4 @@ locale: o,

firstWeekContainsDate: v
}), _ = (n = u == null ? void 0 : u.Head) !== null && n !== void 0 ? n : ar, b = (t = u == null ? void 0 : u.Row) !== null && t !== void 0 ? t : Yr, M = (r = u == null ? void 0 : u.Footer) !== null && r !== void 0 ? r : tr;
return B("table", { id: e.id, className: i.table, style: l.table, role: "grid", "aria-labelledby": e["aria-labelledby"], children: [!d && s(_, {}), s("tbody", { className: i.tbody, style: l.tbody, children: y.map(function(D) {
}), _ = (n = c == null ? void 0 : c.Head) !== null && n !== void 0 ? n : ar, b = (t = c == null ? void 0 : c.Row) !== null && t !== void 0 ? t : Yr, M = (r = c == null ? void 0 : c.Footer) !== null && r !== void 0 ? r : tr;
return R("table", { id: e.id, className: i.table, style: l.table, role: "grid", "aria-labelledby": e["aria-labelledby"], children: [!d && s(_, {}), s("tbody", { className: i.tbody, style: l.tbody, children: y.map(function(D) {
return s(b, { displayMonth: e.displayMonth, dates: D.dates, weekNumber: D.weekNumber }, D.weekNumber);

@@ -987,3 +987,3 @@ }) }), s(M, { displayMonth: e.displayMonth })] });

}
var Ur = Kr() ? Xt : $, We = !1, Xr = 0;
var Ur = Kr() ? Xt : J, We = !1, Xr = 0;
function ut() {

@@ -996,3 +996,3 @@ return "react-day-picker-".concat(++Xr);

a === null && o(ut());
}, []), $(function() {
}, []), J(function() {
We === !1 && (We = !0);

@@ -1002,6 +1002,6 @@ }, []), (n = e ?? a) !== null && n !== void 0 ? n : void 0;

function Gr(e) {
var n, t, r = k(), a = r.dir, o = r.classNames, i = r.styles, l = r.components, d = fe().displayMonths, c = Zr(r.id ? "".concat(r.id, "-").concat(e.displayIndex) : void 0), u = r.id ? "".concat(r.id, "-grid-").concat(e.displayIndex) : void 0, f = [o.month], v = i.month, h = e.displayIndex === 0, y = e.displayIndex === d.length - 1, _ = !h && !y;
var n, t, r = k(), a = r.dir, o = r.classNames, i = r.styles, l = r.components, d = fe().displayMonths, u = Zr(r.id ? "".concat(r.id, "-").concat(e.displayIndex) : void 0), c = r.id ? "".concat(r.id, "-grid-").concat(e.displayIndex) : void 0, f = [o.month], v = i.month, h = e.displayIndex === 0, y = e.displayIndex === d.length - 1, _ = !h && !y;
a === "rtl" && (n = [h, y], y = n[0], h = n[1]), h && (f.push(o.caption_start), v = g(g({}, v), i.caption_start)), y && (f.push(o.caption_end), v = g(g({}, v), i.caption_end)), _ && (f.push(o.caption_between), v = g(g({}, v), i.caption_between));
var b = (t = l == null ? void 0 : l.Caption) !== null && t !== void 0 ? t : er;
return B("div", { className: f.join(" "), style: v, children: [s(b, { id: c, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), s(Vr, { id: u, "aria-labelledby": c, displayMonth: e.displayMonth })] }, e.displayIndex);
return R("div", { className: f.join(" "), style: v, children: [s(b, { id: u, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), s(Vr, { id: c, "aria-labelledby": u, displayMonth: e.displayMonth })] }, e.displayIndex);
}

@@ -1013,5 +1013,5 @@ function $r(e) {

function qr(e) {
var n, t, r = e.initialProps, a = k(), o = Ge(), i = fe(), l = F(!1), d = l[0], c = l[1];
$(function() {
a.initialFocus && o.focusTarget && (d || (o.focus(o.focusTarget), c(!0)));
var n, t, r = e.initialProps, a = k(), o = Ge(), i = fe(), l = F(!1), d = l[0], u = l[1];
J(function() {
a.initialFocus && o.focusTarget && (d || (o.focus(o.focusTarget), u(!0)));
}, [

@@ -1024,4 +1024,4 @@ a.initialFocus,

]);
var u = [a.classNames.root, a.className];
a.numberOfMonths > 1 && u.push(a.classNames.multiple_months), a.showWeekNumber && u.push(a.classNames.with_weeknumber);
var c = [a.classNames.root, a.className];
a.numberOfMonths > 1 && c.push(a.classNames.multiple_months), a.showWeekNumber && c.push(a.classNames.with_weeknumber);
var f = g(g({}, a.styles.root), a.style), v = Object.keys(r).filter(function(y) {

@@ -1033,3 +1033,3 @@ return y.startsWith("data-");

}, {}), h = (t = (n = r.components) === null || n === void 0 ? void 0 : n.Months) !== null && t !== void 0 ? t : $r;
return s("div", g({ className: u.join(" "), style: f, dir: a.dir, id: a.id, nonce: r.nonce, title: r.title, lang: r.lang }, v, { children: s(h, { children: i.displayMonths.map(function(y, _) {
return s("div", g({ className: c.join(" "), style: f, dir: a.dir, id: a.id, nonce: r.nonce, title: r.title, lang: r.lang }, v, { children: s(h, { children: i.displayMonths.map(function(y, _) {
return s(Gr, { displayIndex: _, displayMonth: y }, _);

@@ -1045,3 +1045,3 @@ }) }) }));

}
const zr = 329, G = 12, _e = 26, Ot = 20, Te = 9, ct = 12, Wt = (e, n, t) => t !== H.positionautomatic && t !== void 0 ? t : e.top > n.height + _e ? H.positionabove : H.positionbelow, ea = (e) => e.left + e.width / 4, ta = (e) => document.documentElement.clientWidth - e.right + e.width / 4, na = (e, n) => e.left + n.width, ra = (e) => e.left > G, aa = (e, n) => na(e, n) < document.documentElement.clientWidth - G, oa = (e, n) => aa(e, n) ? ra(e) ? "floating" : "left" : "right", Se = (e, n) => e.top - _e - n.height, Le = (e) => e.bottom + _e, ia = () => document.documentElement.clientWidth - G * 2, la = () => document.documentElement.clientWidth > zr + G * 2, ft = (e) => e.top - _e - Te + 5, sa = (e) => ea(e) - Ot / 2, da = (e) => ta(e) - Ot / 2, ua = (e, n, t) => {
const zr = 329, q = 12, _e = 26, Ot = 20, Te = 9, ct = 12, Wt = (e, n, t) => t !== H.positionautomatic && t !== void 0 ? t : e.top > n.height + _e ? H.positionabove : H.positionbelow, ea = (e) => e.left + e.width / 4, ta = (e) => document.documentElement.clientWidth - e.right + e.width / 4, na = (e, n) => e.left + n.width, ra = (e) => e.left > q, aa = (e, n) => na(e, n) < document.documentElement.clientWidth - q, oa = (e, n) => aa(e, n) ? ra(e) ? "floating" : "left" : "right", Se = (e, n) => e.top - _e - n.height, Le = (e) => e.bottom + _e, ia = () => document.documentElement.clientWidth - q * 2, la = () => document.documentElement.clientWidth > zr + q * 2, ft = (e) => e.top - _e - Te + 5, sa = (e) => ea(e) - Ot / 2, da = (e) => ta(e) - Ot / 2, ua = (e, n, t) => {
const r = oa(e, n), a = Wt(e, n, t);

@@ -1052,6 +1052,6 @@ return r === "left" ? a === H.positionabove ? "leftabove" : "leftbelow" : r === "right" ? a === H.positionabove ? "rightabove" : "rightbelow" : a === H.positionabove ? "floatingabove" : "floatingbelow";

return r === "leftabove" ? {
left: G,
left: q,
top: Se(e, n),
width: a
} : r === "leftbelow" ? { left: G, top: Le(e), width: a } : r === "rightabove" ? { right: G, top: Se(e, n), width: a } : r === "rightbelow" ? { right: G, top: Le(e), width: a } : r === "floatingbelow" ? { left: vt(e, n), top: Le(e), width: a } : { left: vt(e, n), top: Se(e, n), width: a };
} : r === "leftbelow" ? { left: q, top: Le(e), width: a } : r === "rightabove" ? { right: q, top: Se(e, n), width: a } : r === "rightbelow" ? { right: q, top: Le(e), width: a } : r === "floatingbelow" ? { left: vt(e, n), top: Le(e), width: a } : { left: vt(e, n), top: Se(e, n), width: a };
}, vt = (e, n) => fa(e) - n.width / 2, fa = (e) => e.left + e.width / 2, va = (e, n, t) => {

@@ -1073,22 +1073,22 @@ const r = sa(n), a = da(n), o = e.left + ct, i = e.right + ct;

}, ha = (e) => {
const { datepickerWrapperRef: n, footer: t, inputRef: r, testId: a, variant: o, zIndex: i, ...l } = e, d = re(null), [c, u] = F(), f = yn(n), v = mn(r, 0);
const { datepickerWrapperRef: n, footer: t, inputRef: r, testId: a, variant: o, zIndex: i, ...l } = e, d = ae(null), [u, c] = F(), f = yn(n), v = mn(r, 0);
vn(n, !0);
const h = () => {
var A;
u((A = r.current) == null ? void 0 : A.getBoundingClientRect());
c((A = r.current) == null ? void 0 : A.getBoundingClientRect());
};
Z.useEffect(() => {
$.useEffect(() => {
h();
}, []), hn(h, 500), pn(h, ["scroll", "resize"], 10);
const y = Be(I["datepicker-popup-container"], {
[I["datepicker-popup-container--visible"]]: v
}), _ = c && f && Wt(c, f, o), b = Be(I["datepicker-popup-arrow"], {
[I["datepicker-popup-arrow--visible"]]: v,
[I["datepicker-popup-arrow--over"]]: _ === H.positionbelow,
[I["datepicker-popup-arrow--under"]]: _ === H.positionabove
}), M = c && f && ca(c, f, o), D = M && c && _ && va(M, c, _), S = {
const y = Be(x["datepicker-popup-container"], {
[x["datepicker-popup-container--visible"]]: v
}), _ = u && f && Wt(u, f, o), b = Be(x["datepicker-popup-arrow"], {
[x["datepicker-popup-arrow--visible"]]: v,
[x["datepicker-popup-arrow--over"]]: _ === H.positionbelow,
[x["datepicker-popup-arrow--under"]]: _ === H.positionabove
}), M = u && f && ca(u, f, o), D = M && u && _ && va(M, u, _), W = {
...fn,
...I
...x
};
return /* @__PURE__ */ B(Y, { children: [
return /* @__PURE__ */ R(Y, { children: [
/* @__PURE__ */ s("div", { className: y, "data-testid": a, ref: n, style: { ...M, zIndex: i }, children: /* @__PURE__ */ s(

@@ -1098,7 +1098,7 @@ Qr,

captionLayout: "dropdown-buttons",
classNames: S,
classNames: W,
mode: "single",
style: { "--rdp-cell-size": bn("l") },
modifiersClassNames: { today: I["day--today"], selected: I.day_selected, disabled: I["day--disabled"] },
footer: /* @__PURE__ */ s("span", { className: I["footer-wrapper"], children: t }),
modifiersClassNames: { today: x["day--today"], selected: x.day_selected, disabled: x["day--disabled"] },
footer: /* @__PURE__ */ s("span", { className: x["footer-wrapper"], children: t }),
fixedWeeks: !0,

@@ -1110,3 +1110,3 @@ ...l

] });
}, St = Z.forwardRef((e, n) => {
}, St = $.forwardRef((e, n) => {
const {

@@ -1120,4 +1120,4 @@ className: t,

disabled: d,
disableDays: c = [],
disableWeekends: u,
disableDays: u = [],
disableWeekends: c,
error: f,

@@ -1131,65 +1131,65 @@ errorText: v,

maxDate: D,
minDate: S,
minDate: W,
onBlur: A,
onChange: N,
onDatePopupClosed: P,
testId: ae,
autoComplete: ee = "off",
onChange: B,
onDatePopupClosed: N,
testId: V,
autoComplete: Z = "off",
variant: we = H.positionautomatic,
zIndex: De = dn.PopOver,
...ve
} = e, [X, q] = F(o), [Me, te] = F(X ? W(X, a) : ""), [ke, p] = F(i), [m, L] = F(!1), [J, ne] = F(!1), Rt = {
} = e, [G, Q] = F(o), [Me, ne] = F(G ? O(G, a) : ""), [ke, p] = F(i), [m, S] = F(!1), [z, re] = F(!1), Rt = {
dayOfWeek: [0, 6]
}, Bt = u ? [...c, Rt] : c, qe = re(null), Ne = re(null), oe = re(null), { refObject: T } = yt(bt(n) ? n : null), Je = gt([n, T]), he = re(!1);
}, Bt = c ? [...u, Rt] : u, qe = ae(null), Ne = ae(null), oe = ae(null), { refObject: T } = yt(bt(n) ? n : null), Je = gt([n, T]), he = ae(!1);
un(Ne, (w) => {
var O, ie;
const x = w.target;
!((O = Ne.current) != null && O.contains(x)) && !((ie = oe.current) != null && ie.contains(x)) && L(!1);
}), $(() => {
de(o) ? (te(o ? W(o, a) : ""), q(o), p(o)) : (te(""), q(void 0), p(void 0));
}, [o, a]), $(() => {
J && T.current && T.current.focus();
}, [J]);
var I, ie;
const P = w.target;
!((I = Ne.current) != null && I.contains(P)) && !((ie = oe.current) != null && ie.contains(P)) && S(!1);
}), J(() => {
de(o) ? (ne(o ? O(o, a) : ""), Q(o), p(o)) : (ne(""), Q(void 0), p(void 0));
}, [o, a]), J(() => {
z && T.current && T.current.focus();
}, [z]);
const Qe = () => {
T != null && T.current && T.current.focus(), L(!1);
T != null && T.current && T.current.focus(), S(!1);
};
ot(oe, Qe, [at.Escape]), ot(qe, Qe, [at.Escape]);
const ze = (w, x) => {
te(w.currentTarget.value);
const O = le(w.currentTarget.value, x, /* @__PURE__ */ new Date());
de(O) ? (q(O), p(O)) : q(void 0), N && N(w, w.currentTarget.value);
const ze = (w, P) => {
ne(w.currentTarget.value);
const I = le(w.currentTarget.value, P, /* @__PURE__ */ new Date());
de(I) ? (Q(I), p(I)) : Q(void 0), B && B(w, w.currentTarget.value);
}, Tt = () => {
J ? ne(!1) : L(!0);
}, Ft = (w, x, O, ie) => {
if (ne(!0), !w) {
L(!1);
z ? re(!1) : S(!0);
}, Ft = (w, P, I, ie) => {
if (re(!0), !w) {
S(!1);
return;
}
q(w), T.current && (te(W(w, a)), L(!1)), N && N(ie, w), At(T, W(w, a), w), P && P(w);
}, At = (w, x, O, ie) => {
Q(w), T.current && (ne(O(w, a)), S(!1)), B && B(ie, w), At(T, O(w, a), w), N && N(w);
}, At = (w, P, I, ie) => {
if (w.current) {
w.current.value = x;
w.current.value = P;
const tt = new Event("change", { bubbles: !0 });
w.current.dispatchEvent(tt), N && N(tt, O);
w.current.dispatchEvent(tt), B && B(tt, I);
}
}, Ht = (w) => {
var x;
(x = oe.current) != null && x.contains(w.relatedTarget) || L(!1), et(w);
var P;
(P = oe.current) != null && P.contains(w.relatedTarget) || S(!1), et(w);
}, et = (w) => {
var O;
const x = (O = oe.current) == null ? void 0 : O.contains(w.relatedTarget);
x || L(!1), !x && (typeof P > "u" || he.current) && A && A(w), he.current = !1;
var I;
const P = (I = oe.current) == null ? void 0 : I.contains(w.relatedTarget);
P || S(!1), !P && (typeof N > "u" || he.current) && A && A(w), he.current = !1;
}, Yt = (w) => {
w == null || w.stopPropagation(), L(!m);
w == null || w.stopPropagation(), S(!m);
};
$(() => {
const w = (O) => {
["Escape", "Enter", "Tab"].includes(O.key) || (he.current = !0, L(!1));
}, x = T.current;
return x && x.addEventListener("keydown", w), () => {
x && x.removeEventListener("keydown", w);
J(() => {
const w = (I) => {
["Escape", "Enter", "Tab"].includes(I.key) || (he.current = !0, S(!1));
}, P = T.current;
return P && P.addEventListener("keydown", w), () => {
P && P.removeEventListener("keydown", w);
};
}, [T]);
const jt = (w) => {
ze(w, "yyyy-MM-dd"), he.current || P && P(X);
ze(w, "yyyy-MM-dd"), he.current || N && N(G);
}, Vt = /* @__PURE__ */ s(

@@ -1204,7 +1204,7 @@ Re,

label: _,
max: D ? W(D, "yyyy-MM-dd") : "",
min: S ? W(S, "yyyy-MM-dd") : "",
max: D ? O(D, "yyyy-MM-dd") : "",
min: W ? O(W, "yyyy-MM-dd") : "",
type: "date",
ref: Je,
value: X ? W(X, "yyyy-MM-dd") : "",
value: G ? O(G, "yyyy-MM-dd") : "",
width: 14,

@@ -1214,5 +1214,5 @@ ...ve,

onChange: jt,
autoComplete: ee || void 0
autoComplete: Z || void 0
}
), Kt = /* @__PURE__ */ B(Y, { children: [
), Kt = /* @__PURE__ */ R(Y, { children: [
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(

@@ -1245,8 +1245,8 @@ Re,

variant: "borderless",
wrapperClassName: I["date-button"],
className: I["date-button__inner"],
wrapperClassName: x["date-button"],
className: x["date-button__inner"],
children: /* @__PURE__ */ s(ln, { color: "black", svgIcon: sn })
}
),
autoComplete: ee || void 0
autoComplete: Z || void 0
}

@@ -1261,3 +1261,3 @@ ) }),

footer: y,
fromDate: S,
fromDate: W,
toDate: D,

@@ -1267,3 +1267,3 @@ inputRef: T,

month: ke,
selected: X,
selected: G,
onSelect: Ft,

@@ -1276,3 +1276,3 @@ onMonthChange: p,

] });
return /* @__PURE__ */ s("div", { className: t, "data-testid": ae, children: cn() ? Vt : Kt });
return /* @__PURE__ */ s("div", { className: t, "data-testid": V, children: cn() ? Vt : Kt });
});

@@ -1283,20 +1283,20 @@ St.displayName = "DatePicker";

return n.length === 1 ? "0" + n : n;
}, ma = (e) => !e || /^\d+$/.test(e) && e.length <= 2, Lt = Z.forwardRef((e, n) => {
const { error: t, errorText: r, errorTextId: a, label: o, onChange: i, timeUnit: l, testId: d, inputId: c, value: u, autoComplete: f = "off", ...v } = e, [h, y] = F(
typeof u < "u" ? me(u) : void 0
), { refObject: _ } = yt(bt(n) ? n : null), b = gt([n, _]);
$(() => {
y(u ? me(u) : void 0);
}, [u]);
const M = (N) => {
const P = N.target.value;
ma(P) && (y(P), i && i(N));
}, D = (N) => {
const P = me(N.target.value);
y(P), i && i(N);
}, S = (N) => {
const P = /[0-9]/, ae = ["Backspace", " ", "Enter", "Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
!P.test(N.key) && !ae.includes(N.key) && N.preventDefault();
}, A = () => l === "hours" && /* @__PURE__ */ s("span", { className: I["time-separator"], children: ":" });
return /* @__PURE__ */ s("div", { "data-testid": d, children: /* @__PURE__ */ s(
}, ma = (e) => !e || /^\d+$/.test(e) && e.length <= 2, Lt = $.forwardRef((e, n) => {
const { error: t, errorText: r, errorTextId: a, label: o, onBlur: i, onChange: l, timeUnit: d, testId: u, inputId: c, value: f, autoComplete: v = "off", ...h } = e, [y, _] = F(
typeof f < "u" ? me(f) : void 0
), { refObject: b } = yt(bt(n) ? n : null), M = gt([n, b]);
J(() => {
_(f ? me(f) : void 0);
}, [f]);
const D = (N) => {
const V = N.target.value;
ma(V) && (_(V), l && l(N));
}, W = (N) => {
const V = me(N.target.value);
_(V), l && l(N), i && i(N);
}, A = (N) => {
const V = /[0-9]/, Z = ["Backspace", " ", "Enter", "Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
!V.test(N.key) && !Z.includes(N.key) && N.preventDefault();
}, B = () => d === "hours" && /* @__PURE__ */ s("span", { className: x["time-separator"], children: ":" });
return /* @__PURE__ */ s("div", { "data-testid": u, children: /* @__PURE__ */ s(
Re,

@@ -1309,15 +1309,15 @@ {

label: o,
max: l === "hours" ? 23 : 59,
max: d === "hours" ? 23 : 59,
min: 0,
type: "number",
ref: b,
value: h,
ref: M,
value: y,
width: 5,
defaultValue: typeof e.defaultValue < "u" ? me(e.defaultValue) : void 0,
...v,
onChange: M,
onBlur: D,
rightOfInput: A(),
onKeyDown: S,
autoComplete: f || void 0
...h,
onChange: D,
onBlur: W,
rightOfInput: B(),
onKeyDown: A,
autoComplete: v || void 0
}

@@ -1327,15 +1327,15 @@ ) });

Lt.displayName = "DateTime";
const pa = Z.forwardRef((e, n) => {
const { children: t, errorText: r, legend: a, testId: o } = e, i = _n(), l = (d) => it(d, St) ? Z.cloneElement(d, {
className: Be(I["date-time-picker-wrapper__date-picker"]),
const pa = $.forwardRef((e, n) => {
const { children: t, errorText: r, legend: a, testId: o } = e, i = _n(), l = (d) => it(d, St) ? $.cloneElement(d, {
className: Be(x["date-time-picker-wrapper__date-picker"]),
error: !!r,
errorTextId: i
}) : it(d, Lt) ? Z.cloneElement(d, {
}) : it(d, Lt) ? $.cloneElement(d, {
error: !!r,
errorTextId: i
}) : d;
return /* @__PURE__ */ s("div", { ref: n, tabIndex: -1, children: /* @__PURE__ */ s(gn, { errorText: r, errorTextId: i, children: e.legend ? /* @__PURE__ */ B("fieldset", { className: I["date-time-picker-wrapper"], "data-testid": o, children: [
e.legend && /* @__PURE__ */ s("legend", { className: I["date-time-picker-wrapper__legend"], children: a }),
Z.Children.map(t, l)
] }) : /* @__PURE__ */ s("div", { className: I["date-time-picker-wrapper"], children: Z.Children.map(t, l) }) }) });
return /* @__PURE__ */ s("div", { ref: n, tabIndex: -1, children: /* @__PURE__ */ s(gn, { errorText: r, errorTextId: i, children: e.legend ? /* @__PURE__ */ R("fieldset", { className: x["date-time-picker-wrapper"], "data-testid": o, children: [
e.legend && /* @__PURE__ */ s("legend", { className: x["date-time-picker-wrapper__legend"], children: a }),
$.Children.map(t, l)
] }) : /* @__PURE__ */ s("div", { className: x["date-time-picker-wrapper"], children: $.Children.map(t, l) }) }) });
});

@@ -1342,0 +1342,0 @@ pa.displayName = "DateTimePickerWrapper";

@@ -10,3 +10,3 @@ {

"homepage": "https://helsenorge.design",
"version": "8.6.0",
"version": "8.8.0",
"author": "Helsenorge",

@@ -13,0 +13,0 @@ "license": "MIT",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc