impact-nova 2.5.19 → 2.5.21
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/expandable-list-item/expandable-list-item-attributes.js +2 -3
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +2 -3
- package/dist/components/data-display/calendar/calendar-available-view.d.ts +6 -2
- package/dist/components/data-display/calendar/calendar-available-view.js +18 -19
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-week-utils.js +33 -33
- package/dist/components/data-display/calendar/calendar.js +194 -190
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +2 -3
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +6 -6
- package/dist/components/forms/date-picker/fiscal-pass-through.js +7 -3
- package/dist/components/forms/date-picker/multi-week-picker.js +1 -1
- package/dist/components/forms/date-picker/week-picker.js +123 -123
- package/dist/components/forms/date-picker/week-range-picker.js +188 -188
- package/dist/components/forms/select/components/SelectTriggerValue.js +2 -3
- package/dist/components/forms/select/components/Submenu.js +2 -3
- package/dist/form-react/Fields/MultiWeekPickerField.js +16 -15
- package/dist/form-react/Fields/TextFieldWithBackendValidation.js +27 -26
- package/dist/form-react/Fields/WeekRangePicker.js +18 -16
- package/dist/form-react/types/fields.types.d.ts +9 -0
- package/dist/form-react/utils/date.utils.d.ts +1 -0
- package/dist/form-react/utils/date.utils.js +38 -34
- package/dist/lib/fiscal-calendar/index.d.ts +2 -2
- package/dist/lib/fiscal-calendar/index.js +26 -24
- package/dist/lib/fiscal-calendar/week-selection.d.ts +5 -0
- package/dist/lib/fiscal-calendar/week-selection.js +56 -49
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { MultiWeekPicker as
|
|
4
|
-
import { fiscalCalendarPassThrough as
|
|
5
|
-
import { getFieldTestId as
|
|
6
|
-
import { resolveWeekRangeMinMax as
|
|
7
|
-
const
|
|
2
|
+
import { Controller as f } from "react-hook-form";
|
|
3
|
+
import { MultiWeekPicker as p } from "../../components/forms/date-picker/multi-week-picker.js";
|
|
4
|
+
import { fiscalCalendarPassThrough as g } from "../../components/forms/date-picker/fiscal-pass-through.js";
|
|
5
|
+
import { getFieldTestId as k } from "../utils/fieldTestIds.js";
|
|
6
|
+
import { resolveWeekRangeMinMax as M } from "../utils/date.utils.js";
|
|
7
|
+
const b = ({
|
|
8
8
|
field: r,
|
|
9
9
|
validationRules: l,
|
|
10
10
|
isDisabled: s,
|
|
11
|
-
formHelpers:
|
|
11
|
+
formHelpers: c
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
13
|
+
const u = c.form.control, e = r.fieldType === "multi_week_picker" ? r : null;
|
|
14
14
|
if (!e) return null;
|
|
15
|
-
const { minDate: d, maxDate: m } =
|
|
15
|
+
const { minDate: d, maxDate: m } = M(e);
|
|
16
16
|
return /* @__PURE__ */ a(
|
|
17
|
-
|
|
17
|
+
f,
|
|
18
18
|
{
|
|
19
19
|
name: r.id,
|
|
20
|
-
control:
|
|
20
|
+
control: u,
|
|
21
21
|
rules: l,
|
|
22
22
|
render: ({ field: o, fieldState: t }) => {
|
|
23
23
|
const i = !!t.error, n = o.value;
|
|
24
|
-
return /* @__PURE__ */ a("div", { "data-testid":
|
|
25
|
-
|
|
24
|
+
return /* @__PURE__ */ a("div", { "data-testid": k(r.id), children: /* @__PURE__ */ a(
|
|
25
|
+
p,
|
|
26
26
|
{
|
|
27
27
|
label: r.label,
|
|
28
28
|
value: Array.isArray(n) ? n : void 0,
|
|
@@ -36,13 +36,14 @@ const y = ({
|
|
|
36
36
|
helperText: i ? t.error?.message : r.helpText,
|
|
37
37
|
minDate: d,
|
|
38
38
|
maxDate: m,
|
|
39
|
-
...
|
|
39
|
+
...g({
|
|
40
40
|
calendarKind: e.calendarKind,
|
|
41
41
|
fiscalMode: e.fiscalMode,
|
|
42
42
|
granularity: e.granularity,
|
|
43
43
|
fiscalMonthPattern: e.fiscalMonthPattern,
|
|
44
44
|
fiscalYearStartMonth: e.fiscalYearStartMonth,
|
|
45
45
|
weekStartsOn: e.weekStartsOn,
|
|
46
|
+
fiscalConfig: e.fiscalConfig,
|
|
46
47
|
showPeriodBoundaries: e.showPeriodBoundaries,
|
|
47
48
|
autoNavigateToAvailable: e.autoNavigateToAvailable
|
|
48
49
|
})
|
|
@@ -53,5 +54,5 @@ const y = ({
|
|
|
53
54
|
);
|
|
54
55
|
};
|
|
55
56
|
export {
|
|
56
|
-
|
|
57
|
+
b as MultiWeekPickerField
|
|
57
58
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
2
|
-
import { useRef as p, useState as
|
|
1
|
+
import { jsx as m, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as p, useState as T } from "react";
|
|
3
3
|
import { Controller as k } from "react-hook-form";
|
|
4
4
|
import { SmartInput as I } from "../../components/forms/smart-input/smart-input.js";
|
|
5
5
|
const B = ({
|
|
@@ -8,35 +8,35 @@ const B = ({
|
|
|
8
8
|
isDisabled: x,
|
|
9
9
|
formHelpers: t
|
|
10
10
|
}) => {
|
|
11
|
-
const i = e.fieldType === "text_with_backend_validation" ? e : null, o = p(!1), l = p(null), [h, f] =
|
|
11
|
+
const i = e.fieldType === "text_with_backend_validation" ? e : null, o = p(!1), l = p(null), [h, f] = T(!1), C = async (n) => {
|
|
12
12
|
if (i?.validationConfig?.omitValidation?.includes(
|
|
13
13
|
e.id
|
|
14
14
|
)) {
|
|
15
15
|
o.current = !1, l.current = null, await t.form.trigger(e.id);
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
if (!(!
|
|
18
|
+
if (!(!n || n.trim() === "")) {
|
|
19
19
|
f(!0);
|
|
20
20
|
try {
|
|
21
|
-
const
|
|
21
|
+
const r = e.handlerName ? t.formContext?.functions?.[e.handlerName] : void 0;
|
|
22
22
|
let a;
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
23
|
+
if (r) {
|
|
24
|
+
const s = i?.validationConfig?.fieldValuesToIncludeInApiRequest || [], d = s.length > 0 ? s.reduce(
|
|
25
25
|
(u, c) => (u[c] = t.form.getValues(c), u),
|
|
26
26
|
{}
|
|
27
27
|
) : {};
|
|
28
|
-
a = await
|
|
28
|
+
a = await r({
|
|
29
29
|
formHelpers: t,
|
|
30
30
|
fieldId: e.id,
|
|
31
|
-
newValue:
|
|
31
|
+
newValue: n,
|
|
32
32
|
oldValue: t.getPreviousFieldValue(e.id),
|
|
33
|
-
payload: { includedFieldValues:
|
|
33
|
+
payload: { includedFieldValues: d }
|
|
34
34
|
});
|
|
35
35
|
} else {
|
|
36
36
|
if (!i?.validationConfig)
|
|
37
37
|
throw new Error("Validation config is required");
|
|
38
|
-
const
|
|
39
|
-
(
|
|
38
|
+
const s = i.validationConfig.method || "POST", d = i.validationConfig.fieldValuesToIncludeInApiRequest || [], u = d.length > 0 ? d.reduce(
|
|
39
|
+
(w, V) => (w[V] = t.form.getValues(V), w),
|
|
40
40
|
{}
|
|
41
41
|
) : {}, c = i.validationConfig.apiEndpoint;
|
|
42
42
|
if (!c)
|
|
@@ -45,8 +45,8 @@ const B = ({
|
|
|
45
45
|
{
|
|
46
46
|
formHelpers: t,
|
|
47
47
|
apiEndpoint: c,
|
|
48
|
-
value:
|
|
49
|
-
method:
|
|
48
|
+
value: n,
|
|
49
|
+
method: s,
|
|
50
50
|
fieldValuesToIncludeInApiRequest: u
|
|
51
51
|
}
|
|
52
52
|
), !a)
|
|
@@ -55,10 +55,10 @@ const B = ({
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
a?.is_valid ? (o.current = !1, l.current = null, await t.form.trigger(e.id)) : (o.current = !0, l.current = a?.message?.trim() || `This ${e.label} is already taken`, await t.form.trigger(e.id));
|
|
58
|
-
} catch (
|
|
59
|
-
o.current = !0, l.current =
|
|
58
|
+
} catch (r) {
|
|
59
|
+
o.current = !0, l.current = r instanceof Error ? r.message : `This ${e.label} is already taken`, await t.form.trigger(e.id), t.formContext?.transport?.showFormErrorToast?.({
|
|
60
60
|
title: "Error",
|
|
61
|
-
description:
|
|
61
|
+
description: r instanceof Error ? r.message : "Something went wrong"
|
|
62
62
|
});
|
|
63
63
|
} finally {
|
|
64
64
|
f(!1);
|
|
@@ -77,34 +77,35 @@ const B = ({
|
|
|
77
77
|
backendValidation: () => o.current ? l.current || "Validation pending" : !0
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
-
render: ({ field:
|
|
81
|
-
const a = !!
|
|
82
|
-
return /* @__PURE__ */
|
|
80
|
+
render: ({ field: n, fieldState: r }) => {
|
|
81
|
+
const a = !!r.error && r.error.message !== "Validation pending", s = n.value, d = a && !h ? r.error?.message : void 0;
|
|
82
|
+
return /* @__PURE__ */ v("div", { className: "w-full min-w-0", children: [
|
|
83
83
|
/* @__PURE__ */ m(
|
|
84
84
|
I,
|
|
85
85
|
{
|
|
86
86
|
label: e.label,
|
|
87
87
|
type: "text",
|
|
88
|
-
value:
|
|
88
|
+
value: s ?? void 0,
|
|
89
89
|
onChange: (u) => {
|
|
90
|
-
u ? (o.current = !0, l.current = null) : (o.current = !1, l.current = null),
|
|
90
|
+
u ? (o.current = !0, l.current = null) : (o.current = !1, l.current = null), n.onChange(u);
|
|
91
91
|
},
|
|
92
92
|
onBlur: () => {
|
|
93
|
-
|
|
93
|
+
n.onBlur(), C(s ?? "");
|
|
94
94
|
},
|
|
95
95
|
placeholder: e.placeholder,
|
|
96
96
|
required: e.isRequired,
|
|
97
97
|
disabled: x,
|
|
98
98
|
error: a && !h,
|
|
99
|
-
helperText: h ? "Validating…" : a ? void 0 : e.helpText
|
|
99
|
+
helperText: h ? "Validating…" : a ? void 0 : e.helpText,
|
|
100
|
+
allowSpecialCharacters: i.allowSpecialCharacters
|
|
100
101
|
}
|
|
101
102
|
),
|
|
102
|
-
|
|
103
|
+
d ? /* @__PURE__ */ m(
|
|
103
104
|
"p",
|
|
104
105
|
{
|
|
105
106
|
className: "mt-2 text-sm leading-snug text-[#DC2626] break-words",
|
|
106
107
|
role: "alert",
|
|
107
|
-
children:
|
|
108
|
+
children: d
|
|
108
109
|
}
|
|
109
110
|
) : null
|
|
110
111
|
] });
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { WeekRangePicker as
|
|
4
|
-
import { toLocalDate as
|
|
5
|
-
import { resolveWeekSelection as
|
|
6
|
-
import { resolveWeekRangeMinMax as
|
|
7
|
-
const S = (e, a) =>
|
|
2
|
+
import { Controller as T } from "react-hook-form";
|
|
3
|
+
import { WeekRangePicker as b } from "../../components/forms/date-picker/week-range-picker.js";
|
|
4
|
+
import { toLocalDate as M } from "../utils/calendar-boundary.js";
|
|
5
|
+
import { resolveWeekSelection as x } from "../../lib/fiscal-calendar/week-selection.js";
|
|
6
|
+
import { resolveWeekRangeMinMax as Y } from "../utils/date.utils.js";
|
|
7
|
+
const S = (e, a) => x(e, {
|
|
8
8
|
calendarKind: a.calendarKind,
|
|
9
9
|
fiscalMode: a.fiscalMode ?? "basic",
|
|
10
10
|
granularity: a.granularity,
|
|
11
11
|
fiscalMonthPattern: a.fiscalMonthPattern,
|
|
12
12
|
fiscalYearStartMonth: a.fiscalYearStartMonth ?? 1,
|
|
13
|
-
weekStartsOn: a.weekStartsOn
|
|
14
|
-
|
|
13
|
+
weekStartsOn: a.weekStartsOn,
|
|
14
|
+
fiscalConfig: a.fiscalConfig
|
|
15
|
+
}), B = ({
|
|
15
16
|
field: e,
|
|
16
17
|
validationRules: a,
|
|
17
18
|
isDisabled: p,
|
|
@@ -19,26 +20,26 @@ const S = (e, a) => Y(e, {
|
|
|
19
20
|
}) => {
|
|
20
21
|
const t = e.fieldType === "week_range" ? e : null;
|
|
21
22
|
if (!t) return null;
|
|
22
|
-
const { minDate: u, maxDate: m, startMonth: D, endMonth: k } =
|
|
23
|
+
const { minDate: u, maxDate: m, startMonth: D, endMonth: k } = Y(t), v = d.form.control;
|
|
23
24
|
return /* @__PURE__ */ c(
|
|
24
|
-
|
|
25
|
+
T,
|
|
25
26
|
{
|
|
26
27
|
name: e.id,
|
|
27
28
|
control: v,
|
|
28
29
|
rules: a,
|
|
29
30
|
render: ({ field: w, fieldState: h }) => {
|
|
30
|
-
const g = !!h.error, r = w.value, s = r?.start ?
|
|
31
|
+
const g = !!h.error, r = w.value, s = r?.start ? M(r.start) ?? null : null, i = r?.end ? M(r.end) ?? null : null, C = !!(s && i);
|
|
31
32
|
return /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
32
|
-
|
|
33
|
+
b,
|
|
33
34
|
{
|
|
34
35
|
label: e.label,
|
|
35
|
-
value:
|
|
36
|
+
value: C && s && i ? {
|
|
36
37
|
from: S(s, t),
|
|
37
38
|
to: S(i, t)
|
|
38
39
|
} : void 0,
|
|
39
40
|
onChange: (o) => {
|
|
40
|
-
const
|
|
41
|
-
d.setValue(e.id, { start:
|
|
41
|
+
const f = o?.from ? { from: o.from, to: o.to ?? o.from } : void 0, n = f?.from?.startDate, l = f?.to?.endDate, F = n ? `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}` : null, P = l ? `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}` : null;
|
|
42
|
+
d.setValue(e.id, { start: F, end: P });
|
|
42
43
|
},
|
|
43
44
|
placeholder: t.placeholder,
|
|
44
45
|
startMonth: u ?? D,
|
|
@@ -55,6 +56,7 @@ const S = (e, a) => Y(e, {
|
|
|
55
56
|
granularity: t.granularity,
|
|
56
57
|
fiscalMonthPattern: t.fiscalMonthPattern,
|
|
57
58
|
fiscalYearStartMonth: t.fiscalYearStartMonth,
|
|
59
|
+
fiscalConfig: t.fiscalConfig,
|
|
58
60
|
showFooter: t.showFooter,
|
|
59
61
|
showPeriodBoundaries: t.showPeriodBoundaries,
|
|
60
62
|
autoNavigateToAvailable: t.autoNavigateToAvailable,
|
|
@@ -66,5 +68,5 @@ const S = (e, a) => Y(e, {
|
|
|
66
68
|
);
|
|
67
69
|
};
|
|
68
70
|
export {
|
|
69
|
-
|
|
71
|
+
B as WeekRangeField
|
|
70
72
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Option } from '../../components/forms/select';
|
|
2
2
|
import { HTMLInputTypeAttribute } from 'react';
|
|
3
3
|
import { FieldOutputValue } from './fieldsOutput.types';
|
|
4
|
+
import { FiscalCalendarConfig } from '../../lib/fiscal-calendar';
|
|
4
5
|
export type ValidationRule = {
|
|
5
6
|
/** Regex pattern string to test against */
|
|
6
7
|
regex?: string;
|
|
@@ -219,6 +220,8 @@ export type WeekRangeField = BaseField & {
|
|
|
219
220
|
granularity?: "day" | "week" | "period" | "quarter" | "year";
|
|
220
221
|
fiscalMonthPattern?: number[];
|
|
221
222
|
fiscalYearStartMonth?: number;
|
|
223
|
+
/** Canonical retail/NRF config. Wins over fiscalYearStartMonth and fiscalMonthPattern. */
|
|
224
|
+
fiscalConfig?: FiscalCalendarConfig;
|
|
222
225
|
showFooter?: boolean;
|
|
223
226
|
/** Draw `(` / `)` on fiscal period start/end days. Default false. */
|
|
224
227
|
showPeriodBoundaries?: boolean;
|
|
@@ -253,6 +256,7 @@ export type MultiWeekRangeField = BaseField & {
|
|
|
253
256
|
granularity?: "day" | "week" | "period" | "quarter" | "year";
|
|
254
257
|
fiscalMonthPattern?: number[];
|
|
255
258
|
fiscalYearStartMonth?: number;
|
|
259
|
+
fiscalConfig?: FiscalCalendarConfig;
|
|
256
260
|
showPeriodBoundaries?: boolean;
|
|
257
261
|
/** When true, open on the first enabled week. Navigate only. */
|
|
258
262
|
autoNavigateToAvailable?: boolean;
|
|
@@ -462,6 +466,11 @@ export type CheckboxField = BaseField & {
|
|
|
462
466
|
};
|
|
463
467
|
export type TextFieldWithBackendValidation = BaseField & {
|
|
464
468
|
fieldType: "text_with_backend_validation";
|
|
469
|
+
/**
|
|
470
|
+
* When false (default), only letters, numbers, and spaces are kept.
|
|
471
|
+
* Set true to allow punctuation and symbols (same behavior as `text`).
|
|
472
|
+
*/
|
|
473
|
+
allowSpecialCharacters?: boolean;
|
|
465
474
|
/** Legacy built-in path — optional when field.handlerName is set */
|
|
466
475
|
validationConfig?: {
|
|
467
476
|
method?: "GET" | "POST";
|
|
@@ -36,6 +36,7 @@ type WeekRangeBoundsField = {
|
|
|
36
36
|
fiscalMonthPattern?: WeekRangeField["fiscalMonthPattern"];
|
|
37
37
|
fiscalYearStartMonth?: WeekRangeField["fiscalYearStartMonth"];
|
|
38
38
|
weekStartsOn?: WeekRangeField["weekStartsOn"];
|
|
39
|
+
fiscalConfig?: WeekRangeField["fiscalConfig"];
|
|
39
40
|
};
|
|
40
41
|
export declare const handleMinMaxProp: (dateRangeField: DateRangeField) => {
|
|
41
42
|
minDate: Date | undefined;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { format as
|
|
1
|
+
import { format as C } from "date-fns";
|
|
2
2
|
import { civilFromLocalDate as h, localDateFromCivil as x } from "../../lib/fiscal-calendar/civil-date.js";
|
|
3
3
|
import { getFiscalYearForDate as O } from "../../lib/fiscal-calendar/lookup.js";
|
|
4
|
-
import { resolveWeekSelection as p, toFiscalCalendarConfig as Y } from "../../lib/fiscal-calendar/week-selection.js";
|
|
4
|
+
import { resolveWeekSelection as p, toFiscalCalendarConfig as Y, resolveWeekStartsOn as W } from "../../lib/fiscal-calendar/week-selection.js";
|
|
5
5
|
import { toLocalDate as o } from "./calendar-boundary.js";
|
|
6
6
|
const M = "yyyy-MM-dd", l = /* @__PURE__ */ new Map();
|
|
7
|
-
function
|
|
7
|
+
function _(t) {
|
|
8
8
|
const n = t?.trim();
|
|
9
9
|
if (!n) return M;
|
|
10
10
|
const a = n.replace(/D/g, "d").replace(/Y/g, "y");
|
|
11
11
|
let r = l.get(a);
|
|
12
12
|
if (r === void 0) {
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
C(/* @__PURE__ */ new Date(), a), r = !0;
|
|
15
15
|
} catch {
|
|
16
16
|
r = !1;
|
|
17
17
|
}
|
|
@@ -23,7 +23,7 @@ function f(t) {
|
|
|
23
23
|
const n = new Date(t);
|
|
24
24
|
return n.setHours(0, 0, 0, 0), n;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function c(t, n) {
|
|
27
27
|
const a = new Date(t);
|
|
28
28
|
return a.setDate(a.getDate() + n), a;
|
|
29
29
|
}
|
|
@@ -38,7 +38,11 @@ function S(t) {
|
|
|
38
38
|
granularity: t.granularity,
|
|
39
39
|
fiscalMonthPattern: t.fiscalMonthPattern,
|
|
40
40
|
fiscalYearStartMonth: t.fiscalYearStartMonth ?? 1,
|
|
41
|
-
weekStartsOn:
|
|
41
|
+
weekStartsOn: W({
|
|
42
|
+
weekStartsOn: t.weekStartsOn,
|
|
43
|
+
fiscalConfig: t.fiscalConfig
|
|
44
|
+
}),
|
|
45
|
+
fiscalConfig: t.fiscalConfig
|
|
42
46
|
};
|
|
43
47
|
}
|
|
44
48
|
function D(t, n) {
|
|
@@ -55,12 +59,12 @@ function u(t, n) {
|
|
|
55
59
|
);
|
|
56
60
|
return f(a.endDate);
|
|
57
61
|
}
|
|
58
|
-
const
|
|
62
|
+
const V = (t) => {
|
|
59
63
|
let n, a;
|
|
60
64
|
const r = /* @__PURE__ */ new Date();
|
|
61
65
|
if (t.minStartOffsetDays != null && t.minStartOffsetDays >= 0)
|
|
62
66
|
n = f(
|
|
63
|
-
|
|
67
|
+
c(r, t.minStartOffsetDays)
|
|
64
68
|
);
|
|
65
69
|
else if (t.minDate) {
|
|
66
70
|
const s = o(t.minDate);
|
|
@@ -75,24 +79,24 @@ const _ = (t) => {
|
|
|
75
79
|
const s = o(t.startMonth);
|
|
76
80
|
s && (e = f(s));
|
|
77
81
|
} else t.minStartOffsetDays != null && n && (e = n);
|
|
78
|
-
let
|
|
82
|
+
let i;
|
|
79
83
|
if (t.endMonth) {
|
|
80
84
|
const s = o(t.endMonth);
|
|
81
|
-
s && (
|
|
85
|
+
s && (i = f(s));
|
|
82
86
|
}
|
|
83
|
-
return { minDate: n, maxDate: a, startMonth: e, endMonth:
|
|
84
|
-
},
|
|
87
|
+
return { minDate: n, maxDate: a, startMonth: e, endMonth: i };
|
|
88
|
+
}, z = (t) => {
|
|
85
89
|
let n, a;
|
|
86
90
|
const r = /* @__PURE__ */ new Date();
|
|
87
91
|
if (t.minWeeksOffset != null) {
|
|
88
|
-
const s =
|
|
92
|
+
const s = c(
|
|
89
93
|
r,
|
|
90
94
|
-t.minWeeksOffset * 7
|
|
91
95
|
);
|
|
92
96
|
n = D(t, s);
|
|
93
97
|
} else if (t.minStartOffsetDays != null && t.minStartOffsetDays >= 0)
|
|
94
98
|
n = f(
|
|
95
|
-
|
|
99
|
+
c(r, t.minStartOffsetDays)
|
|
96
100
|
);
|
|
97
101
|
else if (t.disablePastWeeks)
|
|
98
102
|
n = D(t, r);
|
|
@@ -101,7 +105,7 @@ const _ = (t) => {
|
|
|
101
105
|
s && (n = D(t, s));
|
|
102
106
|
}
|
|
103
107
|
if (t.maxWeeksOffset != null) {
|
|
104
|
-
const s =
|
|
108
|
+
const s = c(
|
|
105
109
|
r,
|
|
106
110
|
t.maxWeeksOffset * 7
|
|
107
111
|
);
|
|
@@ -115,13 +119,13 @@ const _ = (t) => {
|
|
|
115
119
|
const s = o(t.startMonth);
|
|
116
120
|
s && (e = f(s));
|
|
117
121
|
}
|
|
118
|
-
let
|
|
122
|
+
let i;
|
|
119
123
|
if (t.endMonth) {
|
|
120
124
|
const s = o(t.endMonth);
|
|
121
|
-
s && (
|
|
125
|
+
s && (i = f(s));
|
|
122
126
|
}
|
|
123
|
-
return { minDate: n, maxDate: a, startMonth: e, endMonth:
|
|
124
|
-
},
|
|
127
|
+
return { minDate: n, maxDate: a, startMonth: e, endMonth: i };
|
|
128
|
+
}, H = (t) => {
|
|
125
129
|
let n, a;
|
|
126
130
|
const r = /* @__PURE__ */ new Date();
|
|
127
131
|
if (t.minMonthsOffset != null)
|
|
@@ -157,12 +161,12 @@ const _ = (t) => {
|
|
|
157
161
|
const s = o(t.startMonth);
|
|
158
162
|
s && (e = f(s));
|
|
159
163
|
} else (t.minMonthsOffset != null || t.disablePastMonths) && n && (e = n);
|
|
160
|
-
let
|
|
164
|
+
let i;
|
|
161
165
|
if (t.endMonth) {
|
|
162
166
|
const s = o(t.endMonth);
|
|
163
|
-
s && (
|
|
164
|
-
} else t.maxMonthsOffset != null && a && (
|
|
165
|
-
return { minDate: n, maxDate: a, startMonth: e, endMonth:
|
|
167
|
+
s && (i = f(s));
|
|
168
|
+
} else t.maxMonthsOffset != null && a && (i = a);
|
|
169
|
+
return { minDate: n, maxDate: a, startMonth: e, endMonth: i };
|
|
166
170
|
};
|
|
167
171
|
function v(t) {
|
|
168
172
|
return {
|
|
@@ -201,7 +205,7 @@ function P(t, n) {
|
|
|
201
205
|
}
|
|
202
206
|
return f(new Date(n.getFullYear(), 11, 31));
|
|
203
207
|
}
|
|
204
|
-
const
|
|
208
|
+
const I = (t) => {
|
|
205
209
|
let n, a;
|
|
206
210
|
const r = /* @__PURE__ */ new Date();
|
|
207
211
|
if (t.minYearsOffset != null)
|
|
@@ -227,21 +231,21 @@ const H = (t) => {
|
|
|
227
231
|
const s = o(t.startMonth);
|
|
228
232
|
s && (e = f(s));
|
|
229
233
|
} else t.minYearsOffset != null && n && (e = n);
|
|
230
|
-
let
|
|
234
|
+
let i;
|
|
231
235
|
if (t.endMonth) {
|
|
232
236
|
const s = o(t.endMonth);
|
|
233
|
-
s && (
|
|
234
|
-
} else t.maxYearsOffset != null && a && (
|
|
235
|
-
return { minDate: n, maxDate: a, startMonth: e, endMonth:
|
|
237
|
+
s && (i = f(s));
|
|
238
|
+
} else t.maxYearsOffset != null && a && (i = a);
|
|
239
|
+
return { minDate: n, maxDate: a, startMonth: e, endMonth: i };
|
|
236
240
|
};
|
|
237
241
|
export {
|
|
238
242
|
M as DEFAULT_PICKER_DATE_FORMAT,
|
|
239
|
-
|
|
243
|
+
c as addDaysDate,
|
|
240
244
|
m as addYearsDate,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
245
|
+
_ as handleDateFnsFormat,
|
|
246
|
+
V as resolveDateRangeMinMax,
|
|
247
|
+
H as resolveMonthRangeMinMax,
|
|
248
|
+
z as resolveWeekRangeMinMax,
|
|
249
|
+
I as resolveYearRangeMinMax,
|
|
246
250
|
f as startOfDayDate
|
|
247
251
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { CalendarInterval, CalendarKind, CalendarSelection, CalendarSelectionMode, CivilDate, DateCellMeta, FiscalCalendarConfig, FiscalMode, FiscalMonthPattern, FiscalPeriod, FiscalQuarter, FiscalWeek, FiscalYearModel, FyLabelStyle, Granularity, LeapWeekPolicy, RetailPatternId, WeekSelection, Weekday, } from './types';
|
|
1
|
+
export type { CalendarInterval, CalendarKind, CalendarSelection, CalendarSelectionMode, CivilDate, DateCellMeta, FiscalCalendarConfig, FiscalMode, FiscalMonthPattern, FiscalPeriod, FiscalQuarter, FiscalWeek, FiscalYearModel, FyAnchorRule, FyLabelStyle, Granularity, LeapWeekPolicy, RetailPatternId, WeekSelection, Weekday, } from './types';
|
|
2
2
|
export { DEFAULT_FY_LABEL, DEFAULT_LEAP_WEEK_POLICY, FISCAL_PATTERNS, } from './types';
|
|
3
3
|
export { addDays, civilFromLocalDate, compareCivil, diffDays, formatCivilRange, lastDayOfMonth, localDateFromCivil, parseCivilDate, toCivilDate, weekStart, weekday, } from './civil-date';
|
|
4
4
|
export { buildFiscalYear, clearFiscalYearCache, formatFyLabel, resolvePattern, shiftedFyForDate, } from './build-year';
|
|
@@ -6,5 +6,5 @@ export { getCellMeta, getFiscalYearForDate, clearFiscalLookupCache } from './loo
|
|
|
6
6
|
export { getFiscalPresets } from './presets';
|
|
7
7
|
export type { FiscalPreset } from './presets';
|
|
8
8
|
export { isSameInterval, nextIntervalSelection } from './selection';
|
|
9
|
-
export { getCalendarWeekSelection, getFiscalWeekSelection, resolveWeekSelection, toFiscalCalendarConfig, } from './week-selection';
|
|
9
|
+
export { getCalendarWeekSelection, getFiscalWeekSelection, resolveWeekSelection, resolveWeekStartsOn, toFiscalCalendarConfig, weekStartsOnFromFiscalConfig, } from './week-selection';
|
|
10
10
|
export type { ResolveWeekSelectionOptions } from './week-selection';
|
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
import { DEFAULT_FY_LABEL as t, DEFAULT_LEAP_WEEK_POLICY as r, FISCAL_PATTERNS as o } from "./types.js";
|
|
2
|
-
import { addDays as i, civilFromLocalDate as
|
|
3
|
-
import { buildFiscalYear as
|
|
2
|
+
import { addDays as i, civilFromLocalDate as s, compareCivil as c, diffDays as F, formatCivilRange as n, lastDayOfMonth as f, localDateFromCivil as m, parseCivilDate as C, toCivilDate as v, weekStart as D, weekday as p } from "./civil-date.js";
|
|
3
|
+
import { buildFiscalYear as S, clearFiscalYearCache as d, formatFyLabel as g, resolvePattern as k, shiftedFyForDate as x } from "./build-year.js";
|
|
4
4
|
import { clearFiscalLookupCache as y, getCellMeta as A, getFiscalYearForDate as _ } from "./lookup.js";
|
|
5
|
-
import { getFiscalPresets as
|
|
6
|
-
import { isSameInterval as
|
|
7
|
-
import { getCalendarWeekSelection as
|
|
5
|
+
import { getFiscalPresets as W } from "./presets.js";
|
|
6
|
+
import { isSameInterval as h, nextIntervalSelection as I } from "./selection.js";
|
|
7
|
+
import { getCalendarWeekSelection as T, getFiscalWeekSelection as w, resolveWeekSelection as b, resolveWeekStartsOn as u, toFiscalCalendarConfig as M, weekStartsOnFromFiscalConfig as R } from "./week-selection.js";
|
|
8
8
|
export {
|
|
9
9
|
t as DEFAULT_FY_LABEL,
|
|
10
10
|
r as DEFAULT_LEAP_WEEK_POLICY,
|
|
11
11
|
o as FISCAL_PATTERNS,
|
|
12
12
|
i as addDays,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
S as buildFiscalYear,
|
|
14
|
+
s as civilFromLocalDate,
|
|
15
15
|
y as clearFiscalLookupCache,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
d as clearFiscalYearCache,
|
|
17
|
+
c as compareCivil,
|
|
18
18
|
F as diffDays,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
n as formatCivilRange,
|
|
20
|
+
g as formatFyLabel,
|
|
21
|
+
T as getCalendarWeekSelection,
|
|
22
22
|
A as getCellMeta,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
W as getFiscalPresets,
|
|
24
|
+
w as getFiscalWeekSelection,
|
|
25
25
|
_ as getFiscalYearForDate,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
h as isSameInterval,
|
|
27
|
+
f as lastDayOfMonth,
|
|
28
|
+
m as localDateFromCivil,
|
|
29
|
+
I as nextIntervalSelection,
|
|
30
30
|
C as parseCivilDate,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
k as resolvePattern,
|
|
32
|
+
b as resolveWeekSelection,
|
|
33
|
+
u as resolveWeekStartsOn,
|
|
34
|
+
x as shiftedFyForDate,
|
|
35
|
+
v as toCivilDate,
|
|
35
36
|
M as toFiscalCalendarConfig,
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
D as weekStart,
|
|
38
|
+
R as weekStartsOnFromFiscalConfig,
|
|
39
|
+
p as weekday
|
|
38
40
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { CalendarKind, FiscalMode, FiscalMonthPattern, Granularity, WeekSelection, FiscalCalendarConfig, Weekday } from './types';
|
|
2
2
|
export type { FiscalMode, FiscalMonthPattern };
|
|
3
|
+
export declare function weekStartsOnFromFiscalConfig(fiscalConfig?: FiscalCalendarConfig): Weekday | undefined;
|
|
4
|
+
export declare function resolveWeekStartsOn(options: {
|
|
5
|
+
weekStartsOn?: Weekday;
|
|
6
|
+
fiscalConfig?: FiscalCalendarConfig;
|
|
7
|
+
}): Weekday;
|
|
3
8
|
export declare function getFiscalWeekSelection(date: Date, weekStartsOn: Weekday): WeekSelection;
|
|
4
9
|
export declare function getCalendarWeekSelection(date: Date, weekStartsOn: Weekday): WeekSelection;
|
|
5
10
|
export interface ResolveWeekSelectionOptions {
|