impact-nova 2.5.9 → 2.5.11
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/data-table/column-runtime-state-guard.js +42 -42
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +15 -0
- package/dist/components/data/data-table/data-table-column-tree-cache.js +109 -80
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +65 -62
- package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
- package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
- package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +6 -1
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +31 -23
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +5 -2
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +210 -167
- package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +3 -2
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +126 -124
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
- package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +20 -16
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +1 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +31 -30
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +3 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +68 -53
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-week-utils.js +51 -47
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +3 -1
- package/dist/components/data-display/calendar/calendar.js +170 -165
- package/dist/components/data-display/calendar/calendar.types.d.ts +7 -0
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +5 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +86 -76
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
- package/dist/components/data-display/calendar/use-calendar-state.js +403 -325
- package/dist/components/feedback/dialog/dialog.js +12 -12
- package/dist/components/feedback/sheet/sheet.js +22 -22
- package/dist/components/forms/date-picker/calendar-selection-adapters.d.ts +2 -0
- package/dist/components/forms/date-picker/calendar-selection-adapters.js +36 -31
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +10 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +111 -90
- package/dist/components/forms/date-picker/date-picker.js +74 -70
- package/dist/components/forms/date-picker/date-picker.types.d.ts +7 -0
- package/dist/components/forms/date-picker/date-range-picker.js +148 -144
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +2 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +4 -2
- package/dist/components/forms/date-picker/month-picker.js +84 -80
- package/dist/components/forms/date-picker/month-range-picker.js +147 -143
- package/dist/components/forms/date-picker/multi-date-picker.js +53 -49
- package/dist/components/forms/date-picker/multi-month-picker.js +51 -47
- package/dist/components/forms/date-picker/multi-quarter-picker.js +48 -44
- package/dist/components/forms/date-picker/multi-week-picker.js +55 -51
- package/dist/components/forms/date-picker/multi-year-picker.js +50 -46
- package/dist/components/forms/date-picker/picker-story-layout.d.ts +2 -0
- package/dist/components/forms/date-picker/quarter-picker.js +48 -44
- package/dist/components/forms/date-picker/quarter-range-picker.js +47 -43
- package/dist/components/forms/date-picker/week-picker.js +86 -82
- package/dist/components/forms/date-picker/week-range-picker.js +171 -164
- package/dist/components/forms/date-picker/year-picker.js +49 -45
- package/dist/components/forms/date-picker/year-range-picker.js +49 -45
- package/dist/components/forms/select/components/SelectMenuPanel.js +3 -2
- package/dist/components/forms/select/select.js +1 -0
- package/dist/form-react/Fields/DateInputField.js +51 -50
- package/dist/form-react/Fields/DateRangeField.js +14 -13
- package/dist/form-react/Fields/MonthRangeField.js +29 -28
- package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
- package/dist/form-react/Fields/MultiWeekPickerField.js +18 -17
- package/dist/form-react/Fields/WeekRangePicker.js +48 -48
- package/dist/form-react/types/fields.types.d.ts +14 -0
- package/dist/impact-nova.css +1 -1
- package/dist/lib/overlay/overlay-portal-context.js +16 -16
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn as e } from "../../../lib/utils.js";
|
|
2
|
-
const l = "h-9 w-9 min-h-9 min-w-9",
|
|
2
|
+
const l = "h-9 w-9 min-h-9 min-w-9", E = "min-w-[292px]", d = "w-9 flex-shrink-0", s = "bg-accent", c = "bg-brand text-brand-foreground", i = "hover:bg-brand-strong hover:text-brand-foreground hover:border-transparent", a = "rounded-lg", k = "rounded-l-lg", I = "rounded-r-lg", u = e(
|
|
3
3
|
"flex items-center justify-center p-0 font-normal text-sm transition-colors",
|
|
4
4
|
"border border-transparent",
|
|
5
5
|
a,
|
|
@@ -8,65 +8,66 @@ const l = "h-9 w-9 min-h-9 min-w-9", y = "min-w-[292px]", d = "w-9 flex-shrink-0
|
|
|
8
8
|
l,
|
|
9
9
|
"rdp-day rdp-day_button"
|
|
10
10
|
), p = "hover:bg-accent hover:text-accent-foreground hover:border-transparent", m = "hover:bg-transparent hover:text-inherit hover:border-transparent", v = e(
|
|
11
|
-
i,
|
|
12
11
|
c,
|
|
12
|
+
i,
|
|
13
13
|
a,
|
|
14
14
|
"border-transparent"
|
|
15
|
-
), b = "text-accent-foreground rounded-none border-transparent",
|
|
15
|
+
), b = "text-accent-foreground rounded-none border-transparent", B = e(
|
|
16
16
|
"group/day relative select-none p-0 text-center flex-1 flex items-center justify-center",
|
|
17
17
|
"h-9 [&:nth-child(2)]:pl-2 rdp-day"
|
|
18
|
-
),
|
|
18
|
+
), N = "calendar-interval-cap-start", L = e(s, "rounded-none"), C = "calendar-interval-cap-end", S = e(s, "rounded-none"), A = N, R = C, f = "text-[11px] font-medium text-content-icon", D = "text-brand group-has-[.rdp-selected]/week:text-brand group-hover/week:text-brand", O = "cursor-not-allowed text-content-placeholder opacity-50 group-hover/week:text-content-placeholder group-has-[.rdp-selected]/week:text-content-placeholder", H = e(
|
|
19
19
|
"select-none flex items-center justify-center",
|
|
20
20
|
f,
|
|
21
21
|
l,
|
|
22
22
|
d,
|
|
23
23
|
"rdp-week_number"
|
|
24
|
-
),
|
|
24
|
+
), M = "group-data-[week-selected]/week:bg-accent", P = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring", o = e(
|
|
25
25
|
"relative z-10 border border-transparent p-0 text-sm font-normal transition-colors",
|
|
26
26
|
a,
|
|
27
27
|
"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring focus-visible:ring-offset-0"
|
|
28
|
-
), g = e(
|
|
29
|
-
function
|
|
30
|
-
const r =
|
|
31
|
-
return e(u, r ? v :
|
|
28
|
+
), g = e(c, i), h = "hover:border-brand hover:bg-accent hover:text-accent-foreground", x = "text-accent-foreground", w = "cursor-not-allowed text-content-placeholder opacity-50", U = s;
|
|
29
|
+
function F(t, n) {
|
|
30
|
+
const r = t === "point" || t === "interval-start" || t === "interval-end";
|
|
31
|
+
return e(u, r ? v : t === "interval-middle" ? b : void 0, n === "week" ? r ? void 0 : m : t === "none" ? p : void 0);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const { kind:
|
|
35
|
-
return r ? e(o,
|
|
33
|
+
function j(t) {
|
|
34
|
+
const { kind: n, disabled: r } = t;
|
|
35
|
+
return r ? e(o, w) : n === "point" || n === "interval-start" || n === "interval-end" ? e(o, g) : n === "interval-middle" ? e(o, x) : e(o, h);
|
|
36
36
|
}
|
|
37
37
|
export {
|
|
38
38
|
l as DAY_CELL_SIZE,
|
|
39
|
-
|
|
39
|
+
E as DAY_MONTH_MIN_WIDTH,
|
|
40
40
|
s as INTERVAL_TRACK,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
c as POINT_FILL,
|
|
42
|
+
i as POINT_FILL_HOVER,
|
|
43
43
|
a as SELECTION_RADIUS,
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
I as SELECTION_RADIUS_END,
|
|
45
|
+
k as SELECTION_RADIUS_START,
|
|
46
46
|
d as WEEK_GUTTER_RULE,
|
|
47
|
-
|
|
47
|
+
F as dayButtonAppearanceClassName,
|
|
48
48
|
u as dayButtonBaseClassName,
|
|
49
49
|
p as dayButtonHoverClassName,
|
|
50
50
|
b as dayButtonMiddleClassName,
|
|
51
51
|
v as dayButtonPointClassName,
|
|
52
52
|
m as dayButtonWeekHoverClassName,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
B as dayCellBaseClassName,
|
|
54
|
+
U as periodRangeTrackClassName,
|
|
55
|
+
j as periodTileAppearanceClassName,
|
|
56
56
|
o as periodTileBaseClassName,
|
|
57
|
-
|
|
57
|
+
w as periodTileDisabledClassName,
|
|
58
58
|
h as periodTileHoverClassName,
|
|
59
59
|
x as periodTileMiddleClassName,
|
|
60
60
|
g as periodTilePointClassName,
|
|
61
61
|
R as previewCapEndCellClassName,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
A as previewCapStartCellClassName,
|
|
63
|
+
S as previewCellClassName,
|
|
64
|
+
C as rangeEndCellClassName,
|
|
65
|
+
L as rangeMiddleCellClassName,
|
|
66
|
+
N as rangeStartCellClassName,
|
|
67
|
+
H as weekNumberBaseClassName,
|
|
68
|
+
O as weekNumberBlockedClassName,
|
|
69
|
+
P as weekNumberFocusClassName,
|
|
69
70
|
D as weekNumberInteractiveClassName,
|
|
70
|
-
|
|
71
|
+
M as weekNumberSelectedFillClassName,
|
|
71
72
|
f as weekNumberTypeClassName
|
|
72
73
|
};
|
|
@@ -17,6 +17,8 @@ export interface CalendarWeekNumberCellProps {
|
|
|
17
17
|
fiscalWeekAriaLabel?: (meta: DateCellMeta) => string;
|
|
18
18
|
getCellMeta?: (date: Date) => DateCellMeta | undefined;
|
|
19
19
|
onWeekSelect: (input: WeekPickerInput) => void;
|
|
20
|
+
blank?: boolean;
|
|
21
|
+
blocked?: boolean;
|
|
20
22
|
className?: string;
|
|
21
23
|
}
|
|
22
|
-
export declare function CalendarWeekNumberCell({ week, weekStartsOn, pickerType, calendarKind, weekNumberLabel, weekLabel, fiscalWeekNumberLabel, fiscalWeekAriaLabel, getCellMeta, onWeekSelect, className, ...weekProps }: CalendarWeekNumberCellProps & React.HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function CalendarWeekNumberCell({ week, weekStartsOn, pickerType, calendarKind, weekNumberLabel, weekLabel, fiscalWeekNumberLabel, fiscalWeekAriaLabel, getCellMeta, onWeekSelect, blank, blocked, className, ...weekProps }: CalendarWeekNumberCellProps & React.HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,87 +1,102 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { weekNumberBaseClassName as
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
(
|
|
3
|
+
import { cn as w } from "../../../lib/utils.js";
|
|
4
|
+
import { weekNumberBaseClassName as k, weekNumberBlockedClassName as M, weekNumberInteractiveClassName as j, weekNumberSelectedFillClassName as F, weekNumberFocusClassName as W } from "./calendar-selection-appearance.js";
|
|
5
|
+
function B(e, n) {
|
|
6
|
+
const s = e.getFullYear(), h = e.getMonth(), o = (new Date(s, h, 1).getDay() + 7 - n) % 7, i = new Date(s, h, 1 - o), c = new Date(e), p = (e.getDay() + 7 - n) % 7;
|
|
7
|
+
return c.setDate(e.getDate() - p), Math.round(
|
|
8
|
+
(c.getTime() - i.getTime()) / (10080 * 60 * 1e3)
|
|
9
9
|
) + 1;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function S({
|
|
12
12
|
week: e,
|
|
13
|
-
weekStartsOn:
|
|
14
|
-
pickerType:
|
|
15
|
-
calendarKind:
|
|
16
|
-
weekNumberLabel:
|
|
17
|
-
weekLabel:
|
|
18
|
-
fiscalWeekNumberLabel:
|
|
13
|
+
weekStartsOn: n,
|
|
14
|
+
pickerType: s,
|
|
15
|
+
calendarKind: h = "gregorian",
|
|
16
|
+
weekNumberLabel: N,
|
|
17
|
+
weekLabel: g,
|
|
18
|
+
fiscalWeekNumberLabel: o,
|
|
19
19
|
fiscalWeekAriaLabel: i,
|
|
20
|
-
getCellMeta:
|
|
21
|
-
onWeekSelect:
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
getCellMeta: c,
|
|
21
|
+
onWeekSelect: x,
|
|
22
|
+
blank: p = !1,
|
|
23
|
+
blocked: C = !1,
|
|
24
|
+
className: l,
|
|
25
|
+
...v
|
|
24
26
|
}) {
|
|
25
|
-
const d = e.days.find((
|
|
26
|
-
if (!d)
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
const d = e.days.find((m) => !m.outside)?.date;
|
|
28
|
+
if (p || !d)
|
|
29
|
+
return /* @__PURE__ */ r(
|
|
28
30
|
"th",
|
|
29
31
|
{
|
|
30
32
|
scope: "row",
|
|
31
33
|
"aria-hidden": "true",
|
|
32
|
-
className:
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
className: w(
|
|
35
|
+
k,
|
|
36
|
+
l
|
|
35
37
|
)
|
|
36
38
|
}
|
|
37
39
|
);
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const y = c?.(d), t = y?.fiscalWeek, f = B(d, n), u = t ?? f, D = t && o ? o(t) : N(u), b = t && y && i ? i(y) : g(f);
|
|
41
|
+
if (s === "week") {
|
|
42
|
+
if (C)
|
|
43
|
+
return /* @__PURE__ */ r(
|
|
44
|
+
"td",
|
|
45
|
+
{
|
|
46
|
+
"aria-label": b,
|
|
47
|
+
"aria-disabled": "true",
|
|
48
|
+
"data-week-index": f,
|
|
49
|
+
"data-week-number": u,
|
|
50
|
+
"data-fiscal-week": t,
|
|
51
|
+
className: w(k, l, M),
|
|
52
|
+
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center", children: D })
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
const m = () => x(d);
|
|
56
|
+
return /* @__PURE__ */ r(
|
|
42
57
|
"td",
|
|
43
58
|
{
|
|
44
|
-
"aria-label":
|
|
45
|
-
"data-week-index":
|
|
46
|
-
"data-week-number":
|
|
47
|
-
"data-fiscal-week":
|
|
59
|
+
"aria-label": b,
|
|
60
|
+
"data-week-index": f,
|
|
61
|
+
"data-week-number": u,
|
|
62
|
+
"data-fiscal-week": t,
|
|
48
63
|
"data-selection": "period-row",
|
|
49
64
|
tabIndex: 0,
|
|
50
65
|
role: "button",
|
|
51
|
-
className:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
className: w(
|
|
67
|
+
k,
|
|
68
|
+
W,
|
|
69
|
+
F,
|
|
70
|
+
j,
|
|
56
71
|
"cursor-pointer transition-colors",
|
|
57
|
-
|
|
72
|
+
l
|
|
58
73
|
),
|
|
59
|
-
onClick: (
|
|
60
|
-
|
|
74
|
+
onClick: (a) => {
|
|
75
|
+
a.preventDefault(), a.stopPropagation(), m();
|
|
61
76
|
},
|
|
62
|
-
onKeyDown: (
|
|
63
|
-
(
|
|
77
|
+
onKeyDown: (a) => {
|
|
78
|
+
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), a.stopPropagation(), m());
|
|
64
79
|
},
|
|
65
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center", children: D })
|
|
66
81
|
}
|
|
67
82
|
);
|
|
68
83
|
}
|
|
69
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ r(
|
|
70
85
|
"th",
|
|
71
86
|
{
|
|
72
|
-
...
|
|
73
|
-
"aria-label":
|
|
74
|
-
"data-week-number":
|
|
75
|
-
"data-fiscal-week":
|
|
76
|
-
className:
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
...v,
|
|
88
|
+
"aria-label": b,
|
|
89
|
+
"data-week-number": u,
|
|
90
|
+
"data-fiscal-week": t,
|
|
91
|
+
className: w(
|
|
92
|
+
k,
|
|
93
|
+
l
|
|
79
94
|
),
|
|
80
95
|
scope: "row",
|
|
81
|
-
children: /* @__PURE__ */
|
|
96
|
+
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center whitespace-nowrap", children: D })
|
|
82
97
|
}
|
|
83
98
|
);
|
|
84
99
|
}
|
|
85
100
|
export {
|
|
86
|
-
|
|
101
|
+
S as CalendarWeekNumberCell
|
|
87
102
|
};
|
|
@@ -14,6 +14,12 @@ export declare function fiscalPeriodForWeek(week: {
|
|
|
14
14
|
}, getCellMeta?: (date: Date) => {
|
|
15
15
|
fiscalPeriod?: number;
|
|
16
16
|
} | undefined): number | undefined;
|
|
17
|
+
/** A fiscal week belongs to one period pane. Other panes keep a blank reserved row. */
|
|
18
|
+
export declare function isForeignFiscalWeekRow(options: {
|
|
19
|
+
calendarKind: CalendarKind;
|
|
20
|
+
weekPeriod?: number;
|
|
21
|
+
panePeriod?: number;
|
|
22
|
+
}): boolean;
|
|
17
23
|
export declare function isSameWeek(w1: WeekSelection, w2: WeekSelection): boolean;
|
|
18
24
|
export declare function calculateWeekSelection(weekOrDate: WeekPickerInput, options: {
|
|
19
25
|
calendarKind: CalendarKind;
|
|
@@ -1,71 +1,74 @@
|
|
|
1
|
-
import { civilFromLocalDate as
|
|
2
|
-
import { resolveWeekSelection as
|
|
3
|
-
function
|
|
4
|
-
const o =
|
|
1
|
+
import { civilFromLocalDate as l } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
2
|
+
import { resolveWeekSelection as W } from "../../../lib/fiscal-calendar/week-selection.js";
|
|
3
|
+
function v(e, n) {
|
|
4
|
+
const o = e.days[0]?.date;
|
|
5
5
|
if (o)
|
|
6
6
|
return n?.(o)?.fiscalPeriod;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
function A(e) {
|
|
9
|
+
return e.calendarKind !== "fiscal" || e.weekPeriod == null || e.panePeriod == null ? !1 : e.weekPeriod !== e.panePeriod;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
return T(o, n);
|
|
11
|
+
function m(e, n) {
|
|
12
|
+
return e.year === n.year && e.month === n.month && e.weekOfMonth === n.weekOfMonth;
|
|
14
13
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
14
|
+
function _(e, n) {
|
|
15
|
+
const o = e instanceof Date ? e : e.days.find((t) => !t.outside)?.date ?? e.days[0]?.date ?? /* @__PURE__ */ new Date();
|
|
16
|
+
return W(o, n);
|
|
17
|
+
}
|
|
18
|
+
function E(e, n, o) {
|
|
19
|
+
if (o === "single") return e;
|
|
17
20
|
if (o === "multiple") {
|
|
18
21
|
const a = n || [];
|
|
19
|
-
return a.some((f) =>
|
|
22
|
+
return a.some((f) => m(f, e)) ? a.filter((f) => !m(f, e)) : [...a, e];
|
|
20
23
|
}
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
23
|
-
if (
|
|
24
|
-
const s = { from:
|
|
25
|
-
return
|
|
24
|
+
const t = n;
|
|
25
|
+
if (!t?.from || t.to) return { from: e };
|
|
26
|
+
if (m(e, t.from)) return t;
|
|
27
|
+
const s = { from: t.from, to: e };
|
|
28
|
+
return e.startDate < t.from.startDate && (s.from = e, s.to = t.from), s;
|
|
26
29
|
}
|
|
27
|
-
function x(
|
|
28
|
-
if (!
|
|
29
|
-
const n = [], o = (
|
|
30
|
-
const s = new Date(
|
|
30
|
+
function x(e) {
|
|
31
|
+
if (!e) return;
|
|
32
|
+
const n = [], o = (t) => {
|
|
33
|
+
const s = new Date(t.startDate);
|
|
31
34
|
s.setHours(0, 0, 0, 0);
|
|
32
|
-
const a = new Date(
|
|
35
|
+
const a = new Date(t.endDate);
|
|
33
36
|
for (a.setHours(0, 0, 0, 0); s <= a; )
|
|
34
37
|
n.push(new Date(s)), s.setDate(s.getDate() + 1);
|
|
35
38
|
};
|
|
36
|
-
if (Array.isArray(
|
|
37
|
-
|
|
38
|
-
else if ("from" in
|
|
39
|
-
if (
|
|
40
|
-
if (!
|
|
41
|
-
o(
|
|
39
|
+
if (Array.isArray(e))
|
|
40
|
+
e.forEach(o);
|
|
41
|
+
else if ("from" in e) {
|
|
42
|
+
if (e.from)
|
|
43
|
+
if (!e.to)
|
|
44
|
+
o(e.from);
|
|
42
45
|
else {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const s = new Date(
|
|
46
|
-
for (s.setHours(0, 0, 0, 0);
|
|
47
|
-
n.push(new Date(
|
|
46
|
+
const t = new Date(e.from.startDate);
|
|
47
|
+
t.setHours(0, 0, 0, 0);
|
|
48
|
+
const s = new Date(e.to.endDate);
|
|
49
|
+
for (s.setHours(0, 0, 0, 0); t <= s; )
|
|
50
|
+
n.push(new Date(t)), t.setDate(t.getDate() + 1);
|
|
48
51
|
}
|
|
49
52
|
} else
|
|
50
|
-
o(
|
|
53
|
+
o(e);
|
|
51
54
|
return n;
|
|
52
55
|
}
|
|
53
|
-
function
|
|
54
|
-
if (!
|
|
56
|
+
function F(e, n, o) {
|
|
57
|
+
if (!e || e.length === 0)
|
|
55
58
|
return { range_start: [], range_middle: [], range_end: [] };
|
|
56
|
-
const
|
|
59
|
+
const t = [...e].sort((r, i) => r.getTime() - i.getTime()), s = [], a = [], u = [], f = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
|
|
57
60
|
n === "multiple" && Array.isArray(o) && o.forEach((r) => {
|
|
58
|
-
f.add(
|
|
61
|
+
f.add(l(r.startDate)), d.add(l(r.endDate));
|
|
59
62
|
});
|
|
60
|
-
const
|
|
63
|
+
const D = (r, i) => {
|
|
61
64
|
if (i === 0) return !1;
|
|
62
|
-
const c =
|
|
65
|
+
const c = t[i - 1];
|
|
63
66
|
return r.getTime() - c.getTime() <= 1440 * 60 * 1e3;
|
|
64
|
-
},
|
|
65
|
-
return
|
|
66
|
-
const c =
|
|
67
|
+
}, p = (r, i) => i === t.length - 1 ? !1 : t[i + 1].getTime() - r.getTime() <= 1440 * 60 * 1e3;
|
|
68
|
+
return t.forEach((r, i) => {
|
|
69
|
+
const c = l(r), S = f.has(c), y = d.has(c), h = D(r, i), g = p(r, i);
|
|
67
70
|
if (n === "multiple") {
|
|
68
|
-
|
|
71
|
+
S ? s.push(r) : y ? u.push(r) : a.push(r);
|
|
69
72
|
return;
|
|
70
73
|
}
|
|
71
74
|
!h && !g ? (s.push(r), u.push(r)) : h ? g ? a.push(r) : u.push(r) : s.push(r);
|
|
@@ -73,9 +76,10 @@ function H(t, n, o) {
|
|
|
73
76
|
}
|
|
74
77
|
export {
|
|
75
78
|
_ as calculateWeekSelection,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
F as computeWeekRangeModifiers,
|
|
80
|
+
v as fiscalPeriodForWeek,
|
|
81
|
+
A as isForeignFiscalWeekRow,
|
|
82
|
+
m as isSameWeek,
|
|
79
83
|
E as nextWeekSelection,
|
|
80
84
|
x as weekSelectionsToDates
|
|
81
85
|
};
|