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,17 +1,18 @@
1
1
  "use client";
2
2
  import { jsxs as o, jsx as i, Fragment as N } from "react/jsx-runtime";
3
3
  import { designTokens as d } from "../../../design-tokens.js";
4
- import { DropdownMenu as R, DropdownMenuTrigger as A, DropdownMenuContent as E, DropdownMenuLabel as U, DropdownMenuItem as w, DropdownMenuSeparator as j } from "../../dropdown-menu.js";
4
+ import { DropdownMenu as E, DropdownMenuTrigger as G, DropdownMenuContent as U, DropdownMenuLabel as j, DropdownMenuItem as w, DropdownMenuSeparator as P } from "../../dropdown-menu.js";
5
5
  import { cn as m } from "../../../../lib/utils.js";
6
- import { gridActiveFilterCount as G } from "../grid-filter-compile.js";
7
- import { gridBadgeOperatorLabel as O, GRID_VALUELESS_OPERATORS as T } from "../grid-filter-operators.js";
6
+ import { gridActiveFilterCount as T } from "../grid-filter-compile.js";
7
+ import { gridBadgeOperatorLabel as O, GRID_VALUELESS_OPERATORS as V } from "../grid-filter-operators.js";
8
8
  import { defaultGridI18n as a } from "../grid-i18n.js";
9
- import V from "../../../../node_modules/lucide-react/dist/esm/icons/plus.js";
10
- const z = new Set(T), S = (r, l) => r.value === void 0 || z.has(r.operator) ? "" : typeof r.value == "boolean" ? r.value ? l.booleanOperators.true : l.booleanOperators.false : Array.isArray(r.value) ? r.value.map((f) => r.listOptions?.find((n) => n.value === f)?.label ?? String(f)).join(", ") : r.listOptions?.find((t) => t.value === r.value)?.label ?? String(r.value), B = (r, l) => {
9
+ import { useGridPortalContainer as z } from "./grid-portal-container.js";
10
+ import B from "../../../../node_modules/lucide-react/dist/esm/icons/plus.js";
11
+ const _ = new Set(V), S = (r, l) => r.value === void 0 || _.has(r.operator) ? "" : typeof r.value == "boolean" ? r.value ? l.booleanOperators.true : l.booleanOperators.false : Array.isArray(r.value) ? r.value.map((f) => r.listOptions?.find((n) => n.value === f)?.label ?? String(f)).join(", ") : r.listOptions?.find((t) => t.value === r.value)?.label ?? String(r.value), q = (r, l) => {
11
12
  if (r.kind === "custom") return r.customLabel ?? r.columnLabel;
12
13
  const c = S(r, l), t = O(r, l);
13
14
  return `${r.columnLabel} ${t}${c ? `: ${c}` : ""}`;
14
- }, X = ({
15
+ }, er = ({
15
16
  badges: r,
16
17
  onRemove: l,
17
18
  onClearAll: c,
@@ -21,10 +22,11 @@ const z = new Set(T), S = (r, l) => r.value === void 0 || z.has(r.operator) ? ""
21
22
  i18n: n = a,
22
23
  className: $
23
24
  }) => {
24
- const p = t?.filterCount ?? G(r), s = n.filters, g = n.pagination, C = t?.filterCountIsSingular ?? p === 1 ? s.filterOne ?? a.filters.filterOne : s.filterMany ?? a.filters.filterMany, I = t?.totalIsSingular ? g.rowOne ?? a.pagination.rowOne : g.rows;
25
+ const p = t?.filterCount ?? T(r), { anchorRef: C, container: I } = z(), s = n.filters, g = n.pagination, F = t?.filterCountIsSingular ?? p === 1 ? s.filterOne ?? a.filters.filterOne : s.filterMany ?? a.filters.filterMany, y = t?.totalIsSingular ? g.rowOne ?? a.pagination.rowOne : g.rows;
25
26
  return /* @__PURE__ */ o(
26
27
  "div",
27
28
  {
29
+ ref: C,
28
30
  "data-grid-filter-chips": "",
29
31
  "data-grid-filter-count": p,
30
32
  role: "list",
@@ -32,7 +34,7 @@ const z = new Set(T), S = (r, l) => r.value === void 0 || z.has(r.operator) ? ""
32
34
  className: m("flex flex-wrap items-center gap-1", $),
33
35
  children: [
34
36
  r.map((e) => {
35
- const u = e.kind === "custom", L = u ? "" : S(e, n), F = u ? "" : O(e, n), b = s.conditionOn ?? a.filters.conditionOn, v = e.customLabel ?? e.columnLabel, y = B(e, n), M = u ? v : `${b} ${e.columnLabel}: ${F}${L ? ` ${L}` : ""}`, D = u ? v : `${b} ${e.columnLabel}`, k = `${s.removeFilterNamed ?? a.filters.removeFilterNamed} ${v}`;
37
+ const u = e.kind === "custom", L = u ? "" : S(e, n), M = u ? "" : O(e, n), b = s.conditionOn ?? a.filters.conditionOn, v = e.customLabel ?? e.columnLabel, D = q(e, n), R = u ? v : `${b} ${e.columnLabel}: ${M}${L ? ` ${L}` : ""}`, k = u ? v : `${b} ${e.columnLabel}`, A = `${s.removeFilterNamed ?? a.filters.removeFilterNamed} ${v}`;
36
38
  return (
37
39
  /*
38
40
  UN FILTRO APPLICATO È UN UNICO BERSAGLIO — P7, criterio 4.
@@ -74,13 +76,13 @@ const z = new Set(T), S = (r, l) => r.value === void 0 || z.has(r.operator) ? ""
74
76
  "data-grid-filter-chip": e.columnId,
75
77
  className: "inline-flex items-center gap-1",
76
78
  children: [
77
- /* @__PURE__ */ o(R, { modal: !1, children: [
79
+ /* @__PURE__ */ o(E, { modal: !1, children: [
78
80
  /* @__PURE__ */ i(
79
- A,
81
+ G,
80
82
  {
81
83
  "data-grid-filter-chip-trigger": e.columnId,
82
84
  "data-grid-filter-chip-operator": e.operator,
83
- "aria-label": M,
85
+ "aria-label": R,
84
86
  className: m(
85
87
  d.focusRing,
86
88
  // Stessa correzione della toolbar di P6, stessa ragione:
@@ -98,45 +100,53 @@ const z = new Set(T), S = (r, l) => r.value === void 0 || z.has(r.operator) ? ""
98
100
  // risolve al colore del fondo (adg-r24).
99
101
  "border-d-border bg-d-accent text-d-foreground h-11 cursor-pointer rounded-md"
100
102
  ),
101
- children: /* @__PURE__ */ i("span", { "data-grid-filter-chip-label": "", children: y })
103
+ children: /* @__PURE__ */ i("span", { "data-grid-filter-chip-label": "", children: D })
102
104
  }
103
105
  ),
104
- /* @__PURE__ */ o(E, { align: "start", className: "min-w-52", children: [
105
- /* @__PURE__ */ i(U, { children: D }),
106
- /* @__PURE__ */ i(
107
- w,
108
- {
109
- "data-grid-filter-chip-edit": e.columnId,
110
- disabled: h === void 0,
111
- onSelect: () => {
112
- const x = h;
113
- x !== void 0 && requestAnimationFrame(() => x(e.id));
114
- },
115
- className: "h-11",
116
- children: s.editValue ?? a.filters.editValue
117
- }
118
- ),
119
- !u && /* @__PURE__ */ o(N, { children: [
120
- /* @__PURE__ */ i(j, {}),
121
- /* @__PURE__ */ i(
122
- w,
123
- {
124
- variant: "destructive",
125
- "data-grid-filter-chip-remove": e.columnId,
126
- onSelect: () => l(e.id),
127
- className: "h-11",
128
- children: s.removeFilter ?? a.filters.removeFilter
129
- }
130
- )
131
- ] })
132
- ] })
106
+ /* @__PURE__ */ o(
107
+ U,
108
+ {
109
+ align: "start",
110
+ container: I,
111
+ className: "min-w-52",
112
+ children: [
113
+ /* @__PURE__ */ i(j, { children: k }),
114
+ /* @__PURE__ */ i(
115
+ w,
116
+ {
117
+ "data-grid-filter-chip-edit": e.columnId,
118
+ disabled: h === void 0,
119
+ onSelect: () => {
120
+ const x = h;
121
+ x !== void 0 && requestAnimationFrame(() => x(e.id));
122
+ },
123
+ className: "h-11",
124
+ children: s.editValue ?? a.filters.editValue
125
+ }
126
+ ),
127
+ !u && /* @__PURE__ */ o(N, { children: [
128
+ /* @__PURE__ */ i(P, {}),
129
+ /* @__PURE__ */ i(
130
+ w,
131
+ {
132
+ variant: "destructive",
133
+ "data-grid-filter-chip-remove": e.columnId,
134
+ onSelect: () => l(e.id),
135
+ className: "h-11",
136
+ children: s.removeFilter ?? a.filters.removeFilter
137
+ }
138
+ )
139
+ ] })
140
+ ]
141
+ }
142
+ )
133
143
  ] }),
134
144
  u && /* @__PURE__ */ i(
135
145
  "button",
136
146
  {
137
147
  type: "button",
138
148
  "data-grid-filter-chip-remove-button": e.columnId,
139
- "aria-label": k,
149
+ "aria-label": A,
140
150
  onClick: () => l(e.id),
141
151
  className: m(
142
152
  d.focusRing,
@@ -171,7 +181,7 @@ const z = new Set(T), S = (r, l) => r.value === void 0 || z.has(r.operator) ? ""
171
181
  "border-d-border text-d-foreground cursor-pointer rounded-md border-dashed"
172
182
  ),
173
183
  children: [
174
- /* @__PURE__ */ i(V, { className: "size-3", "aria-hidden": "true" }),
184
+ /* @__PURE__ */ i(B, { className: "size-3", "aria-hidden": "true" }),
175
185
  s.addFilter
176
186
  ]
177
187
  }
@@ -187,14 +197,14 @@ const z = new Set(T), S = (r, l) => r.value === void 0 || z.has(r.operator) ? ""
187
197
  /* @__PURE__ */ o("span", { "data-grid-filter-scope-rows": "", children: [
188
198
  t.totalLabel,
189
199
  " ",
190
- I
200
+ y
191
201
  ] }),
192
202
  p > 0 && /* @__PURE__ */ o(N, { children: [
193
203
  /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "px-1", children: "·" }),
194
204
  /* @__PURE__ */ o("span", { "data-grid-filter-scope-filters": "", children: [
195
205
  t.filterCountLabel,
196
206
  " ",
197
- C
207
+ F
198
208
  ] })
199
209
  ] })
200
210
  ]
@@ -219,6 +229,6 @@ const z = new Set(T), S = (r, l) => r.value === void 0 || z.has(r.operator) ? ""
219
229
  );
220
230
  };
221
231
  export {
222
- X as GridFilterChips,
223
- B as gridBadgeFullLabel
232
+ er as GridFilterChips,
233
+ q as gridBadgeFullLabel
224
234
  };
@@ -1,33 +1,34 @@
1
1
  "use client";
2
- import { jsx as i, jsxs as j } from "react/jsx-runtime";
2
+ import { jsx as i, jsxs as O } from "react/jsx-runtime";
3
3
  import "react";
4
4
  import { designTokens as g } from "../../../design-tokens.js";
5
5
  import { AppSelect as x } from "../../app-select.js";
6
- import { DatePicker as E } from "../../date-picker.js";
7
- import { Icon as O } from "../../icon.js";
6
+ import { DatePicker as R } from "../../date-picker.js";
7
+ import { Icon as V } from "../../icon.js";
8
8
  import { cn as o } from "../../../../lib/utils.js";
9
- import { getGridFilterValueArity as R, isGridFilterValueEmpty as V } from "../grid-filter-operators.js";
9
+ import { getGridFilterValueArity as H, isGridFilterValueEmpty as I } from "../grid-filter-operators.js";
10
10
  import { defaultGridI18n as T } from "../grid-i18n.js";
11
- const H = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "", I = (e) => {
11
+ import { useGridPortalContainer as X } from "./grid-portal-container.js";
12
+ const Y = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "", q = (e) => {
12
13
  if (typeof e != "string" || e === "") return;
13
- const n = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
14
- if (n !== null) {
15
- const [, l, u, p] = n, c = new Date(Number(l), Number(u) - 1, Number(p));
14
+ const d = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
15
+ if (d !== null) {
16
+ const [, l, u, p] = d, c = new Date(Number(l), Number(u) - 1, Number(p));
16
17
  return Number.isNaN(c.getTime()) ? void 0 : c;
17
18
  }
18
19
  const t = new Date(e);
19
20
  return Number.isNaN(t.getTime()) ? void 0 : t;
20
- }, m = (e) => String(e).padStart(2, "0"), X = (e, n) => {
21
+ }, m = (e) => String(e).padStart(2, "0"), B = (e, d) => {
21
22
  if (e === void 0) return "";
22
23
  const t = `${e.getFullYear()}-${m(e.getMonth() + 1)}-${m(
23
24
  e.getDate()
24
25
  )}`;
25
- return n ? `${t}T${m(e.getHours())}:${m(e.getMinutes())}:${m(
26
+ return d ? `${t}T${m(e.getHours())}:${m(e.getMinutes())}:${m(
26
27
  e.getSeconds()
27
28
  )}` : t;
28
- }, _ = ({
29
+ }, re = ({
29
30
  control: e,
30
- operator: n,
31
+ operator: d,
31
32
  value: t,
32
33
  onValueChange: l,
33
34
  name: u,
@@ -36,12 +37,12 @@ const H = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "",
36
37
  size: k = "sm",
37
38
  fullWidth: s = !1,
38
39
  onClear: w,
39
- i18n: d = T,
40
- className: C
40
+ i18n: n = T,
41
+ className: D
41
42
  }) => {
42
- const N = R(e.filterType, n);
43
- if (N === "none") return null;
44
- const a = k === "touch", f = !a, v = `${d.filters.value}: ${p}`, D = !V(t), F = e.editor === "date" || e.editor === "datetime", A = e.editor === "multiSelect", b = w !== void 0 && D && !F && !A, z = o(
43
+ const { anchorRef: F, container: N } = X(), v = H(e.filterType, d);
44
+ if (v === "none") return null;
45
+ const a = k === "touch", f = !a, $ = `${n.filters.value}: ${p}`, A = !I(t), G = e.editor === "date" || e.editor === "datetime", P = e.editor === "multiSelect", b = w !== void 0 && A && !G && !P, z = o(
45
46
  g.focusRing,
46
47
  g.radius.default,
47
48
  "border-d-border bg-d-background text-d-foreground min-w-0 border px-2",
@@ -53,15 +54,16 @@ const H = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "",
53
54
  // il bottone quei 32px sarebbero un buco che nessuno occupa, e con un valore
54
55
  // lungo il testo si accorcerebbe per far posto a niente.
55
56
  b && "pr-8"
56
- ), $ = o(a && "h-11", f && "h-8"), G = a ? "lg" : "sm", S = {
57
+ ), S = o(a && "h-11", f && "h-8"), M = a ? "lg" : "sm", C = {
57
58
  "data-grid-filter-editor-control": u,
58
59
  ...c === void 0 ? {} : { "data-grid-filter-row-value": c }
59
- }, P = "block w-full", h = {
60
- "aria-label": v,
61
- placeholder: d.filters.value,
60
+ }, j = "block w-full", h = {
61
+ "aria-label": $,
62
+ placeholder: n.filters.value,
62
63
  searchable: !0,
63
- searchPlaceholder: d.filters.searchPlaceholder,
64
- emptyPlaceholder: d.notFoundMessage,
64
+ searchPlaceholder: n.filters.searchPlaceholder,
65
+ emptyPlaceholder: n.notFoundMessage,
66
+ portalContainer: N,
65
67
  size: a ? "lg" : "sm",
66
68
  // ⚠️ L'ALTEZZA «touch» ARRIVA DA QUI E NON DA `size`: il gradino più alto
67
69
  // del primitivo è `lg`, cioè 40px, e il criterio 4 del compositore pretende
@@ -70,14 +72,14 @@ const H = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "",
70
72
  // questa adozione NON ha richiesto di toccare `app-select.tsx`.
71
73
  className: o("w-full", a && "h-11")
72
74
  }, y = (r) => ({
73
- ...S,
75
+ ...C,
74
76
  // Zero scelte su un editor a lista è una dichiarazione INCOMPLETA della
75
77
  // colonna (`normalizeOptions(undefined)` restituisce `[]`, non `undefined`):
76
78
  // si marca, non si ripiega su un campo di testo — che rimetterebbe in piedi
77
79
  // il difetto del criterio 1.
78
80
  "data-grid-filter-editor-empty": r ? "" : void 0,
79
- className: P
80
- }), M = (() => {
81
+ className: j
82
+ }), E = (() => {
81
83
  switch (e.editor) {
82
84
  case "text":
83
85
  case "number":
@@ -85,13 +87,13 @@ const H = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "",
85
87
  "input",
86
88
  {
87
89
  type: e.editor === "number" ? "number" : "text",
88
- ...S,
89
- "aria-label": v,
90
- value: H(t),
90
+ ...C,
91
+ "aria-label": $,
92
+ value: Y(t),
91
93
  onChange: (r) => l(
92
94
  e.editor !== "number" ? r.target.value : r.target.value === "" ? void 0 : Number(r.target.value)
93
95
  ),
94
- className: o(z, $)
96
+ className: o(z, S)
95
97
  }
96
98
  );
97
99
  case "boolean":
@@ -101,8 +103,8 @@ const H = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "",
101
103
  ...h,
102
104
  multiple: !1,
103
105
  options: [
104
- { value: "true", label: d.booleanOperators.true },
105
- { value: "false", label: d.booleanOperators.false }
106
+ { value: "true", label: n.booleanOperators.true },
107
+ { value: "false", label: n.booleanOperators.false }
106
108
  ],
107
109
  value: t === !0 ? "true" : t === !1 ? "false" : void 0,
108
110
  onValueChange: (r) => l(r === void 0 ? void 0 : r === "true")
@@ -111,17 +113,18 @@ const H = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "",
111
113
  case "date":
112
114
  case "datetime":
113
115
  return /* @__PURE__ */ i(
114
- E,
116
+ R,
115
117
  {
116
118
  "data-testid": u,
117
119
  showTime: e.editor === "datetime",
118
- size: G,
119
- value: I(t),
120
- onChange: (r) => l(X(r, e.editor === "datetime")),
120
+ size: M,
121
+ value: q(t),
122
+ onChange: (r) => l(B(r, e.editor === "datetime")),
121
123
  clearable: !0,
124
+ portalContainer: N,
122
125
  wrpClassName: o(s && "w-full"),
123
126
  className: o(
124
- $,
127
+ S,
125
128
  a && !s && "w-40",
126
129
  f && !s && "w-32",
127
130
  s && "w-full"
@@ -158,34 +161,35 @@ const H = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "",
158
161
  }
159
162
  }
160
163
  })();
161
- return /* @__PURE__ */ j(
164
+ return /* @__PURE__ */ O(
162
165
  "span",
163
166
  {
167
+ ref: F,
164
168
  "data-grid-filter-editor": u,
165
169
  "data-grid-filter-editor-kind": e.editor,
166
170
  "data-grid-filter-editor-type": e.filterType,
167
- "data-grid-filter-editor-arity": N,
171
+ "data-grid-filter-editor-arity": v,
168
172
  className: o(
169
173
  "inline-flex items-stretch",
170
174
  s && "flex w-full",
171
175
  b && "relative",
172
- C
176
+ D
173
177
  ),
174
178
  children: [
175
- M,
179
+ E,
176
180
  b && /* @__PURE__ */ i(
177
181
  "button",
178
182
  {
179
183
  type: "button",
180
184
  "data-grid-filter-clear": u,
181
- "aria-label": `${d.filters.removeFilterNamed ?? T.filters.removeFilterNamed}: ${p}`,
185
+ "aria-label": `${n.filters.removeFilterNamed ?? T.filters.removeFilterNamed}: ${p}`,
182
186
  onClick: w,
183
187
  className: o(
184
188
  g.focusRing,
185
189
  g.radius.default,
186
190
  "text-d-muted-foreground hover:text-d-foreground absolute top-1/2 right-1 flex size-6 -translate-y-1/2 cursor-pointer items-center justify-center"
187
191
  ),
188
- children: /* @__PURE__ */ i(O, { name: "X", size: "xs", "aria-hidden": "true" })
192
+ children: /* @__PURE__ */ i(V, { name: "X", size: "xs", "aria-hidden": "true" })
189
193
  }
190
194
  )
191
195
  ]
@@ -193,5 +197,5 @@ const H = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "",
193
197
  );
194
198
  };
195
199
  export {
196
- _ as GridFilterValueEditor
200
+ re as GridFilterValueEditor
197
201
  };