@nice2dev/ui 1.4.19 → 1.4.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/NiceGantt-Drl4gvw9.cjs +1 -0
  3. package/dist/{NiceGantt.doc-B6YZcJvG.cjs → NiceGantt.doc-DTv0r7bP.cjs} +2 -2
  4. package/dist/NiceModuleLifecyclePanel-jckyVqqt.cjs +1 -0
  5. package/dist/NiceWindow-DQyf5wat.cjs +1 -0
  6. package/dist/{core-lazy-BhQxFuLf.cjs → core-lazy-DirbU7jp.cjs} +1 -1
  7. package/dist/display/NiceDocumentApprovalFlow.mjs +67 -89
  8. package/dist/display/NiceLeaderboard.mjs +47 -40
  9. package/dist/display/NiceQuestCard.mjs +93 -76
  10. package/dist/docs/NiceGantt.doc.json.mjs +9 -9
  11. package/dist/documentation/utils.mjs +1 -1
  12. package/dist/index.cjs +94 -94
  13. package/dist/index.d.ts +58 -2
  14. package/dist/index.mjs +778 -776
  15. package/dist/navigation/NiceMenu.mjs +249 -248
  16. package/dist/navigation.cjs +1 -1
  17. package/dist/navigation.d.ts +6 -0
  18. package/dist/overlays/NiceResponsiveBox.mjs +51 -24
  19. package/dist/overlays/NiceTutorial.mjs +136 -127
  20. package/dist/overlays.cjs +1 -1
  21. package/dist/overlays.d.ts +25 -2
  22. package/dist/planning/NiceGantt.mjs +130 -121
  23. package/dist/planning/NiceStepper.mjs +36 -35
  24. package/dist/style.css +2 -2
  25. package/dist/tools/NiceDraggable.mjs +44 -29
  26. package/dist/tools/NiceSortable.mjs +66 -48
  27. package/dist/tools/NiceSpeechToText.mjs +67 -52
  28. package/dist/tools/NiceValidationBuilder.mjs +210 -119
  29. package/dist/tools/NiceViewRegistry.mjs +67 -34
  30. package/package.json +4 -4
  31. package/dist/NiceBottomSheet.doc-keq-Fzlz.cjs +0 -8
  32. package/dist/NiceGantt-BygumlaY.cjs +0 -1
  33. package/dist/NiceModuleLifecyclePanel-DAIbzfZd.cjs +0 -1
  34. package/dist/NiceWindow-BklnkBpu.cjs +0 -1
  35. package/dist/docs/NiceBottomSheet.doc.json.mjs +0 -32
@@ -1,20 +1,20 @@
1
- import { jsxs as l, jsx as s } from "react/jsx-runtime";
2
- import { useNiceTranslation as J, useNiceAccessMode as ue, clickOnActivationKey as _e } from "@nice2dev/ui-core";
3
- import { useState as K, useRef as A, useEffect as P, useMemo as T, useCallback as z } from "react";
4
- const fe = [], b = (m, N) => {
5
- const y = new Date(m);
6
- return y.setDate(y.getDate() + N), y;
7
- }, E = (m, N) => Math.ceil((N.getTime() - m.getTime()) / 864e5), ge = ({
8
- tasks: m = fe,
9
- columns: N,
10
- scale: y = "day",
11
- rowHeight: _ = 36,
12
- dayWidth: q = 30,
13
- onTaskClick: x,
14
- onTaskUpdate: w,
1
+ import { jsxs as m, jsx as s } from "react/jsx-runtime";
2
+ import { useNiceTranslation as J, useNiceAccessMode as le, clickOnActivationKey as he } from "@nice2dev/ui-core";
3
+ import { useState as K, useRef as W, useEffect as P, useMemo as T, useCallback as A } from "react";
4
+ const ue = [], p = (_, w) => {
5
+ const D = new Date(_);
6
+ return D.setDate(D.getDate() + w), D;
7
+ }, y = (_, w) => Math.ceil((w.getTime() - _.getTime()) / 864e5), me = ({
8
+ tasks: _ = ue,
9
+ columns: w,
10
+ scale: D = "day",
11
+ rowHeight: f = 36,
12
+ dayWidth: Y = 30,
13
+ onTaskClick: M,
14
+ onTaskUpdate: b,
15
15
  showDependencies: G = !0,
16
16
  dependencyStyle: V = "square",
17
- draggable: M,
17
+ draggable: N,
18
18
  zoomControls: Z,
19
19
  className: H,
20
20
  style: k,
@@ -22,64 +22,64 @@ const fe = [], b = (m, N) => {
22
22
  id: ee,
23
23
  "data-testid": te
24
24
  }) => {
25
- const { t: ne } = J(), ae = ue(U, ee) === "hidden", { t: pe } = J(), [o, B] = K(q), [f, j] = K(null), S = N || [
25
+ const { t: ne } = J(), ae = le(U, ee) === "hidden", { t: fe } = J(), [d, z] = K(Y), [v, R] = K(null), E = w || [
26
26
  { field: "title", title: ne("gantt.task", "Task"), width: 200 }
27
- ], I = S.reduce((e, t) => e + (t.width || 120), 0), X = A(null), C = A(null), W = A(!1);
27
+ ], j = E.reduce((e, t) => e + (t.width || 120), 0), B = W(null), I = W(null), x = W(!1);
28
28
  P(() => {
29
- const e = X.current, t = C.current;
29
+ const e = B.current, t = I.current;
30
30
  if (!e || !t)
31
31
  return;
32
- const a = (c, i) => () => {
33
- W.current || (W.current = !0, i.scrollTop = c.scrollTop, requestAnimationFrame(() => {
34
- W.current = !1;
32
+ const a = (o, i) => () => {
33
+ x.current || (x.current = !0, i.scrollTop = o.scrollTop, requestAnimationFrame(() => {
34
+ x.current = !1;
35
35
  }));
36
36
  }, n = a(e, t), r = a(t, e);
37
37
  return e.addEventListener("scroll", n, { passive: !0 }), t.addEventListener("scroll", r, { passive: !0 }), () => {
38
38
  e.removeEventListener("scroll", n), t.removeEventListener("scroll", r);
39
39
  };
40
40
  }, []);
41
- const d = T(() => {
42
- const e = (t) => m.filter((n) => (n.parentId ?? null) === t).flatMap((n) => [n, ...e(n.id)]);
41
+ const h = T(() => {
42
+ const e = (t) => _.filter((n) => (n.parentId ?? null) === t).flatMap((n) => [n, ...e(n.id)]);
43
43
  return e(null);
44
- }, [m]), u = T(() => {
45
- if (d.length === 0)
44
+ }, [_]), g = T(() => {
45
+ if (h.length === 0)
46
46
  return { start: /* @__PURE__ */ new Date(), end: /* @__PURE__ */ new Date(), days: 30 };
47
- let e = new Date(d[0].start), t = new Date(d[0].end);
48
- return d.forEach((a) => {
47
+ let e = new Date(h[0].start), t = new Date(h[0].end);
48
+ return h.forEach((a) => {
49
49
  new Date(a.start) < e && (e = new Date(a.start)), new Date(a.end) > t && (t = new Date(a.end));
50
- }), e = b(e, -2), t = b(t, 2), { start: e, end: t, days: E(e, t) };
51
- }, [d]), O = u.days * o;
50
+ }), e = p(e, -2), t = p(t, 2), { start: e, end: t, days: y(e, t) };
51
+ }, [h]), X = g.days * d;
52
52
  P(() => {
53
- if (!f || !w)
53
+ if (!v || !b)
54
54
  return;
55
55
  const e = (a) => {
56
- const n = a.clientX - f.startX, r = Math.round(n / o);
56
+ const n = a.clientX - v.startX, r = Math.round(n / d);
57
57
  if (r === 0)
58
58
  return;
59
- const c = m.find((i) => i.id === f.taskId);
60
- if (c)
61
- if (f.mode === "move")
62
- w({
63
- ...c,
64
- start: b(f.origStart, r),
65
- end: b(f.origEnd, r)
59
+ const o = _.find((i) => i.id === v.taskId);
60
+ if (o)
61
+ if (v.mode === "move")
62
+ b({
63
+ ...o,
64
+ start: p(v.origStart, r),
65
+ end: p(v.origEnd, r)
66
66
  });
67
67
  else {
68
- const i = b(f.origEnd, r);
69
- i > f.origStart && w({ ...c, end: i });
68
+ const i = p(v.origEnd, r);
69
+ i > v.origStart && b({ ...o, end: i });
70
70
  }
71
- }, t = () => j(null);
71
+ }, t = () => R(null);
72
72
  return document.addEventListener("mousemove", e), document.addEventListener("mouseup", t), () => {
73
73
  document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", t);
74
74
  };
75
- }, [f, o, m, w]);
76
- const Q = z(
75
+ }, [v, d, _, b]);
76
+ const C = A(
77
77
  (e, t, a) => {
78
- if (!M || !w)
78
+ if (!N || !b)
79
79
  return;
80
80
  a.stopPropagation();
81
- const n = m.find((r) => r.id === e);
82
- n && j({
81
+ const n = _.find((r) => r.id === e);
82
+ n && R({
83
83
  taskId: e,
84
84
  mode: t,
85
85
  startX: a.clientX,
@@ -87,10 +87,10 @@ const fe = [], b = (m, N) => {
87
87
  origEnd: new Date(n.end)
88
88
  });
89
89
  },
90
- [M, m, w]
91
- ), re = z(() => B((e) => Math.min(100, e + 5)), []), se = z(() => B((e) => Math.max(8, e - 5)), []), ie = () => {
90
+ [N, _, b]
91
+ ), re = A(() => z((e) => Math.min(100, e + 5)), []), se = A(() => z((e) => Math.max(8, e - 5)), []), ie = () => {
92
92
  const e = [], t = [];
93
- new Date(u.start);
93
+ new Date(g.start);
94
94
  const a = [
95
95
  "Jan",
96
96
  "Feb",
@@ -105,16 +105,16 @@ const fe = [], b = (m, N) => {
105
105
  "Nov",
106
106
  "Dec"
107
107
  ];
108
- if (y === "day") {
108
+ if (D === "day") {
109
109
  let n = -1, r = 0;
110
- for (let c = 0; c < u.days; c++) {
111
- const i = b(u.start, c);
110
+ for (let o = 0; o < g.days; o++) {
111
+ const i = p(g.start, o);
112
112
  i.getMonth() !== n && (n >= 0 && e.push(
113
- /* @__PURE__ */ l(
113
+ /* @__PURE__ */ m(
114
114
  "div",
115
115
  {
116
116
  className: "nice-gantt__header-cell",
117
- style: { width: (c - r) * o },
117
+ style: { width: (o - r) * d },
118
118
  children: [
119
119
  a[n],
120
120
  " ",
@@ -123,17 +123,17 @@ const fe = [], b = (m, N) => {
123
123
  },
124
124
  `m${n}-${r}`
125
125
  )
126
- ), n = i.getMonth(), r = c);
127
- const h = i.getDay() === 0 || i.getDay() === 6;
126
+ ), n = i.getMonth(), r = o);
127
+ const c = i.getDay() === 0 || i.getDay() === 6;
128
128
  t.push(
129
129
  /* @__PURE__ */ s(
130
130
  "div",
131
131
  {
132
- className: `nice-gantt__header-cell nice-gantt__header-cell--sub ${h ? "nice-gantt__header-cell--weekend" : ""}`,
133
- style: { width: o },
132
+ className: `nice-gantt__header-cell nice-gantt__header-cell--sub ${c ? "nice-gantt__header-cell--weekend" : ""}`,
133
+ style: { width: d },
134
134
  children: i.getDate()
135
135
  },
136
- c
136
+ o
137
137
  )
138
138
  );
139
139
  }
@@ -142,44 +142,44 @@ const fe = [], b = (m, N) => {
142
142
  "div",
143
143
  {
144
144
  className: "nice-gantt__header-cell",
145
- style: { width: (u.days - r) * o },
145
+ style: { width: (g.days - r) * d },
146
146
  children: a[n]
147
147
  },
148
148
  `m${n}-last`
149
149
  )
150
150
  );
151
151
  }
152
- return /* @__PURE__ */ l("div", { className: "nice-gantt__chart-header", children: [
152
+ return /* @__PURE__ */ m("div", { className: "nice-gantt__chart-header", children: [
153
153
  /* @__PURE__ */ s("div", { className: "nice-gantt__header-row", children: e }),
154
154
  /* @__PURE__ */ s("div", { className: "nice-gantt__header-row", children: t })
155
155
  ] });
156
156
  }, ce = (e, t) => {
157
- const a = E(u.start, new Date(e.start)) * o, n = Math.max(E(new Date(e.start), new Date(e.end)) * o, o), r = t * _ + 4, c = _ - 8, i = e.progress ?? 0;
158
- return /* @__PURE__ */ l(
157
+ const a = y(g.start, new Date(e.start)) * d, n = Math.max(y(new Date(e.start), new Date(e.end)) * d, d), r = t * f + 4, o = f - 8, i = e.progress ?? 0;
158
+ return /* @__PURE__ */ m(
159
159
  "div",
160
160
  {
161
- role: x ? "button" : void 0,
162
- tabIndex: x ? 0 : void 0,
163
- onKeyDown: x ? _e : void 0,
164
- className: `nice-gantt__bar ${M ? "nice-gantt__bar--draggable" : ""}`,
161
+ role: M ? "button" : void 0,
162
+ tabIndex: M ? 0 : void 0,
163
+ onKeyDown: M ? he : void 0,
164
+ className: `nice-gantt__bar ${N ? "nice-gantt__bar--draggable" : ""}`,
165
165
  title: `${e.title} (${Math.round(i)}%)`,
166
166
  style: {
167
167
  left: a,
168
168
  top: r,
169
169
  width: n,
170
- height: c,
170
+ height: o,
171
171
  backgroundColor: e.color || "var(--nice-color-primary, #3b82f6)"
172
172
  },
173
- onClick: () => x?.(e),
174
- onMouseDown: M ? (h) => Q(e.id, "move", h) : void 0,
173
+ onClick: () => M?.(e),
174
+ onMouseDown: N ? (c) => C(e.id, "move", c) : void 0,
175
175
  children: [
176
176
  i > 0 && /* @__PURE__ */ s("div", { className: "nice-gantt__bar-progress", style: { width: `${i}%` } }),
177
177
  /* @__PURE__ */ s("span", { className: "nice-gantt__bar-label", children: e.title }),
178
- M && /* @__PURE__ */ s(
178
+ N && /* @__PURE__ */ s(
179
179
  "div",
180
180
  {
181
181
  className: "nice-gantt__bar-resize",
182
- onMouseDown: (h) => Q(e.id, "resize", h)
182
+ onMouseDown: (c) => C(e.id, "resize", c)
183
183
  }
184
184
  )
185
185
  ]
@@ -187,44 +187,53 @@ const fe = [], b = (m, N) => {
187
187
  e.id
188
188
  );
189
189
  }, oe = (e, t, a, n, r) => {
190
- const h = e + 10, L = a - 14, R = (t + n) / 2, D = n >= t ? 1 : -1, Y = Math.abs(n - t) < 1, F = L <= h + 4, p = Y ? t : R, g = F ? Math.max(h, e + 10) : h, v = F ? Math.min(L, a - 10) : L;
191
- if (Y || !r)
192
- return [
193
- `M ${e} ${t}`,
194
- `L ${g} ${t}`,
195
- `L ${g} ${p}`,
196
- `L ${v} ${p}`,
197
- `L ${v} ${n}`,
198
- `L ${a} ${n}`
199
- ].join(" ");
200
- const le = Math.max(0, v - g), he = Math.abs(n - t), me = Math.min(he / 2 || 10, le / 2 || 10), $ = Math.max(2, Math.min(10, me));
201
- return [
190
+ const c = e + 10, l = a - 14, L = Math.abs(n - t) < 1, S = l <= c + 4;
191
+ if (L && !S)
192
+ return `M ${e} ${t} L ${a} ${n}`;
193
+ const u = L ? t + f / 2 : (t + n) / 2, O = [
202
194
  `M ${e} ${t}`,
203
- `L ${g - $} ${t}`,
204
- `Q ${g} ${t} ${g} ${t + D * $}`,
205
- `L ${g} ${p - D * $}`,
206
- `Q ${g} ${p} ${g + $} ${p}`,
207
- `L ${v - $} ${p}`,
208
- `Q ${v} ${p} ${v} ${p + D * $}`,
209
- `L ${v} ${n - D * $}`,
210
- `Q ${v} ${n} ${v + $} ${n}`,
195
+ `L ${c} ${t}`,
196
+ `L ${c} ${u}`,
197
+ `L ${l} ${u}`,
198
+ `L ${l} ${n}`,
199
+ `L ${a} ${n}`
200
+ ].join(" ");
201
+ if (!r)
202
+ return O;
203
+ const Q = u >= t ? 1 : -1, q = n >= u ? 1 : -1, F = l >= c ? 1 : -1, $ = Math.min(
204
+ 8,
205
+ 10,
206
+ Math.abs(u - t) / 2,
207
+ Math.abs(n - u) / 2,
208
+ Math.abs(l - c) / 2
209
+ );
210
+ return $ < 1 ? O : [
211
+ `M ${e} ${t}`,
212
+ `L ${c - $} ${t}`,
213
+ `Q ${c} ${t} ${c} ${t + Q * $}`,
214
+ `L ${c} ${u - Q * $}`,
215
+ `Q ${c} ${u} ${c + F * $} ${u}`,
216
+ `L ${l - F * $} ${u}`,
217
+ `Q ${l} ${u} ${l} ${u + q * $}`,
218
+ `L ${l} ${n - q * $}`,
219
+ `Q ${l} ${n} ${l + $} ${n}`,
211
220
  `L ${a} ${n}`
212
221
  ].join(" ");
213
222
  }, de = () => {
214
223
  if (!G)
215
224
  return null;
216
- const e = [], t = new Map(d.map((a, n) => [a.id, n]));
217
- return d.forEach((a) => {
225
+ const e = [], t = new Map(h.map((a, n) => [a.id, n]));
226
+ return h.forEach((a) => {
218
227
  (a.dependencies || []).forEach((n) => {
219
- const r = t.get(n), c = t.get(a.id);
220
- if (r == null || c == null)
228
+ const r = t.get(n), o = t.get(a.id);
229
+ if (r == null || o == null)
221
230
  return;
222
- const i = d[r], h = E(u.start, new Date(i.end)) * o, L = r * _ + _ / 2, R = E(u.start, new Date(a.start)) * o, D = c * _ + _ / 2;
231
+ const i = h[r], c = y(g.start, new Date(i.end)) * d, l = r * f + f / 2, L = y(g.start, new Date(a.start)) * d, S = o * f + f / 2;
223
232
  e.push(
224
233
  /* @__PURE__ */ s(
225
234
  "path",
226
235
  {
227
- d: oe(h, L, R, D, V === "rounded"),
236
+ d: oe(c, l, L, S, V === "rounded"),
228
237
  fill: "none",
229
238
  stroke: "var(--nice-text-secondary, #6b7280)",
230
239
  strokeWidth: 1.5,
@@ -236,12 +245,12 @@ const fe = [], b = (m, N) => {
236
245
  )
237
246
  );
238
247
  });
239
- }), /* @__PURE__ */ l(
248
+ }), /* @__PURE__ */ m(
240
249
  "svg",
241
250
  {
242
251
  className: "nice-gantt__deps",
243
- width: O,
244
- height: d.length * _,
252
+ width: X,
253
+ height: h.length * f,
245
254
  style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" },
246
255
  children: [
247
256
  /* @__PURE__ */ s("defs", { children: /* @__PURE__ */ s("marker", { id: "arrowhead", markerWidth: "6", markerHeight: "4", refX: "5", refY: "2", orient: "auto", children: /* @__PURE__ */ s("polygon", { points: "0 0, 6 2, 0 4", fill: "var(--nice-text-secondary, #6b7280)" }) }) }),
@@ -250,18 +259,18 @@ const fe = [], b = (m, N) => {
250
259
  }
251
260
  );
252
261
  };
253
- return ae ? null : /* @__PURE__ */ l("div", { className: `nice-gantt ${H || ""}`, style: k, "data-testid": te, children: [
254
- Z && /* @__PURE__ */ l("div", { className: "nice-gantt__zoom-controls", children: [
262
+ return ae ? null : /* @__PURE__ */ m("div", { className: `nice-gantt ${H || ""}`, style: k, "data-testid": te, children: [
263
+ Z && /* @__PURE__ */ m("div", { className: "nice-gantt__zoom-controls", children: [
255
264
  /* @__PURE__ */ s("button", { type: "button", className: "nice-btn nice-btn--sm", onClick: se, children: "−" }),
256
- /* @__PURE__ */ l("span", { className: "nice-gantt__zoom-label", children: [
257
- o,
265
+ /* @__PURE__ */ m("span", { className: "nice-gantt__zoom-label", children: [
266
+ d,
258
267
  "px"
259
268
  ] }),
260
269
  /* @__PURE__ */ s("button", { type: "button", className: "nice-btn nice-btn--sm", onClick: re, children: "+" })
261
270
  ] }),
262
- /* @__PURE__ */ l("div", { className: "nice-gantt__container", children: [
263
- /* @__PURE__ */ l("div", { className: "nice-gantt__table", style: { width: I, minWidth: I }, children: [
264
- /* @__PURE__ */ l("div", { className: "nice-gantt__table-header", children: [
271
+ /* @__PURE__ */ m("div", { className: "nice-gantt__container", children: [
272
+ /* @__PURE__ */ m("div", { className: "nice-gantt__table", style: { width: j, minWidth: j }, children: [
273
+ /* @__PURE__ */ m("div", { className: "nice-gantt__table-header", children: [
265
274
  /* @__PURE__ */ s(
266
275
  "div",
267
276
  {
@@ -270,7 +279,7 @@ const fe = [], b = (m, N) => {
270
279
  children: " "
271
280
  }
272
281
  ),
273
- /* @__PURE__ */ s("div", { className: "nice-gantt__table-header-row nice-gantt__table-header-row--sub", children: S.map((e, t) => /* @__PURE__ */ s(
282
+ /* @__PURE__ */ s("div", { className: "nice-gantt__table-header-row nice-gantt__table-header-row--sub", children: E.map((e, t) => /* @__PURE__ */ s(
274
283
  "div",
275
284
  {
276
285
  className: "nice-gantt__table-header-cell",
@@ -280,7 +289,7 @@ const fe = [], b = (m, N) => {
280
289
  t
281
290
  )) })
282
291
  ] }),
283
- /* @__PURE__ */ s("div", { className: "nice-gantt__table-body", ref: X, children: d.map((e, t) => /* @__PURE__ */ s("div", { className: "nice-gantt__table-row", style: { height: _ }, children: S.map((a, n) => /* @__PURE__ */ s(
292
+ /* @__PURE__ */ s("div", { className: "nice-gantt__table-body", ref: B, children: h.map((e, t) => /* @__PURE__ */ s("div", { className: "nice-gantt__table-row", style: { height: f }, children: E.map((a, n) => /* @__PURE__ */ s(
284
293
  "div",
285
294
  {
286
295
  className: "nice-gantt__table-cell",
@@ -290,27 +299,27 @@ const fe = [], b = (m, N) => {
290
299
  n
291
300
  )) }, e.id)) })
292
301
  ] }),
293
- /* @__PURE__ */ s("div", { className: "nice-gantt__chart", children: /* @__PURE__ */ l("div", { className: "nice-gantt__chart-body-wrap", ref: C, children: [
302
+ /* @__PURE__ */ s("div", { className: "nice-gantt__chart", children: /* @__PURE__ */ m("div", { className: "nice-gantt__chart-body-wrap", ref: I, children: [
294
303
  ie(),
295
- /* @__PURE__ */ l(
304
+ /* @__PURE__ */ m(
296
305
  "div",
297
306
  {
298
307
  className: "nice-gantt__chart-body",
299
308
  style: {
300
- width: O,
301
- height: d.length * _,
309
+ width: X,
310
+ height: h.length * f,
302
311
  position: "relative"
303
312
  },
304
313
  children: [
305
- Array.from({ length: u.days }, (e, t) => {
306
- const a = b(u.start, t), n = a.getDay() === 0 || a.getDay() === 6;
314
+ Array.from({ length: g.days }, (e, t) => {
315
+ const a = p(g.start, t), n = a.getDay() === 0 || a.getDay() === 6;
307
316
  return /* @__PURE__ */ s(
308
317
  "div",
309
318
  {
310
319
  className: `nice-gantt__gridline ${n ? "nice-gantt__gridline--weekend" : ""}`,
311
320
  style: {
312
- left: t * o,
313
- width: o,
321
+ left: t * d,
322
+ width: d,
314
323
  height: "100%",
315
324
  position: "absolute",
316
325
  top: 0
@@ -319,7 +328,7 @@ const fe = [], b = (m, N) => {
319
328
  t
320
329
  );
321
330
  }),
322
- d.map((e, t) => ce(e, t)),
331
+ h.map((e, t) => ce(e, t)),
323
332
  de()
324
333
  ]
325
334
  }
@@ -328,7 +337,7 @@ const fe = [], b = (m, N) => {
328
337
  ] })
329
338
  ] });
330
339
  };
331
- process.env.NODE_ENV !== "production" && (ge.displayName = "NiceGantt");
340
+ process.env.NODE_ENV !== "production" && (me.displayName = "NiceGantt");
332
341
  export {
333
- ge as NiceGantt
342
+ me as NiceGantt
334
343
  };
@@ -1,65 +1,66 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { useNiceTranslation as b, NiceIcon as f } from "@nice2dev/ui-core";
3
- import x from "react";
4
- const y = [], j = ({
5
- steps: s = y,
6
- activeStep: c,
7
- orientation: d = "horizontal",
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import { useNiceTranslation as g, NiceIcon as m } from "@nice2dev/ui-core";
3
+ import z from "react";
4
+ const E = [], C = ({
5
+ steps: s = E,
6
+ activeStep: r,
7
+ orientation: _ = "horizontal",
8
8
  onStepClick: a,
9
9
  allowStepClick: l = !1,
10
- showStepNumbers: _ = !0,
11
- className: m,
12
- style: h,
13
- "data-testid": N
10
+ showStepNumbers: v = !0,
11
+ className: h,
12
+ style: N,
13
+ "data-testid": u
14
14
  }) => {
15
- const { t: v } = b();
16
- return /* @__PURE__ */ i(
15
+ const { t: f } = g();
16
+ return /* @__PURE__ */ o(
17
17
  "div",
18
18
  {
19
- className: `nice-stepper nice-stepper--${d} ${m || ""}`,
20
- style: h,
21
- "data-testid": N,
19
+ className: `nice-stepper nice-stepper--${_} ${h || ""}`,
20
+ style: N,
21
+ "data-testid": u,
22
22
  children: [
23
- /* @__PURE__ */ e("div", { className: "nice-stepper__header", children: s.map((n, t) => {
24
- const r = t < c, p = t === c, u = r ? "nice-stepper__step--completed" : p ? "nice-stepper__step--active" : "";
25
- return /* @__PURE__ */ i(x.Fragment, { children: [
26
- t > 0 && /* @__PURE__ */ e(
23
+ /* @__PURE__ */ e("div", { className: "nice-stepper__header", children: s.map((t, n) => {
24
+ const d = (i, p) => i.status ?? (p < r ? "completed" : p === r ? "active" : "pending"), c = d(t, n), b = c === "completed", $ = c === "active", x = n > 0 && d(s[n - 1], n - 1) === "completed", y = c === "pending" ? "" : `nice-stepper__step--${c}`;
25
+ return /* @__PURE__ */ o(z.Fragment, { children: [
26
+ n > 0 && /* @__PURE__ */ e(
27
27
  "div",
28
28
  {
29
- className: `nice-stepper__connector ${r ? "nice-stepper__connector--completed" : ""}`
29
+ className: `nice-stepper__connector ${x ? "nice-stepper__connector--completed" : ""}`
30
30
  }
31
31
  ),
32
- /* @__PURE__ */ i(
32
+ /* @__PURE__ */ o(
33
33
  "div",
34
34
  {
35
- className: `nice-stepper__step ${u}`,
36
- "aria-current": p ? "step" : void 0,
35
+ className: `nice-stepper__step ${y}`,
36
+ "aria-current": $ ? "step" : void 0,
37
37
  ...l && {
38
38
  role: "button",
39
39
  tabIndex: 0,
40
- onClick: () => a?.(t),
41
- onKeyDown: (o) => {
42
- (o.key === "Enter" || o.key === " ") && (o.preventDefault(), a?.(t));
40
+ onClick: () => a?.(n),
41
+ onKeyDown: (i) => {
42
+ (i.key === "Enter" || i.key === " ") && (i.preventDefault(), a?.(n));
43
43
  }
44
44
  },
45
45
  style: { cursor: l ? "pointer" : void 0 },
46
46
  children: [
47
- /* @__PURE__ */ e("div", { className: "nice-stepper__indicator", children: n.icon ? n.icon : r ? /* @__PURE__ */ e(f, { name: "check", size: 14 }) : _ ? t + 1 : "" }),
48
- /* @__PURE__ */ i("div", { className: "nice-stepper__labels", children: [
49
- /* @__PURE__ */ e("div", { className: "nice-stepper__title", children: n.title }),
50
- n.subtitle && /* @__PURE__ */ e("div", { className: "nice-stepper__subtitle", children: n.subtitle }),
51
- n.optional && /* @__PURE__ */ e("div", { className: "nice-stepper__optional", children: v("optional", "Optional") })
47
+ /* @__PURE__ */ e("div", { className: "nice-stepper__indicator", children: t.icon ? t.icon : b ? /* @__PURE__ */ e(m, { name: "check", size: 14 }) : c === "error" ? /* @__PURE__ */ e(m, { name: "close", size: 14 }) : v ? n + 1 : "" }),
48
+ /* @__PURE__ */ o("div", { className: "nice-stepper__labels", children: [
49
+ /* @__PURE__ */ e("div", { className: "nice-stepper__title", children: t.title }),
50
+ t.subtitle && /* @__PURE__ */ e("div", { className: "nice-stepper__subtitle", children: t.subtitle }),
51
+ t.optional && /* @__PURE__ */ e("div", { className: "nice-stepper__optional", children: f("optional", "Optional") }),
52
+ t.description && /* @__PURE__ */ e("div", { className: "nice-stepper__description", children: t.description })
52
53
  ] })
53
54
  ]
54
55
  }
55
56
  )
56
- ] }, t);
57
+ ] }, n);
57
58
  }) }),
58
- s[c]?.content && /* @__PURE__ */ e("div", { className: "nice-stepper__content", children: s[c].content })
59
+ s[r]?.content && /* @__PURE__ */ e("div", { className: "nice-stepper__content", children: s[r].content })
59
60
  ]
60
61
  }
61
62
  );
62
63
  };
63
64
  export {
64
- j as NiceStepper
65
+ C as NiceStepper
65
66
  };