impact-nova 2.5.5 → 2.5.7
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/data-display/calendar/calendar-apply-validation.js +45 -33
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +62 -54
- package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +88 -85
- package/dist/components/data-display/calendar/calendar-week-utils.js +23 -22
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +1 -1
- package/dist/components/data-display/calendar/use-calendar-state.js +47 -47
- package/dist/components/flows/guidance/guidance-error-boundary.js +22 -14
- package/dist/components/flows/guidance/guidance-layer.js +34 -32
- package/dist/components/flows/guidance/help-center/assets/whats-new-guide-icon.svg.js +4 -0
- package/dist/components/flows/guidance/help-center/filter-help-center-guides.js +10 -7
- package/dist/components/flows/guidance/help-center/guide-catalog-section.d.ts +7 -0
- package/dist/components/flows/guidance/help-center/guide-catalog-section.js +24 -0
- package/dist/components/flows/guidance/help-center/guide-catalog-utils.d.ts +3 -0
- package/dist/components/flows/guidance/help-center/guide-catalog-utils.js +19 -0
- package/dist/components/flows/guidance/help-center/guide-catalog.d.ts +1 -1
- package/dist/components/flows/guidance/help-center/guide-catalog.js +89 -79
- package/dist/components/flows/guidance/help-center/help-center-guide-labels.d.ts +6 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-labels.js +33 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-row.d.ts +12 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-row.js +57 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-type-icons.d.ts +9 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-type-icons.js +114 -0
- package/dist/components/flows/guidance/help-center/help-center-header.d.ts +1 -1
- package/dist/components/flows/guidance/help-center/help-center-header.js +20 -16
- package/dist/components/flows/guidance/help-center/help-center.constants.d.ts +1 -1
- package/dist/components/flows/guidance/help-center/help-center.constants.js +1 -1
- package/dist/components/flows/guidance/help-center/help-center.d.ts +3 -1
- package/dist/components/flows/guidance/help-center/help-center.js +74 -51
- package/dist/components/flows/guidance/help-center/help-center.types.d.ts +9 -1
- package/dist/components/flows/guidance/help-center/renderHelpCenterGuideTypeIcon.d.ts +4 -0
- package/dist/components/flows/guidance/help-center/renderHelpCenterGuideTypeIcon.js +18 -0
- package/dist/components/flows/guidance/help-center.d.ts +4 -2
- package/dist/components/flows/guidance/help-center.js +23 -14
- package/dist/components/flows/guidance/hooks/useGuidanceOverlayGeometry.js +19 -17
- package/dist/components/flows/guidance/index.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/announcement-renderer.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/announcement-renderer.js +20 -12
- package/dist/components/flows/guidance/renderers/guidance-card-shared.d.ts +9 -11
- package/dist/components/flows/guidance/renderers/guidance-card-shared.js +124 -177
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.js +57 -72
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.js +23 -23
- package/dist/components/flows/wizard/wizard.js +41 -38
- package/dist/components/layout/horizontal-scroller/horizontal-scroller.js +35 -53
- package/dist/form-engine/field-dependency-graph.d.ts +1 -4
- package/dist/form-engine/field-dependency-graph.js +53 -57
- package/dist/form-engine/field-groups.d.ts +15 -0
- package/dist/form-engine/field-groups.js +60 -0
- package/dist/form-engine/index.d.ts +3 -2
- package/dist/form-engine/index.js +17 -14
- package/dist/form-engine/types.d.ts +17 -0
- package/dist/form-react/Fields/RichTextField.d.ts +3 -0
- package/dist/form-react/Fields/RichTextField.js +214 -0
- package/dist/form-react/Fields/SelectField.js +27 -28
- package/dist/form-react/Fields/SliderRangeField.d.ts +3 -0
- package/dist/form-react/Fields/SliderRangeField.js +69 -0
- package/dist/form-react/ReactHooksForm.js +149 -87
- package/dist/form-react/fields.d.ts +2 -0
- package/dist/form-react/fields.js +22 -18
- package/dist/form-react/hooks/useCascadingForm.d.ts +1 -2
- package/dist/form-react/hooks/useCascadingForm.js +59 -67
- package/dist/form-react/hooks/useFieldVisibility.d.ts +1 -2
- package/dist/form-react/hooks/useFieldVisibility.js +36 -43
- package/dist/form-react/hooks/useFormSteps.d.ts +29 -0
- package/dist/form-react/hooks/useFormSteps.js +96 -0
- package/dist/form-react/hooks/useReactHookForm.js +17 -18
- package/dist/form-react/hooks/useSelectOptions.d.ts +1 -1
- package/dist/form-react/hooks/useSelectOptions.js +80 -83
- package/dist/form-react/index.d.ts +5 -3
- package/dist/form-react/index.js +93 -88
- package/dist/form-react/registry/defaultFieldRegistrations.d.ts +1 -1
- package/dist/form-react/registry/defaultFieldRegistrations.js +36 -26
- package/dist/form-react/types/fields.types.d.ts +34 -15
- package/dist/form-react/types/fieldsOutput.types.d.ts +5 -1
- package/dist/form-react/types/reactHookForm.types.d.ts +31 -2
- package/dist/form-react/utils/date.utils.d.ts +3 -1
- package/dist/form-react/utils/date.utils.js +84 -55
- package/dist/form-react/utils/fieldDefaults.utils.js +28 -13
- package/dist/i18n/defaultMessages.d.ts +10 -0
- package/dist/i18n/defaultMessages.js +17 -7
- package/dist/i18n/locales/de.js +13 -3
- package/dist/i18n/locales/es.js +13 -3
- package/dist/i18n/locales/hi.js +13 -3
- package/dist/i18n/locales/kn.js +13 -3
- package/dist/impact-nova.css +1 -1
- package/dist/lib/guidance/engine/guidance-engine.d.ts +7 -5
- package/dist/lib/guidance/engine/guidance-engine.js +115 -47
- package/dist/lib/guidance/triggers/trigger-registry.js +6 -6
- package/dist/lib/guidance/types/guidance.types.d.ts +11 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +17 -2
|
@@ -1,33 +1,40 @@
|
|
|
1
|
-
import { isMonthDisabled as
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { isMonthDisabled as g } from "./calendar-month-utils.js";
|
|
2
|
+
function u(n) {
|
|
3
|
+
return new Date(n.getFullYear(), n.getMonth(), n.getDate());
|
|
4
|
+
}
|
|
5
|
+
function d(n, s, o) {
|
|
6
|
+
const i = u(n);
|
|
7
|
+
if (s) {
|
|
8
|
+
const f = u(s);
|
|
9
|
+
if (i < f) return !0;
|
|
7
10
|
}
|
|
8
|
-
if (
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
+
if (o) {
|
|
12
|
+
const f = u(o);
|
|
13
|
+
if (i > f) return !0;
|
|
11
14
|
}
|
|
12
15
|
return !1;
|
|
13
16
|
}
|
|
14
|
-
function
|
|
17
|
+
function p(n, s, o, i) {
|
|
18
|
+
const f = u(n), m = u(s);
|
|
19
|
+
return !!(o && m < u(o) || i && f > u(i));
|
|
20
|
+
}
|
|
21
|
+
function D(n) {
|
|
15
22
|
const {
|
|
16
|
-
showFooter:
|
|
17
|
-
pickerType:
|
|
18
|
-
disabled:
|
|
19
|
-
pendingSelection:
|
|
20
|
-
pendingWeekSelection:
|
|
21
|
-
pendingMonthSelection:
|
|
22
|
-
} =
|
|
23
|
-
if (!
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
const e =
|
|
23
|
+
showFooter: s,
|
|
24
|
+
pickerType: o,
|
|
25
|
+
disabled: i,
|
|
26
|
+
pendingSelection: f,
|
|
27
|
+
pendingWeekSelection: m,
|
|
28
|
+
pendingMonthSelection: y
|
|
29
|
+
} = n;
|
|
30
|
+
if (!s) return !1;
|
|
31
|
+
const a = i;
|
|
32
|
+
if (!a || typeof a != "object" || !("before" in a) && !("after" in a)) return !1;
|
|
33
|
+
const c = a.before, l = a.after;
|
|
34
|
+
if (o === "month") {
|
|
35
|
+
const e = y;
|
|
29
36
|
if (!e) return !1;
|
|
30
|
-
const r = (t) =>
|
|
37
|
+
const r = (t) => g(t.year, t.month, i);
|
|
31
38
|
if (Array.isArray(e)) return e.some(r);
|
|
32
39
|
if ("from" in e) {
|
|
33
40
|
const t = e;
|
|
@@ -35,10 +42,15 @@ function h(u) {
|
|
|
35
42
|
}
|
|
36
43
|
return r(e);
|
|
37
44
|
}
|
|
38
|
-
if (
|
|
39
|
-
const e =
|
|
45
|
+
if (o === "week") {
|
|
46
|
+
const e = m;
|
|
40
47
|
if (!e) return !1;
|
|
41
|
-
const r = (t) =>
|
|
48
|
+
const r = (t) => p(
|
|
49
|
+
t.startDate,
|
|
50
|
+
t.endDate,
|
|
51
|
+
c,
|
|
52
|
+
l
|
|
53
|
+
);
|
|
42
54
|
if (Array.isArray(e)) return e.some(r);
|
|
43
55
|
if ("from" in e) {
|
|
44
56
|
const t = e;
|
|
@@ -46,20 +58,20 @@ function h(u) {
|
|
|
46
58
|
}
|
|
47
59
|
return r(e);
|
|
48
60
|
}
|
|
49
|
-
if (
|
|
50
|
-
const e =
|
|
61
|
+
if (o === "date") {
|
|
62
|
+
const e = f;
|
|
51
63
|
if (!e) return !1;
|
|
52
64
|
if (Array.isArray(e))
|
|
53
|
-
return e.some((r) =>
|
|
65
|
+
return e.some((r) => d(r, c, l));
|
|
54
66
|
if (e instanceof Date)
|
|
55
|
-
return
|
|
67
|
+
return d(e, c, l);
|
|
56
68
|
if ("from" in e) {
|
|
57
69
|
const r = e;
|
|
58
|
-
if (r.from &&
|
|
70
|
+
if (r.from && d(r.from, c, l) || r.to && d(r.to, c, l)) return !0;
|
|
59
71
|
}
|
|
60
72
|
}
|
|
61
73
|
return !1;
|
|
62
74
|
}
|
|
63
75
|
export {
|
|
64
|
-
|
|
76
|
+
D as isCalendarApplyDisabled
|
|
65
77
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as n, jsxs as R } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as u from "react";
|
|
3
3
|
import "react-day-picker";
|
|
4
|
-
import { ChevronRight as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Select as
|
|
4
|
+
import { ChevronRight as N } from "impact-nova-icons";
|
|
5
|
+
import { cn as d } from "../../../lib/utils.js";
|
|
6
|
+
import { Button as D } from "../../primitives/button/button.js";
|
|
7
|
+
import { Select as w } from "../../forms/select/select.js";
|
|
8
8
|
import { CalendarCaptionHeader as Y } from "./calendar-caption-header.js";
|
|
9
9
|
import { CalendarDayButton as z } from "./calendar-day-button.js";
|
|
10
10
|
import { PanelIndexContext as h } from "./calendar-panel-context.js";
|
|
@@ -12,49 +12,49 @@ import { CalendarWeekNumberCell as O } from "./calendar-week-number-cell.js";
|
|
|
12
12
|
import { getAvailableMonths as A } from "./calendar-month-utils.js";
|
|
13
13
|
import { isCalendarPaddingWeek as F } from "./calendar-padding-week.utils.js";
|
|
14
14
|
function _({
|
|
15
|
-
buttonVariant:
|
|
16
|
-
pickerType:
|
|
17
|
-
currentMonth:
|
|
18
|
-
monthsFull:
|
|
19
|
-
resolvedStartMonth:
|
|
20
|
-
resolvedEndMonth:
|
|
21
|
-
availableYears:
|
|
15
|
+
buttonVariant: f,
|
|
16
|
+
pickerType: p,
|
|
17
|
+
currentMonth: c,
|
|
18
|
+
monthsFull: b,
|
|
19
|
+
resolvedStartMonth: k,
|
|
20
|
+
resolvedEndMonth: P,
|
|
21
|
+
availableYears: g,
|
|
22
22
|
weekStartsOn: I,
|
|
23
|
-
previousMonthLabel:
|
|
23
|
+
previousMonthLabel: v,
|
|
24
24
|
nextMonthLabel: x,
|
|
25
25
|
monthPlaceholder: M,
|
|
26
|
-
yearPlaceholder:
|
|
26
|
+
yearPlaceholder: W,
|
|
27
27
|
weekNumberLabel: S,
|
|
28
|
-
weekLabel:
|
|
28
|
+
weekLabel: y,
|
|
29
29
|
onMonthChange: m,
|
|
30
|
-
onWeekSelect:
|
|
30
|
+
onWeekSelect: C,
|
|
31
31
|
components: B
|
|
32
32
|
}) {
|
|
33
33
|
return {
|
|
34
|
-
Root: ({ className: e, rootRef: t, ...a }) => /* @__PURE__ */ n("div", { "data-slot": "calendar", ref: t, className:
|
|
34
|
+
Root: ({ className: e, rootRef: t, ...a }) => /* @__PURE__ */ n("div", { "data-slot": "calendar", ref: t, className: d(e), ...a }),
|
|
35
35
|
Chevron: ({ className: e, orientation: t, ...a }) => t === "left" ? /* @__PURE__ */ n(
|
|
36
|
-
|
|
36
|
+
N,
|
|
37
37
|
{
|
|
38
38
|
size: 16,
|
|
39
|
-
className:
|
|
39
|
+
className: d("rotate-180 text-content", e),
|
|
40
40
|
...a
|
|
41
41
|
}
|
|
42
|
-
) : t === "right" ? /* @__PURE__ */ n(
|
|
42
|
+
) : t === "right" ? /* @__PURE__ */ n(N, { size: 16, className: d("text-content", e), ...a }) : /* @__PURE__ */ n("span", {}),
|
|
43
43
|
PreviousMonthButton: (e) => /* @__PURE__ */ n(
|
|
44
|
-
|
|
44
|
+
D,
|
|
45
45
|
{
|
|
46
|
-
variant:
|
|
46
|
+
variant: f,
|
|
47
47
|
size: "icon",
|
|
48
48
|
className: "h-7 w-7",
|
|
49
|
-
"aria-label":
|
|
50
|
-
title:
|
|
49
|
+
"aria-label": v,
|
|
50
|
+
title: v,
|
|
51
51
|
...e
|
|
52
52
|
}
|
|
53
53
|
),
|
|
54
54
|
NextMonthButton: (e) => /* @__PURE__ */ n(
|
|
55
|
-
|
|
55
|
+
D,
|
|
56
56
|
{
|
|
57
|
-
variant:
|
|
57
|
+
variant: f,
|
|
58
58
|
size: "icon",
|
|
59
59
|
className: "h-7 w-7",
|
|
60
60
|
"aria-label": x,
|
|
@@ -64,28 +64,28 @@ function _({
|
|
|
64
64
|
),
|
|
65
65
|
MonthCaption: ({ displayIndex: e, calendarMonth: t, ...a }) => /* @__PURE__ */ n(h.Provider, { value: e, children: /* @__PURE__ */ n("div", { ...a }) }),
|
|
66
66
|
Month: ({ calendarMonth: e, displayIndex: t, className: a, children: l, ...r }) => {
|
|
67
|
-
const o =
|
|
68
|
-
return /* @__PURE__ */ R("div", { className:
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
const o = u.Children.toArray(l), s = o[o.length - 1], i = o.slice(0, -1);
|
|
68
|
+
return /* @__PURE__ */ R("div", { className: d(a), ...r, children: [
|
|
69
|
+
i.length > 0 ? /* @__PURE__ */ n(Y, { children: i }) : null,
|
|
70
|
+
s
|
|
71
71
|
] });
|
|
72
72
|
},
|
|
73
|
-
Months: ({ className: e, children: t, ...a }) => /* @__PURE__ */ n("div", { "data-slot": "day-months", className:
|
|
73
|
+
Months: ({ className: e, children: t, ...a }) => /* @__PURE__ */ n("div", { "data-slot": "day-months", className: d(e), ...a, children: t }),
|
|
74
74
|
MonthsDropdown: ({ value: e }) => {
|
|
75
|
-
const t =
|
|
75
|
+
const t = u.useContext(h), a = t > 0, r = new Date(c.getFullYear(), c.getMonth() + t, 1).getFullYear(), o = A(
|
|
76
76
|
r,
|
|
77
|
-
w,
|
|
78
77
|
b,
|
|
79
|
-
k
|
|
78
|
+
k,
|
|
79
|
+
P
|
|
80
80
|
);
|
|
81
81
|
return /* @__PURE__ */ n(
|
|
82
|
-
|
|
82
|
+
w,
|
|
83
83
|
{
|
|
84
|
-
value: o.find((
|
|
85
|
-
onChange: (
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
m(a ? new Date(r,
|
|
84
|
+
value: o.find((s) => s.value === e?.toString()),
|
|
85
|
+
onChange: (s) => {
|
|
86
|
+
if (s && "value" in s) {
|
|
87
|
+
const i = parseInt(s.value);
|
|
88
|
+
m(a ? new Date(r, i - 1, 1) : new Date(r, i, 1));
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
scrollToSelectedOnOpen: !0,
|
|
@@ -99,43 +99,51 @@ function _({
|
|
|
99
99
|
);
|
|
100
100
|
},
|
|
101
101
|
YearsDropdown: ({ value: e }) => {
|
|
102
|
-
const a =
|
|
102
|
+
const a = u.useContext(h) > 0;
|
|
103
103
|
return /* @__PURE__ */ n(
|
|
104
|
-
|
|
104
|
+
w,
|
|
105
105
|
{
|
|
106
|
-
value:
|
|
106
|
+
value: g.find((l) => l.value === e?.toString()),
|
|
107
107
|
onChange: (l) => {
|
|
108
108
|
if (l && "value" in l) {
|
|
109
109
|
const r = parseInt(l.value);
|
|
110
110
|
if (a) {
|
|
111
111
|
const o = new Date(
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
c.getFullYear(),
|
|
113
|
+
c.getMonth() + 1,
|
|
114
114
|
1
|
|
115
115
|
).getMonth();
|
|
116
116
|
m(new Date(r, o - 1, 1));
|
|
117
117
|
} else
|
|
118
|
-
m(new Date(r,
|
|
118
|
+
m(new Date(r, c.getMonth(), 1));
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
scrollToSelectedOnOpen: !0,
|
|
122
|
-
options:
|
|
122
|
+
options: g,
|
|
123
123
|
className: "w-[84px] shrink-0",
|
|
124
124
|
menuWidth: "140px",
|
|
125
125
|
isSearchable: !0,
|
|
126
126
|
isClearable: !1,
|
|
127
|
-
placeholder:
|
|
127
|
+
placeholder: W
|
|
128
128
|
}
|
|
129
129
|
);
|
|
130
130
|
},
|
|
131
|
-
DayButton: (e) => /* @__PURE__ */ n(z, { ...e, pickerType:
|
|
131
|
+
DayButton: (e) => /* @__PURE__ */ n(z, { ...e, pickerType: p }),
|
|
132
132
|
Week: ({ week: e, className: t, children: a, ...l }) => {
|
|
133
|
-
const r = F(e);
|
|
133
|
+
const r = F(e), o = p === "week";
|
|
134
134
|
return /* @__PURE__ */ n(
|
|
135
135
|
"tr",
|
|
136
136
|
{
|
|
137
|
-
className:
|
|
137
|
+
className: d(
|
|
138
|
+
t,
|
|
139
|
+
r && "invisible",
|
|
140
|
+
o && !r && "cursor-pointer"
|
|
141
|
+
),
|
|
138
142
|
"aria-hidden": r || void 0,
|
|
143
|
+
onClick: o && !r ? (s) => {
|
|
144
|
+
const i = s.target;
|
|
145
|
+
i.closest("button") || i.closest("[data-week-number]") || C(e);
|
|
146
|
+
} : void 0,
|
|
139
147
|
...l,
|
|
140
148
|
children: a
|
|
141
149
|
}
|
|
@@ -146,10 +154,10 @@ function _({
|
|
|
146
154
|
{
|
|
147
155
|
week: e,
|
|
148
156
|
weekStartsOn: I,
|
|
149
|
-
pickerType:
|
|
157
|
+
pickerType: p,
|
|
150
158
|
weekNumberLabel: S,
|
|
151
|
-
weekLabel:
|
|
152
|
-
onWeekSelect:
|
|
159
|
+
weekLabel: y,
|
|
160
|
+
onWeekSelect: C,
|
|
153
161
|
...t
|
|
154
162
|
}
|
|
155
163
|
),
|
|
@@ -30,7 +30,7 @@ export interface CalendarDayPickerViewProps extends Omit<CalendarProps, "showFoo
|
|
|
30
30
|
dateFnsLocale: DayPickerProps["locale"];
|
|
31
31
|
intlLocale: string;
|
|
32
32
|
weekRangeModifiers?: DayPickerProps["modifiers"];
|
|
33
|
-
onSelect: (date: Date | Date[] | DateRange | undefined) => void;
|
|
33
|
+
onSelect: (date: Date | Date[] | DateRange | undefined, triggerDate?: Date) => void;
|
|
34
34
|
onMonthChange: (month: Date) => void;
|
|
35
35
|
onWeekSelect: (input: WeekPickerInput) => void;
|
|
36
36
|
previousMonthLabel: string;
|
|
@@ -1,106 +1,109 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as Q } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { DayPicker as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { useCalendarDayPickerConfig as
|
|
6
|
-
function
|
|
7
|
-
className:
|
|
3
|
+
import { DayPicker as R } from "react-day-picker";
|
|
4
|
+
import { cn as U } from "../../../lib/utils.js";
|
|
5
|
+
import { useCalendarDayPickerConfig as W } from "./use-calendar-day-picker-config.js";
|
|
6
|
+
function T({
|
|
7
|
+
className: p,
|
|
8
8
|
pickerType: t,
|
|
9
|
-
mode:
|
|
10
|
-
weekMode:
|
|
11
|
-
calendarType:
|
|
9
|
+
mode: o,
|
|
10
|
+
weekMode: a,
|
|
11
|
+
calendarType: e,
|
|
12
12
|
showOutsideDays: n,
|
|
13
|
-
fixedWeeks:
|
|
14
|
-
captionLayout:
|
|
15
|
-
buttonVariant:
|
|
16
|
-
weekStartsOn:
|
|
17
|
-
formatters:
|
|
18
|
-
classNames:
|
|
19
|
-
components:
|
|
20
|
-
selected:
|
|
21
|
-
showFooter:
|
|
13
|
+
fixedWeeks: s,
|
|
14
|
+
captionLayout: g,
|
|
15
|
+
buttonVariant: f,
|
|
16
|
+
weekStartsOn: i,
|
|
17
|
+
formatters: w,
|
|
18
|
+
classNames: b,
|
|
19
|
+
components: D,
|
|
20
|
+
selected: P,
|
|
21
|
+
showFooter: v,
|
|
22
22
|
pendingSelection: y,
|
|
23
|
-
selectedDaysFromWeeks:
|
|
24
|
-
currentMonth:
|
|
25
|
-
monthsFull:
|
|
26
|
-
resolvedStartMonth:
|
|
27
|
-
resolvedEndMonth:
|
|
28
|
-
availableYears:
|
|
29
|
-
dateFnsLocale:
|
|
30
|
-
intlLocale:
|
|
31
|
-
weekRangeModifiers:
|
|
32
|
-
onSelect:
|
|
33
|
-
onMonthChange:
|
|
34
|
-
onWeekSelect:
|
|
35
|
-
previousMonthLabel:
|
|
36
|
-
nextMonthLabel:
|
|
37
|
-
monthPlaceholder:
|
|
38
|
-
yearPlaceholder:
|
|
39
|
-
weekNumberLabel:
|
|
40
|
-
weekLabel:
|
|
41
|
-
formatWeekNumber:
|
|
42
|
-
disabled:
|
|
43
|
-
...
|
|
23
|
+
selectedDaysFromWeeks: h,
|
|
24
|
+
currentMonth: m,
|
|
25
|
+
monthsFull: k,
|
|
26
|
+
resolvedStartMonth: c,
|
|
27
|
+
resolvedEndMonth: l,
|
|
28
|
+
availableYears: C,
|
|
29
|
+
dateFnsLocale: N,
|
|
30
|
+
intlLocale: S,
|
|
31
|
+
weekRangeModifiers: _,
|
|
32
|
+
onSelect: x,
|
|
33
|
+
onMonthChange: u,
|
|
34
|
+
onWeekSelect: L,
|
|
35
|
+
previousMonthLabel: O,
|
|
36
|
+
nextMonthLabel: j,
|
|
37
|
+
monthPlaceholder: V,
|
|
38
|
+
yearPlaceholder: q,
|
|
39
|
+
weekNumberLabel: z,
|
|
40
|
+
weekLabel: A,
|
|
41
|
+
formatWeekNumber: B,
|
|
42
|
+
disabled: F,
|
|
43
|
+
...G
|
|
44
44
|
}) {
|
|
45
|
-
const { dayPickerClassNames:
|
|
46
|
-
buttonVariant:
|
|
45
|
+
const { dayPickerClassNames: H, dayPickerComponents: I } = W({
|
|
46
|
+
buttonVariant: f,
|
|
47
47
|
pickerType: t,
|
|
48
|
-
calendarType:
|
|
48
|
+
calendarType: e,
|
|
49
49
|
showOutsideDays: n,
|
|
50
|
-
classNames:
|
|
51
|
-
currentMonth:
|
|
52
|
-
monthsFull:
|
|
53
|
-
resolvedStartMonth:
|
|
54
|
-
resolvedEndMonth:
|
|
55
|
-
availableYears:
|
|
56
|
-
weekStartsOn:
|
|
57
|
-
previousMonthLabel:
|
|
58
|
-
nextMonthLabel:
|
|
59
|
-
monthPlaceholder:
|
|
60
|
-
yearPlaceholder:
|
|
61
|
-
weekNumberLabel:
|
|
62
|
-
weekLabel:
|
|
63
|
-
onMonthChange:
|
|
64
|
-
onWeekSelect:
|
|
65
|
-
components:
|
|
66
|
-
}),
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
|
|
50
|
+
classNames: b,
|
|
51
|
+
currentMonth: m,
|
|
52
|
+
monthsFull: k,
|
|
53
|
+
resolvedStartMonth: c,
|
|
54
|
+
resolvedEndMonth: l,
|
|
55
|
+
availableYears: C,
|
|
56
|
+
weekStartsOn: i,
|
|
57
|
+
previousMonthLabel: O,
|
|
58
|
+
nextMonthLabel: j,
|
|
59
|
+
monthPlaceholder: V,
|
|
60
|
+
yearPlaceholder: q,
|
|
61
|
+
weekNumberLabel: z,
|
|
62
|
+
weekLabel: A,
|
|
63
|
+
onMonthChange: u,
|
|
64
|
+
onWeekSelect: L,
|
|
65
|
+
components: D
|
|
66
|
+
}), J = o === "range" || o === "multiple" || a === "range" || a === "multiple" ? 2 : 1;
|
|
67
|
+
return /* @__PURE__ */ Q(
|
|
68
|
+
R,
|
|
69
69
|
{
|
|
70
|
-
mode: t === "week" ? "multiple" :
|
|
71
|
-
selected: t === "week" ?
|
|
72
|
-
onSelect:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
mode: t === "week" ? "multiple" : o,
|
|
71
|
+
selected: t === "week" ? h : v ? y : P,
|
|
72
|
+
onSelect: (...r) => {
|
|
73
|
+
const [K, d] = r;
|
|
74
|
+
x(K, d instanceof Date ? d : void 0);
|
|
75
|
+
},
|
|
76
|
+
month: m,
|
|
77
|
+
onMonthChange: u,
|
|
78
|
+
fixedWeeks: s,
|
|
79
|
+
showOutsideDays: s || e === "fiscal" || n,
|
|
80
|
+
weekStartsOn: i,
|
|
81
|
+
modifiers: t === "week" ? _ : void 0,
|
|
82
|
+
locale: N,
|
|
83
|
+
className: U(
|
|
81
84
|
"bg-canvas group/calendar p-2 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
82
85
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
83
86
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
84
|
-
|
|
87
|
+
p
|
|
85
88
|
),
|
|
86
|
-
captionLayout:
|
|
89
|
+
captionLayout: g,
|
|
87
90
|
navLayout: "around",
|
|
88
|
-
startMonth:
|
|
89
|
-
endMonth:
|
|
90
|
-
disabled:
|
|
91
|
-
numberOfMonths:
|
|
91
|
+
startMonth: c,
|
|
92
|
+
endMonth: l,
|
|
93
|
+
disabled: F,
|
|
94
|
+
numberOfMonths: J,
|
|
92
95
|
showWeekNumber: !0,
|
|
93
96
|
formatters: {
|
|
94
|
-
formatMonthDropdown: (
|
|
95
|
-
formatWeekNumber:
|
|
96
|
-
...
|
|
97
|
+
formatMonthDropdown: (r) => r.toLocaleString(S, { month: "short" }),
|
|
98
|
+
formatWeekNumber: B,
|
|
99
|
+
...w
|
|
97
100
|
},
|
|
98
|
-
classNames:
|
|
99
|
-
components:
|
|
100
|
-
...
|
|
101
|
+
classNames: H,
|
|
102
|
+
components: I,
|
|
103
|
+
...G
|
|
101
104
|
}
|
|
102
105
|
);
|
|
103
106
|
}
|
|
104
107
|
export {
|
|
105
|
-
|
|
108
|
+
T as CalendarDayPickerView
|
|
106
109
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveWeekSelection as T } from "../../../lib/fiscal-calendar.js";
|
|
2
|
-
function
|
|
2
|
+
function m(t, s) {
|
|
3
3
|
return t.year === s.year && t.month === s.month && t.weekOfMonth === s.weekOfMonth;
|
|
4
4
|
}
|
|
5
5
|
function W(t, s) {
|
|
@@ -10,21 +10,22 @@ function A(t, s, o) {
|
|
|
10
10
|
if (o === "single") return t;
|
|
11
11
|
if (o === "multiple") {
|
|
12
12
|
const i = s || [];
|
|
13
|
-
return i.some((f) =>
|
|
13
|
+
return i.some((f) => m(f, t)) ? i.filter((f) => !m(f, t)) : [...i, t];
|
|
14
14
|
}
|
|
15
15
|
const e = s;
|
|
16
16
|
if (!e?.from || e.to) return { from: t };
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
if (m(t, e.from)) return e;
|
|
18
|
+
const n = { from: e.from, to: t };
|
|
19
|
+
return t.startDate < e.from.startDate && (n.from = t, n.to = e.from), n;
|
|
19
20
|
}
|
|
20
21
|
function _(t) {
|
|
21
22
|
if (!t) return;
|
|
22
23
|
const s = [], o = (e) => {
|
|
23
|
-
const
|
|
24
|
-
|
|
24
|
+
const n = new Date(e.startDate);
|
|
25
|
+
n.setHours(0, 0, 0, 0);
|
|
25
26
|
const i = new Date(e.endDate);
|
|
26
|
-
for (i.setHours(0, 0, 0, 0);
|
|
27
|
-
s.push(new Date(
|
|
27
|
+
for (i.setHours(0, 0, 0, 0); n <= i; )
|
|
28
|
+
s.push(new Date(n)), n.setDate(n.getDate() + 1);
|
|
28
29
|
};
|
|
29
30
|
if (Array.isArray(t))
|
|
30
31
|
t.forEach(o);
|
|
@@ -35,8 +36,8 @@ function _(t) {
|
|
|
35
36
|
else {
|
|
36
37
|
const e = new Date(t.from.startDate);
|
|
37
38
|
e.setHours(0, 0, 0, 0);
|
|
38
|
-
const
|
|
39
|
-
for (
|
|
39
|
+
const n = new Date(t.to.endDate);
|
|
40
|
+
for (n.setHours(0, 0, 0, 0); e <= n; )
|
|
40
41
|
s.push(new Date(e)), e.setDate(e.getDate() + 1);
|
|
41
42
|
}
|
|
42
43
|
} else
|
|
@@ -46,28 +47,28 @@ function _(t) {
|
|
|
46
47
|
function E(t, s, o) {
|
|
47
48
|
if (!t || t.length === 0)
|
|
48
49
|
return { range_start: [], range_middle: [], range_end: [] };
|
|
49
|
-
const e = [...t].sort((
|
|
50
|
-
s === "multiple" && Array.isArray(o) && o.forEach((
|
|
51
|
-
f.add(
|
|
50
|
+
const e = [...t].sort((r, a) => r.getTime() - a.getTime()), n = [], i = [], u = [], f = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
|
|
51
|
+
s === "multiple" && Array.isArray(o) && o.forEach((r) => {
|
|
52
|
+
f.add(r.startDate.toISOString().split("T")[0]), l.add(r.endDate.toISOString().split("T")[0]);
|
|
52
53
|
});
|
|
53
|
-
const d = (
|
|
54
|
+
const d = (r, a) => {
|
|
54
55
|
if (a === 0) return !1;
|
|
55
56
|
const c = e[a - 1];
|
|
56
|
-
return
|
|
57
|
-
}, p = (
|
|
58
|
-
return e.forEach((
|
|
59
|
-
const c =
|
|
57
|
+
return r.getTime() - c.getTime() <= 1440 * 60 * 1e3;
|
|
58
|
+
}, p = (r, a) => a === e.length - 1 ? !1 : e[a + 1].getTime() - r.getTime() <= 1440 * 60 * 1e3;
|
|
59
|
+
return e.forEach((r, a) => {
|
|
60
|
+
const c = r.toISOString().split("T")[0], D = f.has(c), S = l.has(c), g = d(r, a), h = p(r, a);
|
|
60
61
|
if (s === "multiple") {
|
|
61
|
-
D ?
|
|
62
|
+
D ? n.push(r) : S ? u.push(r) : i.push(r);
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
|
-
!
|
|
65
|
-
}), { range_start:
|
|
65
|
+
!g && !h ? (n.push(r), u.push(r)) : g ? h ? i.push(r) : u.push(r) : n.push(r);
|
|
66
|
+
}), { range_start: n, range_middle: i, range_end: u };
|
|
66
67
|
}
|
|
67
68
|
export {
|
|
68
69
|
W as calculateWeekSelection,
|
|
69
70
|
E as computeWeekRangeModifiers,
|
|
70
|
-
|
|
71
|
+
m as isSameWeek,
|
|
71
72
|
A as nextWeekSelection,
|
|
72
73
|
_ as weekSelectionsToDates
|
|
73
74
|
};
|
|
@@ -53,7 +53,7 @@ export declare function useCalendarState({ showFooter, selected, onSelect, picke
|
|
|
53
53
|
range_middle: Date[];
|
|
54
54
|
range_end: Date[];
|
|
55
55
|
};
|
|
56
|
-
handleInternalSelect: (date: Date | Date[] | DateRange | undefined) => void;
|
|
56
|
+
handleInternalSelect: (date: Date | Date[] | DateRange | undefined, triggerDate?: Date) => void;
|
|
57
57
|
handleApply: () => void;
|
|
58
58
|
handleCancel: () => void;
|
|
59
59
|
handleClear: () => void;
|