laif-ds 1.0.2-app-data-grid.82 → 1.0.2-app-data-grid.87

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 (28) hide show
  1. package/dist/CHANGELOG.md +7 -0
  2. package/dist/_virtual/index3.js +5 -5
  3. package/dist/_virtual/index4.js +5 -5
  4. package/dist/_virtual/index5.js +4 -4
  5. package/dist/_virtual/index6.js +2 -2
  6. package/dist/_virtual/index7.js +2 -5
  7. package/dist/_virtual/index8.js +5 -2
  8. package/dist/agent-docs/adoption-report.json +3 -3
  9. package/dist/agent-docs/components/AppDataGrid.md +10 -9
  10. package/dist/agent-docs/components/DatePicker.md +1 -0
  11. package/dist/agent-docs/components/DropdownMenu.md +2 -0
  12. package/dist/agent-docs/manifest.json +6 -6
  13. package/dist/components/ui/app-data-grid/app-data-grid.js +229 -229
  14. package/dist/components/ui/app-data-grid/parts/grid-filter-chips.js +57 -47
  15. package/dist/components/ui/app-data-grid/parts/grid-filter-editor.js +48 -44
  16. package/dist/components/ui/app-data-grid/parts/grid-filter-row.js +134 -130
  17. package/dist/components/ui/app-data-grid/parts/grid-portal-container.js +14 -0
  18. package/dist/components/ui/date-picker.js +36 -34
  19. package/dist/components/ui/dropdown-menu.js +3 -3
  20. package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
  21. package/dist/index.d.ts +46 -5
  22. package/dist/node_modules/eventemitter3/index.js +1 -1
  23. package/dist/node_modules/eventemitter3/index2.js +1 -1
  24. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
  25. package/dist/node_modules/recharts/es6/util/Events.js +1 -1
  26. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  27. package/dist/node_modules/unified/lib/index.js +1 -1
  28. package/package.json +1 -1
@@ -1,81 +1,83 @@
1
1
  "use client";
2
- import { jsxs as P, jsx as c } from "react/jsx-runtime";
3
- import { useState as k, useRef as z, useLayoutEffect as W } from "react";
4
- import { designTokens as I } from "../../../design-tokens.js";
5
- import { AppSelect as j } from "../../app-select.js";
6
- import { Popover as H, PopoverTrigger as U, PopoverContent as X } from "../../popover.js";
7
- import { cn as x } from "../../../../lib/utils.js";
8
- import { gridFilterOperatorLabel as Z, getGridFilterValueArity as J } from "../grid-filter-operators.js";
9
- import { GRID_SELECT_COLUMN_ID as K } from "../grid-header-matrix.js";
10
- import { defaultGridI18n as y } from "../grid-i18n.js";
11
- import { gridFilterRowHeightClass as Q, gridFilterRowPinnedZClass as V, gridCellPaddingXClass as _, gridPinnedOffsetStyle as Y, gridFilterRowShortPlaceholderMaxWidth as ee } from "../grid-tokens.js";
12
- import { gridColumnFilterControl as te } from "../use-grid-filters.js";
13
- import { GridFilterValueEditor as re } from "./grid-filter-editor.js";
14
- const le = (r, l, n) => {
15
- const t = n.filters, e = y.filters, s = {
16
- string: t.filterRowPlaceholderString ?? e.filterRowPlaceholderString,
17
- number: t.filterRowPlaceholderNumber ?? e.filterRowPlaceholderNumber,
18
- boolean: t.filterRowPlaceholderBoolean ?? e.filterRowPlaceholderBoolean,
19
- date: t.filterRowPlaceholderDate ?? e.filterRowPlaceholderDate,
20
- datetime: t.filterRowPlaceholderDateTime ?? e.filterRowPlaceholderDateTime,
21
- list_single_select: t.filterRowPlaceholderListSingle ?? e.filterRowPlaceholderListSingle,
22
- list_multi_select: t.filterRowPlaceholderListMulti ?? e.filterRowPlaceholderListMulti
2
+ import { jsxs as x, jsx as c } from "react/jsx-runtime";
3
+ import { useState as I, useRef as j, useLayoutEffect as H } from "react";
4
+ import { designTokens as G } from "../../../design-tokens.js";
5
+ import { AppSelect as U } from "../../app-select.js";
6
+ import { Popover as X, PopoverTrigger as Z, PopoverContent as J } from "../../popover.js";
7
+ import { cn as C } from "../../../../lib/utils.js";
8
+ import { gridFilterOperatorLabel as K, getGridFilterValueArity as Q } from "../grid-filter-operators.js";
9
+ import { GRID_SELECT_COLUMN_ID as Y } from "../grid-header-matrix.js";
10
+ import { defaultGridI18n as N } from "../grid-i18n.js";
11
+ import { gridFilterRowHeightClass as ee, gridFilterRowPinnedZClass as V, gridCellPaddingXClass as _, gridPinnedOffsetStyle as re, gridFilterRowShortPlaceholderMaxWidth as te } from "../grid-tokens.js";
12
+ import { gridColumnFilterControl as le } from "../use-grid-filters.js";
13
+ import { GridFilterValueEditor as oe } from "./grid-filter-editor.js";
14
+ import { useGridPortalContainer as ie } from "./grid-portal-container.js";
15
+ const ae = (t, l, a) => {
16
+ const r = a.filters, e = N.filters, n = {
17
+ string: r.filterRowPlaceholderString ?? e.filterRowPlaceholderString,
18
+ number: r.filterRowPlaceholderNumber ?? e.filterRowPlaceholderNumber,
19
+ boolean: r.filterRowPlaceholderBoolean ?? e.filterRowPlaceholderBoolean,
20
+ date: r.filterRowPlaceholderDate ?? e.filterRowPlaceholderDate,
21
+ datetime: r.filterRowPlaceholderDateTime ?? e.filterRowPlaceholderDateTime,
22
+ list_single_select: r.filterRowPlaceholderListSingle ?? e.filterRowPlaceholderListSingle,
23
+ list_multi_select: r.filterRowPlaceholderListMulti ?? e.filterRowPlaceholderListMulti
23
24
  }, f = {
24
- number: t.filterRowPlaceholderNumberShort ?? e.filterRowPlaceholderNumberShort
25
+ number: r.filterRowPlaceholderNumberShort ?? e.filterRowPlaceholderNumberShort
25
26
  };
26
- return l < ee ? f[r] ?? s[r] : s[r];
27
- }, oe = (r, l, n, t) => {
28
- if (r === void 0 || J(l.filterType, n) === "none")
27
+ return l < te ? f[t] ?? n[t] : n[t];
28
+ }, ne = (t, l, a, r) => {
29
+ if (t === void 0 || Q(l.filterType, a) === "none")
29
30
  return "";
30
- const e = r.value;
31
+ const e = t.value;
31
32
  if (e === void 0) return "";
32
- const s = (f) => l.options.find((b) => b.value === f)?.label ?? String(f);
33
- return Array.isArray(e) ? e.map(s).join(", ") : typeof e == "boolean" ? e ? t.booleanOperators.true : t.booleanOperators.false : s(e);
34
- }, ie = (r) => {
35
- const l = r.querySelector(
33
+ const n = (f) => l.options.find((g) => g.value === f)?.label ?? String(f);
34
+ return Array.isArray(e) ? e.map(n).join(", ") : typeof e == "boolean" ? e ? r.booleanOperators.true : r.booleanOperators.false : n(e);
35
+ }, se = (t) => {
36
+ const l = t.querySelector(
36
37
  "[data-grid-filter-editor-control]"
37
38
  );
38
39
  return l === null ? null : typeof l.focus == "function" && l.tabIndex >= 0 ? l : l.querySelector('[role="combobox"]');
39
- }, ae = ({
40
- columnId: r,
40
+ }, de = ({
41
+ columnId: t,
41
42
  columnLabel: l,
42
- width: n,
43
- control: t,
43
+ width: a,
44
+ control: r,
44
45
  badge: e,
45
- onOperatorChange: s,
46
+ onOperatorChange: n,
46
47
  onValueChange: f,
47
- onClear: b,
48
- i18n: d
48
+ onClear: g,
49
+ i18n: s
49
50
  }) => {
50
- const [C, N] = k(!1), w = z(null), [o, $] = k(!1), p = t.operators[0].value, a = e?.operator ?? p, u = Z(
51
- t.filterType,
52
- a,
53
- d
54
- ), m = oe(e, t, a, d), g = m !== "", T = a === p, h = d.filters, G = h.filterBy ?? y.filters.filterBy, M = (d.table ?? y.table).expandCell, A = T ? le(t.filterType, n, d) : u, O = g ? `${u}: ${m}` : A, S = `${l} ${u}${g ? `: ${m}` : ""}`, F = `${G} ${l} — ${u}${g ? `: ${m}` : ""}`;
55
- W(() => {
51
+ const [$, T] = I(!1), w = j(null), { anchorRef: o, container: y } = ie(), [u, v] = I(!1), h = r.operators[0].value, d = e?.operator ?? h, m = K(
52
+ r.filterType,
53
+ d,
54
+ s
55
+ ), b = ne(e, r, d, s), p = b !== "", M = d === h, O = s.filters, A = O.filterBy ?? N.filters.filterBy, B = (s.table ?? N.table).expandCell, E = M ? ae(r.filterType, a, s) : m, S = p ? `${m}: ${b}` : E, F = `${l} ${m}${p ? `: ${b}` : ""}`, L = `${A} ${l} — ${m}${p ? `: ${b}` : ""}`;
56
+ H(() => {
56
57
  const i = w.current;
57
58
  if (!i) return;
58
- const v = () => {
59
- const L = i.scrollWidth > i.clientWidth;
60
- $((D) => D === L ? D : L);
59
+ const R = () => {
60
+ const D = i.scrollWidth > i.clientWidth;
61
+ v((k) => k === D ? k : D);
61
62
  };
62
- if (v(), typeof ResizeObserver > "u") return;
63
- const R = new ResizeObserver(v);
64
- return R.observe(i), () => R.disconnect();
65
- }, [O]);
66
- const B = !g, E = C, q = e !== void 0;
67
- return /* @__PURE__ */ P(H, { open: E, onOpenChange: N, modal: !1, children: [
68
- /* @__PURE__ */ c(U, { asChild: !0, children: /* @__PURE__ */ P(
63
+ if (R(), typeof ResizeObserver > "u") return;
64
+ const P = new ResizeObserver(R);
65
+ return P.observe(i), () => P.disconnect();
66
+ }, [S]);
67
+ const q = !p, z = $, W = e !== void 0;
68
+ return /* @__PURE__ */ x(X, { open: z, onOpenChange: T, modal: !1, children: [
69
+ /* @__PURE__ */ c(Z, { asChild: !0, children: /* @__PURE__ */ x(
69
70
  "button",
70
71
  {
72
+ ref: o,
71
73
  type: "button",
72
- "data-grid-filter-cell-trigger": r,
73
- "data-filter-truncated": o ? "true" : "false",
74
- title: o ? S : void 0,
75
- "aria-label": F,
76
- className: x(
77
- I.focusRing,
78
- I.radius.default,
74
+ "data-grid-filter-cell-trigger": t,
75
+ "data-filter-truncated": u ? "true" : "false",
76
+ title: u ? F : void 0,
77
+ "aria-label": L,
78
+ className: C(
79
+ G.focusRing,
80
+ G.radius.default,
79
81
  // ⚠️ `h-7` E NON `h-8` — 2026-09-10, scelta 1a del proprietario, e la
80
82
  // ragione è una misura di RITMO e non di dimensione. La cella è alta
81
83
  // 36px (`gridFilterRowHeightClass`): con un controllo da 32 restano
@@ -99,7 +101,7 @@ const le = (r, l, n) => {
99
101
  // filtrata no, che si legge come un disallineamento e non come un
100
102
  // segnale. La coppia sta in un ternario e non appesa in coda per
101
103
  // `twMerge`: il ramo giusto va scelto qui, non dedotto dall'ordine.
102
- q ? "border-d-primary" : "border-d-border"
104
+ W ? "border-d-primary" : "border-d-border"
103
105
  ),
104
106
  children: [
105
107
  /* @__PURE__ */ c(
@@ -107,52 +109,54 @@ const le = (r, l, n) => {
107
109
  {
108
110
  ref: w,
109
111
  "aria-hidden": "true",
110
- className: x(
112
+ className: C(
111
113
  "min-w-0 flex-1 truncate",
112
- B && "text-d-muted-foreground"
114
+ q && "text-d-muted-foreground"
113
115
  ),
114
- children: O
116
+ children: S
115
117
  }
116
118
  ),
117
- o && // `select-none` come in `grid-cell-text.tsx`: senza, il testo intero
119
+ u && // `select-none` come in `grid-cell-text.tsx`: senza, il testo intero
118
120
  // finirebbe DUE volte in un incolla della riga.
119
- /* @__PURE__ */ c("span", { className: "sr-only select-none", children: `${M}: ${S}` })
121
+ /* @__PURE__ */ c("span", { className: "sr-only select-none", children: `${B}: ${F}` })
120
122
  ]
121
123
  }
122
124
  ) }),
123
- /* @__PURE__ */ P(
124
- X,
125
+ /* @__PURE__ */ x(
126
+ J,
125
127
  {
126
128
  align: "start",
127
- "data-grid-filter-cell-panel": r,
128
- "aria-label": F,
129
+ container: y,
130
+ "data-grid-filter-cell-panel": t,
131
+ "aria-label": L,
129
132
  className: "flex flex-col gap-2",
130
133
  onOpenAutoFocus: (i) => {
131
- const v = i.currentTarget;
132
- if (!(v instanceof HTMLElement)) return;
133
- const R = ie(v);
134
- R !== null && (i.preventDefault(), R.focus());
134
+ const R = i.currentTarget;
135
+ if (!(R instanceof HTMLElement)) return;
136
+ const P = se(R);
137
+ P !== null && (i.preventDefault(), P.focus());
135
138
  },
136
139
  children: [
137
140
  /* @__PURE__ */ c(
138
141
  "div",
139
142
  {
140
- "data-grid-filter-cell-operator": r,
141
- "data-grid-filter-cell-type": t.filterType,
142
- "data-grid-filter-cell-operator-value": a,
143
+ "data-grid-filter-cell-operator": t,
144
+ "data-grid-filter-cell-type": r.filterType,
145
+ "data-grid-filter-cell-operator-value": d,
143
146
  className: "w-full",
144
147
  children: /* @__PURE__ */ c(
145
- j,
148
+ U,
146
149
  {
147
- options: t.operators,
148
- value: a,
150
+ options: r.operators,
151
+ value: d,
149
152
  onValueChange: (i) => {
150
- i !== void 0 && s(r, i);
153
+ i !== void 0 && n(t, i);
151
154
  },
152
- "aria-label": `${h.operator}: ${l}`,
155
+ "aria-label": `${O.operator}: ${l}`,
156
+ portalContainer: y,
153
157
  searchable: !0,
154
- searchPlaceholder: h.searchPlaceholder,
155
- emptyPlaceholder: d.notFoundMessage,
158
+ searchPlaceholder: O.searchPlaceholder,
159
+ emptyPlaceholder: s.notFoundMessage,
156
160
  size: "sm",
157
161
  className: "w-full"
158
162
  }
@@ -160,43 +164,43 @@ const le = (r, l, n) => {
160
164
  }
161
165
  ),
162
166
  /* @__PURE__ */ c(
163
- re,
167
+ oe,
164
168
  {
165
- control: t,
166
- operator: a,
169
+ control: r,
170
+ operator: d,
167
171
  value: e?.value,
168
- onValueChange: (i) => f(r, i),
169
- name: `filter-row-${r}`,
172
+ onValueChange: (i) => f(t, i),
173
+ name: `filter-row-${t}`,
170
174
  columnLabel: l,
171
175
  fullWidth: !0,
172
- onClear: b === void 0 ? void 0 : () => b(r),
176
+ onClear: g === void 0 ? void 0 : () => g(t),
173
177
  size: "sm",
174
- i18n: d
178
+ i18n: s
175
179
  }
176
180
  )
177
181
  ]
178
182
  }
179
183
  )
180
184
  ] });
181
- }, ve = ({
182
- headers: r,
185
+ }, ye = ({
186
+ headers: t,
183
187
  checkable: l,
184
- pinning: n,
185
- pinnedSlots: t,
188
+ pinning: a,
189
+ pinnedSlots: r,
186
190
  widths: e,
187
- columns: s,
191
+ columns: n,
188
192
  badges: f,
189
- contentHidden: b = !1,
190
- onOperatorChange: d,
191
- onValueChange: C,
192
- onClear: N,
193
- i18n: w = y
194
- }) => b ? null : /* @__PURE__ */ P(
193
+ contentHidden: g = !1,
194
+ onOperatorChange: s,
195
+ onValueChange: $,
196
+ onClear: T,
197
+ i18n: w = N
198
+ }) => g ? null : /* @__PURE__ */ x(
195
199
  "tr",
196
200
  {
197
201
  "data-slot": "grid-filter-row",
198
202
  "data-grid-filter-row": "",
199
- className: Q,
203
+ className: ee,
200
204
  children: [
201
205
  l && // La colonna delle spunte non si filtra: la cella esiste per tenere
202
206
  // l'allineamento con i `<col>` e non porta nessun controllo, quindi
@@ -206,39 +210,39 @@ const le = (r, l, n) => {
206
210
  /* @__PURE__ */ c(
207
211
  "td",
208
212
  {
209
- "data-grid-filter-cell": K,
210
- className: x(
213
+ "data-grid-filter-cell": Y,
214
+ className: C(
211
215
  _,
212
- n && "bg-d-background sticky",
213
- n && V
216
+ a && "bg-d-background sticky",
217
+ a && V
214
218
  ),
215
- style: n ? { left: "0px" } : void 0
219
+ style: a ? { left: "0px" } : void 0
216
220
  }
217
221
  ),
218
- r.map((o, $) => {
219
- const p = t[o.columnId], a = p !== void 0, u = s.find(
220
- (h) => h.id === o.columnId
221
- ), m = u === void 0 || !u.filterable ? void 0 : te(u, w), g = f.find(
222
- (h) => h.columnId === o.columnId
223
- ), T = $ > 0 && !(p?.edge === !0 && p.side === "right");
224
- return /* @__PURE__ */ P(
222
+ t.map((o, y) => {
223
+ const u = r[o.columnId], v = u !== void 0, h = n.find(
224
+ (p) => p.id === o.columnId
225
+ ), d = h === void 0 || !h.filterable ? void 0 : le(h, w), m = f.find(
226
+ (p) => p.columnId === o.columnId
227
+ ), b = y > 0 && !(u?.edge === !0 && u.side === "right");
228
+ return /* @__PURE__ */ x(
225
229
  "td",
226
230
  {
227
231
  "data-grid-filter-cell": o.columnId,
228
232
  "data-grid-filter-cell-label": o.headerLabel,
229
- "data-grid-filter-cell-applied": g === void 0 ? "false" : "true",
230
- className: x(
233
+ "data-grid-filter-cell-applied": m === void 0 ? "false" : "true",
234
+ className: C(
231
235
  _,
232
236
  // ⚠️ `relative` SOLO SE NON PINNATA: `sticky` è già un valore di
233
237
  // `position` e ancora da sé il trattino, mentre scriverci
234
238
  // `relative` sopra la sbloccherebbe. Le due non convivono.
235
- !a && "relative",
236
- a && "bg-d-background sticky",
237
- a && V
239
+ !v && "relative",
240
+ v && "bg-d-background sticky",
241
+ v && V
238
242
  ),
239
- style: Y(p),
243
+ style: re(u),
240
244
  children: [
241
- T && /* @__PURE__ */ c(
245
+ b && /* @__PURE__ */ c(
242
246
  "span",
243
247
  {
244
248
  "aria-hidden": "true",
@@ -246,17 +250,17 @@ const le = (r, l, n) => {
246
250
  className: "bg-d-border pointer-events-none absolute top-1/2 left-0 h-3 w-px -translate-y-1/2"
247
251
  }
248
252
  ),
249
- m !== void 0 && /* @__PURE__ */ c(
250
- ae,
253
+ d !== void 0 && /* @__PURE__ */ c(
254
+ de,
251
255
  {
252
256
  columnId: o.columnId,
253
257
  columnLabel: o.headerLabel,
254
258
  width: e[o.columnId] ?? 0,
255
- control: m,
256
- badge: g,
257
- onOperatorChange: d,
258
- onValueChange: C,
259
- onClear: N,
259
+ control: d,
260
+ badge: m,
261
+ onOperatorChange: s,
262
+ onValueChange: $,
263
+ onClear: T,
260
264
  i18n: w
261
265
  }
262
266
  )
@@ -269,5 +273,5 @@ const le = (r, l, n) => {
269
273
  }
270
274
  );
271
275
  export {
272
- ve as GridFilterRow
276
+ ye as GridFilterRow
273
277
  };
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import { useState as r, useCallback as l } from "react";
3
+ const s = (t) => t?.closest("[data-app-data-grid]") ?? null, u = () => {
4
+ const [t, o] = r(null);
5
+ return { anchorRef: l((n) => {
6
+ if (n === null) return;
7
+ const a = s(n);
8
+ o((e) => e === a ? e : a);
9
+ }, []), container: t };
10
+ };
11
+ export {
12
+ s as gridPortalContainerOf,
13
+ u as useGridPortalContainer
14
+ };
@@ -3,13 +3,13 @@ import { jsxs as f, jsx as r } from "react/jsx-runtime";
3
3
  import * as c from "react";
4
4
  import { useCallback as X, useMemo as H, useEffect as G } from "react";
5
5
  import { designTokens as l } from "../design-tokens.js";
6
- import { Calendar as J, CalendarDayButton as Ce } from "./calendar.js";
6
+ import { Calendar as J, CalendarDayButton as xe } from "./calendar.js";
7
7
  import { Icon as K } from "./icon.js";
8
- import { Label as xe } from "./label.js";
9
- import { Popover as be, PopoverTrigger as De, PopoverContent as Me } from "./popover.js";
8
+ import { Label as be } from "./label.js";
9
+ import { Popover as De, PopoverTrigger as Me, PopoverContent as Se } from "./popover.js";
10
10
  import { cn as Q } from "../../lib/utils.js";
11
11
  import { TimePickerColumn as R } from "./app-time-picker.js";
12
- import { it as Se } from "../../node_modules/date-fns/locale/it.js";
12
+ import { it as Ne } from "../../node_modules/date-fns/locale/it.js";
13
13
  import { formatDate as z } from "../../node_modules/date-fns/format.js";
14
14
  import { isSameDay as O } from "../../node_modules/date-fns/isSameDay.js";
15
15
  const W = (o) => {
@@ -17,7 +17,7 @@ const W = (o) => {
17
17
  const M = Math.trunc(o);
18
18
  return Math.min(59, Math.max(1, M));
19
19
  };
20
- function Te(o) {
20
+ function Ae(o) {
21
21
  const {
22
22
  placeholder: M = "Seleziona data",
23
23
  dateFormat: Y,
@@ -27,7 +27,7 @@ function Te(o) {
27
27
  firstDate: E,
28
28
  lastDate: F,
29
29
  availableDates: I,
30
- locale: u = Se,
30
+ locale: u = Ne,
31
31
  initialCalendarMonth: w,
32
32
  customCalendarProps: S,
33
33
  label: T,
@@ -39,32 +39,33 @@ function Te(o) {
39
39
  maxDate: _,
40
40
  numberOfMonths: oe,
41
41
  clearable: ae = !1,
42
- onClear: j
42
+ onClear: j,
43
+ portalContainer: re
43
44
  } = o, a = o.mode === "range", C = !a && o.showTime === !0, N = !a && o.withSeconds === !0, p = a ? 1 : W(o.minuteStep), k = a ? 1 : W(o.secondStep), P = Y ?? (C ? N ? "dd/MM/yyyy HH:mm:ss" : "dd/MM/yyyy HH:mm" : "dd/MM/yyyy"), [i, x] = c.useState(
44
45
  a ? void 0 : o.value
45
46
  ), [n, b] = c.useState(
46
47
  a ? o.value : void 0
47
48
  ), [L, D] = c.useState(
48
49
  w
49
- ), [B, V] = c.useState(!1), re = (e) => {
50
+ ), [B, V] = c.useState(!1), ie = (e) => {
50
51
  const t = e ? new Date(e) : void 0;
51
52
  C && t && i && t.setHours(
52
53
  i.getHours(),
53
54
  i.getMinutes(),
54
55
  i.getSeconds()
55
56
  ), x(t), t && D(t), !a && o.onChange && o.onChange(t), !C && t && V(!1);
56
- }, ie = X(() => {
57
+ }, se = X(() => {
57
58
  a ? (b(void 0), o.onChange && o.onChange(void 0)) : (x(void 0), o.onChange && o.onChange(void 0)), j?.();
58
- }, [a, o.onChange, j]), se = i?.getHours(), le = i?.getMinutes(), fe = i?.getSeconds(), de = H(
59
+ }, [a, o.onChange, j]), le = i?.getHours(), fe = i?.getMinutes(), de = i?.getSeconds(), me = H(
59
60
  () => Array.from({ length: 24 }, (e, t) => t),
60
61
  []
61
- ), me = H(
62
+ ), ce = H(
62
63
  () => Array.from(
63
64
  { length: Math.floor(59 / p) + 1 },
64
65
  (e, t) => t * p
65
66
  ),
66
67
  [p]
67
- ), ce = H(
68
+ ), ue = H(
68
69
  () => Array.from(
69
70
  { length: Math.floor(59 / k) + 1 },
70
71
  (e, t) => t * k
@@ -76,7 +77,7 @@ function Te(o) {
76
77
  i || s.setHours(0, 0, 0, 0), e === "hour" ? s.setHours(t) : e === "minute" ? s.setMinutes(t) : e === "second" && s.setSeconds(t), x(s), !a && o.onChange && o.onChange(s);
77
78
  },
78
79
  [i, a, o.onChange]
79
- ), ue = (e, t) => {
80
+ ), he = (e, t) => {
80
81
  let s;
81
82
  !n || !n.from ? s = { from: t, to: void 0 } : n.from && !n.to ? t < n.from ? s = { from: t, to: void 0 } : s = { from: n.from, to: t } : n.from && n.to && (s = { from: t, to: void 0 }), b(s), s?.from && D(s.from), a && o.onChange && o.onChange(s);
82
83
  };
@@ -104,21 +105,21 @@ function Te(o) {
104
105
  };
105
106
  return window.addEventListener("pointerup", e), () => window.removeEventListener("pointerup", e);
106
107
  }, [h, a, o.onChange, n]);
107
- const he = (e, t) => {
108
+ const ge = (e, t) => {
108
109
  !a || !n || !n.from || !n.to || (O(e, n.from) ? (g("from"), t.preventDefault()) : O(e, n.to) && (g("to"), t.preventDefault()));
109
- }, ge = (e) => {
110
+ }, ve = (e) => {
110
111
  if (!h || !n || !n.from || !n.to) return;
111
112
  let t = { ...n };
112
113
  h === "from" ? e <= n.to ? t.from = e : (t.from = n.to, t.to = e, g("to")) : h === "to" && (e >= n.from ? t.to = e : (t.to = n.from, t.from = e, g("from"))), b(t);
113
- }, ve = c.useId(), q = te ?? ve, U = a ? !!n?.from : !!i, we = () => a && n ? /* @__PURE__ */ f("span", { children: [
114
+ }, we = c.useId(), q = te ?? we, U = a ? !!n?.from : !!i, Ce = () => a && n ? /* @__PURE__ */ f("span", { children: [
114
115
  n.from && z(n.from, P, { locale: u }),
115
116
  n.from && n.to && " - ",
116
117
  n.to && z(n.to, P, { locale: u })
117
118
  ] }) : !a && i ? /* @__PURE__ */ r("span", { children: z(i, P, { locale: u }) }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: M });
118
119
  return /* @__PURE__ */ f("div", { className: Q("flex flex-col gap-1.5", ee), children: [
119
- T && /* @__PURE__ */ r(xe, { htmlFor: q, className: $, children: T }),
120
- /* @__PURE__ */ f(be, { open: d ? !1 : B, onOpenChange: V, modal: !0, children: [
121
- /* @__PURE__ */ r(De, { asChild: !0, children: /* @__PURE__ */ f(
120
+ T && /* @__PURE__ */ r(be, { htmlFor: q, className: $, children: T }),
121
+ /* @__PURE__ */ f(De, { open: d ? !1 : B, onOpenChange: V, modal: !0, children: [
122
+ /* @__PURE__ */ r(Me, { asChild: !0, children: /* @__PURE__ */ f(
122
123
  "div",
123
124
  {
124
125
  id: q,
@@ -146,14 +147,14 @@ function Te(o) {
146
147
  },
147
148
  children: [
148
149
  /* @__PURE__ */ r(K, { name: "Calendar", size: v === "lg" ? "sm" : "xs" }),
149
- /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: we() }),
150
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: Ce() }),
150
151
  ae && U && /* @__PURE__ */ r(
151
152
  "div",
152
153
  {
153
154
  role: "button",
154
155
  className: "bg-d-accent hover:bg-d-accent/80 border-d-border flex shrink-0 cursor-pointer items-center justify-center rounded-full border p-1 transition-colors",
155
156
  onClick: (e) => {
156
- e.stopPropagation(), e.preventDefault(), ie();
157
+ e.stopPropagation(), e.preventDefault(), se();
157
158
  },
158
159
  onMouseDown: (e) => e.preventDefault(),
159
160
  "aria-label": "Clear selection",
@@ -172,8 +173,9 @@ function Te(o) {
172
173
  ) }),
173
174
  " ",
174
175
  /* @__PURE__ */ f(
175
- Me,
176
+ Se,
176
177
  {
178
+ container: re,
177
179
  className: "flex max-h-[500px] min-h-0 w-auto flex-row p-0 shadow",
178
180
  align: "start",
179
181
  children: [
@@ -183,7 +185,7 @@ function Te(o) {
183
185
  ...S || {},
184
186
  mode: "range",
185
187
  selected: n,
186
- onSelect: ue,
188
+ onSelect: he,
187
189
  autoFocus: !0,
188
190
  disabled: m,
189
191
  locale: u,
@@ -194,14 +196,14 @@ function Te(o) {
194
196
  components: {
195
197
  ...S?.components,
196
198
  DayButton: (e) => /* @__PURE__ */ r(
197
- Ce,
199
+ xe,
198
200
  {
199
201
  ...e,
200
202
  onPointerDown: (t) => {
201
- e.onPointerDown && e.onPointerDown(t), he(e.day.date, t);
203
+ e.onPointerDown && e.onPointerDown(t), ge(e.day.date, t);
202
204
  },
203
205
  onPointerEnter: (t) => {
204
- e.onPointerEnter && e.onPointerEnter(t), ge(e.day.date);
206
+ e.onPointerEnter && e.onPointerEnter(t), ve(e.day.date);
205
207
  }
206
208
  }
207
209
  )
@@ -213,7 +215,7 @@ function Te(o) {
213
215
  ...S || {},
214
216
  mode: "single",
215
217
  selected: i,
216
- onSelect: re,
218
+ onSelect: ie,
217
219
  autoFocus: !0,
218
220
  disabled: m,
219
221
  locale: u,
@@ -240,8 +242,8 @@ function Te(o) {
240
242
  R,
241
243
  {
242
244
  type: "hour",
243
- value: se,
244
- options: de,
245
+ value: le,
246
+ options: me,
245
247
  onChange: (e) => y("hour", e),
246
248
  className: "flex flex-1"
247
249
  }
@@ -250,8 +252,8 @@ function Te(o) {
250
252
  R,
251
253
  {
252
254
  type: "minute",
253
- value: le,
254
- options: me,
255
+ value: fe,
256
+ options: ce,
255
257
  onChange: (e) => y("minute", e),
256
258
  className: "flex flex-1"
257
259
  }
@@ -260,8 +262,8 @@ function Te(o) {
260
262
  R,
261
263
  {
262
264
  type: "second",
263
- value: fe,
264
- options: ce,
265
+ value: de,
266
+ options: ue,
265
267
  onChange: (e) => y("second", e),
266
268
  className: "flex flex-1"
267
269
  }
@@ -275,5 +277,5 @@ function Te(o) {
275
277
  ] });
276
278
  }
277
279
  export {
278
- Te as DatePicker
280
+ Ae as DatePicker
279
281
  };
@@ -35,17 +35,17 @@ const C = n.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a(
35
35
  }
36
36
  ));
37
37
  C.displayName = w.displayName;
38
- const z = n.forwardRef(({ className: e, sideOffset: t = 4, ...o }, d) => /* @__PURE__ */ a(c, { children: /* @__PURE__ */ a(
38
+ const z = n.forwardRef(({ className: e, sideOffset: t = 4, container: o, ...d }, s) => /* @__PURE__ */ a(c, { container: o, children: /* @__PURE__ */ a(
39
39
  p,
40
40
  {
41
- ref: d,
41
+ ref: s,
42
42
  sideOffset: t,
43
43
  className: r(
44
44
  "bg-d-popover text-d-popover-foreground border-d-border z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
45
45
  "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
46
46
  e
47
47
  ),
48
- ...o
48
+ ...d
49
49
  }
50
50
  ) }));
51
51
  z.displayName = p.displayName;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as n, jsxs as b, Fragment as G } from "react/jsx-runtime";
3
- import L from "../../../../../_virtual/index7.js";
3
+ import L from "../../../../../_virtual/index8.js";
4
4
  import _ from "../../../../../_virtual/debounce3.js";
5
5
  import { useContext as j, useRef as l, useState as o, useCallback as M, useMemo as N, useEffect as a } from "react";
6
6
  import { GanttContext as O } from "../Gantt/GanttContext.js";