impact-nova 2.6.1 → 2.6.3
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/ag-grid-react/ag-grid.types.d.ts +14 -9
- package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +2 -12
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +200 -207
- package/dist/components/data/ag-grid-react/index.js +182 -179
- package/dist/components/flows/guidance/renderers/announcement-renderer.js +72 -69
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.js +118 -109
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.js +92 -82
- package/dist/form-react/Fields/DateRangeField.js +20 -19
- package/dist/form-react/Fields/WeekRangePicker.js +36 -36
- package/dist/impact-nova-tokens.scss +2 -2
- package/dist/impact-nova.css +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,33 +1,41 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { createPortal as
|
|
1
|
+
import { jsxs as u, jsx as o, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { createPortal as $ } from "react-dom";
|
|
4
4
|
import { GuidanceStepPanel as A } from "./guidance-card-shared.js";
|
|
5
|
-
import { useGuidanceOverlayGeometry as
|
|
6
|
-
import { useAdvanceOnTargetClick as
|
|
7
|
-
const
|
|
5
|
+
import { useGuidanceOverlayGeometry as T } from "../hooks/useGuidanceOverlayGeometry.js";
|
|
6
|
+
import { useAdvanceOnTargetClick as G, buildHighlightRectForTarget as M, computePopoverPosition as P } from "./guidance-renderer-shared.js";
|
|
7
|
+
const H = 220, g = `motion-safe:transition-[top,left,width,height] motion-safe:duration-[${H}ms] motion-safe:ease-[cubic-bezier(0.22,1,0.36,1)]`;
|
|
8
8
|
function L({
|
|
9
9
|
highlightRect: e,
|
|
10
|
-
blocksPointerEvents:
|
|
10
|
+
blocksPointerEvents: l = !0
|
|
11
11
|
}) {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
if (!l)
|
|
13
|
+
return null;
|
|
14
|
+
const a = typeof window < "u" ? window.innerWidth : 0, i = typeof window < "u" ? window.innerHeight : 0, d = Math.max(0, e.y), m = Math.max(0, e.x), r = Math.min(
|
|
15
|
+
a,
|
|
16
|
+
e.x + e.width
|
|
17
|
+
), c = Math.min(
|
|
18
|
+
i,
|
|
19
|
+
e.y + e.height
|
|
20
|
+
), s = Math.max(0, c - d), n = `pointer-events-auto absolute ${g}`;
|
|
21
|
+
return /* @__PURE__ */ u(z, { children: [
|
|
14
22
|
/* @__PURE__ */ o(
|
|
15
23
|
"div",
|
|
16
24
|
{
|
|
17
|
-
className:
|
|
18
|
-
style: { top: 0, left: 0, width: a, height:
|
|
25
|
+
className: n,
|
|
26
|
+
style: { top: 0, left: 0, width: a, height: d },
|
|
19
27
|
"aria-hidden": "true"
|
|
20
28
|
}
|
|
21
29
|
),
|
|
22
30
|
/* @__PURE__ */ o(
|
|
23
31
|
"div",
|
|
24
32
|
{
|
|
25
|
-
className:
|
|
33
|
+
className: n,
|
|
26
34
|
style: {
|
|
27
35
|
top: c,
|
|
28
36
|
left: 0,
|
|
29
37
|
width: a,
|
|
30
|
-
height: Math.max(0,
|
|
38
|
+
height: Math.max(0, i - c)
|
|
31
39
|
},
|
|
32
40
|
"aria-hidden": "true"
|
|
33
41
|
}
|
|
@@ -35,12 +43,12 @@ function L({
|
|
|
35
43
|
/* @__PURE__ */ o(
|
|
36
44
|
"div",
|
|
37
45
|
{
|
|
38
|
-
className:
|
|
46
|
+
className: n,
|
|
39
47
|
style: {
|
|
40
|
-
top:
|
|
48
|
+
top: d,
|
|
41
49
|
left: 0,
|
|
42
|
-
width:
|
|
43
|
-
height:
|
|
50
|
+
width: m,
|
|
51
|
+
height: s
|
|
44
52
|
},
|
|
45
53
|
"aria-hidden": "true"
|
|
46
54
|
}
|
|
@@ -48,31 +56,30 @@ function L({
|
|
|
48
56
|
/* @__PURE__ */ o(
|
|
49
57
|
"div",
|
|
50
58
|
{
|
|
51
|
-
className:
|
|
59
|
+
className: n,
|
|
52
60
|
style: {
|
|
53
|
-
top:
|
|
54
|
-
left:
|
|
55
|
-
width: Math.max(0, a -
|
|
56
|
-
height:
|
|
61
|
+
top: d,
|
|
62
|
+
left: r,
|
|
63
|
+
width: Math.max(0, a - r),
|
|
64
|
+
height: s
|
|
57
65
|
},
|
|
58
66
|
"aria-hidden": "true"
|
|
59
67
|
}
|
|
60
68
|
)
|
|
61
69
|
] });
|
|
62
70
|
}
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return Math.min(Math.max(r, y), m);
|
|
71
|
+
const w = 12, R = Math.ceil(
|
|
72
|
+
16 + w * Math.SQRT2 / 2
|
|
73
|
+
);
|
|
74
|
+
function _(e) {
|
|
75
|
+
const l = w / 2, a = e.placement === "left" || e.placement === "right", i = a ? e.highlightRect.y + e.highlightRect.height / 2 : e.highlightRect.x + e.highlightRect.width / 2, d = a ? e.popoverTop : e.popoverLeft, m = a ? e.popoverHeight : e.popoverWidth, r = i - d - l, c = R, s = m - R - w;
|
|
76
|
+
return s < c || r < c || r > s ? null : r;
|
|
70
77
|
}
|
|
71
78
|
function B({
|
|
72
79
|
placement: e,
|
|
73
|
-
offset:
|
|
80
|
+
offset: l
|
|
74
81
|
}) {
|
|
75
|
-
const a = e === "left" || e === "right" ? { top:
|
|
82
|
+
const a = e === "left" || e === "right" ? { top: l } : { left: l }, i = {
|
|
76
83
|
bottom: "left-0 top-0 -translate-y-1/2 border-l border-t",
|
|
77
84
|
top: "bottom-0 left-0 translate-y-1/2 border-b border-r",
|
|
78
85
|
right: "left-0 top-0 -translate-x-1/2 border-b border-l",
|
|
@@ -82,72 +89,75 @@ function B({
|
|
|
82
89
|
"span",
|
|
83
90
|
{
|
|
84
91
|
"aria-hidden": "true",
|
|
85
|
-
className: `pointer-events-none absolute z-0 size-3 rotate-45 border border-[var(--color-border-accent-muted)] bg-[var(--color-border-accent-muted)] ${
|
|
92
|
+
className: `pointer-events-none absolute z-0 size-3 rotate-45 border border-[var(--color-border-accent-muted)] bg-[var(--color-border-accent-muted)] ${i}`,
|
|
86
93
|
style: a
|
|
87
94
|
}
|
|
88
95
|
);
|
|
89
96
|
}
|
|
90
97
|
function j({
|
|
91
98
|
instruction: e,
|
|
92
|
-
overlayComponent:
|
|
99
|
+
overlayComponent: l,
|
|
93
100
|
onNext: a,
|
|
94
|
-
onSkip:
|
|
95
|
-
onDismiss:
|
|
96
|
-
onBack:
|
|
101
|
+
onSkip: i,
|
|
102
|
+
onDismiss: d,
|
|
103
|
+
onBack: m
|
|
97
104
|
}) {
|
|
98
|
-
const r = e.target?.element,
|
|
105
|
+
const r = e.target?.element, c = T(r, e.stepId), s = e.stepIndex + 1 >= e.totalSteps, n = G(e, a), y = n || e.advanceOn === "auto", x = f.useRef(null), k = f.useRef(null), [v, E] = f.useState({ width: 400, height: 240 }), S = f.useCallback(() => {
|
|
99
106
|
r?.click();
|
|
100
107
|
}, [r]);
|
|
101
|
-
if (
|
|
108
|
+
if (f.useLayoutEffect(() => {
|
|
102
109
|
const p = k.current;
|
|
103
110
|
p?.parentElement === document.body && document.body.appendChild(p);
|
|
104
|
-
}, [e.stepId,
|
|
105
|
-
const p =
|
|
111
|
+
}, [e.stepId, y]), f.useLayoutEffect(() => {
|
|
112
|
+
const p = x.current;
|
|
106
113
|
if (!p)
|
|
107
114
|
return;
|
|
108
|
-
const
|
|
115
|
+
const C = () => {
|
|
109
116
|
const b = p.getBoundingClientRect();
|
|
110
117
|
b.width > 0 && b.height > 0 && E({
|
|
111
118
|
width: b.width,
|
|
112
119
|
height: b.height
|
|
113
120
|
});
|
|
114
121
|
};
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
return
|
|
118
|
-
|
|
122
|
+
C();
|
|
123
|
+
const N = new ResizeObserver(C);
|
|
124
|
+
return N.observe(p), () => {
|
|
125
|
+
N.disconnect();
|
|
119
126
|
};
|
|
120
|
-
}, [e.stepId, e.content.title, e.content.body]), !
|
|
127
|
+
}, [e.stepId, e.content.title, e.content.body]), !c || !r || typeof document > "u")
|
|
121
128
|
return null;
|
|
122
|
-
const t =
|
|
129
|
+
const t = M(r);
|
|
130
|
+
if (!t)
|
|
131
|
+
return null;
|
|
132
|
+
const h = P({
|
|
123
133
|
targetRect: t,
|
|
124
134
|
popoverWidth: v.width,
|
|
125
135
|
popoverHeight: v.height,
|
|
126
136
|
preferredPlacement: e.placement
|
|
127
|
-
}),
|
|
128
|
-
placement:
|
|
129
|
-
popoverTop:
|
|
130
|
-
popoverLeft:
|
|
137
|
+
}), O = _({
|
|
138
|
+
placement: h.placement,
|
|
139
|
+
popoverTop: h.top,
|
|
140
|
+
popoverLeft: h.left,
|
|
131
141
|
highlightRect: t,
|
|
132
142
|
popoverWidth: v.width,
|
|
133
143
|
popoverHeight: v.height
|
|
134
|
-
}),
|
|
135
|
-
return
|
|
136
|
-
/* @__PURE__ */
|
|
144
|
+
}), I = `guidance-mask-${e.stepId}`;
|
|
145
|
+
return $(
|
|
146
|
+
/* @__PURE__ */ u(
|
|
137
147
|
"div",
|
|
138
148
|
{
|
|
139
149
|
ref: k,
|
|
140
|
-
"data-component":
|
|
150
|
+
"data-component": l,
|
|
141
151
|
className: "fixed inset-0 z-[60] pointer-events-none",
|
|
142
152
|
role: "presentation",
|
|
143
153
|
children: [
|
|
144
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ u(
|
|
145
155
|
"svg",
|
|
146
156
|
{
|
|
147
|
-
className: `pointer-events-none absolute inset-0 size-full ${
|
|
157
|
+
className: `pointer-events-none absolute inset-0 size-full ${g}`,
|
|
148
158
|
"aria-hidden": "true",
|
|
149
159
|
children: [
|
|
150
|
-
/* @__PURE__ */ o("defs", { children: /* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ o("defs", { children: /* @__PURE__ */ u("mask", { id: I, children: [
|
|
151
161
|
/* @__PURE__ */ o("rect", { width: "100%", height: "100%", fill: "white" }),
|
|
152
162
|
/* @__PURE__ */ o(
|
|
153
163
|
"rect",
|
|
@@ -158,7 +168,7 @@ function j({
|
|
|
158
168
|
height: t.height,
|
|
159
169
|
rx: "8",
|
|
160
170
|
fill: "black",
|
|
161
|
-
className:
|
|
171
|
+
className: g
|
|
162
172
|
}
|
|
163
173
|
)
|
|
164
174
|
] }) }),
|
|
@@ -168,8 +178,8 @@ function j({
|
|
|
168
178
|
width: "100%",
|
|
169
179
|
height: "100%",
|
|
170
180
|
fill: "var(--guidance-backdrop-bg)",
|
|
171
|
-
fillOpacity: "var(--guidance-backdrop-opacity, 0.
|
|
172
|
-
mask: `url(#${
|
|
181
|
+
fillOpacity: "var(--guidance-backdrop-opacity, 0.4)",
|
|
182
|
+
mask: `url(#${I})`
|
|
173
183
|
}
|
|
174
184
|
)
|
|
175
185
|
]
|
|
@@ -179,10 +189,10 @@ function j({
|
|
|
179
189
|
L,
|
|
180
190
|
{
|
|
181
191
|
highlightRect: t,
|
|
182
|
-
blocksPointerEvents: !
|
|
192
|
+
blocksPointerEvents: !y
|
|
183
193
|
}
|
|
184
194
|
),
|
|
185
|
-
|
|
195
|
+
y ? null : /* @__PURE__ */ o(
|
|
186
196
|
"div",
|
|
187
197
|
{
|
|
188
198
|
className: "pointer-events-auto absolute z-10",
|
|
@@ -195,11 +205,11 @@ function j({
|
|
|
195
205
|
"aria-hidden": "true"
|
|
196
206
|
}
|
|
197
207
|
),
|
|
198
|
-
|
|
208
|
+
n ? /* @__PURE__ */ o(
|
|
199
209
|
"button",
|
|
200
210
|
{
|
|
201
211
|
type: "button",
|
|
202
|
-
className: `absolute z-10 cursor-pointer border-0 bg-transparent p-0 pointer-events-auto ${
|
|
212
|
+
className: `absolute z-10 cursor-pointer border-0 bg-transparent p-0 pointer-events-auto ${g}`,
|
|
203
213
|
style: {
|
|
204
214
|
top: t.y,
|
|
205
215
|
left: t.x,
|
|
@@ -207,13 +217,13 @@ function j({
|
|
|
207
217
|
height: t.height
|
|
208
218
|
},
|
|
209
219
|
"aria-label": `Click ${e.content.title}`,
|
|
210
|
-
onClick:
|
|
220
|
+
onClick: S
|
|
211
221
|
}
|
|
212
222
|
) : null,
|
|
213
223
|
/* @__PURE__ */ o(
|
|
214
224
|
"div",
|
|
215
225
|
{
|
|
216
|
-
className: `pointer-events-none absolute rounded-lg ring-2 ring-[var(--guidance-highlight-ring,var(--color-primary))] ${
|
|
226
|
+
className: `pointer-events-none absolute rounded-lg ring-2 ring-[var(--guidance-highlight-ring,var(--color-primary))] ${g}`,
|
|
217
227
|
style: {
|
|
218
228
|
top: t.y,
|
|
219
229
|
left: t.x,
|
|
@@ -222,26 +232,26 @@ function j({
|
|
|
222
232
|
}
|
|
223
233
|
}
|
|
224
234
|
),
|
|
225
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ u(
|
|
226
236
|
"div",
|
|
227
237
|
{
|
|
228
|
-
ref:
|
|
229
|
-
className: `pointer-events-auto absolute z-20 w-[min(400px,calc(100vw-2rem))] ${
|
|
238
|
+
ref: x,
|
|
239
|
+
className: `pointer-events-auto absolute z-20 w-[min(400px,calc(100vw-2rem))] ${g}`,
|
|
230
240
|
style: {
|
|
231
|
-
top:
|
|
232
|
-
left:
|
|
241
|
+
top: h.top,
|
|
242
|
+
left: h.left
|
|
233
243
|
},
|
|
234
244
|
role: "dialog",
|
|
235
245
|
"aria-labelledby": `guidance-tour-title-${e.stepId}`,
|
|
236
246
|
"aria-describedby": `guidance-tour-body-${e.stepId}`,
|
|
237
247
|
children: [
|
|
238
|
-
/* @__PURE__ */ o(
|
|
248
|
+
O !== null ? /* @__PURE__ */ o(
|
|
239
249
|
B,
|
|
240
250
|
{
|
|
241
|
-
placement:
|
|
242
|
-
offset:
|
|
251
|
+
placement: h.placement,
|
|
252
|
+
offset: O
|
|
243
253
|
}
|
|
244
|
-
),
|
|
254
|
+
) : null,
|
|
245
255
|
/* @__PURE__ */ o("div", { className: "relative z-[1] overflow-hidden rounded-2xl border border-stroke bg-canvas shadow-elevation-floating", children: /* @__PURE__ */ o(
|
|
246
256
|
A,
|
|
247
257
|
{
|
|
@@ -251,15 +261,15 @@ function j({
|
|
|
251
261
|
stepIndex: e.stepIndex,
|
|
252
262
|
totalSteps: e.totalSteps,
|
|
253
263
|
skippable: e.skippable,
|
|
254
|
-
primaryActionLabel:
|
|
255
|
-
onSkip:
|
|
256
|
-
onDismiss:
|
|
257
|
-
onBack:
|
|
264
|
+
primaryActionLabel: s ? "Done" : "Next",
|
|
265
|
+
onSkip: i,
|
|
266
|
+
onDismiss: d,
|
|
267
|
+
onBack: m,
|
|
258
268
|
canGoBack: e.canGoBack,
|
|
259
269
|
advanceOn: e.advanceOn,
|
|
260
270
|
onPrimaryAction: a,
|
|
261
|
-
showPrimaryAction: !
|
|
262
|
-
footerHint:
|
|
271
|
+
showPrimaryAction: !n && e.advanceOn !== "auto",
|
|
272
|
+
footerHint: n ? e.content.footer ?? "Click the highlighted button to continue." : e.advanceOn === "auto" ? e.content.footer ?? "Complete the action above to continue." : null,
|
|
263
273
|
footerKeybinding: e.content.keybinding,
|
|
264
274
|
shortcutReferences: e.content.shortcutReferences,
|
|
265
275
|
titleId: `guidance-tour-title-${e.stepId}`,
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { Controller as S } from "react-hook-form";
|
|
4
|
-
import { DateRangePicker as
|
|
5
|
-
import { toLocalDate as
|
|
6
|
-
import { resolveDateRangeMinMax as P } from "../utils/date.utils.js";
|
|
7
|
-
const
|
|
4
|
+
import { DateRangePicker as F } from "../../components/forms/date-picker/date-range-picker.js";
|
|
5
|
+
import { toLocalDate as d } from "../utils/calendar-boundary.js";
|
|
6
|
+
import { resolveDateRangeMinMax as P, handleDateFnsFormat as x } from "../utils/date.utils.js";
|
|
7
|
+
const q = ({
|
|
8
8
|
field: r,
|
|
9
|
-
validationRules:
|
|
9
|
+
validationRules: c,
|
|
10
10
|
isDisabled: l,
|
|
11
11
|
formHelpers: n
|
|
12
12
|
}) => {
|
|
13
13
|
const t = r.fieldType === "date_range" ? r : null;
|
|
14
14
|
if (!t) return null;
|
|
15
|
-
const
|
|
15
|
+
const m = n.form.control, { minDate: h, maxDate: u, startMonth: p, endMonth: f } = P(t), g = t.dateFormat ? x(t.dateFormat) : void 0;
|
|
16
16
|
return /* @__PURE__ */ a(
|
|
17
17
|
S,
|
|
18
18
|
{
|
|
19
19
|
name: r.id,
|
|
20
|
-
control:
|
|
20
|
+
control: m,
|
|
21
21
|
disabled: l,
|
|
22
|
-
rules:
|
|
23
|
-
render: ({ field:
|
|
24
|
-
const i = !!s.error, o =
|
|
22
|
+
rules: c,
|
|
23
|
+
render: ({ field: D, fieldState: s }) => {
|
|
24
|
+
const i = !!s.error, o = D.value;
|
|
25
25
|
return /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
26
|
-
|
|
26
|
+
F,
|
|
27
27
|
{
|
|
28
28
|
label: r.label,
|
|
29
|
-
minDate:
|
|
29
|
+
minDate: h,
|
|
30
30
|
maxDate: u,
|
|
31
31
|
startMonth: p,
|
|
32
|
-
endMonth:
|
|
32
|
+
endMonth: f,
|
|
33
33
|
value: {
|
|
34
|
-
from: o?.start ?
|
|
35
|
-
to: o?.end ?
|
|
34
|
+
from: o?.start ? d(o.start) : void 0,
|
|
35
|
+
to: o?.end ? d(o.end) : void 0
|
|
36
36
|
},
|
|
37
37
|
onChange: (e) => {
|
|
38
|
-
const M = e?.from ? `${e.from.getFullYear()}-${String(e.from.getMonth() + 1).padStart(2, "0")}-${String(e.from.getDate()).padStart(2, "0")}` : null,
|
|
39
|
-
n.setValue(r.id, { start: M, end:
|
|
38
|
+
const M = e?.from ? `${e.from.getFullYear()}-${String(e.from.getMonth() + 1).padStart(2, "0")}-${String(e.from.getDate()).padStart(2, "0")}` : null, v = e?.to ? `${e.to.getFullYear()}-${String(e.to.getMonth() + 1).padStart(2, "0")}-${String(e.to.getDate()).padStart(2, "0")}` : null;
|
|
39
|
+
n.setValue(r.id, { start: M, end: v });
|
|
40
40
|
},
|
|
41
41
|
startPlaceholder: t.startPlaceholder || "Start Date",
|
|
42
42
|
endPlaceholder: t.endPlaceholder || "End Date",
|
|
@@ -51,7 +51,8 @@ const Y = ({
|
|
|
51
51
|
fiscalYearStartMonth: t.fiscalYearStartMonth,
|
|
52
52
|
fiscalMonthPattern: t.fiscalMonthPattern,
|
|
53
53
|
showPresets: t.showPresets,
|
|
54
|
-
autoNavigateToAvailable: t.autoNavigateToAvailable
|
|
54
|
+
autoNavigateToAvailable: t.autoNavigateToAvailable,
|
|
55
|
+
format: g
|
|
55
56
|
}
|
|
56
57
|
) });
|
|
57
58
|
}
|
|
@@ -59,5 +60,5 @@ const Y = ({
|
|
|
59
60
|
);
|
|
60
61
|
};
|
|
61
62
|
export {
|
|
62
|
-
|
|
63
|
+
q as DateRangeField
|
|
63
64
|
};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { Controller as
|
|
3
|
-
import { WeekRangePicker as
|
|
2
|
+
import { Controller as b } from "react-hook-form";
|
|
3
|
+
import { WeekRangePicker as x } from "../../components/forms/date-picker/week-range-picker.js";
|
|
4
4
|
import { toLocalDate as M } from "../utils/calendar-boundary.js";
|
|
5
|
-
import { resolveWeekSelection as
|
|
6
|
-
import { resolveWeekRangeMinMax as
|
|
7
|
-
const S = (
|
|
8
|
-
calendarKind:
|
|
9
|
-
fiscalMode:
|
|
10
|
-
granularity:
|
|
11
|
-
fiscalMonthPattern:
|
|
12
|
-
fiscalYearStartMonth:
|
|
13
|
-
weekStartsOn:
|
|
14
|
-
fiscalConfig:
|
|
15
|
-
}),
|
|
16
|
-
field:
|
|
17
|
-
validationRules:
|
|
5
|
+
import { resolveWeekSelection as Y } from "../../lib/fiscal-calendar/week-selection.js";
|
|
6
|
+
import { resolveWeekRangeMinMax as $, handleDateFnsFormat as y } from "../utils/date.utils.js";
|
|
7
|
+
const S = (a, e) => Y(a, {
|
|
8
|
+
calendarKind: e.calendarKind,
|
|
9
|
+
fiscalMode: e.fiscalMode ?? "basic",
|
|
10
|
+
granularity: e.granularity,
|
|
11
|
+
fiscalMonthPattern: e.fiscalMonthPattern,
|
|
12
|
+
fiscalYearStartMonth: e.fiscalYearStartMonth ?? 1,
|
|
13
|
+
weekStartsOn: e.weekStartsOn,
|
|
14
|
+
fiscalConfig: e.fiscalConfig
|
|
15
|
+
}), A = ({
|
|
16
|
+
field: a,
|
|
17
|
+
validationRules: e,
|
|
18
18
|
isDisabled: p,
|
|
19
19
|
formHelpers: d
|
|
20
20
|
}) => {
|
|
21
|
-
const t =
|
|
21
|
+
const t = a.fieldType === "week_range" ? a : null;
|
|
22
22
|
if (!t) return null;
|
|
23
|
-
const { minDate:
|
|
23
|
+
const { minDate: m, maxDate: u, startMonth: D, endMonth: k } = $(t), v = t.dateFormat ? y(t.dateFormat) : void 0, w = d.form.control;
|
|
24
24
|
return /* @__PURE__ */ c(
|
|
25
|
-
|
|
25
|
+
b,
|
|
26
26
|
{
|
|
27
|
-
name:
|
|
28
|
-
control:
|
|
29
|
-
rules:
|
|
30
|
-
render: ({ field:
|
|
31
|
-
const g = !!h.error,
|
|
27
|
+
name: a.id,
|
|
28
|
+
control: w,
|
|
29
|
+
rules: e,
|
|
30
|
+
render: ({ field: F, fieldState: h }) => {
|
|
31
|
+
const g = !!h.error, o = F.value, s = o?.start ? M(o.start) ?? null : null, i = o?.end ? M(o.end) ?? null : null, C = !!(s && i);
|
|
32
32
|
return /* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(
|
|
33
|
-
|
|
33
|
+
x,
|
|
34
34
|
{
|
|
35
|
-
label:
|
|
35
|
+
label: a.label,
|
|
36
36
|
value: C && s && i ? {
|
|
37
37
|
from: S(s, t),
|
|
38
38
|
to: S(i, t)
|
|
39
39
|
} : void 0,
|
|
40
|
-
onChange: (
|
|
41
|
-
const f =
|
|
42
|
-
d.setValue(
|
|
40
|
+
onChange: (r) => {
|
|
41
|
+
const f = r?.from ? { from: r.from, to: r.to ?? r.from } : void 0, n = f?.from?.startDate, l = f?.to?.endDate, P = n ? `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}` : null, T = l ? `${l.getFullYear()}-${String(l.getMonth() + 1).padStart(2, "0")}-${String(l.getDate()).padStart(2, "0")}` : null;
|
|
42
|
+
d.setValue(a.id, { start: P, end: T });
|
|
43
43
|
},
|
|
44
44
|
placeholder: t.placeholder,
|
|
45
|
-
startMonth:
|
|
46
|
-
endMonth:
|
|
47
|
-
required:
|
|
45
|
+
startMonth: m ?? D,
|
|
46
|
+
endMonth: u ?? k,
|
|
47
|
+
required: a.isRequired,
|
|
48
48
|
disabled: p,
|
|
49
49
|
error: g,
|
|
50
|
-
helperText: g ? h.error?.message :
|
|
50
|
+
helperText: g ? h.error?.message : a.helpText,
|
|
51
51
|
calendarKind: t.calendarKind,
|
|
52
52
|
fiscalMode: t.fiscalMode,
|
|
53
53
|
weekStartsOn: t.weekStartsOn,
|
|
54
|
-
minDate:
|
|
55
|
-
maxDate:
|
|
54
|
+
minDate: m,
|
|
55
|
+
maxDate: u,
|
|
56
56
|
granularity: t.granularity,
|
|
57
57
|
fiscalMonthPattern: t.fiscalMonthPattern,
|
|
58
58
|
fiscalYearStartMonth: t.fiscalYearStartMonth,
|
|
@@ -60,7 +60,7 @@ const S = (e, a) => x(e, {
|
|
|
60
60
|
showFooter: t.showFooter,
|
|
61
61
|
showPeriodBoundaries: t.showPeriodBoundaries,
|
|
62
62
|
autoNavigateToAvailable: t.autoNavigateToAvailable,
|
|
63
|
-
format:
|
|
63
|
+
format: v
|
|
64
64
|
}
|
|
65
65
|
) });
|
|
66
66
|
}
|
|
@@ -68,5 +68,5 @@ const S = (e, a) => x(e, {
|
|
|
68
68
|
);
|
|
69
69
|
};
|
|
70
70
|
export {
|
|
71
|
-
|
|
71
|
+
A as WeekRangeField
|
|
72
72
|
};
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
/* —— Guidance (tours, coach marks, announcements) —— */
|
|
177
177
|
--guidance-announcement-hero-bg: #eceefd;
|
|
178
178
|
--guidance-backdrop-bg: #000000;
|
|
179
|
-
--guidance-backdrop-opacity: 0.
|
|
179
|
+
--guidance-backdrop-opacity: 0.4;
|
|
180
180
|
--guidance-coach-mark-bg: #ffffff;
|
|
181
181
|
--guidance-coach-mark-border: #e8eaed;
|
|
182
182
|
--guidance-highlight-ring: #5267f4;
|
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
/* —— Guidance (tours, coach marks, announcements) —— */
|
|
413
413
|
--guidance-announcement-hero-bg: #eceefd;
|
|
414
414
|
--guidance-backdrop-bg: #000000;
|
|
415
|
-
--guidance-backdrop-opacity: 0.
|
|
415
|
+
--guidance-backdrop-opacity: 0.4;
|
|
416
416
|
--guidance-coach-mark-bg: #ffffff;
|
|
417
417
|
--guidance-coach-mark-border: #e8eaed;
|
|
418
418
|
--guidance-highlight-ring: #5267f4;
|