@object-ui/plugin-gantt 17.1.0 → 17.3.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,122 @@
1
1
  # @object-ui/plugin-gantt
2
2
 
3
+ ## 17.3.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 5c856ec: `ObjectGantt`'s quick-filter bar is now localized instead of pinned to Chinese. The four `QuickFilterBar` labels (`all`, `clear`, `empty`, `resultSummary`) were hardcoded as Chinese string literals at the `ObjectGantt` call site, so the bar read 全部 / 清除筛选 / 无可选项 / 显示 N / M 项任务 under an `en`, `ja`, `es` or `ar` session while the rest of the gantt toolbar localized correctly — a conspicuous mismatch, and a violation of the English-only-codebase rule. `QuickFilterBar` itself was never at fault: it is presentational and already falls back to English, so the host was the only thing pinning the copy.
8
+
9
+ The four strings moved into a new `gantt.quickFilter` namespace, added to all ten built-in locale packs, and the call site now resolves them through the gantt package's existing `useGanttTranslation` — the same per-key hook every other gantt string already uses, so a host dictionary that lags on these keys still renders the bundled English default rather than a raw key. `gantt.quickFilter.resultSummary` deliberately keeps SINGLE-brace placeholders (`{shown}` / `{total}`): the call site substitutes them with a literal `.replace`, not i18next interpolation, matching `gantt.autoScheduleDlg.body` and the placeholder convention `all-locales-key-parity` already recognises. Anyone retranslating these packs must keep that spelling — a respell to `{{shown}}` would render the raw placeholder to the user.
10
+
11
+ - Updated dependencies [18cd432]
12
+ - Updated dependencies [b7165ce]
13
+ - Updated dependencies [532cf8b]
14
+ - Updated dependencies [680080a]
15
+ - Updated dependencies [a7651e6]
16
+ - Updated dependencies [d915c47]
17
+ - Updated dependencies [b71fc92]
18
+ - Updated dependencies [65516ba]
19
+ - Updated dependencies [94c5b7c]
20
+ - Updated dependencies [ca0fa8f]
21
+ - Updated dependencies [34595eb]
22
+ - Updated dependencies [3889ffb]
23
+ - Updated dependencies [5781fb1]
24
+ - Updated dependencies [7e2406a]
25
+ - Updated dependencies [bbbde12]
26
+ - Updated dependencies [5a24ad9]
27
+ - Updated dependencies [9e9e9a9]
28
+ - Updated dependencies [19b8c9b]
29
+ - Updated dependencies [56409c2]
30
+ - Updated dependencies [042e09d]
31
+ - Updated dependencies [7d08c3f]
32
+ - Updated dependencies [9cbcbf4]
33
+ - Updated dependencies [85c4c9c]
34
+ - Updated dependencies [fd54c3e]
35
+ - Updated dependencies [4eeb932]
36
+ - Updated dependencies [6fe485b]
37
+ - Updated dependencies [5c856ec]
38
+ - Updated dependencies [23018cc]
39
+ - Updated dependencies [58a00f0]
40
+ - Updated dependencies [53811d1]
41
+ - Updated dependencies [b17ce4c]
42
+ - Updated dependencies [68b6a28]
43
+ - Updated dependencies [0554e88]
44
+ - Updated dependencies [d915c47]
45
+ - Updated dependencies [f44d872]
46
+ - Updated dependencies [28b2e65]
47
+ - Updated dependencies [509104a]
48
+ - Updated dependencies [825bbe3]
49
+ - Updated dependencies [6195841]
50
+ - Updated dependencies [5dd0127]
51
+ - Updated dependencies [06632e9]
52
+ - Updated dependencies [c7fba27]
53
+ - Updated dependencies [a415684]
54
+ - Updated dependencies [a4cff5b]
55
+ - Updated dependencies [175bd79]
56
+ - Updated dependencies [5af2852]
57
+ - Updated dependencies [12bf669]
58
+ - Updated dependencies [34d9169]
59
+ - Updated dependencies [5881a2c]
60
+ - Updated dependencies [9bc3709]
61
+ - Updated dependencies [f833d3a]
62
+ - Updated dependencies [30ae33a]
63
+ - Updated dependencies [a6ec93d]
64
+ - Updated dependencies [2a9513d]
65
+ - Updated dependencies [49f7449]
66
+ - Updated dependencies [71be406]
67
+ - Updated dependencies [d22ae31]
68
+ - Updated dependencies [c7ed4c3]
69
+ - Updated dependencies [2409e1d]
70
+ - Updated dependencies [789fe3e]
71
+ - Updated dependencies [f789c3b]
72
+ - Updated dependencies [a321fa4]
73
+ - Updated dependencies [8d8094a]
74
+ - @object-ui/core@17.3.0
75
+ - @object-ui/fields@17.3.0
76
+ - @object-ui/components@17.3.0
77
+ - @object-ui/plugin-detail@17.3.0
78
+ - @object-ui/types@17.3.0
79
+ - @object-ui/i18n@17.3.0
80
+ - @object-ui/react@17.3.0
81
+
82
+ ## 17.2.0
83
+
84
+ ### Patch Changes
85
+
86
+ - Updated dependencies [4ae0ac4]
87
+ - Updated dependencies [696e3c1]
88
+ - Updated dependencies [bca45cc]
89
+ - Updated dependencies [6be575c]
90
+ - Updated dependencies [a889e31]
91
+ - Updated dependencies [09d30a4]
92
+ - Updated dependencies [4bf612c]
93
+ - Updated dependencies [335041c]
94
+ - Updated dependencies [b414983]
95
+ - Updated dependencies [256f8cc]
96
+ - Updated dependencies [d9668a7]
97
+ - Updated dependencies [4b470b9]
98
+ - Updated dependencies [785b8a5]
99
+ - Updated dependencies [cb82705]
100
+ - Updated dependencies [f572849]
101
+ - Updated dependencies [4a51e77]
102
+ - Updated dependencies [f6e8d78]
103
+ - Updated dependencies [ea96284]
104
+ - Updated dependencies [d3584c6]
105
+ - Updated dependencies [dd06bcd]
106
+ - Updated dependencies [a8ad6c0]
107
+ - Updated dependencies [444457c]
108
+ - Updated dependencies [850033c]
109
+ - Updated dependencies [022e4c3]
110
+ - Updated dependencies [009e25d]
111
+ - Updated dependencies [726b89c]
112
+ - @object-ui/types@17.2.0
113
+ - @object-ui/components@17.2.0
114
+ - @object-ui/core@17.2.0
115
+ - @object-ui/plugin-detail@17.2.0
116
+ - @object-ui/react@17.2.0
117
+ - @object-ui/i18n@17.2.0
118
+ - @object-ui/fields@17.2.0
119
+
3
120
  ## 17.1.0
4
121
 
5
122
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectGantt.d.ts","sourceRoot":"","sources":["../src/ObjectGantt.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAwE,MAAM,OAAO,CAAC;AAE7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAyB,MAAM,kBAAkB,CAAC;AA2B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C;IACjC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CACnB,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,CAAC,CAAC,KACtE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACjC;AAqID,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAmpClD,CAAC"}
package/dist/index.js CHANGED
@@ -8,10 +8,10 @@ import { resolveFieldCurrency as te, useLocalization as _ } from "@object-ui/i18
8
8
  import { RecordDetailDrawer as v, deriveRecordPageHref as ne } from "@object-ui/plugin-detail";
9
9
  import { AlertDialog as re, AlertDialogAction as ie, AlertDialogCancel as ae, AlertDialogContent as oe, AlertDialogDescription as se, AlertDialogFooter as ce, AlertDialogHeader as le, AlertDialogTitle as ue, Button as y, cn as b, useResizeObserver as de } from "@object-ui/components";
10
10
  import { formatCurrency as fe, formatDate as pe, formatDateTime as me, formatNumber as he, formatPercent as ge, getSemanticColorName as _e, getSemanticHex as ve, humanizeLabel as x } from "@object-ui/fields";
11
- import { Activity as S, ArrowRight as C, ChevronDown as ye, ChevronLeft as be, ChevronRight as xe, Download as Se, FileDown as w, Lock as Ce, Maximize2 as we, Minimize2 as Te, PanelLeft as Ee, PanelLeftClose as De, Redo2 as T, RefreshCw as E, Save as Oe, Undo2 as ke, Wand2 as D, ZoomIn as O, ZoomOut as Ae } from "lucide-react";
11
+ import { Activity as S, ArrowRight as ye, ChevronDown as be, ChevronLeft as xe, ChevronRight as Se, Download as Ce, FileDown as C, Lock as we, Maximize2 as Te, Minimize2 as w, PanelLeft as Ee, PanelLeftClose as De, Redo2 as T, RefreshCw as E, Save as Oe, Undo2 as ke, Wand2 as D, ZoomIn as O, ZoomOut as Ae } from "lucide-react";
12
12
  import { Fragment as je, jsx as k, jsxs as A } from "react/jsx-runtime";
13
13
  //#region src/scheduling.ts
14
- var j = 1e3 * 60 * 60 * 24, M = (e) => e.toISOString().slice(0, 10);
14
+ var j = 864e5, M = (e) => e.toISOString().slice(0, 10);
15
15
  function N(e, t) {
16
16
  if (t.skipWeekends) {
17
17
  let t = e.getUTCDay();
@@ -180,9 +180,7 @@ function Be(e, t, n) {
180
180
  case "sf":
181
181
  a = t ? Pe(e, i, t) : e - i;
182
182
  break;
183
- default:
184
- a = r;
185
- break;
183
+ default: a = r;
186
184
  }
187
185
  a > o && (o = a);
188
186
  }
@@ -355,6 +353,10 @@ var R = {
355
353
  "gantt.autoScheduleDlg.confirm": "Apply",
356
354
  "gantt.autoScheduleDlg.cancel": "Cancel",
357
355
  "gantt.autoScheduleDlg.none": "All dependencies satisfied — nothing to reschedule.",
356
+ "gantt.quickFilter.all": "All",
357
+ "gantt.quickFilter.clear": "Clear filters",
358
+ "gantt.quickFilter.empty": "No options",
359
+ "gantt.quickFilter.resultSummary": "Showing {shown} / {total} tasks",
358
360
  "gantt.resource.header": "Resource",
359
361
  "gantt.resource.peak": "Peak",
360
362
  "gantt.resource.over": "overloaded",
@@ -411,7 +413,7 @@ var tt = [
411
413
  month: 30.44,
412
414
  quarter: 91.31,
413
415
  year: 365.25
414
- }, rt = 1e3 * 60 * 60 * 24;
416
+ }, rt = 864e5;
415
417
  function z(e, t) {
416
418
  let n = new Intl.DateTimeFormat("en-US", {
417
419
  timeZone: e,
@@ -870,7 +872,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
870
872
  let e = [];
871
873
  for (let t of j) for (let n of t.dependencies ?? []) {
872
874
  let r = typeof n == "object" && n ? n.id : n;
873
- r == null || r === "" || e.push([String(r), String(t.id)]);
875
+ r != null && r !== "" && e.push([String(r), String(t.id)]);
874
876
  }
875
877
  return e;
876
878
  }, [j]), bn = e.useCallback((e, t) => String(t.id) !== String(e) && !t.locked && t.type !== "group" && !Ve(yn, e, t.id), [yn]), xn = e.useRef(null), [G, Sn] = e.useState(null), Cn = e.useRef(null);
@@ -1532,7 +1534,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
1532
1534
  let e = Xt(W);
1533
1535
  return Jr(e.start, e.end);
1534
1536
  }
1535
- if (e.isSummary && Zr?.has(String(e.task.id)) && !(ce === "self" && e.task.hasOwnDates !== !1)) {
1537
+ if (e.isSummary && Zr?.has(String(e.task.id)) && (ce !== "self" || e.task.hasOwnDates === !1)) {
1536
1538
  let t = Xt(W), n = String(W.taskId), r = null, i = null;
1537
1539
  for (let a of Kt(e.task.id)) {
1538
1540
  if ((Wt.get(String(a.id)) ?? []).length !== 0) continue;
@@ -1772,14 +1774,14 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
1772
1774
  size: "icon",
1773
1775
  className: "h-8 w-8",
1774
1776
  "aria-label": P("gantt.toolbar.prevPeriod"),
1775
- children: /* @__PURE__ */ k(be, { className: "h-4 w-4" })
1777
+ children: /* @__PURE__ */ k(xe, { className: "h-4 w-4" })
1776
1778
  }),
1777
1779
  /* @__PURE__ */ k(y, {
1778
1780
  variant: "ghost",
1779
1781
  size: "icon",
1780
1782
  className: "h-8 w-8",
1781
1783
  "aria-label": P("gantt.toolbar.nextPeriod"),
1782
- children: /* @__PURE__ */ k(xe, { className: "h-4 w-4" })
1784
+ children: /* @__PURE__ */ k(Se, { className: "h-4 w-4" })
1783
1785
  }),
1784
1786
  /* @__PURE__ */ k("span", {
1785
1787
  className: "font-semibold text-xs sm:text-sm",
@@ -1792,7 +1794,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
1792
1794
  className: "inline-flex items-center gap-1 rounded-full border bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",
1793
1795
  "data-testid": "gantt-readonly-badge",
1794
1796
  title: P("gantt.readOnlyHint"),
1795
- children: [/* @__PURE__ */ k(Ce, { className: "h-3 w-3" }), P("gantt.readOnly")]
1797
+ children: [/* @__PURE__ */ k(we, { className: "h-3 w-3" }), P("gantt.readOnly")]
1796
1798
  })
1797
1799
  ]
1798
1800
  }), /* @__PURE__ */ A("div", {
@@ -1937,7 +1939,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
1937
1939
  onClick: Ti,
1938
1940
  "aria-label": P("gantt.toolbar.exportPng"),
1939
1941
  "data-testid": "gantt-export-png",
1940
- children: /* @__PURE__ */ k(Se, { className: "h-4 w-4" })
1942
+ children: /* @__PURE__ */ k(Ce, { className: "h-4 w-4" })
1941
1943
  }),
1942
1944
  /* @__PURE__ */ k(y, {
1943
1945
  variant: "ghost",
@@ -1946,7 +1948,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
1946
1948
  onClick: Ei,
1947
1949
  "aria-label": P("gantt.toolbar.exportPdf"),
1948
1950
  "data-testid": "gantt-export-pdf",
1949
- children: /* @__PURE__ */ k(w, { className: "h-4 w-4" })
1951
+ children: /* @__PURE__ */ k(C, { className: "h-4 w-4" })
1950
1952
  }),
1951
1953
  ue || le ? /* @__PURE__ */ k(y, {
1952
1954
  variant: "ghost",
@@ -1967,7 +1969,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
1967
1969
  "aria-label": P(yr ? "gantt.toolbar.exitFullscreen" : "gantt.toolbar.enterFullscreen"),
1968
1970
  "aria-pressed": yr,
1969
1971
  "data-testid": "gantt-fullscreen",
1970
- children: k(yr ? Te : we, { className: "h-4 w-4" })
1972
+ children: k(yr ? w : Te, { className: "h-4 w-4" })
1971
1973
  })
1972
1974
  ]
1973
1975
  })]
@@ -2147,7 +2149,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
2147
2149
  "aria-expanded": !r,
2148
2150
  "aria-label": P(r ? "gantt.row.expand" : "gantt.row.collapse"),
2149
2151
  "data-testid": `gantt-row-toggle-${t.id}`,
2150
- children: k(r ? xe : ye, { className: "h-3.5 w-3.5" })
2152
+ children: k(r ? Se : be, { className: "h-3.5 w-3.5" })
2151
2153
  }) : /* @__PURE__ */ k("span", {
2152
2154
  className: "w-3 shrink-0",
2153
2155
  style: { marginLeft: -4 },
@@ -2247,7 +2249,7 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
2247
2249
  onClick: (e) => {
2248
2250
  e.stopPropagation(), o(t);
2249
2251
  },
2250
- children: /* @__PURE__ */ k(C, { className: "h-3.5 w-3.5" })
2252
+ children: /* @__PURE__ */ k(ye, { className: "h-3.5 w-3.5" })
2251
2253
  })
2252
2254
  })
2253
2255
  ]
@@ -2333,10 +2335,12 @@ function ht({ tasks: t, viewMode: n, startDate: r, endDate: i, markers: a, onTas
2333
2335
  let n = hr.start + t, r = e.realMs ?? 0;
2334
2336
  if (!r) return null;
2335
2337
  let i = e.date.getTime(), a = e.date, o = new Date(a.getFullYear(), a.getMonth(), a.getDate() + 1, 0, 0, 0, 0).getTime();
2336
- return o <= i || o >= i + r ? null : /* @__PURE__ */ k("div", {
2338
+ if (o <= i || o >= i + r) return null;
2339
+ let s = Y[n] + (o - i) / r * e.width;
2340
+ return /* @__PURE__ */ k("div", {
2337
2341
  className: "absolute top-0 bottom-0",
2338
2342
  style: {
2339
- left: Y[n] + (o - i) / r * e.width,
2343
+ left: s,
2340
2344
  borderLeft: "1px dashed hsl(var(--muted-foreground) / 0.4)"
2341
2345
  },
2342
2346
  "data-testid": `gantt-midnight-${n}`,
@@ -3455,7 +3459,7 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
3455
3459
  position: "absolute",
3456
3460
  left: 0,
3457
3461
  right: 0,
3458
- top: (B - yt) / 2 + t,
3462
+ top: 14 / 2 + t,
3459
3463
  borderTop: "1px dashed hsl(var(--muted-foreground) / 0.6)",
3460
3464
  pointerEvents: "none",
3461
3465
  zIndex: 1
@@ -3475,7 +3479,7 @@ function St({ tasks: t, assignee: n, effort: r, capacity: i = 1, viewMode: a = "
3475
3479
  display: "flex",
3476
3480
  alignItems: "flex-end",
3477
3481
  justifyContent: "center",
3478
- paddingBottom: (B - yt) / 2
3482
+ paddingBottom: 14 / 2
3479
3483
  },
3480
3484
  children: t.load > 0 && /* @__PURE__ */ k("div", { style: {
3481
3485
  width: d - 6,
@@ -3722,7 +3726,7 @@ function jt(e) {
3722
3726
  if (typeof e == "number") return [e];
3723
3727
  if (!Array.isArray(e)) return [];
3724
3728
  let t = [];
3725
- for (let n of e) if (!(n == null || n === "")) if (typeof n == "object") {
3729
+ for (let n of e) if (n != null && n !== "") if (typeof n == "object") {
3726
3730
  let e = n.id ?? n._id ?? n.task ?? n.target;
3727
3731
  if (e == null || e === "") continue;
3728
3732
  let r = At[String(n.type ?? "").toLowerCase().replace(/-/g, "_")];
@@ -3798,34 +3802,34 @@ function Pt(e) {
3798
3802
  return null;
3799
3803
  }
3800
3804
  var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick: ee, onBeforeTaskUpdate: y, ...de }) => {
3801
- let [S, C] = o([]), [ye, be] = o(!0), [xe, Se] = o(null), [w, Ce] = o(null), { currency: we } = _(), { t: Te } = Je(), Ee = t((e) => {
3802
- g.error(Te("gantt.writeFailed"), { description: H(e) ?? void 0 });
3803
- }, [Te]), De = Mt(e), T = i(() => De, [JSON.stringify(De)]), E = Pt(e), Oe = T?.provider === "value", ke = n(f)?.apiFetch, D = i(() => d(T, s ?? null, { fetch: ke }), [
3805
+ let [S, ye] = o([]), [be, xe] = o(!0), [Se, Ce] = o(null), [C, we] = o(null), { currency: Te } = _(), { t: w } = Je(), Ee = t((e) => {
3806
+ g.error(w("gantt.writeFailed"), { description: H(e) ?? void 0 });
3807
+ }, [w]), De = Mt(e), T = i(() => De, [JSON.stringify(De)]), E = Pt(e), Oe = T?.provider === "value", ke = n(f)?.apiFetch, D = i(() => d(T, s ?? null, { fetch: ke }), [
3804
3808
  T,
3805
3809
  s,
3806
3810
  ke
3807
3811
  ]), O = T?.provider === "object" ? T.object : e.objectName ?? "", [Ae, je] = o(!1), j = a(0), M = t(async ({ silent: t = !1 } = {}) => {
3808
3812
  let n = ++j.current, r = () => j.current === n;
3809
3813
  try {
3810
- if (t ? je(!0) : be(!0), de.data && Array.isArray(de.data)) {
3811
- r() && C(de.data);
3814
+ if (t ? je(!0) : xe(!0), de.data && Array.isArray(de.data)) {
3815
+ r() && ye(de.data);
3812
3816
  return;
3813
3817
  }
3814
3818
  if (Oe && T?.provider === "value") {
3815
- r() && C(T.items);
3819
+ r() && ye(T.items);
3816
3820
  return;
3817
3821
  }
3818
3822
  if (!D || typeof D.find != "function") throw Error("DataSource required for object/api providers");
3819
- let n = c(w?.fields), i = await D.find(O, {
3823
+ let n = c(C?.fields), i = await D.find(O, {
3820
3824
  $filter: e.filter,
3821
3825
  $orderby: Nt(e.sort),
3822
3826
  ...n.length > 0 ? { $expand: n } : {}
3823
3827
  });
3824
- r() && C(l(i));
3828
+ r() && ye(l(i));
3825
3829
  } catch (e) {
3826
- t ? console.error("[ObjectGantt] Failed to refresh data:", e) : r() && Se(e);
3830
+ t ? console.error("[ObjectGantt] Failed to refresh data:", e) : r() && Ce(e);
3827
3831
  } finally {
3828
- t ? je(!1) : be(!1);
3832
+ t ? je(!1) : xe(!1);
3829
3833
  }
3830
3834
  }, [
3831
3835
  D,
@@ -3834,7 +3838,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
3834
3838
  T,
3835
3839
  e.filter,
3836
3840
  e.sort,
3837
- w
3841
+ C
3838
3842
  ]);
3839
3843
  r(() => {
3840
3844
  M();
@@ -3843,7 +3847,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
3843
3847
  try {
3844
3848
  if (!D || !O) return;
3845
3849
  let e = await D.getObjectSchema(O);
3846
- Ce(e);
3850
+ we(e);
3847
3851
  } catch (e) {
3848
3852
  console.error("Failed to fetch object schema:", e);
3849
3853
  }
@@ -3856,7 +3860,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
3856
3860
  ]);
3857
3861
  let N = i(() => {
3858
3862
  if (!E || !S.length) return [];
3859
- let { startDateField: e, endDateField: t, titleField: n, progressField: r, dependenciesField: i, colorField: a, borderColorField: o, parentField: s, typeField: c, lockField: l, tooltipFields: d, baselineStartField: f, baselineEndField: p, quickFilters: m } = E, h = w?.fields ?? {}, g = /* @__PURE__ */ new Map();
3863
+ let { startDateField: e, endDateField: t, titleField: n, progressField: r, dependenciesField: i, colorField: a, borderColorField: o, parentField: s, typeField: c, lockField: l, tooltipFields: d, baselineStartField: f, baselineEndField: p, quickFilters: m } = E, h = C?.fields ?? {}, g = /* @__PURE__ */ new Map();
3860
3864
  for (let e of m ?? []) {
3861
3865
  if (!e?.field || !Array.isArray(e.options) || !e.options.length) continue;
3862
3866
  let t = /* @__PURE__ */ new Map();
@@ -3879,7 +3883,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
3879
3883
  e?.contact && [e.contact.first_name, e.contact.last_name].filter(Boolean).join(" ")
3880
3884
  ];
3881
3885
  for (let e of t) if (e != null && String(e).trim() !== "") return String(e);
3882
- return u(w, e);
3886
+ return u(C, e);
3883
3887
  }, v = (e, t) => {
3884
3888
  if (t) return t;
3885
3889
  let n = h[e] ?? h[e.split(".")[0]];
@@ -3906,7 +3910,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
3906
3910
  case "integer":
3907
3911
  case "float":
3908
3912
  case "decimal": return he(Number(e));
3909
- case "currency": return fe(Number(e), te(n, we));
3913
+ case "currency": return fe(Number(e), te(n, Te));
3910
3914
  case "percent": return ge(Number(e));
3911
3915
  case "boolean":
3912
3916
  case "checkbox": return e ? "Yes" : "No";
@@ -3974,11 +3978,11 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
3974
3978
  }, [
3975
3979
  S,
3976
3980
  E,
3977
- w
3981
+ C
3978
3982
  ]), Me = i(() => {
3979
3983
  let e = E?.groupByField;
3980
3984
  if (!e) return;
3981
- let t = w?.fields ?? {}, n = (e, t) => {
3985
+ let t = C?.fields ?? {}, n = (e, t) => {
3982
3986
  if (!t) return;
3983
3987
  let n = e;
3984
3988
  for (let e of t.split(".")) {
@@ -4005,10 +4009,10 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4005
4009
  label: r(i)
4006
4010
  };
4007
4011
  };
4008
- }, [E?.groupByField, w]), P = i(() => {
4012
+ }, [E?.groupByField, C]), P = i(() => {
4009
4013
  let e = E?.assigneeField;
4010
4014
  if (!e) return;
4011
- let t = w?.fields ?? {}, n = (e, t) => {
4015
+ let t = C?.fields ?? {}, n = (e, t) => {
4012
4016
  if (!t) return;
4013
4017
  let n = e;
4014
4018
  for (let e of t.split(".")) {
@@ -4035,7 +4039,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4035
4039
  label: r(i)
4036
4040
  };
4037
4041
  };
4038
- }, [E?.assigneeField, w]), Ne = i(() => {
4042
+ }, [E?.assigneeField, C]), Ne = i(() => {
4039
4043
  let e = E?.effortField;
4040
4044
  if (e) return (t) => {
4041
4045
  let n = t.data?.[e], r = Number(n);
@@ -4063,7 +4067,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4063
4067
  }, []), Fe = E?.quickFilters, [Ie, Le] = o({});
4064
4068
  r(() => {
4065
4069
  if (!Fe?.length || !s || typeof s.find != "function") return;
4066
- let e = w?.fields ?? {}, t = !1;
4070
+ let e = C?.fields ?? {}, t = !1;
4067
4071
  return (async () => {
4068
4072
  let n = {};
4069
4073
  for (let t of Fe) {
@@ -4072,8 +4076,8 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4072
4076
  if (i !== "lookup" && i !== "master_detail") continue;
4073
4077
  let a = r?.reference_to ?? r?.reference ?? r?.referenceTo;
4074
4078
  if (a) try {
4075
- let e = l(await s.find(a, { $top: 1e3 }));
4076
- n[t.field] = e.map((e) => ({
4079
+ let e = await s.find(a, { $top: 1e3 }), r = l(e);
4080
+ n[t.field] = r.map((e) => ({
4077
4081
  value: String(e.id ?? e._id ?? e.value ?? ""),
4078
4082
  label: String(e.name ?? e.label ?? e.title ?? e.id ?? e._id ?? "")
4079
4083
  }));
@@ -4091,11 +4095,11 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4091
4095
  }, [
4092
4096
  JSON.stringify(Fe),
4093
4097
  s,
4094
- w
4098
+ C
4095
4099
  ]);
4096
4100
  let Re = i(() => {
4097
4101
  if (!Fe?.length) return [];
4098
- let e = w?.fields ?? {};
4102
+ let e = C?.fields ?? {};
4099
4103
  return Fe.map((t) => {
4100
4104
  let n = e[t.field] ?? e[t.field.split(".")[0]], r = t.label ?? n?.label ?? x(t.field), i;
4101
4105
  if (t.options?.length) i = t.options.map((e) => typeof e == "object" ? {
@@ -4134,7 +4138,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4134
4138
  });
4135
4139
  }, [
4136
4140
  Fe,
4137
- w,
4141
+ C,
4138
4142
  Ie,
4139
4143
  S,
4140
4144
  I
@@ -4211,7 +4215,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4211
4215
  return;
4212
4216
  }
4213
4217
  let { objectName: t, recordId: n } = e;
4214
- if (!(T?.provider === "api" || t !== O) || !s || typeof s.findOne != "function") {
4218
+ if (T?.provider !== "api" && t === O || !s || typeof s.findOne != "function") {
4215
4219
  et(null);
4216
4220
  return;
4217
4221
  }
@@ -4244,14 +4248,14 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4244
4248
  let s = e.data?.id ?? e.data?._id ?? e.id;
4245
4249
  if (s == null) return;
4246
4250
  let c = S;
4247
- C((e) => e.map((e) => String(e.id ?? e._id) === String(s) ? {
4251
+ ye((e) => e.map((e) => String(e.id ?? e._id) === String(s) ? {
4248
4252
  ...e,
4249
4253
  ...o
4250
4254
  } : e));
4251
4255
  try {
4252
4256
  await D.update(O, String(s), o), M({ silent: !0 });
4253
4257
  } catch (e) {
4254
- console.error("[ObjectGantt] Failed to persist task update:", e), C(c), Ee(e);
4258
+ console.error("[ObjectGantt] Failed to persist task update:", e), ye(c), Ee(e);
4255
4259
  }
4256
4260
  }, [
4257
4261
  E,
@@ -4270,14 +4274,14 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4270
4274
  let r = E?.dependenciesField;
4271
4275
  if (!r || !D || typeof D.update != "function") return;
4272
4276
  let i = rt(t, n), a = S;
4273
- C((t) => t.map((t) => String(t.id ?? t._id) === String(e) ? {
4277
+ ye((t) => t.map((t) => String(t.id ?? t._id) === String(e) ? {
4274
4278
  ...t,
4275
4279
  [r]: i
4276
4280
  } : t));
4277
4281
  try {
4278
4282
  await D.update(O, String(e), { [r]: i }), M({ silent: !0 });
4279
4283
  } catch (e) {
4280
- console.error("[ObjectGantt] Failed to persist dependency:", e), C(a), Ee(e);
4284
+ console.error("[ObjectGantt] Failed to persist dependency:", e), ye(a), Ee(e);
4281
4285
  }
4282
4286
  }, [
4283
4287
  E,
@@ -4328,12 +4332,12 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4328
4332
  }
4329
4333
  lt(!0);
4330
4334
  let t = S;
4331
- C((t) => t.filter((t) => String(t.id ?? t._id) !== String(e)));
4335
+ ye((t) => t.filter((t) => String(t.id ?? t._id) !== String(e)));
4332
4336
  try {
4333
- if (await D.delete(O, String(e)) === !1) throw Error(Te("gantt.writeFailed"));
4337
+ if (await D.delete(O, String(e)) === !1) throw Error(w("gantt.writeFailed"));
4334
4338
  st(null), M({ silent: !0 });
4335
4339
  } catch (e) {
4336
- console.error("[ObjectGantt] Failed to delete:", e), C(t), st(null), Ee(e);
4340
+ console.error("[ObjectGantt] Failed to delete:", e), ye(t), st(null), Ee(e);
4337
4341
  } finally {
4338
4342
  lt(!1);
4339
4343
  }
@@ -4344,9 +4348,9 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4344
4348
  S,
4345
4349
  M,
4346
4350
  Ee,
4347
- Te
4351
+ w
4348
4352
  ]);
4349
- return ye ? /* @__PURE__ */ k("div", {
4353
+ return be ? /* @__PURE__ */ k("div", {
4350
4354
  className: m,
4351
4355
  children: /* @__PURE__ */ k("div", {
4352
4356
  className: "flex items-center justify-center h-96",
@@ -4355,13 +4359,13 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4355
4359
  children: "Loading Gantt chart..."
4356
4360
  })
4357
4361
  })
4358
- }) : xe ? /* @__PURE__ */ k("div", {
4362
+ }) : Se ? /* @__PURE__ */ k("div", {
4359
4363
  className: m,
4360
4364
  children: /* @__PURE__ */ k("div", {
4361
4365
  className: "flex items-center justify-center h-96",
4362
4366
  children: /* @__PURE__ */ A("div", {
4363
4367
  className: "text-destructive",
4364
- children: ["Error: ", xe.message]
4368
+ children: ["Error: ", Se.message]
4365
4369
  })
4366
4370
  })
4367
4371
  }) : E ? /* @__PURE__ */ A("div", {
@@ -4375,10 +4379,10 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4375
4379
  resultCount: qe.length,
4376
4380
  totalCount: N.length,
4377
4381
  labels: {
4378
- all: "全部",
4379
- clear: "清除筛选",
4380
- empty: "无可选项",
4381
- resultSummary: (e, t) => `显示 ${e} / ${t} 项任务`
4382
+ all: w("gantt.quickFilter.all"),
4383
+ clear: w("gantt.quickFilter.clear"),
4384
+ empty: w("gantt.quickFilter.empty"),
4385
+ resultSummary: (e, t) => w("gantt.quickFilter.resultSummary").replace("{shown}", String(e)).replace("{total}", String(t))
4382
4386
  }
4383
4387
  }),
4384
4388
  /* @__PURE__ */ k("div", {
@@ -4418,7 +4422,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4418
4422
  dependencyTypes: E?.dependencyTypes,
4419
4423
  timeZone: E?.timeZone,
4420
4424
  onBeforeTaskUpdate: y,
4421
- exportFileName: String(E?.exportFileName ?? e.label ?? w?.label ?? e.objectName ?? "") || void 0,
4425
+ exportFileName: String(E?.exportFileName ?? e.label ?? C?.label ?? e.objectName ?? "") || void 0,
4422
4426
  inlineEdit: !0,
4423
4427
  onRefresh: (T?.provider === "object" || T?.provider === "api") && typeof D?.find == "function" ? () => M({ silent: !0 }) : void 0,
4424
4428
  refreshing: Ae
@@ -4427,7 +4431,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4427
4431
  Qe.isOverlay && Qe.isOpen && Qe.selectedRecord && (() => {
4428
4432
  let t = Qe.selectedRecord, n = R(t);
4429
4433
  if (!n || Ke(t)) return null;
4430
- let { objectName: r, recordId: i } = n, a = n.href ?? void 0, o = E?.titleField ? String(t[E.titleField] ?? Te("gantt.drawer.fallbackTitle")) : Te("gantt.drawer.fallbackTitle"), c = !!e.readOnly || (E?.lockField ? !!t[E.lockField] : !1), l = $e?.key === `${r}:${i}` ? $e : null, u = l?.record ?? t, d = l?.schema ?? (r === O ? w : void 0), f = l && s ? s : D;
4434
+ let { objectName: r, recordId: i } = n, a = n.href ?? void 0, o = E?.titleField ? String(t[E.titleField] ?? w("gantt.drawer.fallbackTitle")) : w("gantt.drawer.fallbackTitle"), c = !!e.readOnly || (E?.lockField ? !!t[E.lockField] : !1), l = $e?.key === `${r}:${i}` ? $e : null, u = l?.record ?? t, d = l?.schema ?? (r === O ? C : void 0), f = l && s ? s : D;
4431
4435
  return /* @__PURE__ */ k(v, {
4432
4436
  open: !0,
4433
4437
  onClose: Qe.close,
@@ -4453,7 +4457,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4453
4457
  ...n.record,
4454
4458
  [e]: t
4455
4459
  }
4456
- } : n), C((n) => n.map((n) => String(n.id ?? n._id) === String(i) ? {
4460
+ } : n), ye((n) => n.map((n) => String(n.id ?? n._id) === String(i) ? {
4457
4461
  ...n,
4458
4462
  [e]: t
4459
4463
  } : n)), M({ silent: !0 });
@@ -4462,11 +4466,11 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4462
4466
  onDelete: c ? void 0 : async () => {
4463
4467
  if (D?.delete) {
4464
4468
  try {
4465
- if (await D.delete(r, String(i)) === !1) throw Error(Te("gantt.writeFailed"));
4469
+ if (await D.delete(r, String(i)) === !1) throw Error(w("gantt.writeFailed"));
4466
4470
  } catch (e) {
4467
4471
  throw Ee(e), e;
4468
4472
  }
4469
- C((e) => e.filter((e) => String(e.id ?? e._id) !== String(i)));
4473
+ ye((e) => e.filter((e) => String(e.id ?? e._id) !== String(i)));
4470
4474
  }
4471
4475
  }
4472
4476
  });
@@ -4476,9 +4480,9 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4476
4480
  onOpenChange: (e) => {
4477
4481
  !e && !ct && st(null);
4478
4482
  },
4479
- children: /* @__PURE__ */ A(oe, { children: [/* @__PURE__ */ A(le, { children: [/* @__PURE__ */ k(ue, { children: Te("gantt.delete.title") }), /* @__PURE__ */ k(se, { children: ot ? Te("gantt.delete.body", { title: ot.title }) : null })] }), /* @__PURE__ */ A(ce, { children: [/* @__PURE__ */ k(ae, {
4483
+ children: /* @__PURE__ */ A(oe, { children: [/* @__PURE__ */ A(le, { children: [/* @__PURE__ */ k(ue, { children: w("gantt.delete.title") }), /* @__PURE__ */ k(se, { children: ot ? w("gantt.delete.body", { title: ot.title }) : null })] }), /* @__PURE__ */ A(ce, { children: [/* @__PURE__ */ k(ae, {
4480
4484
  disabled: ct,
4481
- children: Te("gantt.delete.cancel")
4485
+ children: w("gantt.delete.cancel")
4482
4486
  }), /* @__PURE__ */ k(ie, {
4483
4487
  onClick: (e) => {
4484
4488
  e.preventDefault(), dt();
@@ -4486,7 +4490,7 @@ var Ft = ({ schema: e, dataSource: s, className: m, onTaskClick: h, onRowClick:
4486
4490
  disabled: ct,
4487
4491
  "data-testid": "gantt-delete-confirm",
4488
4492
  className: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
4489
- children: Te(ct ? "gantt.delete.deleting" : "gantt.delete.confirm")
4493
+ children: w(ct ? "gantt.delete.deleting" : "gantt.delete.confirm")
4490
4494
  })] })] })
4491
4495
  })
4492
4496
  ]