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
|
@@ -4,29 +4,29 @@ import { createPortal as $ } from "react-dom";
|
|
|
4
4
|
import { GuidanceStepPanel as S } from "./guidance-card-shared.js";
|
|
5
5
|
import { useGuidanceOverlayGeometry as z } from "../hooks/useGuidanceOverlayGeometry.js";
|
|
6
6
|
import { useAdvanceOnTargetClick as E, buildHighlightRectForTarget as P, computePopoverPosition as A } from "./guidance-renderer-shared.js";
|
|
7
|
-
const
|
|
8
|
-
function
|
|
7
|
+
const R = 220, n = `motion-safe:transition-[top,left,width,height] motion-safe:duration-[${R}ms] motion-safe:ease-[cubic-bezier(0.22,1,0.36,1)]`;
|
|
8
|
+
function G({
|
|
9
9
|
highlightRect: e,
|
|
10
10
|
blocksPointerEvents: u = !0
|
|
11
11
|
}) {
|
|
12
|
-
const
|
|
12
|
+
const i = typeof window < "u" ? window.innerWidth : 0, g = typeof window < "u" ? window.innerHeight : 0, s = e.x + e.width, a = e.y + e.height, d = u ? `pointer-events-auto absolute bg-[var(--guidance-backdrop-bg)] opacity-[var(--guidance-backdrop-opacity,0.6)] ${n}` : `pointer-events-none absolute bg-[var(--guidance-backdrop-bg)] opacity-[var(--guidance-backdrop-opacity,0.6)] ${n}`;
|
|
13
13
|
return /* @__PURE__ */ h(C, { children: [
|
|
14
14
|
/* @__PURE__ */ o(
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
|
-
className:
|
|
18
|
-
style: { top: 0, left: 0, width:
|
|
17
|
+
className: d,
|
|
18
|
+
style: { top: 0, left: 0, width: i, height: e.y },
|
|
19
19
|
"aria-hidden": "true"
|
|
20
20
|
}
|
|
21
21
|
),
|
|
22
22
|
/* @__PURE__ */ o(
|
|
23
23
|
"div",
|
|
24
24
|
{
|
|
25
|
-
className:
|
|
25
|
+
className: d,
|
|
26
26
|
style: {
|
|
27
27
|
top: a,
|
|
28
28
|
left: 0,
|
|
29
|
-
width:
|
|
29
|
+
width: i,
|
|
30
30
|
height: Math.max(0, g - a)
|
|
31
31
|
},
|
|
32
32
|
"aria-hidden": "true"
|
|
@@ -35,7 +35,7 @@ function H({
|
|
|
35
35
|
/* @__PURE__ */ o(
|
|
36
36
|
"div",
|
|
37
37
|
{
|
|
38
|
-
className:
|
|
38
|
+
className: d,
|
|
39
39
|
style: {
|
|
40
40
|
top: e.y,
|
|
41
41
|
left: 0,
|
|
@@ -48,11 +48,11 @@ function H({
|
|
|
48
48
|
/* @__PURE__ */ o(
|
|
49
49
|
"div",
|
|
50
50
|
{
|
|
51
|
-
className:
|
|
51
|
+
className: d,
|
|
52
52
|
style: {
|
|
53
53
|
top: e.y,
|
|
54
54
|
left: s,
|
|
55
|
-
width: Math.max(0,
|
|
55
|
+
width: Math.max(0, i - s),
|
|
56
56
|
height: e.height
|
|
57
57
|
},
|
|
58
58
|
"aria-hidden": "true"
|
|
@@ -63,18 +63,18 @@ function H({
|
|
|
63
63
|
function B({
|
|
64
64
|
instruction: e,
|
|
65
65
|
overlayComponent: u,
|
|
66
|
-
onNext:
|
|
66
|
+
onNext: i,
|
|
67
67
|
onSkip: g,
|
|
68
68
|
onDismiss: s
|
|
69
69
|
}) {
|
|
70
|
-
const a = e.target?.element,
|
|
70
|
+
const a = e.target?.element, d = z(a, e.stepId), I = e.stepIndex + 1 >= e.totalSteps, c = E(e, i), v = c || e.advanceOn === "auto", b = l.useRef(null), f = l.useRef(null), [m, O] = l.useState({ width: 400, height: 240 }), N = l.useCallback(() => {
|
|
71
71
|
a?.click();
|
|
72
72
|
}, [a]);
|
|
73
73
|
if (l.useLayoutEffect(() => {
|
|
74
74
|
const r = f.current;
|
|
75
75
|
r?.parentElement === document.body && document.body.appendChild(r);
|
|
76
|
-
}, [e.stepId,
|
|
77
|
-
const r =
|
|
76
|
+
}, [e.stepId, v]), l.useLayoutEffect(() => {
|
|
77
|
+
const r = b.current;
|
|
78
78
|
if (!r)
|
|
79
79
|
return;
|
|
80
80
|
const k = () => {
|
|
@@ -89,12 +89,12 @@ function B({
|
|
|
89
89
|
return x.observe(r), () => {
|
|
90
90
|
x.disconnect();
|
|
91
91
|
};
|
|
92
|
-
}, [e.stepId, e.content.title, e.content.body]), !
|
|
92
|
+
}, [e.stepId, e.content.title, e.content.body]), !d || !a || typeof document > "u")
|
|
93
93
|
return null;
|
|
94
94
|
const t = P(a), y = A({
|
|
95
|
-
targetRect:
|
|
96
|
-
popoverWidth:
|
|
97
|
-
popoverHeight:
|
|
95
|
+
targetRect: t,
|
|
96
|
+
popoverWidth: m.width,
|
|
97
|
+
popoverHeight: m.height
|
|
98
98
|
}), w = `guidance-mask-${e.stepId}`;
|
|
99
99
|
return $(
|
|
100
100
|
/* @__PURE__ */ h(
|
|
@@ -140,10 +140,10 @@ function B({
|
|
|
140
140
|
}
|
|
141
141
|
),
|
|
142
142
|
/* @__PURE__ */ o(
|
|
143
|
-
|
|
143
|
+
G,
|
|
144
144
|
{
|
|
145
145
|
highlightRect: t,
|
|
146
|
-
blocksPointerEvents: !
|
|
146
|
+
blocksPointerEvents: !v
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
149
|
c ? /* @__PURE__ */ o(
|
|
@@ -176,7 +176,7 @@ function B({
|
|
|
176
176
|
/* @__PURE__ */ o(
|
|
177
177
|
"div",
|
|
178
178
|
{
|
|
179
|
-
ref:
|
|
179
|
+
ref: b,
|
|
180
180
|
className: `pointer-events-auto absolute z-20 w-[min(400px,calc(100vw-2rem))] overflow-hidden rounded-2xl border border-stroke bg-canvas shadow-elevation-floating ${n}`,
|
|
181
181
|
style: {
|
|
182
182
|
top: y.top,
|
|
@@ -197,9 +197,9 @@ function B({
|
|
|
197
197
|
primaryActionLabel: I ? "Done" : "Next",
|
|
198
198
|
onSkip: g,
|
|
199
199
|
onDismiss: s,
|
|
200
|
-
onPrimaryAction:
|
|
200
|
+
onPrimaryAction: i,
|
|
201
201
|
showPrimaryAction: !c && e.advanceOn !== "auto",
|
|
202
|
-
footerHint: c ? "Click highlighted
|
|
202
|
+
footerHint: c ? e.content.footer ?? "Click the highlighted button to continue." : e.advanceOn === "auto" ? e.content.footer ?? "Complete the action above to continue." : null,
|
|
203
203
|
titleId: `guidance-tour-title-${e.stepId}`,
|
|
204
204
|
bodyId: `guidance-tour-body-${e.stepId}`
|
|
205
205
|
}
|
|
@@ -12,24 +12,24 @@ const k = ({
|
|
|
12
12
|
steps: s = [],
|
|
13
13
|
children: i
|
|
14
14
|
}) => {
|
|
15
|
-
const [d,
|
|
15
|
+
const [d, f] = y({
|
|
16
16
|
prop: r,
|
|
17
17
|
defaultProp: e,
|
|
18
18
|
onChange: o
|
|
19
|
-
}), [
|
|
20
|
-
l((
|
|
21
|
-
}, []), c = a.useCallback((
|
|
22
|
-
l((
|
|
23
|
-
}, []),
|
|
19
|
+
}), [u, l] = a.useState([]), x = a.useCallback((g) => {
|
|
20
|
+
l((b) => b.includes(g) ? b : [...b, g].sort((v, w) => v - w));
|
|
21
|
+
}, []), c = a.useCallback((g) => {
|
|
22
|
+
l((b) => b.filter((v) => v !== g));
|
|
23
|
+
}, []), m = t ?? (u.length > 0 ? Math.max(...u) : s.length), h = a.useMemo(
|
|
24
24
|
() => ({
|
|
25
25
|
value: d ?? e,
|
|
26
|
-
totalSteps:
|
|
26
|
+
totalSteps: m,
|
|
27
27
|
steps: s,
|
|
28
|
-
setValue:
|
|
29
|
-
registerStep:
|
|
28
|
+
setValue: f,
|
|
29
|
+
registerStep: x,
|
|
30
30
|
unregisterStep: c
|
|
31
31
|
}),
|
|
32
|
-
[d, e,
|
|
32
|
+
[d, e, m, s, f, x, c]
|
|
33
33
|
);
|
|
34
34
|
return /* @__PURE__ */ n(C.Provider, { value: h, children: i });
|
|
35
35
|
};
|
|
@@ -118,7 +118,7 @@ const P = a.forwardRef(
|
|
|
118
118
|
{
|
|
119
119
|
ref: t,
|
|
120
120
|
className: p(
|
|
121
|
-
"flex flex-col flex-1 min-h-0 min-w-0 overflow-hidden pt-[50px]
|
|
121
|
+
"flex flex-col flex-1 min-h-0 min-w-0 overflow-hidden pt-[50px] pb-[73px]",
|
|
122
122
|
r
|
|
123
123
|
),
|
|
124
124
|
"data-slot": "body",
|
|
@@ -131,35 +131,35 @@ const P = a.forwardRef(
|
|
|
131
131
|
P.displayName = "WizardBody";
|
|
132
132
|
const F = a.forwardRef(
|
|
133
133
|
({ className: r, interactive: e = !0, linear: o = !1, ...t }, s) => {
|
|
134
|
-
const { value: i, totalSteps: d, steps:
|
|
134
|
+
const { value: i, totalSteps: d, steps: f, setValue: u } = W();
|
|
135
135
|
if (d <= 0) return null;
|
|
136
|
-
const l = (
|
|
137
|
-
e && (o &&
|
|
136
|
+
const l = (x) => {
|
|
137
|
+
e && (o && x > i || u(x));
|
|
138
138
|
};
|
|
139
139
|
return /* @__PURE__ */ n(
|
|
140
140
|
"div",
|
|
141
141
|
{
|
|
142
142
|
ref: s,
|
|
143
|
-
className: p("flex gap-2 mb-[42px] shrink-0", r),
|
|
143
|
+
className: p("flex gap-2 mb-[42px] shrink-0 px-6 sm:px-10 md:px-16 lg:px-20 xl:px-[60px] 2xl:px-[190px]", r),
|
|
144
144
|
"data-slot": "progress",
|
|
145
145
|
role: "list",
|
|
146
146
|
...t,
|
|
147
|
-
children: Array.from({ length: d }, (
|
|
148
|
-
const
|
|
147
|
+
children: Array.from({ length: d }, (x, c) => {
|
|
148
|
+
const m = c + 1, h = c === i - 1, g = c < i - 1, v = f[c]?.label ?? `Step ${m} of ${d}`, w = e && (!o || m <= i);
|
|
149
149
|
return /* @__PURE__ */ n(
|
|
150
150
|
"div",
|
|
151
151
|
{
|
|
152
152
|
role: "listitem",
|
|
153
|
-
"aria-label":
|
|
153
|
+
"aria-label": v,
|
|
154
154
|
"aria-current": h ? "step" : void 0,
|
|
155
155
|
tabIndex: w ? 0 : void 0,
|
|
156
|
-
onClick: () => l(
|
|
156
|
+
onClick: () => l(m),
|
|
157
157
|
onKeyDown: w ? (z) => {
|
|
158
|
-
(z.key === "Enter" || z.key === " ") && (z.preventDefault(), l(
|
|
158
|
+
(z.key === "Enter" || z.key === " ") && (z.preventDefault(), l(m));
|
|
159
159
|
} : void 0,
|
|
160
160
|
className: p(
|
|
161
161
|
"h-2 flex-1 max-w-[132px] rounded-[4px] transition-colors duration-300 motion-reduce:transition-none",
|
|
162
|
-
h ||
|
|
162
|
+
h || g ? "bg-brand" : "bg-accent",
|
|
163
163
|
w ? "cursor-pointer" : "cursor-default"
|
|
164
164
|
)
|
|
165
165
|
},
|
|
@@ -197,31 +197,31 @@ const T = a.forwardRef(
|
|
|
197
197
|
T.displayName = "WizardStepDescription";
|
|
198
198
|
const j = a.forwardRef(
|
|
199
199
|
({ className: r, children: e, ...o }, t) => {
|
|
200
|
-
const { edges: s, setEdges: i } = N(), d = a.useRef(null),
|
|
200
|
+
const { edges: s, setEdges: i } = N(), d = a.useRef(null), f = a.useCallback(
|
|
201
201
|
(l) => {
|
|
202
202
|
d.current = l, typeof t == "function" ? t(l) : t && (t.current = l);
|
|
203
203
|
},
|
|
204
204
|
[t]
|
|
205
|
-
),
|
|
205
|
+
), u = a.useCallback(() => {
|
|
206
206
|
const l = d.current;
|
|
207
207
|
if (!l) return;
|
|
208
|
-
const { scrollTop:
|
|
209
|
-
i((
|
|
208
|
+
const { scrollTop: x, scrollHeight: c, clientHeight: m } = l, h = 1, g = x > h, b = x + m < c - h;
|
|
209
|
+
i((v) => v.top === g && v.bottom === b ? v : { top: g, bottom: b });
|
|
210
210
|
}, [i]);
|
|
211
211
|
return a.useEffect(() => {
|
|
212
212
|
const l = d.current;
|
|
213
213
|
if (!l) return;
|
|
214
|
-
const
|
|
215
|
-
requestAnimationFrame(
|
|
214
|
+
const x = () => {
|
|
215
|
+
requestAnimationFrame(u);
|
|
216
216
|
};
|
|
217
|
-
|
|
218
|
-
const c = new ResizeObserver(
|
|
217
|
+
x(), l.addEventListener("scroll", u, { passive: !0 });
|
|
218
|
+
const c = new ResizeObserver(x);
|
|
219
219
|
c.observe(l);
|
|
220
|
-
const
|
|
221
|
-
return
|
|
222
|
-
l.removeEventListener("scroll",
|
|
220
|
+
const m = l.firstElementChild;
|
|
221
|
+
return m && c.observe(m), () => {
|
|
222
|
+
l.removeEventListener("scroll", u), c.disconnect();
|
|
223
223
|
};
|
|
224
|
-
}, [
|
|
224
|
+
}, [u, e]), /* @__PURE__ */ n(
|
|
225
225
|
"div",
|
|
226
226
|
{
|
|
227
227
|
className: p(
|
|
@@ -234,8 +234,11 @@ const j = a.forwardRef(
|
|
|
234
234
|
children: /* @__PURE__ */ n(
|
|
235
235
|
"div",
|
|
236
236
|
{
|
|
237
|
-
ref:
|
|
238
|
-
className: p(
|
|
237
|
+
ref: f,
|
|
238
|
+
className: p(
|
|
239
|
+
"flex-1 min-h-0 overflow-y-auto overflow-x-hidden px-6 py-4 sm:px-10 md:px-16 lg:px-20 xl:px-[60px] 2xl:px-[190px]",
|
|
240
|
+
r
|
|
241
|
+
),
|
|
239
242
|
"data-slot": "content",
|
|
240
243
|
...o,
|
|
241
244
|
children: e
|
|
@@ -248,8 +251,8 @@ const j = a.forwardRef(
|
|
|
248
251
|
j.displayName = "WizardContent";
|
|
249
252
|
const A = a.forwardRef(
|
|
250
253
|
({ className: r, value: e, children: o, ...t }, s) => {
|
|
251
|
-
const { value: i, registerStep: d, unregisterStep:
|
|
252
|
-
return a.useEffect(() => (d(e), () =>
|
|
254
|
+
const { value: i, registerStep: d, unregisterStep: f } = W();
|
|
255
|
+
return a.useEffect(() => (d(e), () => f(e)), [e, d, f]), i !== e ? null : /* @__PURE__ */ n("div", { ref: s, className: p(r), "data-step": e, ...t, children: o });
|
|
253
256
|
}
|
|
254
257
|
);
|
|
255
258
|
A.displayName = "WizardStep";
|
|
@@ -261,7 +264,7 @@ const B = a.forwardRef(
|
|
|
261
264
|
{
|
|
262
265
|
ref: t,
|
|
263
266
|
className: p(
|
|
264
|
-
"relative z-10 mt-auto flex shrink-0 items-center justify-between bg-canvas-elevated pt-6 pb-[27px] transition-[box-shadow,border-color] duration-200",
|
|
267
|
+
"relative z-10 mt-auto flex shrink-0 items-center justify-between bg-canvas-elevated pt-6 pb-[27px] px-6 sm:px-10 md:px-16 lg:px-20 xl:px-[60px] 2xl:px-[190px] transition-[box-shadow,border-color] duration-200",
|
|
265
268
|
s.bottom && "border-t border-stroke-hairline shadow-elevation-wizard-footer",
|
|
266
269
|
r
|
|
267
270
|
),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import { ChevronRight as W } from "impact-nova-icons";
|
|
4
4
|
import { useVirtualizer as j } from "@tanstack/react-virtual";
|
|
@@ -8,25 +8,25 @@ import { useImpactNovaI18n as T } from "../../../i18n/use-impact-nova-i18n.js";
|
|
|
8
8
|
function $({
|
|
9
9
|
className: N,
|
|
10
10
|
items: d,
|
|
11
|
-
renderItem:
|
|
11
|
+
renderItem: R,
|
|
12
12
|
scrollStep: p = 200,
|
|
13
13
|
hideScrollbar: u = !0,
|
|
14
14
|
controlsPosition: v = "right",
|
|
15
15
|
renderPrevious: x,
|
|
16
16
|
renderNext: g,
|
|
17
|
-
maxWidth:
|
|
17
|
+
maxWidth: L = "100%",
|
|
18
18
|
estimateSize: m = 200,
|
|
19
|
-
overscan:
|
|
19
|
+
overscan: C = 5,
|
|
20
20
|
...B
|
|
21
21
|
}, E) {
|
|
22
|
-
const { t:
|
|
22
|
+
const { t: w } = T(), r = n.useRef(null), [o, H] = n.useState(!1), [s, I] = n.useState(!1);
|
|
23
23
|
n.useImperativeHandle(E, () => r.current);
|
|
24
24
|
const c = j({
|
|
25
25
|
count: d.length,
|
|
26
26
|
getScrollElement: () => r.current,
|
|
27
27
|
estimateSize: typeof m == "function" ? m : () => m,
|
|
28
28
|
horizontal: !0,
|
|
29
|
-
overscan:
|
|
29
|
+
overscan: C
|
|
30
30
|
}), V = c.getTotalSize(), f = n.useCallback(() => {
|
|
31
31
|
const e = r.current;
|
|
32
32
|
e && (H(e.scrollLeft > 0), I(
|
|
@@ -37,27 +37,23 @@ function $({
|
|
|
37
37
|
const e = r.current;
|
|
38
38
|
if (!e) return;
|
|
39
39
|
f();
|
|
40
|
-
const
|
|
41
|
-
e.addEventListener("scroll",
|
|
42
|
-
const
|
|
40
|
+
const t = () => f();
|
|
41
|
+
e.addEventListener("scroll", t);
|
|
42
|
+
const a = new ResizeObserver(() => {
|
|
43
43
|
f();
|
|
44
44
|
});
|
|
45
|
-
return
|
|
46
|
-
e.removeEventListener("scroll",
|
|
45
|
+
return a.observe(e), () => {
|
|
46
|
+
e.removeEventListener("scroll", t), a.disconnect();
|
|
47
47
|
};
|
|
48
48
|
}, [f, d, V]);
|
|
49
|
-
const
|
|
49
|
+
const z = () => {
|
|
50
50
|
r.current?.scrollBy({ left: -p, behavior: "smooth" });
|
|
51
|
-
},
|
|
51
|
+
}, b = () => {
|
|
52
52
|
r.current?.scrollBy({ left: p, behavior: "smooth" });
|
|
53
|
-
}, S = ({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}) => {
|
|
58
|
-
if (i) return null;
|
|
59
|
-
const k = b(e === "left" ? "horizontalScroller.scrollLeft" : "horizontalScroller.scrollRight");
|
|
60
|
-
return /* @__PURE__ */ a(
|
|
53
|
+
}, S = (e, t, a) => {
|
|
54
|
+
if (a) return null;
|
|
55
|
+
const k = w(e === "left" ? "horizontalScroller.scrollLeft" : "horizontalScroller.scrollRight");
|
|
56
|
+
return /* @__PURE__ */ i(
|
|
61
57
|
O,
|
|
62
58
|
{
|
|
63
59
|
variant: "ghost",
|
|
@@ -65,67 +61,53 @@ function $({
|
|
|
65
61
|
className: h(
|
|
66
62
|
"h-8 w-8 rounded-md bg-canvas-muted text-content-tertiary hover:bg-brand-tint hover:text-brand"
|
|
67
63
|
),
|
|
68
|
-
onClick:
|
|
69
|
-
disabled:
|
|
64
|
+
onClick: t,
|
|
65
|
+
disabled: a,
|
|
70
66
|
"aria-label": k,
|
|
71
67
|
"data-component": e === "left" ? "horizontal-scroller-prev" : "horizontal-scroller-next",
|
|
72
68
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ l(
|
|
74
70
|
W,
|
|
75
71
|
{
|
|
76
72
|
className: h("h-4 w-4", e === "left" && "rotate-180")
|
|
77
73
|
}
|
|
78
74
|
),
|
|
79
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ l("span", { className: "sr-only", children: k })
|
|
80
76
|
]
|
|
81
77
|
}
|
|
82
78
|
);
|
|
83
79
|
}, y = (() => {
|
|
84
|
-
const e = x ? x({ onClick:
|
|
85
|
-
S,
|
|
86
|
-
{
|
|
87
|
-
direction: "left",
|
|
88
|
-
onClick: w,
|
|
89
|
-
disabled: !o
|
|
90
|
-
}
|
|
91
|
-
), l = g ? g({ onClick: z, disabled: !s }) : /* @__PURE__ */ t(
|
|
92
|
-
S,
|
|
93
|
-
{
|
|
94
|
-
direction: "right",
|
|
95
|
-
onClick: z,
|
|
96
|
-
disabled: !s
|
|
97
|
-
}
|
|
98
|
-
);
|
|
80
|
+
const e = x ? x({ onClick: z, disabled: !o }) : S("left", z, !o), t = g ? g({ onClick: b, disabled: !s }) : S("right", b, !s);
|
|
99
81
|
return v === "split" ? {
|
|
100
|
-
left: o ? /* @__PURE__ */
|
|
101
|
-
right: s ? /* @__PURE__ */
|
|
82
|
+
left: o ? /* @__PURE__ */ l("div", { className: "flex-shrink-0", children: e }) : null,
|
|
83
|
+
right: s ? /* @__PURE__ */ l("div", { className: "flex-shrink-0", children: t }) : null
|
|
102
84
|
} : v === "left" ? {
|
|
103
|
-
left: o || s ? /* @__PURE__ */
|
|
85
|
+
left: o || s ? /* @__PURE__ */ i("div", { className: "flex-shrink-0 flex items-center gap-1", children: [
|
|
104
86
|
e,
|
|
105
|
-
|
|
87
|
+
t
|
|
106
88
|
] }) : null,
|
|
107
89
|
right: null
|
|
108
90
|
} : {
|
|
109
91
|
left: null,
|
|
110
|
-
right: o || s ? /* @__PURE__ */
|
|
92
|
+
right: o || s ? /* @__PURE__ */ i("div", { className: "flex-shrink-0 flex items-center gap-1", children: [
|
|
111
93
|
e,
|
|
112
|
-
|
|
94
|
+
t
|
|
113
95
|
] }) : null
|
|
114
96
|
};
|
|
115
97
|
})();
|
|
116
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ i(
|
|
117
99
|
"div",
|
|
118
100
|
{
|
|
119
101
|
className: h(
|
|
120
102
|
"flex items-center gap-2 min-w-0 w-full bg-transparent",
|
|
121
103
|
N
|
|
122
104
|
),
|
|
123
|
-
style: { maxWidth:
|
|
105
|
+
style: { maxWidth: L },
|
|
124
106
|
"data-component": "horizontal-scroller",
|
|
125
107
|
...B,
|
|
126
108
|
children: [
|
|
127
109
|
y.left,
|
|
128
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ l(
|
|
129
111
|
"div",
|
|
130
112
|
{
|
|
131
113
|
ref: r,
|
|
@@ -140,7 +122,7 @@ function $({
|
|
|
140
122
|
msOverflowStyle: u ? "none" : "auto"
|
|
141
123
|
},
|
|
142
124
|
"data-component": "horizontal-scroller-viewport",
|
|
143
|
-
children: /* @__PURE__ */
|
|
125
|
+
children: /* @__PURE__ */ i(
|
|
144
126
|
"div",
|
|
145
127
|
{
|
|
146
128
|
style: {
|
|
@@ -149,7 +131,7 @@ function $({
|
|
|
149
131
|
position: "relative"
|
|
150
132
|
},
|
|
151
133
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ l(
|
|
153
135
|
"div",
|
|
154
136
|
{
|
|
155
137
|
style: {
|
|
@@ -158,13 +140,13 @@ function $({
|
|
|
158
140
|
}
|
|
159
141
|
}
|
|
160
142
|
),
|
|
161
|
-
c.getVirtualItems().map((e) => /* @__PURE__ */
|
|
143
|
+
c.getVirtualItems().map((e) => /* @__PURE__ */ l(
|
|
162
144
|
"div",
|
|
163
145
|
{
|
|
164
146
|
ref: c.measureElement,
|
|
165
147
|
"data-index": e.index,
|
|
166
148
|
className: "flex-shrink-0",
|
|
167
|
-
children:
|
|
149
|
+
children: R(d[e.index], e.index)
|
|
168
150
|
},
|
|
169
151
|
e.key
|
|
170
152
|
))
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { FieldDependency, FieldVisibilityBase, FormValuesSnapshot } from './types';
|
|
2
2
|
export declare function collectFieldDependencyIds(field: FieldVisibilityBase): string[];
|
|
3
3
|
export declare function computeIsFieldVisible(field: FieldVisibilityBase, formValues: FormValuesSnapshot): boolean;
|
|
4
|
-
export declare function computeIsFieldDisabled(field: FieldVisibilityBase, formValues: FormValuesSnapshot
|
|
5
|
-
isCascadingDisabled?: (field: FieldVisibilityBase) => boolean;
|
|
6
|
-
}): boolean;
|
|
7
|
-
export declare function computeIsCascadingDisabled(field: FieldVisibilityBase, formValues: FormValuesSnapshot, isCascadingEnabled: boolean): boolean;
|
|
4
|
+
export declare function computeIsFieldDisabled(field: FieldVisibilityBase, formValues: FormValuesSnapshot): boolean;
|
|
8
5
|
export declare function getDependentFieldIds(allFields: FieldVisibilityBase[], changedFieldName: string): string[];
|
|
9
6
|
export declare function buildCascadeParentFormState(cascadingDependency: FieldDependency[] | undefined, formValues: FormValuesSnapshot): Record<string, unknown> | null;
|
|
10
7
|
export declare function collectFormWatchFieldIds(fields: FieldVisibilityBase[]): string[];
|
|
@@ -1,90 +1,86 @@
|
|
|
1
1
|
import { isEmptyValue as l } from "./is-empty-value.js";
|
|
2
|
-
function
|
|
2
|
+
function u(n) {
|
|
3
3
|
const t = /* @__PURE__ */ new Set();
|
|
4
|
-
return
|
|
5
|
-
t.add(
|
|
6
|
-
}),
|
|
7
|
-
t.add(
|
|
8
|
-
}),
|
|
9
|
-
t.add(
|
|
4
|
+
return n.visibilityDependency?.forEach((e) => {
|
|
5
|
+
t.add(e.fieldId);
|
|
6
|
+
}), n.disableDependency?.forEach((e) => {
|
|
7
|
+
t.add(e.fieldId);
|
|
8
|
+
}), n.cascadingDependency?.forEach((e) => {
|
|
9
|
+
t.add(e.fieldId);
|
|
10
10
|
}), Array.from(t);
|
|
11
11
|
}
|
|
12
|
-
function d(
|
|
13
|
-
return !
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return e.value === null ? !l(n) : e.value === "__empty__" ? l(n) : typeof n == "boolean" ? n === (e.value === "true") : Array.isArray(n) ? n.some((r) => typeof r == "object" && r?.value === e.value ? !0 : typeof r == "string" && r === e.value) : typeof n == "object" && n !== null && "value" in n ? n.value === e.value : n === e.value;
|
|
12
|
+
function d(n, t) {
|
|
13
|
+
return !n.visibilityDependency || n.visibilityDependency.length === 0 ? !0 : n.visibilityDependency.every((e) => {
|
|
14
|
+
const r = t[e.fieldId];
|
|
15
|
+
return e.value === "__empty__" ? l(r) : r === e.value;
|
|
16
|
+
});
|
|
18
17
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
) : e.disableDependency.some(
|
|
23
|
-
(i) => u(i, t)
|
|
24
|
-
)) || n?.isCascadingDisabled?.(e));
|
|
18
|
+
function o(n, t) {
|
|
19
|
+
const e = t[n.fieldId];
|
|
20
|
+
return n.value === null ? !l(e) : n.value === "__empty__" ? l(e) : typeof e == "boolean" ? e === (n.value === "true") : Array.isArray(e) ? e.some((r) => typeof r == "object" && r?.value === n.value ? !0 : typeof r == "string" && r === n.value) : typeof e == "object" && e !== null && "value" in e ? e.value === n.value : e === n.value;
|
|
25
21
|
}
|
|
26
|
-
function
|
|
27
|
-
return !n ||
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
function s(n, t) {
|
|
23
|
+
return !!(!d(n, t) || n.isDisabled || n.disableDependency && n.disableDependency.length > 0 && (n.disableDependencyMode === "every" ? n.disableDependency.every(
|
|
24
|
+
(r) => o(r, t)
|
|
25
|
+
) : n.disableDependency.some(
|
|
26
|
+
(r) => o(r, t)
|
|
27
|
+
)));
|
|
31
28
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
34
|
-
(
|
|
29
|
+
function f(n, t) {
|
|
30
|
+
return n.filter(
|
|
31
|
+
(e) => e.cascadingDependency?.some(
|
|
35
32
|
(r) => r.fieldId === t
|
|
36
33
|
)
|
|
37
|
-
).map((
|
|
34
|
+
).map((e) => e.id);
|
|
38
35
|
}
|
|
39
|
-
function
|
|
40
|
-
if (!
|
|
36
|
+
function y(n, t) {
|
|
37
|
+
if (!n || n.length === 0)
|
|
41
38
|
return null;
|
|
42
|
-
const
|
|
43
|
-
for (const r of
|
|
39
|
+
const e = {};
|
|
40
|
+
for (const r of n) {
|
|
44
41
|
const i = t[r.fieldId];
|
|
45
|
-
i == null || i === "" || Array.isArray(i) && i.length === 0 || (
|
|
42
|
+
i == null || i === "" || Array.isArray(i) && i.length === 0 || (e[r.fieldId] = i);
|
|
46
43
|
}
|
|
47
|
-
return Object.keys(
|
|
44
|
+
return Object.keys(e).length > 0 ? e : null;
|
|
48
45
|
}
|
|
49
|
-
function
|
|
46
|
+
function c(n) {
|
|
50
47
|
const t = /* @__PURE__ */ new Set();
|
|
51
|
-
for (const
|
|
52
|
-
|
|
53
|
-
for (const r of
|
|
48
|
+
for (const e of n) {
|
|
49
|
+
e.doNotIncludeInSubmit || t.add(e.id);
|
|
50
|
+
for (const r of u(e))
|
|
54
51
|
t.add(r);
|
|
55
52
|
}
|
|
56
53
|
return Array.from(t);
|
|
57
54
|
}
|
|
58
|
-
function b(
|
|
59
|
-
return
|
|
55
|
+
function b(n) {
|
|
56
|
+
return c(n);
|
|
60
57
|
}
|
|
61
|
-
function
|
|
58
|
+
function p(n) {
|
|
62
59
|
const t = /* @__PURE__ */ new Set();
|
|
63
|
-
for (const
|
|
64
|
-
t.add(
|
|
65
|
-
for (const r of
|
|
60
|
+
for (const e of n) {
|
|
61
|
+
t.add(e.id);
|
|
62
|
+
for (const r of u(e))
|
|
66
63
|
t.add(r);
|
|
67
64
|
}
|
|
68
65
|
return Array.from(t);
|
|
69
66
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
72
|
-
(r) => !!t[r.id] && d(r,
|
|
67
|
+
function I(n, t, e) {
|
|
68
|
+
return n.some(
|
|
69
|
+
(r) => !!t[r.id] && d(r, e)
|
|
73
70
|
);
|
|
74
71
|
}
|
|
75
|
-
function
|
|
76
|
-
return
|
|
72
|
+
function v(n, t) {
|
|
73
|
+
return n.filter((e) => d(e, t)).map((e) => e.id);
|
|
77
74
|
}
|
|
78
75
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
y as buildCascadeParentFormState,
|
|
77
|
+
u as collectFieldDependencyIds,
|
|
81
78
|
b as collectFilterSidebarWatchFieldIds,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
f as computeIsCascadingDisabled,
|
|
79
|
+
c as collectFormWatchFieldIds,
|
|
80
|
+
p as collectSectionWatchFieldIds,
|
|
81
|
+
v as collectVisibleFieldIds,
|
|
86
82
|
s as computeIsFieldDisabled,
|
|
87
83
|
d as computeIsFieldVisible,
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
f as getDependentFieldIds,
|
|
85
|
+
I as hasVisibleFieldErrors
|
|
90
86
|
};
|