@caspeco/casper-ui-library 7.7.0 → 7.7.2
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/date-picker/base-date-picker.js +21 -21
- package/dist/components/date-picker/date-picker-date-cell.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-date-cell.js +36 -33
- package/dist/components/date-picker/date-picker-header.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-header.js +121 -90
- package/dist/components/menu/menu-group.js +1 -1
- package/dist/components/segmented-control/segmented-control-item.d.ts +2 -1
- package/dist/components/segmented-control/segmented-control-item.d.ts.map +1 -1
- package/dist/components/segmented-control/types.d.ts +2 -1
- package/dist/components/segmented-control/types.d.ts.map +1 -1
- package/dist/components/table/table-cell.js +1 -1
- package/dist/components/table/table-filter.js +1 -1
- package/dist/components/table/table-row-expand-toggle-button.js +6 -6
- package/dist/node_modules/date-fns/constructNow.js +8 -0
- package/dist/node_modules/date-fns/isToday.js +13 -0
- package/package.json +1 -1
|
@@ -5,16 +5,16 @@ import { DatePickerDateCell as X } from "./date-picker-date-cell.js";
|
|
|
5
5
|
import { DatePickerHeader as Lt } from "./date-picker-header.js";
|
|
6
6
|
import { DatePickerWeekCell as Pt } from "./date-picker-week-cell.js";
|
|
7
7
|
import { hasDotOnDate as p, isDateStrikeThrough as Ut, getWeekCellVariant as _t, getDateCellVariant as Z, firstLetterUpperCase as zt, hasDatePassed as At } from "./helper.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
8
|
+
import { lv as Ht } 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 { nlBE as Xt } from "../../node_modules/date-fns/locale/nl-BE.js";
|
|
17
|
+
import { fr as R } from "../../node_modules/date-fns/locale/fr.js";
|
|
18
18
|
import { sv as Zt } from "../../node_modules/date-fns/locale/sv.js";
|
|
19
19
|
import { da as Nt } from "../../node_modules/date-fns/locale/da.js";
|
|
20
20
|
import { nb as Rt } from "../../node_modules/date-fns/locale/nb.js";
|
|
@@ -33,15 +33,15 @@ const ar = {
|
|
|
33
33
|
"nb-NO": { locale: Rt },
|
|
34
34
|
"da-DK": { locale: Nt },
|
|
35
35
|
"sv-SE": { locale: Zt },
|
|
36
|
-
"nl-NL": { locale:
|
|
37
|
-
"fi-FI": { locale:
|
|
38
|
-
"es-ES": { locale:
|
|
39
|
-
"et-EE": { locale:
|
|
40
|
-
"lt-LT": { locale:
|
|
41
|
-
"lv-LV": { locale:
|
|
42
|
-
"fr-FR": { locale:
|
|
43
|
-
"fr-BE": { locale:
|
|
44
|
-
"nl-BE": { locale:
|
|
36
|
+
"nl-NL": { locale: Jt },
|
|
37
|
+
"fi-FI": { locale: qt },
|
|
38
|
+
"es-ES": { locale: Yt },
|
|
39
|
+
"et-EE": { locale: Kt },
|
|
40
|
+
"lt-LT": { locale: jt },
|
|
41
|
+
"lv-LV": { locale: Ht },
|
|
42
|
+
"fr-FR": { locale: R },
|
|
43
|
+
"fr-BE": { locale: R },
|
|
44
|
+
"nl-BE": { locale: Xt }
|
|
45
45
|
};
|
|
46
46
|
function Gr({
|
|
47
47
|
selectedDate: l,
|
|
@@ -94,12 +94,12 @@ function Gr({
|
|
|
94
94
|
[S, $, E, e?.startDate, s]
|
|
95
95
|
);
|
|
96
96
|
function yt() {
|
|
97
|
-
const o =
|
|
97
|
+
const o = Qt(/* @__PURE__ */ new Date(), { locale: D });
|
|
98
98
|
return Array.from({ length: 7 }, (r, t) => tt(rt(o, t), "eee", { locale: D }));
|
|
99
99
|
}
|
|
100
100
|
const St = tt(F(n), "MMMM yyyy", {
|
|
101
101
|
locale: D
|
|
102
|
-
}), Ct =
|
|
102
|
+
}), Ct = N(n).getDate(), Mt = [a ? "v." : void 0, ...yt()], Ot = D.options?.weekStartsOn || 0, T = (F(n).getDay() - Ot + 7) % 7, kt = (7 - N(n).getDay()) % 7, gt = ["auto", "auto", "100%"], Bt = ["auto", "auto", "100%"], It = (o) => !mt && At(o) ? !0 : W ? W(o) : !1, vt = Array.from({ length: Ct + T + kt }, (o, r) => {
|
|
103
103
|
const t = rt(F(n), r - T), k = et(t, n), g = f(t, /* @__PURE__ */ new Date()), u = It(t) || ct, G = p(t, m?.yellowDotDates), L = p(t, m?.greenDotDates), P = p(t, m?.blueDotDates), U = p(t, m?.redDotDates), _ = p(t, m?.greyDotDates), z = Ut(t, nt) && !u;
|
|
104
104
|
let B = !1;
|
|
105
105
|
l && (B = f(t, l));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-date-cell.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-date-cell.tsx"],"names":[],"mappings":"AAIA,KAAK,OAAO,GACT,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,CAAC;AAElB,KAAK,qBAAqB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,IAAI,CAAC;IACV,gBAAgB,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,uLAgBhC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"date-picker-date-cell.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-date-cell.tsx"],"names":[],"mappings":"AAIA,KAAK,OAAO,GACT,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,CAAC;AAElB,KAAK,qBAAqB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,IAAI,CAAC;IACV,gBAAgB,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,uLAgBhC,qBAAqB,4CAuGvB,CAAC"}
|
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import { useStyleConfig as
|
|
3
|
-
import { formatDate as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as e, Fragment as W, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useStyleConfig as m, Button as O, Box as t, Stack as V } from "@chakra-ui/react";
|
|
3
|
+
import { formatDate as j } from "../../node_modules/date-fns/format.js";
|
|
4
|
+
import { isToday as x } from "../../node_modules/date-fns/isToday.js";
|
|
5
|
+
import { ThemeColorVariable as r, ThemeSpaceVariable as u } from "../../theme/theme-types.js";
|
|
6
|
+
const N = ({
|
|
7
|
+
gridColumn: b,
|
|
8
|
+
gridRow: f,
|
|
9
|
+
gridIndex: g,
|
|
10
|
+
day: n,
|
|
11
|
+
handleDateChange: h,
|
|
11
12
|
variant: o,
|
|
12
13
|
isDisabled: d,
|
|
13
14
|
isStrikeThrough: s,
|
|
14
|
-
hasBlueDot:
|
|
15
|
+
hasBlueDot: C,
|
|
15
16
|
hasYellowDot: k,
|
|
16
|
-
hasGreenDot:
|
|
17
|
-
hasGreyDot:
|
|
18
|
-
hasRedDot:
|
|
17
|
+
hasGreenDot: D,
|
|
18
|
+
hasGreyDot: y,
|
|
19
|
+
hasRedDot: S,
|
|
19
20
|
selectWeek: a,
|
|
20
21
|
isHoliday: i
|
|
21
22
|
}) => {
|
|
22
|
-
const
|
|
23
|
+
const R = m("DateCell", { variant: o }), B = m("DateCellWeek", { variant: o }), c = (o === "selectedDay" || o === "startDateRange" || o === "endDateRange") && !a, l = {
|
|
23
24
|
borderRadius: "50%",
|
|
24
|
-
border:
|
|
25
|
-
width:
|
|
26
|
-
height:
|
|
27
|
-
},
|
|
28
|
-
return /* @__PURE__ */ e(
|
|
25
|
+
border: c ? "solid 1.5px white" : "",
|
|
26
|
+
width: c ? "7.5px" : "6px",
|
|
27
|
+
height: c ? "7.5px" : "6px"
|
|
28
|
+
}, w = g % 7 === 6;
|
|
29
|
+
return /* @__PURE__ */ e(W, { children: /* @__PURE__ */ p(
|
|
29
30
|
O,
|
|
30
31
|
{
|
|
31
|
-
__css: a ?
|
|
32
|
+
__css: a ? B : R,
|
|
32
33
|
type: "button",
|
|
33
|
-
sx: a && o === "selectedDay" &&
|
|
34
|
+
sx: a && o === "selectedDay" && w ? {
|
|
34
35
|
borderTopRightRadius: "10px",
|
|
35
36
|
borderBottomRightRadius: "10px"
|
|
36
37
|
} : {},
|
|
37
38
|
variant: o,
|
|
38
39
|
isDisabled: d || s,
|
|
39
40
|
onClick: () => {
|
|
40
|
-
!d && !s &&
|
|
41
|
+
!d && !s && h(n);
|
|
41
42
|
},
|
|
42
|
-
gridColumn:
|
|
43
|
-
gridRow:
|
|
43
|
+
gridColumn: b,
|
|
44
|
+
gridRow: f,
|
|
44
45
|
display: "flex",
|
|
45
46
|
"data-testid": "date-picker-date-cell",
|
|
46
47
|
children: [
|
|
@@ -49,7 +50,9 @@ const L = ({
|
|
|
49
50
|
{
|
|
50
51
|
"data-testid": i ? "holiday" : void 0,
|
|
51
52
|
sx: { color: i ? r.Error : "inherit" },
|
|
52
|
-
|
|
53
|
+
fontWeight: x(n) ? "bold" : "normal",
|
|
54
|
+
textDecoration: x(n) ? "underline" : "none",
|
|
55
|
+
children: j(n, "d")
|
|
53
56
|
}
|
|
54
57
|
),
|
|
55
58
|
s && /* @__PURE__ */ e("span", {}),
|
|
@@ -57,11 +60,11 @@ const L = ({
|
|
|
57
60
|
V,
|
|
58
61
|
{
|
|
59
62
|
position: "absolute",
|
|
60
|
-
bottom:
|
|
63
|
+
bottom: u.XSmall,
|
|
61
64
|
direction: "row",
|
|
62
|
-
spacing:
|
|
65
|
+
spacing: u.XSmall,
|
|
63
66
|
children: [
|
|
64
|
-
|
|
67
|
+
C && /* @__PURE__ */ e(
|
|
65
68
|
t,
|
|
66
69
|
{
|
|
67
70
|
sx: {
|
|
@@ -70,7 +73,7 @@ const L = ({
|
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
),
|
|
73
|
-
|
|
76
|
+
D && /* @__PURE__ */ e(
|
|
74
77
|
t,
|
|
75
78
|
{
|
|
76
79
|
sx: {
|
|
@@ -88,7 +91,7 @@ const L = ({
|
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
93
|
),
|
|
91
|
-
|
|
94
|
+
y && /* @__PURE__ */ e(
|
|
92
95
|
t,
|
|
93
96
|
{
|
|
94
97
|
sx: {
|
|
@@ -97,7 +100,7 @@ const L = ({
|
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
102
|
),
|
|
100
|
-
|
|
103
|
+
S && /* @__PURE__ */ e(
|
|
101
104
|
t,
|
|
102
105
|
{
|
|
103
106
|
sx: {
|
|
@@ -114,5 +117,5 @@ const L = ({
|
|
|
114
117
|
) });
|
|
115
118
|
};
|
|
116
119
|
export {
|
|
117
|
-
|
|
120
|
+
N as DatePickerDateCell
|
|
118
121
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-header.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-header.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"date-picker-header.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-header.tsx"],"names":[],"mappings":"AAKA,OAAO,EAeN,KAAK,MAAM,EACX,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,KAAK,qBAAqB,GAAG;IAC5B,aAAa,EAAE,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,IAAI,CAAC;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,yBAAyB,EAAE,OAAO,CAAC;IACnC,wBAAwB,EAAE,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,wMAc9B,qBAAqB,4CAiJvB,CAAC"}
|
|
@@ -1,107 +1,138 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Flex as
|
|
3
|
-
import { firstLetterUpperCase as
|
|
4
|
-
import { startOfMonth as
|
|
5
|
-
import { isBefore as
|
|
6
|
-
import { isSameMonth as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { sv as
|
|
17
|
-
import { da as
|
|
18
|
-
import { nb as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { jsxs as u, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Flex as p, Text as N } from "@chakra-ui/react";
|
|
3
|
+
import { firstLetterUpperCase as T } from "./helper.js";
|
|
4
|
+
import { startOfMonth as d } from "../../node_modules/date-fns/startOfMonth.js";
|
|
5
|
+
import { isBefore as Q } from "../../node_modules/date-fns/isBefore.js";
|
|
6
|
+
import { isSameMonth as X } from "../../node_modules/date-fns/isSameMonth.js";
|
|
7
|
+
import { startOfDay as Z } from "../../node_modules/date-fns/startOfDay.js";
|
|
8
|
+
import { Button as _ } from "../button/button.js";
|
|
9
|
+
import { IconButton as x } from "../icon-button/icon-button.js";
|
|
10
|
+
import { Icons as B } from "../icon/types.js";
|
|
11
|
+
import { getISOWeek as E } from "../../node_modules/date-fns/getISOWeek.js";
|
|
12
|
+
import { enGB as D } from "../../node_modules/date-fns/locale/en-GB.js";
|
|
13
|
+
import { enUS as k } from "../../node_modules/date-fns/locale/en-US.js";
|
|
14
|
+
import { nlBE as F } from "../../node_modules/date-fns/locale/nl-BE.js";
|
|
15
|
+
import { fr as P } from "../../node_modules/date-fns/locale/fr.js";
|
|
16
|
+
import { sv as V } from "../../node_modules/date-fns/locale/sv.js";
|
|
17
|
+
import { da as v } from "../../node_modules/date-fns/locale/da.js";
|
|
18
|
+
import { nb as j } from "../../node_modules/date-fns/locale/nb.js";
|
|
19
|
+
import { subMonths as R } from "../../node_modules/date-fns/subMonths.js";
|
|
20
|
+
import { subWeeks as rr } from "../../node_modules/date-fns/subWeeks.js";
|
|
21
|
+
import { subDays as l } from "../../node_modules/date-fns/subDays.js";
|
|
22
|
+
import { addMonths as tr } from "../../node_modules/date-fns/addMonths.js";
|
|
23
|
+
import { addWeeks as or } from "../../node_modules/date-fns/addWeeks.js";
|
|
24
|
+
import { addDays as b } from "../../node_modules/date-fns/addDays.js";
|
|
25
|
+
import { isSameYear as er } from "../../node_modules/date-fns/isSameYear.js";
|
|
26
|
+
import { isSameDay as ir } from "../../node_modules/date-fns/isSameDay.js";
|
|
27
|
+
import { ThemeSpaceVariable as H, ThemeFontSizeVariable as ar, ThemeFontVariable as mr } from "../../theme/theme-types.js";
|
|
28
|
+
import { formatDate as S } from "../../node_modules/date-fns/format.js";
|
|
29
|
+
const gr = ({
|
|
30
|
+
onMonthChange: h,
|
|
31
|
+
selectedMonth: a,
|
|
32
|
+
month: w,
|
|
28
33
|
selectWeek: m,
|
|
29
|
-
locale:
|
|
30
|
-
selectedDate:
|
|
31
|
-
onDateChange:
|
|
32
|
-
isExpanded:
|
|
33
|
-
disablePastMonths:
|
|
34
|
-
disableBackwardNavigation:
|
|
35
|
-
disableForwardNavigation:
|
|
36
|
-
dateRange:
|
|
37
|
-
onRangeChange:
|
|
34
|
+
locale: e,
|
|
35
|
+
selectedDate: t,
|
|
36
|
+
onDateChange: i,
|
|
37
|
+
isExpanded: n,
|
|
38
|
+
disablePastMonths: I,
|
|
39
|
+
disableBackwardNavigation: U,
|
|
40
|
+
disableForwardNavigation: $,
|
|
41
|
+
dateRange: o,
|
|
42
|
+
onRangeChange: f
|
|
38
43
|
}) => {
|
|
39
|
-
function
|
|
44
|
+
function g(r) {
|
|
40
45
|
switch (r) {
|
|
41
|
-
case
|
|
42
|
-
case F:
|
|
43
|
-
return "Week";
|
|
44
|
-
case Q:
|
|
46
|
+
case j:
|
|
45
47
|
return "Uke";
|
|
46
|
-
case
|
|
48
|
+
case v:
|
|
47
49
|
return "Uge";
|
|
48
|
-
case
|
|
49
|
-
default:
|
|
50
|
+
case V:
|
|
50
51
|
return "Vecka";
|
|
52
|
+
case P:
|
|
53
|
+
return "Semaine";
|
|
54
|
+
case F:
|
|
55
|
+
case k:
|
|
56
|
+
case D:
|
|
57
|
+
default:
|
|
58
|
+
return "Week";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function z(r) {
|
|
62
|
+
switch (r) {
|
|
63
|
+
case j:
|
|
64
|
+
case v:
|
|
65
|
+
case V:
|
|
66
|
+
return "I dag";
|
|
67
|
+
case P:
|
|
68
|
+
return "Aujourd'hui";
|
|
69
|
+
case F:
|
|
70
|
+
return "Vandaag";
|
|
71
|
+
case k:
|
|
72
|
+
case D:
|
|
73
|
+
default:
|
|
74
|
+
return "Today";
|
|
51
75
|
}
|
|
52
76
|
}
|
|
53
|
-
function
|
|
77
|
+
function L(r) {
|
|
54
78
|
return !!r?.startDate && !!r?.endDate;
|
|
55
79
|
}
|
|
56
|
-
const
|
|
57
|
-
function
|
|
58
|
-
return
|
|
80
|
+
const c = !m && L(o) && f;
|
|
81
|
+
function O(r) {
|
|
82
|
+
return er(r.startDate, r.endDate) ? e === D || e === k ? "MMM d" : "d MMM" : "PP";
|
|
59
83
|
}
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
return
|
|
84
|
+
const W = () => {
|
|
85
|
+
if (n)
|
|
86
|
+
return T(w);
|
|
63
87
|
if (m)
|
|
64
|
-
return `${
|
|
65
|
-
if (
|
|
66
|
-
const r =
|
|
67
|
-
return `${
|
|
88
|
+
return `${g(e)} ${E(t)}`;
|
|
89
|
+
if (c) {
|
|
90
|
+
const r = O(o), J = S(o.startDate, r, { locale: e }), K = S(o.endDate, r, { locale: e });
|
|
91
|
+
return `${J} - ${K}`.replace(/\./g, "");
|
|
68
92
|
}
|
|
69
|
-
return
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
startDate:
|
|
73
|
-
endDate:
|
|
74
|
-
}) :
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
startDate:
|
|
78
|
-
endDate:
|
|
79
|
-
}) :
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
return t ? S(t, "dd MMMM", { locale: e }) : T(w);
|
|
94
|
+
}, A = () => {
|
|
95
|
+
n ? h(R(d(a))) : m ? i(rr(t)) : c ? f({
|
|
96
|
+
startDate: l(o.startDate),
|
|
97
|
+
endDate: l(o.endDate)
|
|
98
|
+
}) : i(l(t));
|
|
99
|
+
}, C = () => {
|
|
100
|
+
n ? h(tr(d(a), 1)) : m ? i(or(t, 1)) : c ? f({
|
|
101
|
+
startDate: b(o.startDate, 1),
|
|
102
|
+
endDate: b(o.endDate, 1)
|
|
103
|
+
}) : i(b(t, 1));
|
|
104
|
+
}, y = d(/* @__PURE__ */ new Date()), G = U || I && (Q(a, y) || X(a, y)), M = Z(/* @__PURE__ */ new Date()), Y = !ir(t, M), q = () => {
|
|
105
|
+
i(M);
|
|
106
|
+
};
|
|
107
|
+
return /* @__PURE__ */ u(p, { justify: "space-between", align: "center", mb: H.Small, children: [
|
|
108
|
+
/* @__PURE__ */ s(N, { fontWeight: "500", fontFamily: mr.SubHeader, fontSize: ar.Large, children: W() }),
|
|
109
|
+
/* @__PURE__ */ u(p, { align: "center", gap: H.Small, children: [
|
|
110
|
+
Y && /* @__PURE__ */ s(_, { variant: "ghost", size: "sm", onClick: q, children: z(e) }),
|
|
111
|
+
/* @__PURE__ */ u(p, { align: "center", children: [
|
|
112
|
+
/* @__PURE__ */ s(
|
|
113
|
+
x,
|
|
114
|
+
{
|
|
115
|
+
icon: B.Back,
|
|
116
|
+
"aria-label": "Back",
|
|
117
|
+
variant: "ghost",
|
|
118
|
+
onClick: A,
|
|
119
|
+
isDisabled: G
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ s(
|
|
123
|
+
x,
|
|
124
|
+
{
|
|
125
|
+
icon: B.Forward,
|
|
126
|
+
"aria-label": "Forward",
|
|
127
|
+
variant: "ghost",
|
|
128
|
+
onClick: C,
|
|
129
|
+
isDisabled: $
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] })
|
|
133
|
+
] })
|
|
103
134
|
] });
|
|
104
135
|
};
|
|
105
136
|
export {
|
|
106
|
-
|
|
137
|
+
gr as DatePickerHeader
|
|
107
138
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ButtonProps, ResponsiveValue } from '@chakra-ui/react';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
|
+
import { ButtonSize } from '../button/types.js';
|
|
3
4
|
import { SegmentedControlItem } from './types.js';
|
|
4
5
|
type CustomButtonProps = Pick<ButtonProps, "isDisabled" | "isActive" | "key" | "aria-label">;
|
|
5
6
|
type SegmentedControlButtonProps = CustomButtonProps & {
|
|
@@ -14,7 +15,7 @@ type SegmentedControlButtonProps = CustomButtonProps & {
|
|
|
14
15
|
/**
|
|
15
16
|
* Size for component. Defaults to 'md' (medium).
|
|
16
17
|
*/
|
|
17
|
-
size: ResponsiveValue<
|
|
18
|
+
size: ResponsiveValue<ButtonSize> | undefined;
|
|
18
19
|
children: React.ReactNode;
|
|
19
20
|
};
|
|
20
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented-control-item.d.ts","sourceRoot":"","sources":["../../../lib/components/segmented-control/segmented-control-item.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,KAAK,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,GAAG,UAAU,GAAG,KAAK,GAAG,YAAY,CAAC,CAAC;AAE7F,KAAK,2BAA2B,GAAG,iBAAiB,GAAG;IACtD;;OAEG;IACH,IAAI,EAAE,oBAAoB,CAAC;IAC3B;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC9C;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"segmented-control-item.d.ts","sourceRoot":"","sources":["../../../lib/components/segmented-control/segmented-control-item.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,KAAK,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,GAAG,UAAU,GAAG,KAAK,GAAG,YAAY,CAAC,CAAC;AAE7F,KAAK,2BAA2B,GAAG,iBAAiB,GAAG;IACtD;;OAEG;IACH,IAAI,EAAE,oBAAoB,CAAC;IAC3B;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC9C;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,2BAA2B,2CAW9F"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MarginProps, PaddingProps } from '../../theme/index.js';
|
|
2
2
|
import { ResponsiveValue } from '@chakra-ui/react';
|
|
3
|
+
import { ButtonSize } from '../button/types.js';
|
|
3
4
|
export type SegmentedControlItem = {
|
|
4
5
|
/**
|
|
5
6
|
* Required identifier for item.
|
|
@@ -38,7 +39,7 @@ type CustomSegmentedControlProps = {
|
|
|
38
39
|
/**
|
|
39
40
|
* Size for component. Defaults to 'md' (medium).
|
|
40
41
|
*/
|
|
41
|
-
size?: ResponsiveValue<
|
|
42
|
+
size?: ResponsiveValue<ButtonSize> | undefined;
|
|
42
43
|
};
|
|
43
44
|
export type SegmentedControlProps = CustomSegmentedControlProps & MarginProps & PaddingProps;
|
|
44
45
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/segmented-control/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/segmented-control/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,oBAAoB,GAAG;IAClC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,2BAA2B,GAAG;IAClC;;OAEG;IACH,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAChD;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,GAAG,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -120,7 +120,7 @@ const G = ({
|
|
|
120
120
|
items: e.items,
|
|
121
121
|
selectedItems: e.selectedItems,
|
|
122
122
|
onChange: (s) => k(e.filterId, s),
|
|
123
|
-
footerContent: /* @__PURE__ */ l(T, { variant: "link", size: "
|
|
123
|
+
footerContent: /* @__PURE__ */ l(T, { variant: "link", size: "xs", onClick: () => k(e.filterId, []), children: /* @__PURE__ */ l(A, { children: h.filterBoxReset }) })
|
|
124
124
|
},
|
|
125
125
|
e.filterId
|
|
126
126
|
)) }),
|
|
@@ -7,18 +7,18 @@ import { Icons as i } from "../icon/types.js";
|
|
|
7
7
|
import { ThemeSpaceVariable as f } from "../../theme/theme-types.js";
|
|
8
8
|
const B = d(
|
|
9
9
|
({ row: o, localeString: l, rowIsExpanded: n, hidden: a }) => {
|
|
10
|
-
const r = x[l],
|
|
11
|
-
e.stopPropagation(),
|
|
12
|
-
},
|
|
10
|
+
const r = x[l], p = o.getToggleExpandedHandler(), s = (e) => {
|
|
11
|
+
e.stopPropagation(), p();
|
|
12
|
+
}, m = () => n ? `${r.collapseRow} ${o.index + 1}` : `${r.expandRow} ${o.index + 1}`;
|
|
13
13
|
return /* @__PURE__ */ t(c, { as: "span", h: "100%", children: /* @__PURE__ */ t(
|
|
14
14
|
g,
|
|
15
15
|
{
|
|
16
|
-
size: "
|
|
16
|
+
size: "xs",
|
|
17
17
|
mr: f.XSmall,
|
|
18
18
|
variant: "ghost",
|
|
19
|
-
"aria-label":
|
|
19
|
+
"aria-label": m(),
|
|
20
20
|
icon: n ? i.TreeViewCollapse : i.TreeViewExpand,
|
|
21
|
-
onClick:
|
|
21
|
+
onClick: s,
|
|
22
22
|
onKeyDown: (e) => e.stopPropagation(),
|
|
23
23
|
visibility: a ? "hidden" : "initial",
|
|
24
24
|
"aria-hidden": a,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { constructFrom as r } from "./constructFrom.js";
|
|
2
|
+
import { constructNow as t } from "./constructNow.js";
|
|
3
|
+
import { isSameDay as m } from "./isSameDay.js";
|
|
4
|
+
function f(o, i) {
|
|
5
|
+
return m(
|
|
6
|
+
r(o, o),
|
|
7
|
+
t(o)
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
f as default,
|
|
12
|
+
f as isToday
|
|
13
|
+
};
|