@elaraai/east-ui 1.0.67 → 1.0.69

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 (306) hide show
  1. package/README.md +2 -2
  2. package/dist/src/charts/chart/index.d.ts +39 -4
  3. package/dist/src/charts/chart/index.d.ts.map +1 -1
  4. package/dist/src/charts/chart/index.js +3 -3
  5. package/dist/src/charts/chart/index.js.map +1 -1
  6. package/dist/src/charts/spec/index.d.ts +61 -3
  7. package/dist/src/charts/spec/index.d.ts.map +1 -1
  8. package/dist/src/charts/spec/types.d.ts +1 -1
  9. package/dist/src/charts/spec/types.js +1 -1
  10. package/dist/src/collections/blend/index.d.ts +1 -1
  11. package/dist/src/collections/blend/index.d.ts.map +1 -1
  12. package/dist/src/collections/blend/index.js +1 -1
  13. package/dist/src/collections/blend/index.js.map +1 -1
  14. package/dist/src/collections/blend/types.js +1 -1
  15. package/dist/src/collections/blend/types.js.map +1 -1
  16. package/dist/src/collections/board/index.d.ts +4 -4
  17. package/dist/src/collections/board/index.d.ts.map +1 -1
  18. package/dist/src/collections/board/index.js +1 -1
  19. package/dist/src/collections/board/index.js.map +1 -1
  20. package/dist/src/collections/board/types.js +1 -1
  21. package/dist/src/collections/board/types.js.map +1 -1
  22. package/dist/src/collections/calendar/index.d.ts +1 -1
  23. package/dist/src/collections/calendar/index.d.ts.map +1 -1
  24. package/dist/src/collections/deck/index.d.ts +58 -0
  25. package/dist/src/collections/deck/index.d.ts.map +1 -1
  26. package/dist/src/collections/index.d.ts +1 -2
  27. package/dist/src/collections/index.d.ts.map +1 -1
  28. package/dist/src/collections/index.js +1 -2
  29. package/dist/src/collections/index.js.map +1 -1
  30. package/dist/src/collections/library/index.d.ts +29 -0
  31. package/dist/src/collections/library/index.d.ts.map +1 -1
  32. package/dist/src/collections/library/types.d.ts +29 -0
  33. package/dist/src/collections/library/types.d.ts.map +1 -1
  34. package/dist/src/collections/matrix/index.d.ts +1 -1
  35. package/dist/src/collections/matrix/index.d.ts.map +1 -1
  36. package/dist/src/collections/plan/assemble.d.ts +3732 -0
  37. package/dist/src/collections/plan/assemble.d.ts.map +1 -0
  38. package/dist/src/collections/plan/assemble.js +187 -0
  39. package/dist/src/collections/plan/assemble.js.map +1 -0
  40. package/dist/src/collections/plan/builders.d.ts +612 -0
  41. package/dist/src/collections/plan/builders.d.ts.map +1 -0
  42. package/dist/src/collections/plan/builders.js +543 -0
  43. package/dist/src/collections/plan/builders.js.map +1 -0
  44. package/dist/src/collections/plan/data-forms.d.ts +332 -0
  45. package/dist/src/collections/plan/data-forms.d.ts.map +1 -0
  46. package/dist/src/collections/plan/data-forms.js +212 -0
  47. package/dist/src/collections/plan/data-forms.js.map +1 -0
  48. package/dist/src/collections/plan/factories.d.ts +338 -0
  49. package/dist/src/collections/plan/factories.d.ts.map +1 -0
  50. package/dist/src/collections/plan/factories.js +414 -0
  51. package/dist/src/collections/plan/factories.js.map +1 -0
  52. package/dist/src/collections/plan/index.d.ts +271 -0
  53. package/dist/src/collections/plan/index.d.ts.map +1 -0
  54. package/dist/src/collections/plan/index.js +162 -0
  55. package/dist/src/collections/plan/index.js.map +1 -0
  56. package/dist/src/collections/plan/ir.d.ts +3496 -0
  57. package/dist/src/collections/plan/ir.d.ts.map +1 -0
  58. package/dist/src/collections/plan/ir.js +83 -0
  59. package/dist/src/collections/plan/ir.js.map +1 -0
  60. package/dist/src/collections/plan/pick.d.ts +115 -0
  61. package/dist/src/collections/plan/pick.d.ts.map +1 -0
  62. package/dist/src/collections/plan/pick.js +193 -0
  63. package/dist/src/collections/plan/pick.js.map +1 -0
  64. package/dist/src/collections/plan/root.d.ts +210 -0
  65. package/dist/src/collections/plan/root.d.ts.map +1 -0
  66. package/dist/src/collections/plan/root.js +146 -0
  67. package/dist/src/collections/plan/root.js.map +1 -0
  68. package/dist/src/collections/plan/series.d.ts +11890 -0
  69. package/dist/src/collections/plan/series.d.ts.map +1 -0
  70. package/dist/src/collections/plan/series.js +412 -0
  71. package/dist/src/collections/plan/series.js.map +1 -0
  72. package/dist/src/collections/plan/types.d.ts +9291 -0
  73. package/dist/src/collections/plan/types.d.ts.map +1 -0
  74. package/dist/src/collections/plan/types.js +940 -0
  75. package/dist/src/collections/plan/types.js.map +1 -0
  76. package/dist/src/collections/roster/index.d.ts +4 -4
  77. package/dist/src/collections/roster/index.d.ts.map +1 -1
  78. package/dist/src/collections/roster/index.js +1 -1
  79. package/dist/src/collections/roster/index.js.map +1 -1
  80. package/dist/src/collections/roster/types.d.ts +1 -1
  81. package/dist/src/collections/roster/types.d.ts.map +1 -1
  82. package/dist/src/collections/roster/types.js +4 -3
  83. package/dist/src/collections/roster/types.js.map +1 -1
  84. package/dist/src/collections/table/index.d.ts +70 -2
  85. package/dist/src/collections/table/index.d.ts.map +1 -1
  86. package/dist/src/collections/table/index.js +55 -11
  87. package/dist/src/collections/table/index.js.map +1 -1
  88. package/dist/src/collections/table/types.d.ts +1 -1
  89. package/dist/src/collections/table/types.d.ts.map +1 -1
  90. package/dist/src/component.d.ts +3898 -1339
  91. package/dist/src/component.d.ts.map +1 -1
  92. package/dist/src/component.js +83 -146
  93. package/dist/src/component.js.map +1 -1
  94. package/dist/src/container/card/types.d.ts +1 -1
  95. package/dist/src/container/card/types.d.ts.map +1 -1
  96. package/dist/src/contracts/approval.d.ts +117 -0
  97. package/dist/src/contracts/approval.d.ts.map +1 -0
  98. package/dist/src/contracts/approval.js +105 -0
  99. package/dist/src/contracts/approval.js.map +1 -0
  100. package/dist/src/contracts/drag.d.ts +3 -3
  101. package/dist/src/contracts/drag.d.ts.map +1 -1
  102. package/dist/src/contracts/drag.js +23 -10
  103. package/dist/src/contracts/drag.js.map +1 -1
  104. package/dist/src/contracts/index.d.ts +4 -1
  105. package/dist/src/contracts/index.d.ts.map +1 -1
  106. package/dist/src/contracts/index.js +4 -1
  107. package/dist/src/contracts/index.js.map +1 -1
  108. package/dist/src/contracts/pick.d.ts +705 -0
  109. package/dist/src/contracts/pick.d.ts.map +1 -0
  110. package/dist/src/contracts/pick.js +360 -0
  111. package/dist/src/contracts/pick.js.map +1 -0
  112. package/dist/src/contracts/review.d.ts +7 -99
  113. package/dist/src/contracts/review.d.ts.map +1 -1
  114. package/dist/src/contracts/review.js +11 -85
  115. package/dist/src/contracts/review.js.map +1 -1
  116. package/dist/src/contracts/slice-affordances.d.ts +13 -4
  117. package/dist/src/contracts/slice-affordances.d.ts.map +1 -1
  118. package/dist/src/contracts/slice-affordances.js +13 -3
  119. package/dist/src/contracts/slice-affordances.js.map +1 -1
  120. package/dist/src/contracts/source.d.ts +432 -0
  121. package/dist/src/contracts/source.d.ts.map +1 -0
  122. package/dist/src/contracts/source.js +505 -0
  123. package/dist/src/contracts/source.js.map +1 -0
  124. package/dist/src/contracts/states.d.ts +130 -0
  125. package/dist/src/contracts/states.d.ts.map +1 -1
  126. package/dist/src/contracts/states.js +122 -0
  127. package/dist/src/contracts/states.js.map +1 -1
  128. package/dist/src/contracts/time.d.ts +76 -0
  129. package/dist/src/contracts/time.d.ts.map +1 -0
  130. package/dist/src/contracts/time.js +78 -0
  131. package/dist/src/contracts/time.js.map +1 -0
  132. package/dist/src/display/trace/types.d.ts +1 -1
  133. package/dist/src/display/trace/types.d.ts.map +1 -1
  134. package/dist/src/index.d.ts +10 -2
  135. package/dist/src/index.d.ts.map +1 -1
  136. package/dist/src/index.js +22 -2
  137. package/dist/src/index.js.map +1 -1
  138. package/dist/src/internal.d.ts +5 -3
  139. package/dist/src/internal.d.ts.map +1 -1
  140. package/dist/src/internal.js +4 -3
  141. package/dist/src/internal.js.map +1 -1
  142. package/dist/src/layout/dock/index.d.ts +1 -1
  143. package/dist/src/layout/dock/index.js +1 -1
  144. package/dist/src/layout/index.d.ts +0 -1
  145. package/dist/src/layout/index.d.ts.map +1 -1
  146. package/dist/src/layout/index.js +0 -1
  147. package/dist/src/layout/index.js.map +1 -1
  148. package/dist/src/overlays/drawer/types.d.ts +1 -1
  149. package/dist/src/overlays/drawer/types.d.ts.map +1 -1
  150. package/dist/src/pick/index.d.ts +443 -0
  151. package/dist/src/pick/index.d.ts.map +1 -0
  152. package/dist/src/pick/index.js +64 -0
  153. package/dist/src/pick/index.js.map +1 -0
  154. package/dist/src/pick/panel/index.d.ts +64 -0
  155. package/dist/src/pick/panel/index.d.ts.map +1 -0
  156. package/dist/src/pick/panel/index.js +61 -0
  157. package/dist/src/pick/panel/index.js.map +1 -0
  158. package/dist/src/platform/slice/index.d.ts +291 -0
  159. package/dist/src/platform/slice/index.d.ts.map +1 -1
  160. package/dist/src/platform/slice/index.js +16 -0
  161. package/dist/src/platform/slice/index.js.map +1 -1
  162. package/dist/src/runtime/collections/deck.d.ts +29 -0
  163. package/dist/src/runtime/collections/deck.d.ts.map +1 -1
  164. package/dist/src/runtime/collections/index.d.ts +1 -2
  165. package/dist/src/runtime/collections/index.d.ts.map +1 -1
  166. package/dist/src/runtime/collections/index.js +1 -2
  167. package/dist/src/runtime/collections/index.js.map +1 -1
  168. package/dist/src/runtime/collections/library.d.ts +1 -1
  169. package/dist/src/runtime/collections/library.js +1 -1
  170. package/dist/src/runtime/collections/plan.d.ts +98 -0
  171. package/dist/src/runtime/collections/plan.d.ts.map +1 -0
  172. package/dist/src/runtime/collections/plan.js +98 -0
  173. package/dist/src/runtime/collections/plan.js.map +1 -0
  174. package/dist/src/runtime/collections/schematic.d.ts +1 -1
  175. package/dist/src/runtime/collections/schematic.js +1 -1
  176. package/dist/src/runtime/collections/table.d.ts +9 -1
  177. package/dist/src/runtime/collections/table.d.ts.map +1 -1
  178. package/dist/src/runtime/collections/table.js +1 -7
  179. package/dist/src/runtime/collections/table.js.map +1 -1
  180. package/dist/src/runtime/layout/dock.d.ts +2 -2
  181. package/dist/src/runtime/layout/dock.js +2 -2
  182. package/dist/src/runtime/layout/index.d.ts +0 -1
  183. package/dist/src/runtime/layout/index.d.ts.map +1 -1
  184. package/dist/src/runtime/layout/index.js +0 -1
  185. package/dist/src/runtime/layout/index.js.map +1 -1
  186. package/dist/src/shared/plot-gutter.d.ts +6 -23
  187. package/dist/src/shared/plot-gutter.d.ts.map +1 -1
  188. package/dist/src/shared/plot-gutter.js +6 -19
  189. package/dist/src/shared/plot-gutter.js.map +1 -1
  190. package/dist/src/shared/reify.d.ts +47 -4
  191. package/dist/src/shared/reify.d.ts.map +1 -1
  192. package/dist/src/shared/reify.js +62 -4
  193. package/dist/src/shared/reify.js.map +1 -1
  194. package/dist/src/slice/breakdown/index.d.ts +27 -0
  195. package/dist/src/slice/breakdown/index.d.ts.map +1 -1
  196. package/dist/src/slice/breakdown/types.d.ts +27 -0
  197. package/dist/src/slice/breakdown/types.d.ts.map +1 -1
  198. package/dist/src/slice/cohort/index.d.ts +54 -0
  199. package/dist/src/slice/cohort/index.d.ts.map +1 -1
  200. package/dist/src/slice/cohort/types.d.ts +27 -0
  201. package/dist/src/slice/cohort/types.d.ts.map +1 -1
  202. package/dist/src/slice/filter/index.d.ts +27 -0
  203. package/dist/src/slice/filter/index.d.ts.map +1 -1
  204. package/dist/src/slice/filter/types.d.ts +27 -0
  205. package/dist/src/slice/filter/types.d.ts.map +1 -1
  206. package/dist/src/slice/index.d.ts +405 -0
  207. package/dist/src/slice/index.d.ts.map +1 -1
  208. package/dist/src/slice/legend/index.d.ts +27 -0
  209. package/dist/src/slice/legend/index.d.ts.map +1 -1
  210. package/dist/src/slice/legend/types.d.ts +27 -0
  211. package/dist/src/slice/legend/types.d.ts.map +1 -1
  212. package/dist/src/slice/range/index.d.ts +60 -18
  213. package/dist/src/slice/range/index.d.ts.map +1 -1
  214. package/dist/src/slice/range/index.js +9 -1
  215. package/dist/src/slice/range/index.js.map +1 -1
  216. package/dist/src/slice/range/types.d.ts +63 -22
  217. package/dist/src/slice/range/types.d.ts.map +1 -1
  218. package/dist/src/slice/range/types.js +12 -5
  219. package/dist/src/slice/range/types.js.map +1 -1
  220. package/dist/src/slice/search/index.d.ts +27 -0
  221. package/dist/src/slice/search/index.d.ts.map +1 -1
  222. package/dist/src/slice/search/types.d.ts +27 -0
  223. package/dist/src/slice/search/types.d.ts.map +1 -1
  224. package/dist/src/slice/summary/index.d.ts +27 -0
  225. package/dist/src/slice/summary/index.d.ts.map +1 -1
  226. package/dist/src/slice/summary/types.d.ts +27 -0
  227. package/dist/src/slice/summary/types.d.ts.map +1 -1
  228. package/dist/src/style/content.d.ts +4 -6
  229. package/dist/src/style/content.d.ts.map +1 -1
  230. package/dist/src/style/content.js +4 -6
  231. package/dist/src/style/content.js.map +1 -1
  232. package/dist/src/style/scheme.js +1 -1
  233. package/dist/src/style/scheme.js.map +1 -1
  234. package/dist/test/collections/index.d.ts +2 -2
  235. package/dist/test/collections/index.d.ts.map +1 -1
  236. package/dist/test/collections/index.js +2 -2
  237. package/dist/test/collections/index.js.map +1 -1
  238. package/dist/test/collections/paged-source.examples.d.ts +9 -0
  239. package/dist/test/collections/paged-source.examples.d.ts.map +1 -0
  240. package/dist/test/collections/paged-source.examples.js +136 -0
  241. package/dist/test/collections/paged-source.examples.js.map +1 -0
  242. package/dist/test/collections/plan.examples.d.ts +125 -0
  243. package/dist/test/collections/plan.examples.d.ts.map +1 -0
  244. package/dist/test/collections/plan.examples.js +2939 -0
  245. package/dist/test/collections/plan.examples.js.map +1 -0
  246. package/dist/test/contracts/pick.examples.d.ts +6 -0
  247. package/dist/test/contracts/pick.examples.d.ts.map +1 -0
  248. package/dist/test/contracts/pick.examples.js +89 -0
  249. package/dist/test/contracts/pick.examples.js.map +1 -0
  250. package/dist/test/layout/dock.examples.d.ts +4 -4
  251. package/dist/test/layout/dock.examples.d.ts.map +1 -1
  252. package/dist/test/layout/dock.examples.js +34 -16
  253. package/dist/test/layout/dock.examples.js.map +1 -1
  254. package/dist/test/slice/slice.examples.d.ts +2 -1
  255. package/dist/test/slice/slice.examples.d.ts.map +1 -1
  256. package/dist/test/slice/slice.examples.js +67 -9
  257. package/dist/test/slice/slice.examples.js.map +1 -1
  258. package/package.json +3 -3
  259. package/dist/src/collections/gantt/index.d.ts +0 -377
  260. package/dist/src/collections/gantt/index.d.ts.map +0 -1
  261. package/dist/src/collections/gantt/index.js +0 -896
  262. package/dist/src/collections/gantt/index.js.map +0 -1
  263. package/dist/src/collections/gantt/types.d.ts +0 -353
  264. package/dist/src/collections/gantt/types.d.ts.map +0 -1
  265. package/dist/src/collections/gantt/types.js +0 -207
  266. package/dist/src/collections/gantt/types.js.map +0 -1
  267. package/dist/src/collections/planner/index.d.ts +0 -624
  268. package/dist/src/collections/planner/index.d.ts.map +0 -1
  269. package/dist/src/collections/planner/index.js +0 -941
  270. package/dist/src/collections/planner/index.js.map +0 -1
  271. package/dist/src/collections/planner/types.d.ts +0 -615
  272. package/dist/src/collections/planner/types.d.ts.map +0 -1
  273. package/dist/src/collections/planner/types.js +0 -423
  274. package/dist/src/collections/planner/types.js.map +0 -1
  275. package/dist/src/layout/aligned-stack/index.d.ts +0 -101
  276. package/dist/src/layout/aligned-stack/index.d.ts.map +0 -1
  277. package/dist/src/layout/aligned-stack/index.js +0 -105
  278. package/dist/src/layout/aligned-stack/index.js.map +0 -1
  279. package/dist/src/layout/aligned-stack/types.d.ts +0 -50
  280. package/dist/src/layout/aligned-stack/types.d.ts.map +0 -1
  281. package/dist/src/layout/aligned-stack/types.js +0 -24
  282. package/dist/src/layout/aligned-stack/types.js.map +0 -1
  283. package/dist/src/runtime/collections/gantt.d.ts +0 -67
  284. package/dist/src/runtime/collections/gantt.d.ts.map +0 -1
  285. package/dist/src/runtime/collections/gantt.js +0 -58
  286. package/dist/src/runtime/collections/gantt.js.map +0 -1
  287. package/dist/src/runtime/collections/planner.d.ts +0 -80
  288. package/dist/src/runtime/collections/planner.d.ts.map +0 -1
  289. package/dist/src/runtime/collections/planner.js +0 -76
  290. package/dist/src/runtime/collections/planner.js.map +0 -1
  291. package/dist/src/runtime/layout/aligned-stack.d.ts +0 -38
  292. package/dist/src/runtime/layout/aligned-stack.d.ts.map +0 -1
  293. package/dist/src/runtime/layout/aligned-stack.js +0 -36
  294. package/dist/src/runtime/layout/aligned-stack.js.map +0 -1
  295. package/dist/test/collections/gantt.examples.d.ts +0 -33
  296. package/dist/test/collections/gantt.examples.d.ts.map +0 -1
  297. package/dist/test/collections/gantt.examples.js +0 -359
  298. package/dist/test/collections/gantt.examples.js.map +0 -1
  299. package/dist/test/collections/planner.examples.d.ts +0 -47
  300. package/dist/test/collections/planner.examples.d.ts.map +0 -1
  301. package/dist/test/collections/planner.examples.js +0 -546
  302. package/dist/test/collections/planner.examples.js.map +0 -1
  303. package/dist/test/layout/aligned-stack.examples.d.ts +0 -25
  304. package/dist/test/layout/aligned-stack.examples.d.ts.map +0 -1
  305. package/dist/test/layout/aligned-stack.examples.js +0 -294
  306. package/dist/test/layout/aligned-stack.examples.js.map +0 -1
@@ -1,896 +0,0 @@
1
- /**
2
- * Copyright (c) 2025 Elara AI Pty Ltd
3
- * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
- */
5
- import { East, Expr, StructType, ArrayType, DictType, StringType, OptionType, DateTimeType, FloatType, variant, IntegerType, NullType, some, none, toEastTypeValue, FunctionType, } from "@elaraai/east";
6
- import { TableCellClickEventType, TableRowClickEventType, TableSortEventType, } from "../table/types.js";
7
- import { TimeStepType, GanttMilestoneKindType, GanttAxisType, GanttAxisRangeType, GanttTierType } from "./types.js";
8
- import { PlannerStateType } from "../planner/types.js";
9
- import { resolveEventState } from "../planner/index.js";
10
- import { StatusValueType } from "../../feedback/status/types.js";
11
- import { ApprovalStateType, RowRefType, RowReviewType, buildReview } from "../../contracts/review.js";
12
- import { CanDropFnType, DragEventType } from "../../contracts/drag.js";
13
- import { AlignType, LabelInputType, FontWeightType, FontStyleType, SizeType, } from "../../style.js";
14
- import { UIComponentType } from "../../component.js";
15
- import { mapRowsBlock, reifyAccessor } from "../../shared/reify.js";
16
- import { SliceChromeType } from "../../platform/slice/index.js";
17
- import { SliceAffordanceType } from "../../contracts/slice-affordances.js";
18
- import { DensityType } from "../../style/interaction.js";
19
- import { PlotGutterType } from "../../shared/plot-gutter.js";
20
- import { TableCellType, TableColumnType, TableCellRenderContextType, } from "../table/index.js";
21
- import { Text } from "../../typography/index.js";
22
- import { GanttStyleType, TableVariantType, TableSizeType, GanttTaskClickEventType, GanttTaskProgressChangeEventType, GanttMilestoneClickEventType, } from "./types.js";
23
- import { StatusTokenType } from "../../style/interaction.js";
24
- // Re-export types
25
- export { GanttStyleType, TimeStepType, GanttMilestoneKindType, GanttAxisType, GanttAxisRangeType, GanttTierType, } from "./types.js";
26
- // The shared event lifecycle a task's `state` carries (#262).
27
- export { PlannerStateType } from "../planner/types.js";
28
- // ============================================================================
29
- // Gantt Task / Milestone (UIComp-coupled — defined here, not in types.ts)
30
- // ============================================================================
31
- /**
32
- * East StructType for a Gantt task bar.
33
- *
34
- * @remarks
35
- * Spans from `start` to `end`. `state` is the shared event lifecycle
36
- * (`PlannerStateType`: committed / proposed(added|model|removed) /
37
- * rejected — the same audit grammar as Planner / Roster / Board, #262);
38
- * it drives the bar's treatment (colour, dash, ghost, strike). `status`
39
- * is the orthogonal **risk/status axis** (the old `"atRisk"` becomes
40
- * `status: "danger"`): a semantic tint over the state treatment.
41
- * `popover` (click-triggered) accepts any UIComponent for rich detail.
42
- *
43
- * @property start - Start date/time of the task
44
- * @property end - End date/time of the task
45
- * @property label - Optional rich label (text + alignment + typography)
46
- * @property progress - Optional progress percentage (0-100)
47
- * @property state - The audit state (shared `PlannerStateType` lifecycle)
48
- * @property status - Optional risk/status tint (success / warning / danger / info / neutral)
49
- * @property popover - Optional rich popover (click-triggered, UIComponent)
50
- */
51
- export const GanttTaskType = StructType({
52
- start: DateTimeType,
53
- end: DateTimeType,
54
- label: OptionType(LabelInputType),
55
- progress: OptionType(FloatType),
56
- state: PlannerStateType,
57
- status: OptionType(StatusValueType),
58
- popover: OptionType(UIComponentType),
59
- });
60
- /**
61
- * East StructType for a Gantt milestone marker.
62
- *
63
- * @remarks
64
- * Single point in time (no duration). `kind` (interim / release)
65
- * drives the diamond's fill. Same `popover` rich-content surface as
66
- * tasks.
67
- *
68
- * @property date - The date/time of the milestone
69
- * @property label - Optional rich label
70
- * @property kind - Optional milestone kind driving the diamond fill (default release)
71
- * @property popover - Optional rich popover (click, UIComponent)
72
- */
73
- export const GanttMilestoneType = StructType({
74
- date: DateTimeType,
75
- label: OptionType(LabelInputType),
76
- kind: OptionType(GanttMilestoneKindType),
77
- popover: OptionType(UIComponentType),
78
- });
79
- // ============================================================================
80
- // Gantt Row Type
81
- // ============================================================================
82
- /**
83
- * East type for a Gantt row.
84
- *
85
- * @remarks
86
- * Each row has table cells (displayed on the left) and two timeline-
87
- * track arrays on the right: `tasks` (duration bars) and `milestones`
88
- * (single-point markers). The previous variant `events` array has
89
- * been retired — splitting by subtype removes variant ceremony at the
90
- * call site and gives per-subtype TS narrowing for free.
91
- *
92
- * @property cells - Dict of column key to cell value (a bare `LiteralValueType`, same as Table)
93
- * @property tasks - Array of task bars (start + end DateTime)
94
- * @property milestones - Array of milestone markers (single DateTime)
95
- */
96
- export const GanttRowType = StructType({
97
- cells: DictType(StringType, TableCellType),
98
- tasks: ArrayType(GanttTaskType),
99
- milestones: ArrayType(GanttMilestoneType),
100
- // Review chrome (only meaningful when the root carries `review`, #263):
101
- status: OptionType(StatusValueType), // the quiet row dot (absent ⇒ clean)
102
- approval: OptionType(ApprovalStateType), // the row's review decision (absent ⇒ no decision)
103
- });
104
- // ============================================================================
105
- // Gantt Root Type
106
- // ============================================================================
107
- /**
108
- * Standalone East StructType mirror of the inline `Gantt` variant in
109
- * `component.ts`.
110
- *
111
- * @remarks
112
- * main carries content (`rows` / `columns` / `frozen`),
113
- * config (`interactive` / `dragStep` / `durationStep`), structured
114
- * state (`rowStatus`), and behaviour (callbacks); `style` carries
115
- * visual fields only.
116
- *
117
- * @property rows - Array of Gantt rows
118
- * @property columns - Array of column definitions (same as Table)
119
- * @property frozen - Column keys to freeze (pin left)
120
- * @property interactive - Row hover highlight toggle
121
- * @property dragStep - Drag-snap time step
122
- * @property durationStep - Duration-change snap step
123
- * @property rowStatus - Row-status callback: `(rowIndex) => StatusToken`
124
- * @property onCellClick - Cell click callback
125
- * @property onCellDoubleClick - Cell double-click callback
126
- * @property onRowClick - Row click callback
127
- * @property onRowDoubleClick - Row double-click callback
128
- * @property onSortChange - Sort change callback
129
- * @property onTaskClick - Task click callback
130
- * @property onTaskDoubleClick - Task double-click callback
131
- * @property id - DnD target identity (#268)
132
- * @property sources - Library ids accepted for `add` drags
133
- * @property onDrag - Shared drag-grammar funnel (add / move / resize)
134
- * @property canDrop - Optional IR-level drop veto
135
- * @property onTaskProgressChange - Task progress change callback
136
- * @property onMilestoneClick - Milestone click callback
137
- * @property onMilestoneDoubleClick - Milestone double-click callback
138
- * @property review - Optional review chrome (shared contract, #263)
139
- * @property style - Optional visual style sub-struct
140
- */
141
- export const GanttRootType = StructType({
142
- rows: ArrayType(GanttRowType),
143
- columns: ArrayType(TableColumnType),
144
- frozen: ArrayType(StringType),
145
- axis: OptionType(GanttAxisType),
146
- dragStep: OptionType(TimeStepType),
147
- durationStep: OptionType(TimeStepType),
148
- rowStatus: OptionType(FunctionType([IntegerType], StatusTokenType)),
149
- onCellClick: OptionType(FunctionType([TableCellClickEventType], NullType)),
150
- onCellDoubleClick: OptionType(FunctionType([TableCellClickEventType], NullType)),
151
- onRowClick: OptionType(FunctionType([TableRowClickEventType], NullType)),
152
- onRowDoubleClick: OptionType(FunctionType([TableRowClickEventType], NullType)),
153
- onSortChange: OptionType(FunctionType([TableSortEventType], NullType)),
154
- onTaskClick: OptionType(FunctionType([GanttTaskClickEventType], NullType)),
155
- onTaskDoubleClick: OptionType(FunctionType([GanttTaskClickEventType], NullType)),
156
- // DnD target role (#268) — `id` + `sources` connect the Gantt to sibling
157
- // Libraries; ALL completed drags (Library `add` landing as proposed(added)
158
- // bars, task-body `move`, edge `resize`) arrive through the ONE shared
159
- // `onDrag` grammar callback. The renderer registers the target iff
160
- // `onDrag` is present. Cell encoding (contracts/drag.ts): `row` = the row
161
- // index key, `slot` = the snapped ISO instant, `event` = `t<taskIndex>` /
162
- // `m<milestoneIndex>`.
163
- id: StringType,
164
- sources: ArrayType(StringType),
165
- onDrag: OptionType(FunctionType([DragEventType], NullType)),
166
- canDrop: OptionType(CanDropFnType),
167
- onTaskProgressChange: OptionType(FunctionType([GanttTaskProgressChangeEventType], NullType)),
168
- onMilestoneClick: OptionType(FunctionType([GanttMilestoneClickEventType], NullType)),
169
- onMilestoneDoubleClick: OptionType(FunctionType([GanttMilestoneClickEventType], NullType)),
170
- // Optional review chrome (#263) — the shared contract's row-granularity
171
- // config: per-row Approve/Reject decision column + the commitBar foot.
172
- // Absent ⇒ a plain Gantt (row `status`/`approval` are inert).
173
- review: OptionType(RowReviewType),
174
- slice: OptionType(SliceChromeType),
175
- style: OptionType(GanttStyleType),
176
- });
177
- // ============================================================================
178
- // Factory Functions for Events
179
- // ============================================================================
180
- function buildAlignValue(a) {
181
- if (a === undefined)
182
- return undefined;
183
- if (typeof a === "string") {
184
- return East.value(variant(a, null), AlignType);
185
- }
186
- return a;
187
- }
188
- function isLabelInputObject(input) {
189
- return (typeof input === "object"
190
- && input !== null
191
- && !Array.isArray(input)
192
- && Object.prototype.hasOwnProperty.call(input, "value")
193
- && typeof input.type === "undefined");
194
- }
195
- function buildLabel(input) {
196
- if (!isLabelInputObject(input)) {
197
- return East.value({
198
- value: input,
199
- align: none,
200
- verticalAlign: none,
201
- color: none,
202
- fontWeight: none,
203
- fontStyle: none,
204
- fontSize: none,
205
- }, LabelInputType);
206
- }
207
- const li = input;
208
- const fontWeightValue = li.fontWeight !== undefined
209
- ? (typeof li.fontWeight === "string"
210
- ? East.value(variant(li.fontWeight, null), FontWeightType)
211
- : li.fontWeight)
212
- : undefined;
213
- const fontStyleValue = li.fontStyle !== undefined
214
- ? (typeof li.fontStyle === "string"
215
- ? East.value(variant(li.fontStyle, null), FontStyleType)
216
- : li.fontStyle)
217
- : undefined;
218
- const fontSizeValue = li.fontSize !== undefined
219
- ? (typeof li.fontSize === "string"
220
- ? East.value(variant(li.fontSize, null), SizeType)
221
- : li.fontSize)
222
- : undefined;
223
- return East.value({
224
- value: li.value,
225
- align: li.align !== undefined ? some(buildAlignValue(li.align)) : none,
226
- verticalAlign: li.verticalAlign !== undefined ? some(buildAlignValue(li.verticalAlign)) : none,
227
- color: li.color !== undefined ? some(li.color) : none,
228
- fontWeight: fontWeightValue ? some(fontWeightValue) : none,
229
- fontStyle: fontStyleValue ? some(fontStyleValue) : none,
230
- fontSize: fontSizeValue ? some(fontSizeValue) : none,
231
- }, LabelInputType);
232
- }
233
- /**
234
- * Builds a single Gantt task East value from an ergonomic TS input.
235
- *
236
- * @param input - Task configuration ({@link TaskInput})
237
- * @returns An East expression of {@link GanttTaskType}
238
- *
239
- * @remarks
240
- * Internal implementation of `Gantt.Task` — see the namespace JSDoc
241
- * for the externally-visible contract. Normalises optional fields
242
- * into their `OptionType` envelopes and converts variant string
243
- * literals to East variant values.
244
- *
245
- * @example
246
- * ```ts
247
- * import { East } from "@elaraai/east";
248
- * import { Gantt, UIComponentType } from "@elaraai/east-ui";
249
- *
250
- * const example = East.function([], UIComponentType, _$ => {
251
- * return Gantt.Root(
252
- * [{ name: "Task", start: new Date("2024-01-01"), end: new Date("2024-01-15") }],
253
- * ["name"],
254
- * row => ({ tasks: [Gantt.Task({
255
- * start: row.start,
256
- * end: row.end,
257
- * label: "Design Phase",
258
- * progress: 75,
259
- * state: "committed",
260
- * })] }),
261
- * );
262
- * });
263
- * ```
264
- */
265
- function createTask(input) {
266
- const statusValue = input.status
267
- ? (typeof input.status === "string"
268
- ? East.value(variant(input.status, null), StatusValueType)
269
- : input.status)
270
- : undefined;
271
- return East.value({
272
- start: input.start,
273
- end: input.end,
274
- label: input.label !== undefined ? some(buildLabel(input.label)) : none,
275
- progress: input.progress !== undefined ? some(input.progress) : none,
276
- state: resolveEventState(input.state ?? "committed"),
277
- status: statusValue ? some(statusValue) : none,
278
- popover: input.popover !== undefined ? some(input.popover) : none,
279
- }, GanttTaskType);
280
- }
281
- /**
282
- * Builds a single Gantt milestone East value from an ergonomic TS input.
283
- *
284
- * @param input - Milestone configuration ({@link MilestoneInput})
285
- * @returns An East expression of {@link GanttMilestoneType}
286
- *
287
- * @remarks
288
- * Internal implementation of `Gantt.Milestone` — see the namespace
289
- * JSDoc for the externally-visible contract.
290
- *
291
- * @example
292
- * ```ts
293
- * import { East } from "@elaraai/east";
294
- * import { Gantt, UIComponentType } from "@elaraai/east-ui";
295
- *
296
- * const example = East.function([], UIComponentType, _$ => {
297
- * return Gantt.Root(
298
- * [{ name: "Launch", date: new Date("2024-02-01") }],
299
- * ["name"],
300
- * row => ({ milestones: [Gantt.Milestone({
301
- * date: row.date,
302
- * label: "Design Complete",
303
- * kind: "release",
304
- * })] }),
305
- * );
306
- * });
307
- * ```
308
- */
309
- function createMilestone(input) {
310
- const kindValue = input.kind
311
- ? (typeof input.kind === "string"
312
- ? East.value(variant(input.kind, null), GanttMilestoneKindType)
313
- : input.kind)
314
- : undefined;
315
- return East.value({
316
- date: input.date,
317
- label: input.label !== undefined ? some(buildLabel(input.label)) : none,
318
- kind: kindValue ? some(kindValue) : none,
319
- popover: input.popover !== undefined ? some(input.popover) : none,
320
- }, GanttMilestoneType);
321
- }
322
- /**
323
- * Builds the Gantt time-axis East value from the ergonomic {@link GanttAxisInput}.
324
- *
325
- * @remarks
326
- * Wraps the optional `range` / `format` / `tier` into their `some` / `none`
327
- * envelopes and converts the `tier` string shorthand to an East variant — flat
328
- * TS input in, fully-shaped {@link GanttAxisType} value out.
329
- */
330
- function buildGanttAxis(input) {
331
- const tierValue = input.tier
332
- ? (typeof input.tier === "string"
333
- ? East.value(variant(input.tier, null), GanttTierType)
334
- : input.tier)
335
- : undefined;
336
- return East.value({
337
- range: input.range !== undefined
338
- ? some(East.value({ min: input.range.min, max: input.range.max }, GanttAxisRangeType))
339
- : none,
340
- format: input.format !== undefined ? some(input.format) : none,
341
- tier: tierValue ? some(tierValue) : none,
342
- }, GanttAxisType);
343
- }
344
- // ============================================================================
345
- // Main Gantt Factory
346
- // ============================================================================
347
- /**
348
- * Creates a Gantt component following the Table pattern.
349
- *
350
- * @typeParam T - The struct type of each data row
351
- * @param data - Array of data structs
352
- * @param columns - Column specification for the left-side table columns
353
- * @param events - Function to extract events from each row
354
- * @param style - Optional Gantt styling
355
- * @returns An East expression representing the Gantt component
356
- *
357
- * @example
358
- * ```ts
359
- * import { East } from "@elaraai/east";
360
- * import { Gantt, UIComponentType } from "@elaraai/east-ui";
361
- *
362
- * const example = East.function([], UIComponentType, $ => {
363
- * return Gantt.Root(
364
- * [
365
- * { name: "Design", start: new Date("2024-01-01"), end: new Date("2024-01-15") },
366
- * { name: "Development", start: new Date("2024-01-10"), end: new Date("2024-02-01") },
367
- * ],
368
- * ["name"],
369
- * row => [Gantt.Task({ start: row.start, end: row.end })],
370
- * { showToday: true }
371
- * );
372
- * });
373
- * ```
374
- */
375
- function createGantt(data, columns, rowSpec, style) {
376
- const data_expr = East.value(data);
377
- const field_types = Expr.type(data_expr).value.fields;
378
- // Normalize columns to object format
379
- // dataType: the original field type from the data struct
380
- // valueType: the type after applying value function (computed during row mapping)
381
- const columnEntries = Array.isArray(columns)
382
- ? columns.map(key => [key, undefined])
383
- : Object.entries(columns);
384
- const columns_obj = Object.fromEntries(columnEntries.map(([key, config]) => {
385
- const fieldType = field_types[key];
386
- return [key, {
387
- ...config,
388
- dataType: toEastTypeValue(fieldType),
389
- }];
390
- }));
391
- const rowType = Expr.type(data_expr).value;
392
- // Reify each column's value extractor ONCE into a real East function and
393
- // derive the column's valueType from the function's output type — checked
394
- // a single time here rather than during map expansion (#205).
395
- for (const [col_key, col_config] of Object.entries(columns_obj)) {
396
- const fieldType = field_types[col_key];
397
- const valueFn = col_config.value !== undefined
398
- ? reifyAccessor([fieldType, rowType], col_config.value)
399
- : undefined;
400
- col_config.valueFn = valueFn;
401
- const valueOutType = valueFn !== undefined
402
- ? Expr.type(valueFn).output
403
- : fieldType;
404
- const valueTypeTag = valueOutType.type;
405
- // check that the type is a valid LiteralValueType (primitive) tag
406
- if (valueTypeTag !== "Null" && valueTypeTag !== "Boolean" && valueTypeTag !== "Integer" &&
407
- valueTypeTag !== "Float" && valueTypeTag !== "String" && valueTypeTag !== "DateTime" &&
408
- valueTypeTag !== "Blob") {
409
- throw new Error(`Column "${col_key}" has value type "${valueTypeTag}" which is not a valid column type. Complex types require a value function that returns a primitive type.`);
410
- }
411
- col_config.valueType = variant(valueTypeTag, null);
412
- }
413
- // Map each data row to a GanttRow with cells and events
414
- const rows_mapped = mapRowsBlock(data_expr, GanttRowType, ($, datum) => {
415
- // Build cells dict (same as Table) — cells carry ONLY the sortable
416
- // primitive; rendering goes through the column's render function
417
- // (synthesized default below when the author omits it).
418
- const cells = $.let(new Map(), DictType(StringType, TableCellType));
419
- for (const [col_key, col_config] of Object.entries(columns_obj)) {
420
- const field_value = datum[col_key];
421
- const valueFn = col_config.valueFn;
422
- // Cell value: call the column's reified value function, or use the
423
- // field value directly (primitive columns).
424
- const cellValue = valueFn !== undefined
425
- ? variant(col_config.valueType.type, valueFn(field_value, datum))
426
- : variant(col_config.valueType.type, field_value);
427
- $(cells.insert(col_key, cellValue));
428
- }
429
- // Get tasks + milestones from the row. The callback returns
430
- // `SubtypeExprOrValue<ArrayType<...>>` for each — accepting either
431
- // an East-side ArrayExpr (e.g. mapping over an East array field)
432
- // or a plain JS array of values built by `Gantt.Task(...)` /
433
- // `Gantt.Milestone(...)`. Default to an empty East array when a
434
- // key is omitted.
435
- const spec = rowSpec(datum);
436
- return East.value({
437
- cells: cells,
438
- tasks: East.value(spec.tasks ?? [], ArrayType(GanttTaskType)),
439
- milestones: East.value(spec.milestones ?? [], ArrayType(GanttMilestoneType)),
440
- // Review chrome (#263) — pass-through accessors (clean ⇒ approved,
441
- // flagged ⇒ pending; see the shared `deriveApproval` helper).
442
- status: spec.status !== undefined
443
- ? East.value(spec.status, OptionType(StatusValueType))
444
- : none,
445
- approval: spec.approval !== undefined
446
- ? East.value(spec.approval, OptionType(ApprovalStateType))
447
- : none,
448
- }, GanttRowType);
449
- });
450
- // Create columns array from the columns config
451
- const columns_mapped = [];
452
- for (const [key, config] of Object.entries(columns_obj)) {
453
- columns_mapped.push({
454
- key: key,
455
- dataType: config.dataType,
456
- valueType: config.valueType,
457
- header: config?.header !== undefined ? some(config.header) : some(key),
458
- width: config?.width !== undefined ? some(config.width) : none,
459
- minWidth: config?.minWidth !== undefined ? some(config.minWidth) : none,
460
- maxWidth: config?.maxWidth !== undefined ? some(config.maxWidth) : none,
461
- render: config?.render
462
- ? East.value(config.render, FunctionType([TableCellRenderContextType], UIComponentType))
463
- // Synthesized capture-free default: stringify the cell value via
464
- // the column's statically-known tag (same as Table).
465
- : East.function([TableCellRenderContextType], UIComponentType, (_$, ctx) => Text.Root(East.str `${ctx.cellValue.unwrap(config.valueType.type)}`, {
466
- whiteSpace: "nowrap",
467
- overflow: "hidden",
468
- textOverflow: "ellipsis",
469
- })),
470
- // Row grouping is Table-only — the Gantt pane carries no group rows.
471
- aggregate: none,
472
- aggregateRender: none,
473
- });
474
- }
475
- // Reorder columns: frozen first, then the rest
476
- const frozenKeys = (style?.frozen ?? []);
477
- const frozenSet = new Set(frozenKeys);
478
- const columnsByKey = new Map(columns_mapped.map(c => [c.key, c]));
479
- const orderedColumns = [
480
- ...frozenKeys.filter(key => columnsByKey.has(key)).map(key => columnsByKey.get(key)),
481
- ...columns_mapped.filter(c => !frozenSet.has(c.key)),
482
- ];
483
- const columns_expr = East.value(orderedColumns, ArrayType(TableColumnType));
484
- const frozen_expr = East.value(frozenKeys, ArrayType(StringType));
485
- // Build style value
486
- const variantValue = style?.variant
487
- ? (typeof style.variant === "string"
488
- ? East.value(variant(style.variant, null), TableVariantType)
489
- : style.variant)
490
- : undefined;
491
- const sizeValue = style?.size
492
- ? (typeof style.size === "string"
493
- ? East.value(variant(style.size, null), TableSizeType)
494
- : style.size)
495
- : undefined;
496
- const densityValue = style?.density
497
- ? (typeof style.density === "string"
498
- ? East.value(variant(style.density, null), DensityType)
499
- : style.density)
500
- : undefined;
501
- const hasStyle = !!style && (style.height !== undefined ||
502
- style.maxHeight !== undefined ||
503
- style.variant !== undefined ||
504
- style.size !== undefined ||
505
- style.density !== undefined ||
506
- style.striped !== undefined ||
507
- style.stickyHeader !== undefined ||
508
- style.showColumnBorder !== undefined ||
509
- style.showToday !== undefined ||
510
- style.rowHeight !== undefined ||
511
- style.plotGutter !== undefined);
512
- const gutterCfg = style?.plotGutter;
513
- const styleValue = hasStyle ? East.value({
514
- height: style.height !== undefined ? some(style.height) : none,
515
- maxHeight: style.maxHeight !== undefined ? some(style.maxHeight) : none,
516
- variant: variantValue ? some(variantValue) : none,
517
- size: sizeValue ? some(sizeValue) : none,
518
- density: densityValue ? some(densityValue) : none,
519
- striped: style.striped !== undefined ? some(style.striped) : none,
520
- stickyHeader: style.stickyHeader !== undefined ? some(style.stickyHeader) : none,
521
- showColumnBorder: style.showColumnBorder !== undefined ? some(style.showColumnBorder) : none,
522
- showToday: style.showToday !== undefined ? some(style.showToday) : none,
523
- rowHeight: style.rowHeight !== undefined ? some(style.rowHeight) : none,
524
- plotGutter: gutterCfg !== undefined
525
- ? some(East.value({
526
- left: gutterCfg.left !== undefined ? some(gutterCfg.left) : none,
527
- right: gutterCfg.right !== undefined ? some(gutterCfg.right) : none,
528
- }, PlotGutterType))
529
- : none,
530
- }, GanttStyleType) : undefined;
531
- const sliceChromeValue = style?.slice !== undefined
532
- ? East.value({
533
- slice: style.slice,
534
- affordances: East.value((style.affordances ?? ["filter", "search", "range"]).map(a => variant(a, null)), ArrayType(SliceAffordanceType)),
535
- }, SliceChromeType)
536
- : undefined;
537
- return East.value(variant("Gantt", {
538
- rows: rows_mapped,
539
- columns: columns_expr,
540
- frozen: frozen_expr,
541
- axis: style?.axis ? some(buildGanttAxis(style.axis)) : none,
542
- dragStep: style?.dragStep ? some(style.dragStep) : none,
543
- durationStep: style?.durationStep ? some(style.durationStep) : none,
544
- rowStatus: style?.rowStatus !== undefined
545
- ? some(East.value(style.rowStatus, FunctionType([IntegerType], StatusTokenType)))
546
- : none,
547
- onCellClick: style?.onCellClick ? some(style.onCellClick) : none,
548
- onCellDoubleClick: style?.onCellDoubleClick ? some(style.onCellDoubleClick) : none,
549
- onRowClick: style?.onRowClick ? some(style.onRowClick) : none,
550
- onRowDoubleClick: style?.onRowDoubleClick ? some(style.onRowDoubleClick) : none,
551
- onSortChange: style?.onSortChange ? some(style.onSortChange) : none,
552
- onTaskClick: style?.onTaskClick ? some(style.onTaskClick) : none,
553
- onTaskDoubleClick: style?.onTaskDoubleClick ? some(style.onTaskDoubleClick) : none,
554
- id: style?.id ?? "",
555
- sources: East.value(style?.sources ?? [], ArrayType(StringType)),
556
- onDrag: style?.onDrag ? some(style.onDrag) : none,
557
- canDrop: style?.canDrop ? some(style.canDrop) : none,
558
- onTaskProgressChange: style?.onTaskProgressChange ? some(style.onTaskProgressChange) : none,
559
- onMilestoneClick: style?.onMilestoneClick ? some(style.onMilestoneClick) : none,
560
- onMilestoneDoubleClick: style?.onMilestoneDoubleClick ? some(style.onMilestoneDoubleClick) : none,
561
- review: style?.review !== undefined ? some(buildReview(style.review, RowReviewType)) : none,
562
- slice: sliceChromeValue ? some(sliceChromeValue) : none,
563
- style: styleValue ? some(styleValue) : none,
564
- }), UIComponentType);
565
- }
566
- const GanttTypes = {
567
- /**
568
- * East StructType for the entire Gantt value — the root IR.
569
- *
570
- * @remarks
571
- * The main struct carries content (`rows` / `columns` /
572
- * `frozen`), drag-step configuration, structured state
573
- * (`rowStatus`), and behaviour callbacks; visual-only fields live
574
- * inside the optional `style` sub-struct ({@link GanttStyleType}).
575
- *
576
- * @property rows - Array of Gantt rows ({@link GanttRowType})
577
- * @property columns - Array of column definitions (shared with Table)
578
- * @property frozen - Column keys to freeze (pin left)
579
- * @property dragStep - Optional snap step for task drag
580
- * @property durationStep - Optional snap step for task duration change
581
- * @property rowStatus - Row-status callback `(rowIndex) => StatusToken`
582
- * @property onCellClick - Cell click callback
583
- * @property onCellDoubleClick - Cell double-click callback
584
- * @property onRowClick - Row click callback
585
- * @property onRowDoubleClick - Row double-click callback
586
- * @property onSortChange - Sort change callback
587
- * @property onTaskClick - Task click callback
588
- * @property onTaskDoubleClick - Task double-click callback
589
- * @property onTaskDrag - Task drag callback (presence enables drag)
590
- * @property onTaskDurationChange - Task duration-change callback (presence enables resize)
591
- * @property onTaskProgressChange - Task progress-change callback
592
- * @property onMilestoneClick - Milestone click callback
593
- * @property onMilestoneDoubleClick - Milestone double-click callback
594
- * @property style - Optional visual style sub-struct
595
- */
596
- Root: GanttRootType,
597
- /**
598
- * East StructType for a single Gantt row.
599
- *
600
- * @remarks
601
- * Each row pairs `cells` (the dict of column-keyed table cells,
602
- * shared with the Table primitive) with two timeline tracks:
603
- * `tasks` (duration bars) and `milestones` (single-point markers).
604
- *
605
- * @property cells - Dict of column key to cell content (shared with Table)
606
- * @property tasks - Array of task bars ({@link GanttTaskType})
607
- * @property milestones - Array of milestone markers ({@link GanttMilestoneType})
608
- */
609
- Row: GanttRowType,
610
- /**
611
- * East StructType for a single Gantt task bar.
612
- *
613
- * @remarks
614
- * Every optional field is wrapped in `OptionType`. Use the
615
- * {@link createTask | `Gantt.Task`} factory to construct values
616
- * from a flat TS interface; the factory handles the `some` /
617
- * `none` / `variant(...)` envelopes for you.
618
- *
619
- * @property start - Start date/time of the task
620
- * @property end - End date/time of the task
621
- * @property label - Optional rich label (text + alignment + typography)
622
- * @property progress - Progress percentage (0-100)
623
- * @property status - Schedule status driving the bar colour (committed / proposed / atRisk)
624
- * @property popover - Click-triggered rich popover (UIComponent)
625
- */
626
- Task: GanttTaskType,
627
- /**
628
- * East StructType for a single Gantt milestone marker.
629
- *
630
- * @remarks
631
- * Every optional field is wrapped in `OptionType`. Use the
632
- * {@link createMilestone | `Gantt.Milestone`} factory to construct
633
- * values from a flat TS interface.
634
- *
635
- * @property date - The date/time of the milestone
636
- * @property label - Optional rich label (text + alignment + typography)
637
- * @property kind - Milestone kind driving the diamond fill (interim / release)
638
- * @property popover - Click-triggered rich popover (UIComponent)
639
- */
640
- Milestone: GanttMilestoneType,
641
- /**
642
- * East VariantType for a task's audit state — the shared event
643
- * lifecycle (`PlannerStateType`, #262). Drives the bar treatment:
644
- * committed solid, proposed(added) dashed, proposed(model) dashed
645
- * ghost, proposed(removed) struck ghost, rejected greyed strike.
646
- *
647
- * @property committed - Audit-locked, immutable
648
- * @property proposed - Drafted; the flavour (added / model / removed) is nested
649
- * @property rejected - Reviewed and declined; kept for diff
650
- */
651
- State: PlannerStateType,
652
- /**
653
- * East VariantType for a task's optional risk/status tint — the
654
- * status axis the old `atRisk` moved to (#262); tints the bar
655
- * colour over the state treatment.
656
- *
657
- * @property success - On-track (green tint)
658
- * @property warning - Caution (amber tint)
659
- * @property danger - Slipping / blocked (red tint — the old `atRisk`)
660
- * @property info - Informational (teal tint)
661
- * @property neutral - Muted
662
- */
663
- Status: StatusValueType,
664
- /**
665
- * A row's review decision — the shared `ApprovalStateType`
666
- * (approved / pending / rejected) from `contracts/review.ts` (#263).
667
- */
668
- Approval: ApprovalStateType,
669
- /**
670
- * The review configuration — the shared row-granularity
671
- * `RowReviewType` (decision column + commitBar foot) from
672
- * `contracts/review.ts` (#263).
673
- */
674
- Review: RowReviewType,
675
- /**
676
- * The per-row approve / reject callback payload — the shared
677
- * `RowRefType` (`{ rowIndex }`).
678
- */
679
- ApproveEvent: RowRefType,
680
- /**
681
- * East VariantType for a milestone's kind — drives the diamond fill.
682
- *
683
- * @property interim - Intermediate checkpoint (amber)
684
- * @property release - Shippable deliverable (brand teal)
685
- */
686
- MilestoneKind: GanttMilestoneKindType,
687
- /**
688
- * East StructType for the Gantt time-axis configuration.
689
- *
690
- * @remarks
691
- * The Gantt analogue of the Planner `axis`, specialised to the single
692
- * time scale. Construct via the `axis` option on `Gantt.Root`.
693
- *
694
- * @property range - Optional explicit `{ min, max }` window (omitted ⇒ derived from data)
695
- * @property format - Optional tick-label date pattern (e.g. `"MMM"`)
696
- * @property tier - Optional header band granularity ({@link GanttTierType})
697
- */
698
- Axis: GanttAxisType,
699
- /**
700
- * East VariantType for the axis header granularity.
701
- *
702
- * @property auto - Interval + count chosen automatically
703
- * @property day - One band per day
704
- * @property week - One band per week
705
- * @property month - One band per calendar month
706
- * @property quarter - One band per calendar quarter
707
- * @property year - One band per calendar year
708
- */
709
- Tier: GanttTierType,
710
- /**
711
- * East StructType holding every visual field for a Gantt.
712
- *
713
- * @remarks
714
- * Visual-only. Mirror of {@link GanttStyleType} —
715
- * exposed on the namespace so consumers can reference the IR
716
- * style type via `Gantt.Types.Style`.
717
- *
718
- * @property height - CSS height for the Gantt container
719
- * @property variant - Table variant (line / outline)
720
- * @property size - Table size (sm / md / lg)
721
- * @property density - Density preset driving row + header height (compact / condensed / comfortable)
722
- * @property striped - Whether to show zebra stripes on rows
723
- * @property stickyHeader - Whether the header sticks when scrolling
724
- * @property showColumnBorder - Whether to show borders between columns
725
- * @property showToday - Whether to show the now-line
726
- */
727
- Style: GanttStyleType,
728
- /**
729
- * East StructType for a table column definition — re-export of
730
- * the shared {@link TableColumnType} so consumers can reference
731
- * column shape via `Gantt.Types.Column`.
732
- *
733
- * @property key - The column key (field name)
734
- * @property dataType - Original data field type
735
- * @property valueType - Sortable / display value type after value-fn
736
- * @property header - Optional header text
737
- * @property width - Optional CSS width
738
- * @property minWidth - Optional CSS min-width
739
- * @property maxWidth - Optional CSS max-width
740
- * @property render - Optional render function for cell content
741
- */
742
- Column: TableColumnType,
743
- /**
744
- * East StructType for a table cell — re-export of the shared
745
- * {@link TableCellType} so consumers can reference the cell
746
- * shape via `Gantt.Types.Cell`.
747
- *
748
- * @property value - The literal cell value (used for sorting)
749
- * @property content - Optional pre-rendered UIComponent body
750
- */
751
- Cell: TableCellType,
752
- /**
753
- * East StructType for the event payload of `onTaskClick` /
754
- * `onTaskDoubleClick` callbacks.
755
- *
756
- * @property rowIndex - Row index (0-based)
757
- * @property taskIndex - Task index within the row (0-based)
758
- * @property taskStart - Start date/time of the task
759
- * @property taskEnd - End date/time of the task
760
- */
761
- TaskClickEvent: GanttTaskClickEventType,
762
- /**
763
- * East StructType for the event payload of `onTaskProgressChange`.
764
- *
765
- * @property rowIndex - Row index (0-based)
766
- * @property taskIndex - Task index within the row (0-based)
767
- * @property previousProgress - Previous progress value (0-100)
768
- * @property newProgress - New progress value (0-100)
769
- */
770
- TaskProgressChangeEvent: GanttTaskProgressChangeEventType,
771
- /**
772
- * East StructType for the event payload of `onMilestoneClick` /
773
- * `onMilestoneDoubleClick` callbacks.
774
- *
775
- * @property rowIndex - Row index (0-based)
776
- * @property milestoneIndex - Milestone index within the row (0-based)
777
- * @property milestoneDate - Date/time of the milestone
778
- */
779
- MilestoneClickEvent: GanttMilestoneClickEventType,
780
- };
781
- /**
782
- * Gantt namespace for creating Gantt chart components.
783
- *
784
- * @remarks
785
- * Gantt charts display time-based events (tasks and milestones) in rows.
786
- * Each row has table columns on the left and a timeline with events on the right.
787
- * The API follows the Table pattern for column configuration.
788
- */
789
- const GanttImpl = {
790
- /**
791
- * Creates a Gantt component following the Table pattern.
792
- *
793
- * @typeParam T - The struct type of each data row
794
- * @param data - Array of data structs
795
- * @param columns - Column specification for the left-side table columns
796
- * @param events - Function to extract events from each row
797
- * @param style - Optional Gantt styling
798
- * @returns An East expression representing the Gantt component
799
- *
800
- * @remarks
801
- * Gantt charts display time-based events (tasks and milestones) in rows.
802
- * Each row has table columns on the left and a timeline with events on the right.
803
- * The API follows the Table pattern for column configuration.
804
- *
805
- * @example
806
- * ```ts
807
- * import { East } from "@elaraai/east";
808
- * import { Gantt, UIComponentType } from "@elaraai/east-ui";
809
- *
810
- * const example = East.function([], UIComponentType, $ => {
811
- * return Gantt.Root(
812
- * [
813
- * { name: "Design", start: new Date("2024-01-01"), end: new Date("2024-01-15") },
814
- * { name: "Development", start: new Date("2024-01-10"), end: new Date("2024-02-01") },
815
- * ],
816
- * ["name"],
817
- * row => ({ tasks: [Gantt.Task({ start: row.start, end: row.end })] }),
818
- * { showToday: true }
819
- * );
820
- * });
821
- * ```
822
- */
823
- Root: createGantt,
824
- /**
825
- * Builds a single Gantt task East value from an ergonomic TS input.
826
- *
827
- * @param input - Task configuration ({@link TaskInput})
828
- * @returns An East expression of {@link GanttTaskType}
829
- *
830
- * @remarks
831
- * Use inside the `rowSpec` callback of `Gantt.Root`. The callback's
832
- * `tasks` field is `SubtypeExprOrValue<ArrayType<GanttTaskType>>`,
833
- * so callers pass either an East-side ArrayExpr or a JS array of
834
- * values built by this factory. The factory normalises optional
835
- * fields (`label` / `progress` / `status` / `popover`) into their
836
- * `OptionType` envelopes and converts variant string literals
837
- * (`"committed"`, `"start"`) to East variant values — flat TS input
838
- * in, fully-shaped East value out.
839
- *
840
- * @example
841
- * ```ts
842
- * import { East } from "@elaraai/east";
843
- * import { Gantt, UIComponentType } from "@elaraai/east-ui";
844
- *
845
- * const example = East.function([], UIComponentType, _$ => {
846
- * return Gantt.Root(
847
- * [{ name: "Design", start: new Date("2024-01-01"), end: new Date("2024-01-15") }],
848
- * ["name"],
849
- * row => ({ tasks: [Gantt.Task({
850
- * start: row.start,
851
- * end: row.end,
852
- * label: "Design Phase",
853
- * progress: 75,
854
- * status: "committed",
855
- * })] }),
856
- * );
857
- * });
858
- * ```
859
- */
860
- Task: createTask,
861
- /**
862
- * Builds a single Gantt milestone East value from an ergonomic TS input.
863
- *
864
- * @param input - Milestone configuration ({@link MilestoneInput})
865
- * @returns An East expression of {@link GanttMilestoneType}
866
- *
867
- * @remarks
868
- * Use inside the `rowSpec` callback of `Gantt.Root`. The callback's
869
- * `milestones` field is `SubtypeExprOrValue<ArrayType<GanttMilestoneType>>`,
870
- * so callers pass either an East-side ArrayExpr or a JS array of
871
- * values built by this factory. Same option/variant normalisation
872
- * as `Gantt.Task`.
873
- *
874
- * @example
875
- * ```ts
876
- * import { East } from "@elaraai/east";
877
- * import { Gantt, UIComponentType } from "@elaraai/east-ui";
878
- *
879
- * const example = East.function([], UIComponentType, _$ => {
880
- * return Gantt.Root(
881
- * [{ name: "Launch", date: new Date("2024-02-01") }],
882
- * ["name"],
883
- * row => ({ milestones: [Gantt.Milestone({
884
- * date: row.date,
885
- * label: "Design Complete",
886
- * kind: "release",
887
- * })] }),
888
- * );
889
- * });
890
- * ```
891
- */
892
- Milestone: createMilestone,
893
- Types: GanttTypes,
894
- };
895
- export const Gantt = GanttImpl;
896
- //# sourceMappingURL=index.js.map