@caspeco/casper-ui-library 4.0.0 → 4.0.1
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/components/combobox/combobox-button.js +72 -73
- package/dist/components/combobox/combobox-menu.js +68 -69
- package/dist/components/combobox/combobox.js +104 -109
- package/dist/components/date-picker/base-date-picker.js +175 -176
- package/dist/components/date-picker/date-picker-header.js +10 -10
- package/dist/components/date-picker/helper.js +9 -9
- package/dist/components/image-upload/image-cropper.js +112 -113
- package/dist/components/image-upload/image-upload-dropzone.js +35 -36
- package/dist/components/menu/menu-group.js +44 -45
- package/dist/components/segmented-control/segmented-control.js +29 -29
- package/dist/components/table/table-cell.js +25 -26
- package/dist/components/table/table-header-dropdown.js +60 -60
- package/dist/components/table/table-header-row.js +19 -20
- package/dist/components/table/table-toolbar.js +63 -64
- package/dist/components/table/use-controllable-state.js +7 -7
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -1
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +41 -41
- package/dist/node_modules/date-fns/addDays.js +7 -7
- package/dist/node_modules/date-fns/addMonths.js +13 -13
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +11 -11
- package/dist/node_modules/date-fns/endOfDay.js +6 -6
- package/dist/node_modules/date-fns/endOfMonth.js +6 -6
- package/dist/node_modules/date-fns/format.js +46 -47
- package/dist/node_modules/date-fns/getDayOfYear.js +8 -8
- package/dist/node_modules/date-fns/getISOWeek.js +9 -9
- package/dist/node_modules/date-fns/getISOWeekYear.js +10 -10
- package/dist/node_modules/date-fns/getWeek.js +9 -9
- package/dist/node_modules/date-fns/getWeekYear.js +13 -14
- package/dist/node_modules/date-fns/isSameDay.js +9 -9
- package/dist/node_modules/date-fns/isSameMonth.js +9 -9
- package/dist/node_modules/date-fns/isSameWeek.js +8 -8
- package/dist/node_modules/date-fns/isSameYear.js +9 -9
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +12 -12
- package/dist/node_modules/date-fns/locale/da/_lib/formatDistance.js +4 -4
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +3 -3
- package/dist/node_modules/date-fns/locale/es/_lib/formatDistance.js +4 -4
- package/dist/node_modules/date-fns/locale/et/_lib/formatDistance.js +6 -6
- package/dist/node_modules/date-fns/locale/fi/_lib/formatDistance.js +17 -17
- package/dist/node_modules/date-fns/locale/lt/_lib/formatDistance.js +47 -47
- package/dist/node_modules/date-fns/locale/lv/_lib/formatDistance.js +11 -11
- package/dist/node_modules/date-fns/locale/nb/_lib/formatDistance.js +3 -3
- package/dist/node_modules/date-fns/locale/nl/_lib/formatDistance.js +4 -4
- package/dist/node_modules/date-fns/locale/sv/_lib/formatDistance.js +5 -5
- package/dist/node_modules/date-fns/startOfDay.js +6 -6
- package/dist/node_modules/date-fns/startOfMonth.js +6 -6
- package/dist/node_modules/date-fns/startOfWeek.js +7 -8
- package/dist/node_modules/date-fns/startOfWeekYear.js +9 -10
- package/dist/node_modules/date-fns/startOfYear.js +5 -5
- package/dist/theme/theme-config/components/modal-theme.js +13 -15
- package/dist/theme/theme-config/components/select-theme.js +15 -19
- package/package.json +2 -2
|
@@ -1,244 +1,243 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { GridItem as
|
|
3
|
-
import
|
|
4
|
-
import { DatePickerDateCell as
|
|
5
|
-
import { DatePickerHeader as
|
|
6
|
-
import { DatePickerWeekCell as
|
|
7
|
-
import { hasDotOnDate as h, isDateStrikeThrough as
|
|
8
|
-
import { lv as
|
|
9
|
-
import { lt as
|
|
10
|
-
import { et as
|
|
11
|
-
import { es as
|
|
12
|
-
import { fi as
|
|
13
|
-
import { nl as
|
|
14
|
-
import { endOfMonth as
|
|
15
|
-
import { startOfWeek as
|
|
16
|
-
import { sv as
|
|
17
|
-
import { da as
|
|
18
|
-
import { nb as
|
|
19
|
-
import { enGB as
|
|
20
|
-
import { enUS as
|
|
21
|
-
import { formatDate as
|
|
22
|
-
import { startOfMonth as
|
|
23
|
-
import { addDays as
|
|
24
|
-
import { isSameMonth as
|
|
25
|
-
import { isSameDay as
|
|
26
|
-
import { getISOWeek as
|
|
27
|
-
import { ThemeColorVariable as
|
|
28
|
-
const
|
|
29
|
-
"en-US": { locale:
|
|
30
|
-
"en-GB": { locale:
|
|
31
|
-
"nb-NO": { locale:
|
|
32
|
-
"da-DK": { locale:
|
|
33
|
-
"sv-SE": { locale:
|
|
34
|
-
"nl-NL": { locale:
|
|
35
|
-
"fi-FI": { locale:
|
|
36
|
-
"es-ES": { locale:
|
|
37
|
-
"et-EE": { locale:
|
|
38
|
-
"lt-LT": { locale:
|
|
39
|
-
"lv-LV": { locale:
|
|
1
|
+
import { jsxs as w, jsx as n, Fragment as bt } from "react/jsx-runtime";
|
|
2
|
+
import { GridItem as q, Box as Ft, Grid as J } from "@chakra-ui/react";
|
|
3
|
+
import Gt, { useState as Q, useEffect as Tt, useCallback as Lt } from "react";
|
|
4
|
+
import { DatePickerDateCell as X } from "./date-picker-date-cell.js";
|
|
5
|
+
import { DatePickerHeader as Et } from "./date-picker-header.js";
|
|
6
|
+
import { DatePickerWeekCell as Pt } from "./date-picker-week-cell.js";
|
|
7
|
+
import { hasDotOnDate as h, isDateStrikeThrough as _t, getWeekCellVariant as zt, getDateCellVariant as Z, firstLetterUpperCase as At, hasDatePassed as Ht } from "./helper.js";
|
|
8
|
+
import { lv as Ut } from "../../node_modules/date-fns/locale/lv.js";
|
|
9
|
+
import { lt as jt } from "../../node_modules/date-fns/locale/lt.js";
|
|
10
|
+
import { et as Kt } from "../../node_modules/date-fns/locale/et.js";
|
|
11
|
+
import { es as Yt } from "../../node_modules/date-fns/locale/es.js";
|
|
12
|
+
import { fi as qt } from "../../node_modules/date-fns/locale/fi.js";
|
|
13
|
+
import { nl as Jt } from "../../node_modules/date-fns/locale/nl.js";
|
|
14
|
+
import { endOfMonth as N } from "../../node_modules/date-fns/endOfMonth.js";
|
|
15
|
+
import { startOfWeek as Qt } from "../../node_modules/date-fns/startOfWeek.js";
|
|
16
|
+
import { sv as Xt } from "../../node_modules/date-fns/locale/sv.js";
|
|
17
|
+
import { da as Zt } from "../../node_modules/date-fns/locale/da.js";
|
|
18
|
+
import { nb as Nt } from "../../node_modules/date-fns/locale/nb.js";
|
|
19
|
+
import { enGB as Rt } from "../../node_modules/date-fns/locale/en-GB.js";
|
|
20
|
+
import { enUS as tr } from "../../node_modules/date-fns/locale/en-US.js";
|
|
21
|
+
import { formatDate as R } from "../../node_modules/date-fns/format.js";
|
|
22
|
+
import { startOfMonth as x } from "../../node_modules/date-fns/startOfMonth.js";
|
|
23
|
+
import { addDays as tt } from "../../node_modules/date-fns/addDays.js";
|
|
24
|
+
import { isSameMonth as rt } from "../../node_modules/date-fns/isSameMonth.js";
|
|
25
|
+
import { isSameDay as f } from "../../node_modules/date-fns/isSameDay.js";
|
|
26
|
+
import { getISOWeek as et } from "../../node_modules/date-fns/getISOWeek.js";
|
|
27
|
+
import { ThemeColorVariable as ot, ThemeSpaceVariable as at, ThemeFontSizeVariable as rr, ThemeFontVariable as er } from "../../theme/theme-types.js";
|
|
28
|
+
const or = {
|
|
29
|
+
"en-US": { locale: tr },
|
|
30
|
+
"en-GB": { locale: Rt },
|
|
31
|
+
"nb-NO": { locale: Nt },
|
|
32
|
+
"da-DK": { locale: Zt },
|
|
33
|
+
"sv-SE": { locale: Xt },
|
|
34
|
+
"nl-NL": { locale: Jt },
|
|
35
|
+
"fi-FI": { locale: qt },
|
|
36
|
+
"es-ES": { locale: Yt },
|
|
37
|
+
"et-EE": { locale: Kt },
|
|
38
|
+
"lt-LT": { locale: jt },
|
|
39
|
+
"lv-LV": { locale: Ut }
|
|
40
40
|
};
|
|
41
|
-
function
|
|
42
|
-
selectedDate:
|
|
43
|
-
onDateChange:
|
|
44
|
-
onMonthChange:
|
|
45
|
-
markSundayRed:
|
|
46
|
-
strikeThroughDates:
|
|
47
|
-
showDaysOutsideMonth:
|
|
48
|
-
localeString:
|
|
49
|
-
canSelectPastDates:
|
|
50
|
-
isExpanded:
|
|
51
|
-
dots:
|
|
52
|
-
weekNumbers:
|
|
41
|
+
function Fr({
|
|
42
|
+
selectedDate: l,
|
|
43
|
+
onDateChange: S,
|
|
44
|
+
onMonthChange: B,
|
|
45
|
+
markSundayRed: lt,
|
|
46
|
+
strikeThroughDates: st,
|
|
47
|
+
showDaysOutsideMonth: nt = !1,
|
|
48
|
+
localeString: it,
|
|
49
|
+
canSelectPastDates: ft,
|
|
50
|
+
isExpanded: C = !0,
|
|
51
|
+
dots: c,
|
|
52
|
+
weekNumbers: a = !1,
|
|
53
53
|
selectWeek: m = !1,
|
|
54
|
-
shouldDisableDate:
|
|
55
|
-
selectedMonth:
|
|
56
|
-
dateRange:
|
|
57
|
-
isRangeDate:
|
|
58
|
-
onRangeChange:
|
|
59
|
-
isDisabled:
|
|
60
|
-
redDays:
|
|
61
|
-
disablePastMonths:
|
|
62
|
-
disableBackwardNavigation:
|
|
63
|
-
disableForwardNavigation:
|
|
54
|
+
shouldDisableDate: V,
|
|
55
|
+
selectedMonth: W,
|
|
56
|
+
dateRange: o,
|
|
57
|
+
isRangeDate: $ = !1,
|
|
58
|
+
onRangeChange: i,
|
|
59
|
+
isDisabled: ct = !1,
|
|
60
|
+
redDays: mt = [],
|
|
61
|
+
disablePastMonths: Dt = !1,
|
|
62
|
+
disableBackwardNavigation: ht = !1,
|
|
63
|
+
disableForwardNavigation: pt = !1
|
|
64
64
|
}) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
a && a({ startDate: o, endDate: null }), O(!1);
|
|
65
|
+
const [s, b] = Q(W || l || /* @__PURE__ */ new Date()), [F, M] = Q(!0), { locale: D } = or[it];
|
|
66
|
+
Tt(() => {
|
|
67
|
+
l && b(W || l || /* @__PURE__ */ new Date());
|
|
68
|
+
}, [C]);
|
|
69
|
+
const ut = (r) => {
|
|
70
|
+
b(r), B && B(r);
|
|
71
|
+
}, G = (r) => {
|
|
72
|
+
if (F)
|
|
73
|
+
i && i({ startDate: r, endDate: null }), M(!1);
|
|
74
|
+
else if (o?.startDate && o.startDate > r)
|
|
75
|
+
i && i({ startDate: r, endDate: null }), M(!1);
|
|
77
76
|
else {
|
|
78
|
-
if (
|
|
77
|
+
if (o?.startDate && f(r, o.startDate))
|
|
79
78
|
return;
|
|
80
|
-
if (
|
|
81
|
-
const
|
|
82
|
-
|
|
79
|
+
if (o?.startDate && i) {
|
|
80
|
+
const e = { startDate: o.startDate, endDate: r };
|
|
81
|
+
i(e);
|
|
83
82
|
}
|
|
84
|
-
|
|
83
|
+
M(!0);
|
|
85
84
|
}
|
|
86
|
-
}, p =
|
|
87
|
-
(
|
|
88
|
-
|
|
85
|
+
}, p = Lt(
|
|
86
|
+
(r) => {
|
|
87
|
+
$ ? G(r) : S && S(r);
|
|
89
88
|
},
|
|
90
|
-
[
|
|
89
|
+
[S, $, F, G]
|
|
91
90
|
);
|
|
92
|
-
function
|
|
93
|
-
const
|
|
94
|
-
return Array.from({ length: 7 }, (
|
|
91
|
+
function dt() {
|
|
92
|
+
const r = Qt(/* @__PURE__ */ new Date(), { locale: D });
|
|
93
|
+
return Array.from({ length: 7 }, (e, t) => R(tt(r, t), "eee", { locale: D }));
|
|
95
94
|
}
|
|
96
|
-
const
|
|
95
|
+
const yt = R(x(s), "MMMM yyyy", {
|
|
97
96
|
locale: D
|
|
98
|
-
}),
|
|
99
|
-
const t =
|
|
97
|
+
}), St = N(s).getDate(), Ct = [a ? "v." : void 0, ...dt()], Mt = D.options?.weekStartsOn || 0, T = (x(s).getDay() - Mt + 7) % 7, Ot = (7 - N(s).getDay()) % 7, gt = ["auto", "auto", "100%"], kt = ["auto", "auto", "100%"], It = (r) => !ft && Ht(r) ? !0 : V ? V(r) : !1, vt = Array.from({ length: St + T + Ot }, (r, e) => {
|
|
98
|
+
const t = tt(x(s), e - T), wt = rt(t, s), O = f(t, /* @__PURE__ */ new Date()), u = It(t) || ct, L = h(t, c?.yellowDotDates), E = h(t, c?.greenDotDates), P = h(t, c?.blueDotDates), _ = h(t, c?.redDotDates), z = h(t, c?.greyDotDates), A = _t(t, st) && !u;
|
|
99
|
+
let g = !1;
|
|
100
|
+
l && (g = f(t, l));
|
|
101
|
+
const xt = t.getDay() === 0, H = mt.some(($t) => f($t, t)) || (lt ?? !1) && xt, k = et(t);
|
|
102
|
+
let d = !1;
|
|
103
|
+
m && l && (d = et(l) === k);
|
|
104
|
+
const U = !rt(t, s), j = !!(o?.startDate && o?.endDate && t > o.startDate && t < o.endDate);
|
|
100
105
|
let I = !1;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
w,
|
|
124
|
-
x
|
|
125
|
-
), Q = Math.floor(l / 7) + 1, S = l % 7 + 1;
|
|
126
|
-
return i ? /* @__PURE__ */ B(Er.Fragment, { children: [
|
|
127
|
-
i && l % 7 === 0 && /* @__PURE__ */ n(
|
|
128
|
-
X,
|
|
106
|
+
o?.startDate && (I = f(t, o?.startDate));
|
|
107
|
+
let v = !1, K = !1;
|
|
108
|
+
o?.endDate && (v = f(t, o?.endDate), K = !0);
|
|
109
|
+
const Bt = Z(
|
|
110
|
+
g || d,
|
|
111
|
+
O,
|
|
112
|
+
U,
|
|
113
|
+
j,
|
|
114
|
+
I,
|
|
115
|
+
v,
|
|
116
|
+
K
|
|
117
|
+
), Vt = zt(d, O), Wt = Z(
|
|
118
|
+
g || d,
|
|
119
|
+
O,
|
|
120
|
+
U,
|
|
121
|
+
j,
|
|
122
|
+
I,
|
|
123
|
+
v
|
|
124
|
+
), Y = Math.floor(e / 7) + 1, y = e % 7 + 1;
|
|
125
|
+
return a ? /* @__PURE__ */ w(Gt.Fragment, { children: [
|
|
126
|
+
a && e % 7 === 0 && /* @__PURE__ */ n(
|
|
127
|
+
q,
|
|
129
128
|
{
|
|
130
129
|
gridColumn: 1,
|
|
131
130
|
gridRow: "1 / span 7",
|
|
132
131
|
opacity: "0.24",
|
|
133
132
|
borderRight: "1px solid",
|
|
134
|
-
borderColor:
|
|
133
|
+
borderColor: ot.OnSurfaceBorder
|
|
135
134
|
},
|
|
136
|
-
`grid-${
|
|
135
|
+
`grid-${e}-${t}`
|
|
137
136
|
),
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
a && e % 7 === 0 && /* @__PURE__ */ n(
|
|
138
|
+
Pt,
|
|
140
139
|
{
|
|
141
140
|
handleWeekChange: p,
|
|
142
141
|
date: t,
|
|
143
|
-
gridIndex:
|
|
144
|
-
variant:
|
|
142
|
+
gridIndex: e,
|
|
143
|
+
variant: Vt,
|
|
145
144
|
selectWeek: m,
|
|
146
145
|
isDisabled: u
|
|
147
146
|
},
|
|
148
|
-
`week-${
|
|
147
|
+
`week-${e}-${k}`
|
|
149
148
|
),
|
|
150
149
|
/* @__PURE__ */ n(
|
|
151
|
-
|
|
150
|
+
X,
|
|
152
151
|
{
|
|
153
|
-
hasBlueDot:
|
|
154
|
-
hasGreenDot:
|
|
155
|
-
hasYellowDot:
|
|
156
|
-
hasRedDot:
|
|
157
|
-
hasGreyDot:
|
|
158
|
-
gridIndex:
|
|
159
|
-
gridColumn:
|
|
160
|
-
gridRow:
|
|
152
|
+
hasBlueDot: P,
|
|
153
|
+
hasGreenDot: E,
|
|
154
|
+
hasYellowDot: L,
|
|
155
|
+
hasRedDot: _,
|
|
156
|
+
hasGreyDot: z,
|
|
157
|
+
gridIndex: e,
|
|
158
|
+
gridColumn: a ? y + 2 : y,
|
|
159
|
+
gridRow: Y,
|
|
161
160
|
day: t,
|
|
162
161
|
handleDateChange: p,
|
|
163
|
-
variant:
|
|
162
|
+
variant: Wt,
|
|
164
163
|
isDisabled: u,
|
|
165
|
-
isStrikeThrough:
|
|
164
|
+
isStrikeThrough: A,
|
|
166
165
|
selectWeek: m,
|
|
167
|
-
isHoliday:
|
|
166
|
+
isHoliday: H
|
|
168
167
|
},
|
|
169
|
-
t.toString() +
|
|
168
|
+
t.toString() + e
|
|
170
169
|
)
|
|
171
|
-
] }, `fragment-${
|
|
172
|
-
|
|
170
|
+
] }, `fragment-${e}-${k}`) : wt || nt ? /* @__PURE__ */ n(
|
|
171
|
+
X,
|
|
173
172
|
{
|
|
174
|
-
hasBlueDot:
|
|
175
|
-
hasGreenDot:
|
|
176
|
-
hasYellowDot:
|
|
177
|
-
hasRedDot:
|
|
178
|
-
hasGreyDot:
|
|
179
|
-
gridIndex:
|
|
180
|
-
gridColumn:
|
|
181
|
-
gridRow:
|
|
173
|
+
hasBlueDot: P,
|
|
174
|
+
hasGreenDot: E,
|
|
175
|
+
hasYellowDot: L,
|
|
176
|
+
hasRedDot: _,
|
|
177
|
+
hasGreyDot: z,
|
|
178
|
+
gridIndex: e,
|
|
179
|
+
gridColumn: a ? y + 1 : y,
|
|
180
|
+
gridRow: Y,
|
|
182
181
|
day: t,
|
|
183
182
|
handleDateChange: p,
|
|
184
|
-
variant:
|
|
183
|
+
variant: Bt,
|
|
185
184
|
isDisabled: u,
|
|
186
|
-
isStrikeThrough:
|
|
185
|
+
isStrikeThrough: A,
|
|
187
186
|
selectWeek: m,
|
|
188
|
-
isHoliday:
|
|
187
|
+
isHoliday: H
|
|
189
188
|
},
|
|
190
|
-
`${t.toString()}-${
|
|
189
|
+
`${t.toString()}-${e}`
|
|
191
190
|
) : null;
|
|
192
191
|
});
|
|
193
|
-
return /* @__PURE__ */
|
|
192
|
+
return /* @__PURE__ */ w(Ft, { w: kt, h: gt, children: [
|
|
194
193
|
/* @__PURE__ */ n(
|
|
195
|
-
|
|
194
|
+
Et,
|
|
196
195
|
{
|
|
197
|
-
selectedDate:
|
|
196
|
+
selectedDate: l || /* @__PURE__ */ new Date(),
|
|
198
197
|
onDateChange: p,
|
|
199
|
-
isExpanded:
|
|
200
|
-
onMonthChange:
|
|
198
|
+
isExpanded: C,
|
|
199
|
+
onMonthChange: ut,
|
|
201
200
|
selectedMonth: s,
|
|
202
|
-
month:
|
|
201
|
+
month: yt,
|
|
203
202
|
locale: D,
|
|
204
203
|
selectWeek: m,
|
|
205
|
-
disablePastMonths:
|
|
206
|
-
disableBackwardNavigation:
|
|
207
|
-
disableForwardNavigation:
|
|
208
|
-
dateRange:
|
|
209
|
-
onRangeChange:
|
|
204
|
+
disablePastMonths: Dt,
|
|
205
|
+
disableBackwardNavigation: ht,
|
|
206
|
+
disableForwardNavigation: pt,
|
|
207
|
+
dateRange: o,
|
|
208
|
+
onRangeChange: i
|
|
210
209
|
}
|
|
211
210
|
),
|
|
212
|
-
|
|
213
|
-
/* @__PURE__ */ n(
|
|
211
|
+
C && /* @__PURE__ */ w(bt, { children: [
|
|
212
|
+
/* @__PURE__ */ n(J, { templateColumns: a ? "48px 1px 1fr 1fr 1fr 1fr 1fr 1fr 1fr" : "repeat(7, 1fr)", children: Ct.map((r, e) => {
|
|
214
213
|
let t;
|
|
215
|
-
return
|
|
216
|
-
|
|
214
|
+
return a && e === 0 ? t = 1 : a ? t = e + 2 : t = e, r ? /* @__PURE__ */ n(
|
|
215
|
+
q,
|
|
217
216
|
{
|
|
218
217
|
textAlign: "center",
|
|
219
218
|
fontWeight: "500",
|
|
220
|
-
fontFamily:
|
|
221
|
-
fontSize:
|
|
219
|
+
fontFamily: er.Body,
|
|
220
|
+
fontSize: rr.Small,
|
|
222
221
|
gridColumn: t,
|
|
223
|
-
borderRight:
|
|
224
|
-
pb:
|
|
225
|
-
children:
|
|
222
|
+
borderRight: a && e === 0 ? `1px solid ${ot.OnSurfaceBorder}` : "",
|
|
223
|
+
pb: at.Small,
|
|
224
|
+
children: At(r).slice(0, 2)
|
|
226
225
|
},
|
|
227
|
-
|
|
226
|
+
r
|
|
228
227
|
) : null;
|
|
229
228
|
}) }),
|
|
230
229
|
/* @__PURE__ */ n(
|
|
231
|
-
|
|
230
|
+
J,
|
|
232
231
|
{
|
|
233
|
-
templateColumns:
|
|
234
|
-
rowGap:
|
|
232
|
+
templateColumns: a ? "48px 1px 1fr 1fr 1fr 1fr 1fr 1fr 1fr" : "repeat(7, 1fr)",
|
|
233
|
+
rowGap: at.Small,
|
|
235
234
|
flexShrink: 1,
|
|
236
|
-
children:
|
|
235
|
+
children: vt
|
|
237
236
|
}
|
|
238
237
|
)
|
|
239
238
|
] })
|
|
240
239
|
] });
|
|
241
240
|
}
|
|
242
241
|
export {
|
|
243
|
-
|
|
242
|
+
Fr as BaseDatePicker
|
|
244
243
|
};
|
|
@@ -28,13 +28,13 @@ const Fr = ({
|
|
|
28
28
|
selectWeek: m,
|
|
29
29
|
locale: o,
|
|
30
30
|
selectedDate: i,
|
|
31
|
-
onDateChange:
|
|
32
|
-
isExpanded:
|
|
31
|
+
onDateChange: a,
|
|
32
|
+
isExpanded: f,
|
|
33
33
|
disablePastMonths: P,
|
|
34
34
|
disableBackwardNavigation: B,
|
|
35
35
|
disableForwardNavigation: T,
|
|
36
36
|
dateRange: t,
|
|
37
|
-
onRangeChange:
|
|
37
|
+
onRangeChange: s
|
|
38
38
|
}) => {
|
|
39
39
|
function V(r) {
|
|
40
40
|
switch (r) {
|
|
@@ -51,14 +51,14 @@ const Fr = ({
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
function h(r) {
|
|
54
|
-
return !!
|
|
54
|
+
return !!r?.startDate && !!r?.endDate;
|
|
55
55
|
}
|
|
56
|
-
const n = !m && h(t) &&
|
|
56
|
+
const n = !m && h(t) && s;
|
|
57
57
|
function v(r) {
|
|
58
58
|
return X(r.startDate, r.endDate) ? o === F || o === x ? "MMM d" : "d MMM" : "PP";
|
|
59
59
|
}
|
|
60
60
|
const y = () => {
|
|
61
|
-
if (
|
|
61
|
+
if (f)
|
|
62
62
|
return S(d);
|
|
63
63
|
if (m)
|
|
64
64
|
return `${V(o)} ${A(i)}`;
|
|
@@ -68,15 +68,15 @@ const Fr = ({
|
|
|
68
68
|
}
|
|
69
69
|
return i ? b(i, "dd MMMM", { locale: o }) : S(d);
|
|
70
70
|
}, H = () => {
|
|
71
|
-
|
|
71
|
+
f ? k(Y(u(e))) : m ? a(q(i)) : n ? s({
|
|
72
72
|
startDate: c(t.startDate),
|
|
73
73
|
endDate: c(t.endDate)
|
|
74
|
-
}) :
|
|
74
|
+
}) : a(c(i));
|
|
75
75
|
}, U = () => {
|
|
76
|
-
|
|
76
|
+
f ? k(C(u(e), 1)) : m ? a(J(i, 1)) : n ? s({
|
|
77
77
|
startDate: D(t.startDate, 1),
|
|
78
78
|
endDate: D(t.endDate, 1)
|
|
79
|
-
}) :
|
|
79
|
+
}) : a(D(i, 1));
|
|
80
80
|
}, M = u(/* @__PURE__ */ new Date()), $ = B || P && (O(e, M) || G(e, M));
|
|
81
81
|
return /* @__PURE__ */ L(W, { justify: "space-between", align: "center", mb: Z.Small, children: [
|
|
82
82
|
/* @__PURE__ */ p(
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { isSameDay as n } from "../../node_modules/date-fns/isSameDay.js";
|
|
2
|
-
import { endOfDay as
|
|
3
|
-
import { isPast as
|
|
4
|
-
const m = (
|
|
5
|
-
function p(
|
|
6
|
-
const
|
|
7
|
-
return
|
|
2
|
+
import { endOfDay as u } from "../../node_modules/date-fns/endOfDay.js";
|
|
3
|
+
import { isPast as f } from "../../node_modules/date-fns/isPast.js";
|
|
4
|
+
const m = (e, t) => t?.some((r) => n(new Date(r), e)), y = (e, t) => !t || t.length === 0 ? !1 : t.some((r) => n(new Date(r), e));
|
|
5
|
+
function p(e) {
|
|
6
|
+
const t = u(e);
|
|
7
|
+
return f(t);
|
|
8
8
|
}
|
|
9
|
-
const d = (
|
|
9
|
+
const d = (e) => `${e.slice(0, 1).toUpperCase()}${e.slice(1)}`, g = (e, t, r, a, i, s, o) => i ? o ? "startDateRange" : "selectedDay" : s ? "endDateRange" : e ? "selectedDay" : a ? "isSelectedRangeDay" : t ? "currentDay" : r ? "outSideMonth" : "normal", h = (e, t) => e ? "selectedDay" : t ? "currentDay" : "normal";
|
|
10
10
|
export {
|
|
11
11
|
d as firstLetterUpperCase,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
g as getDateCellVariant,
|
|
13
|
+
h as getWeekCellVariant,
|
|
14
14
|
p as hasDatePassed,
|
|
15
15
|
y as hasDotOnDate,
|
|
16
16
|
m as isDateStrikeThrough
|