impact-nova 2.5.6 → 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-react/registry/defaultFieldRegistrations.js +36 -28
- package/dist/form-react/types/fields.types.d.ts +3 -3
- package/dist/form-react/utils/date.utils.d.ts +3 -1
- package/dist/form-react/utils/date.utils.js +84 -55
- 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 +1 -1
|
@@ -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,32 +1,40 @@
|
|
|
1
|
+
import { lazy as t, createElement as r, Suspense as l } from "react";
|
|
1
2
|
import { registerFieldType as e } from "./fieldRegistry.js";
|
|
2
|
-
import { SelectField as
|
|
3
|
-
import { ButtonsGroupField as
|
|
4
|
-
import { RadioField as
|
|
5
|
-
import { TextField as
|
|
6
|
-
import { TextAreaField as
|
|
7
|
-
import { DateRangeField as
|
|
8
|
-
import { DateInputField as
|
|
9
|
-
import { WeekRangeField as
|
|
10
|
-
import { MonthRangeField as
|
|
11
|
-
import { MultiWeekPickerField as
|
|
12
|
-
import { MultiMonthPickerField as
|
|
13
|
-
import { FileUploadField as
|
|
14
|
-
import { FillFormByPasteField as
|
|
15
|
-
import { FillFormByFileUploadField as
|
|
16
|
-
import { ChipsField as
|
|
17
|
-
import { TextFieldWithBackendValidation as
|
|
18
|
-
import { SwitchField as
|
|
19
|
-
import { CheckboxField as
|
|
20
|
-
import { LabelField as
|
|
21
|
-
import { DividerField as
|
|
22
|
-
import { DividerWithLabelField as
|
|
23
|
-
import { NumericComboboxField as
|
|
24
|
-
import { SliderRangeField as
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
3
|
+
import { SelectField as m } from "../Fields/SelectField.js";
|
|
4
|
+
import { ButtonsGroupField as d } from "../Fields/ButtonsGroupField.js";
|
|
5
|
+
import { RadioField as p } from "../Fields/RadioField.js";
|
|
6
|
+
import { TextField as a } from "../Fields/TextField.js";
|
|
7
|
+
import { TextAreaField as f } from "../Fields/TextAreaField.js";
|
|
8
|
+
import { DateRangeField as F } from "../Fields/DateRangeField.js";
|
|
9
|
+
import { DateInputField as n } from "../Fields/DateInputField.js";
|
|
10
|
+
import { WeekRangeField as _ } from "../Fields/WeekRangePicker.js";
|
|
11
|
+
import { MonthRangeField as c } from "../Fields/MonthRangeField.js";
|
|
12
|
+
import { MultiWeekPickerField as u } from "../Fields/MultiWeekPickerField.js";
|
|
13
|
+
import { MultiMonthPickerField as h } from "../Fields/MultiMonthPickerField.js";
|
|
14
|
+
import { FileUploadField as s } from "../Fields/FileUploadField.js";
|
|
15
|
+
import { FillFormByPasteField as b } from "../Fields/FillFormByPasteField.js";
|
|
16
|
+
import { FillFormByFileUploadField as x } from "../Fields/FillFormByFileUploadField.js";
|
|
17
|
+
import { ChipsField as k } from "../Fields/ChipsField.js";
|
|
18
|
+
import { TextFieldWithBackendValidation as g } from "../Fields/TextFieldWithBackendValidation.js";
|
|
19
|
+
import { SwitchField as y } from "../Fields/SwitchField.js";
|
|
20
|
+
import { CheckboxField as R } from "../Fields/CheckboxField.js";
|
|
21
|
+
import { LabelField as T } from "../Fields/LabelField.js";
|
|
22
|
+
import { DividerField as w } from "../Fields/DividerField.js";
|
|
23
|
+
import { DividerWithLabelField as v } from "../Fields/DividerWithLabelField.js";
|
|
24
|
+
import { NumericComboboxField as D } from "../Fields/NumericComboboxField.js";
|
|
25
|
+
import { SliderRangeField as B } from "../Fields/SliderRangeField.js";
|
|
26
|
+
const M = t(
|
|
27
|
+
() => import("../Fields/RichTextField.js").then((i) => ({
|
|
28
|
+
default: i.RichTextField
|
|
29
|
+
}))
|
|
30
|
+
);
|
|
31
|
+
let o = !1;
|
|
32
|
+
function ie() {
|
|
33
|
+
o || (o = !0, e("divider", w), e("divider_with_label", v), e("label", T), e("select", m), e("button_group", d), e("radio", p), e("text", a), e("numeric_combobox", D), e("text_area", f), e("date", n), e("date_range", F), e("week_range", _), e("multi_week_picker", u), e("month_range", c), e("multi_month_picker", h), e("file_upload", s), e("fill_form_by_paste", b), e("fill_form_by_file_upload", x), e("chips", k), e("text_with_backend_validation", g), e("switch", y), e("checkbox", R), e("slider_range", B), e(
|
|
34
|
+
"rich_text",
|
|
35
|
+
(i) => r(l, { fallback: null }, r(M, i))
|
|
36
|
+
));
|
|
29
37
|
}
|
|
30
38
|
export {
|
|
31
|
-
|
|
39
|
+
ie as registerDefaultFieldTypes
|
|
32
40
|
};
|
|
@@ -189,7 +189,7 @@ export type WeekRangeField = BaseField & {
|
|
|
189
189
|
maxDate?: string;
|
|
190
190
|
/** Minimum selectable start date = today + N days (0 = today, blocks past dates). */
|
|
191
191
|
minStartOffsetDays?: number;
|
|
192
|
-
/** When true,
|
|
192
|
+
/** When true, blocks weeks before the current week (minDate = current week start). */
|
|
193
193
|
disablePastWeeks?: boolean;
|
|
194
194
|
/** First month shown in the picker navigation (ISO date string). */
|
|
195
195
|
startMonth?: string;
|
|
@@ -207,9 +207,9 @@ export type WeekRangeField = BaseField & {
|
|
|
207
207
|
fiscalYearStartMonth?: number;
|
|
208
208
|
showFooter?: boolean;
|
|
209
209
|
format?: string;
|
|
210
|
-
/**
|
|
210
|
+
/** Earliest week: week start of the week N weeks before the current week (0 = current week). */
|
|
211
211
|
minWeeksOffset?: number;
|
|
212
|
-
/**
|
|
212
|
+
/** Latest week: week end of the week N weeks after the current week. */
|
|
213
213
|
maxWeeksOffset?: number;
|
|
214
214
|
dateFormat?: string;
|
|
215
215
|
};
|
|
@@ -19,13 +19,15 @@ export declare function handleDateFnsFormat(configFormat?: string): string;
|
|
|
19
19
|
export declare function formatDateByConfigFormat(d: Date, df?: string): string;
|
|
20
20
|
export declare function startOfDayDate(d: Date): Date;
|
|
21
21
|
export declare function addDaysDate(d: Date, n: number): Date;
|
|
22
|
+
type WeekRangeBoundsField = Pick<WeekRangeField, "minDate" | "maxDate" | "minStartOffsetDays" | "disablePastWeeks" | "minWeeksOffset" | "maxWeeksOffset" | "startMonth" | "endMonth" | "calendarType" | "fiscalMode" | "selectionMode" | "fiscalMonthPattern" | "fiscalYearStartMonth" | "weekStartsOn">;
|
|
22
23
|
export declare const handleMinMaxProp: (dateRangeField: DateRangeField) => {
|
|
23
24
|
minDate: Date | undefined;
|
|
24
25
|
maxDate: Date | undefined;
|
|
25
26
|
};
|
|
26
|
-
export declare const resolveWeekRangeMinMax: (weekRangeField:
|
|
27
|
+
export declare const resolveWeekRangeMinMax: (weekRangeField: WeekRangeBoundsField) => {
|
|
27
28
|
minDate: Date | undefined;
|
|
28
29
|
maxDate: Date | undefined;
|
|
29
30
|
startMonth: Date | undefined;
|
|
30
31
|
endMonth: Date | undefined;
|
|
31
32
|
};
|
|
33
|
+
export {};
|