@toclocoinc/lattice-grid 1.32.0 → 1.34.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.
Files changed (65) hide show
  1. package/README.md +1 -1
  2. package/docs/API.html +420 -2
  3. package/docs/api-detail.html +5 -2
  4. package/lattice-grid.d.ts +730 -1
  5. package/lattice-grid.esm.min.js +4 -4
  6. package/lattice-grid.min.cjs +4 -4
  7. package/lattice-grid.min.js +4 -4
  8. package/modules/angular.esm.min.js +2 -2
  9. package/modules/angular.min.cjs +2 -2
  10. package/modules/angular.min.js +2 -2
  11. package/modules/chart-alluvial.esm.min.js +143 -0
  12. package/modules/chart-arc.esm.min.js +102 -0
  13. package/modules/chart-bubblemap.esm.min.js +86 -0
  14. package/modules/chart-bump.esm.min.js +105 -0
  15. package/modules/chart-calendar.esm.min.js +124 -0
  16. package/modules/chart-decomposition.esm.min.js +127 -0
  17. package/modules/chart-diverging.esm.min.js +99 -0
  18. package/modules/chart-dumbbell.esm.min.js +110 -0
  19. package/modules/chart-fan.esm.min.js +135 -0
  20. package/modules/chart-hexbin.esm.min.js +144 -0
  21. package/modules/chart-hexmap.esm.min.js +120 -0
  22. package/modules/chart-icicle.esm.min.js +92 -0
  23. package/modules/chart-parallel.esm.min.js +114 -0
  24. package/modules/chart-ridgeline.esm.min.js +114 -0
  25. package/modules/chart-roc.esm.min.js +177 -0
  26. package/modules/chart-slope.esm.min.js +95 -0
  27. package/modules/chart-splom.esm.min.js +120 -0
  28. package/modules/chart-waffle.esm.min.js +92 -0
  29. package/modules/charts.esm.min.js +107 -9
  30. package/modules/charts.min.cjs +105 -9
  31. package/modules/charts.min.js +105 -9
  32. package/modules/data-router.esm.min.js +1546 -8
  33. package/modules/data-router.min.cjs +1546 -8
  34. package/modules/data-router.min.js +1546 -8
  35. package/modules/devtools.esm.min.js +2 -2
  36. package/modules/devtools.min.cjs +2 -2
  37. package/modules/devtools.min.js +2 -2
  38. package/modules/dhtmlx-compat.esm.min.js +4 -4
  39. package/modules/dhtmlx-compat.min.cjs +4 -4
  40. package/modules/dhtmlx-compat.min.js +4 -4
  41. package/modules/gantt.esm.min.js +2004 -0
  42. package/modules/gantt.min.cjs +1996 -0
  43. package/modules/gantt.min.js +1996 -0
  44. package/modules/htmx.esm.min.js +4 -4
  45. package/modules/htmx.min.cjs +4 -4
  46. package/modules/htmx.min.js +4 -4
  47. package/modules/kanban.esm.min.js +2278 -0
  48. package/modules/kanban.min.cjs +2281 -0
  49. package/modules/kanban.min.js +2281 -0
  50. package/modules/mock-socket.esm.min.js +2 -2
  51. package/modules/mock-socket.min.cjs +242 -0
  52. package/modules/mock-socket.min.js +242 -0
  53. package/modules/react.esm.min.js +2 -2
  54. package/modules/react.min.cjs +2 -2
  55. package/modules/react.min.js +2 -2
  56. package/modules/svelte.esm.min.js +2 -2
  57. package/modules/svelte.min.cjs +2 -2
  58. package/modules/svelte.min.js +2 -2
  59. package/modules/vue.esm.min.js +2 -2
  60. package/modules/vue.min.cjs +2 -2
  61. package/modules/vue.min.js +2 -2
  62. package/modules/webcomponent.esm.min.js +4 -4
  63. package/modules/webcomponent.min.cjs +4 -4
  64. package/modules/webcomponent.min.js +4 -4
  65. package/package.json +1 -1
package/lattice-grid.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.32.0, type declarations
2
+ * Lattice Grid 1.34.0, type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
@@ -5863,9 +5863,244 @@ declare module 'lattice-grid/modules/charts' {
5863
5863
  export function resolveScheme(spec?: object): object;
5864
5864
  export function schemeNames(): string[];
5865
5865
  export function setDefaultScheme(name: string): void;
5866
+ /**
5867
+ * The definition an extension chart type registers (BACKLOG-0000886). `draw`
5868
+ * receives the base drawing context — `plot`, `bound`, `groups`, `scheme`,
5869
+ * `typography`, `fontSize`, `labels`, `grid`, `spec`, `doc` — plus
5870
+ * `ctx.helpers`, the base's own toolkit of primitives (element factory, scales,
5871
+ * axes, mark pool, distribution kernels), and appends its marks to the layer
5872
+ * groups. `bind` optionally supplies the bound data (default: the by-series
5873
+ * binder); `freeform` lays the chart out without axis gutters; `labelled`
5874
+ * declares that `labels` applies.
5875
+ */
5876
+ interface ChartTypeDefinition {
5877
+ draw: (ctx: object) => object;
5878
+ bind?: (grid: Grid, spec: ChartSpec) => object;
5879
+ freeform?: boolean;
5880
+ labelled?: boolean;
5881
+ }
5882
+ /**
5883
+ * Register an extension chart type so `createChart({ type })` can draw it
5884
+ * (BACKLOG-0000886). Extension types ship as their own opt-in modules, so the
5885
+ * base charts bundle does not grow for a type a caller never imports — you pay
5886
+ * only for the charts you use.
5887
+ */
5888
+ export function registerChartType(name: string, def: ChartTypeDefinition): void;
5889
+ /** Every registered extension chart-type name, in registration order. */
5890
+ export function registeredChartTypes(): string[];
5866
5891
  export { Chart };
5867
5892
  }
5868
5893
 
5894
+ declare module 'lattice-grid/modules/chart-ridgeline' {
5895
+ /**
5896
+ * The ridgeline (joy plot) extension chart type (BACKLOG-0000886). Importing
5897
+ * this module registers `ridgeline` with the base charts module; the base
5898
+ * bundle does not include it unless a caller imports it. Draws one
5899
+ * kernel-density ridge per category (`x`), stacked and overlapping, over the
5900
+ * distribution of a measure (`y`); `spec.overlap` sets the vertical overlap.
5901
+ */
5902
+ export function drawRidgeline(ctx: object): object;
5903
+ export default drawRidgeline;
5904
+ }
5905
+
5906
+ declare module 'lattice-grid/modules/chart-calendar' {
5907
+ /**
5908
+ * The calendar-heatmap extension chart type (BACKLOG-0000886). Importing this
5909
+ * module registers `calendar`. Draws value-by-day as a GitHub-style grid: `x`
5910
+ * is a date column, `y` the measure summed per day.
5911
+ */
5912
+ export function drawCalendar(ctx: object): object;
5913
+ export default drawCalendar;
5914
+ }
5915
+
5916
+ declare module 'lattice-grid/modules/chart-splom' {
5917
+ /**
5918
+ * The scatter-plot-matrix (SPLOM) extension chart type (BACKLOG-0000886).
5919
+ * Importing this module registers `splom`. Crosses every pair of the numeric
5920
+ * `columns` (2–6) as a matrix of scatters, naming each variable on the
5921
+ * diagonal.
5922
+ */
5923
+ export function drawSplom(ctx: object): object;
5924
+ /** The SPLOM binding: reads the numeric `columns` off the grid's visible rows. */
5925
+ export function bindSplom(grid: Grid, spec: object): object;
5926
+ export default drawSplom;
5927
+ }
5928
+
5929
+ declare module 'lattice-grid/modules/chart-hexbin' {
5930
+ /**
5931
+ * The hexbin / 2D-density extension chart type (BACKLOG-0000886). Importing
5932
+ * this module registers `hexbin`. Bins `x`/`y` points into hexagons shaded by
5933
+ * count, so a large scatter reads as a density field rather than overplotting.
5934
+ */
5935
+ export function drawHexbin(ctx: object): object;
5936
+ /** The hexbin binding: reads the numeric `x` and `y` columns off the grid's rows. */
5937
+ export function bindHexbin(grid: Grid, spec: object): object;
5938
+ export default drawHexbin;
5939
+ }
5940
+
5941
+ declare module 'lattice-grid/modules/chart-roc' {
5942
+ /**
5943
+ * The ROC / PR / calibration extension chart type (BACKLOG-0000886). Importing
5944
+ * this module registers `roc`. `spec.curve` chooses `'roc'` (default, with the
5945
+ * chance diagonal and AUC), `'pr'`, or `'calibration'`; `label` is the outcome
5946
+ * column (positive when truthy or equal to `spec.positive`), `score` the model
5947
+ * score.
5948
+ */
5949
+ export function drawRoc(ctx: object): object;
5950
+ /** The ROC binding: reads the outcome and score off the grid's rows. */
5951
+ export function bindRoc(grid: Grid, spec: object): object;
5952
+ export default drawRoc;
5953
+ }
5954
+
5955
+ declare module 'lattice-grid/modules/chart-fan' {
5956
+ /**
5957
+ * The fan / forecast extension chart type (BACKLOG-0000886). Importing this
5958
+ * module registers `fan`. Draws `y` (history) as a solid line, `forecast` as a
5959
+ * dashed continuation, and the `lower`/`upper` interval as a widening band.
5960
+ */
5961
+ export function drawFan(ctx: object): object;
5962
+ /** The fan binding: reads the history, forecast and interval columns in row order. */
5963
+ export function bindFan(grid: Grid, spec: object): object;
5964
+ export default drawFan;
5965
+ }
5966
+
5967
+ declare module 'lattice-grid/modules/chart-decomposition' {
5968
+ /**
5969
+ * The seasonal-decomposition panel extension chart type (BACKLOG-0000886),
5970
+ * companion to the `tsTrend`/`tsSeasonal`/`tsResidual` shadow columns.
5971
+ * Importing this module registers `decomposition`. Draws a stacked panel per
5972
+ * named component column (`observed`/`trend`/`seasonal`/`residual`) sharing one
5973
+ * x axis.
5974
+ */
5975
+ export function drawDecomposition(ctx: object): object;
5976
+ /** The decomposition binding: reads the named component columns in row order. */
5977
+ export function bindDecomposition(grid: Grid, spec: object): object;
5978
+ export default drawDecomposition;
5979
+ }
5980
+
5981
+ declare module 'lattice-grid/modules/chart-slope' {
5982
+ /**
5983
+ * The slope-chart extension type (BACKLOG-0000886). Importing this module
5984
+ * registers `slope`. One line per `series` connecting its `y` across the `x`
5985
+ * periods — before/after comparison read from the slopes.
5986
+ */
5987
+ export function drawSlope(ctx: object): object;
5988
+ export default drawSlope;
5989
+ }
5990
+
5991
+ declare module 'lattice-grid/modules/chart-dumbbell' {
5992
+ /**
5993
+ * The dumbbell / connected-dot extension type (BACKLOG-0000886). Importing
5994
+ * this module registers `dumbbell`. Two dots (`start`, `end`) joined by a bar
5995
+ * per `x` category — the gap is the bar's length.
5996
+ */
5997
+ export function drawDumbbell(ctx: object): object;
5998
+ /** The dumbbell binding: reads the category and its two numeric columns. */
5999
+ export function bindDumbbell(grid: Grid, spec: object): object;
6000
+ export default drawDumbbell;
6001
+ }
6002
+
6003
+ declare module 'lattice-grid/modules/chart-bump' {
6004
+ /**
6005
+ * The bump-chart extension type (BACKLOG-0000886). Importing this module
6006
+ * registers `bump`. One line per `series` plotted by its rank of `y` within
6007
+ * each `x` period — rank-over-time, where crossings are the story.
6008
+ */
6009
+ export function drawBump(ctx: object): object;
6010
+ export default drawBump;
6011
+ }
6012
+
6013
+ declare module 'lattice-grid/modules/chart-diverging' {
6014
+ /**
6015
+ * The diverging-bar extension type (BACKLOG-0000886). Importing this module
6016
+ * registers `diverging`. Horizontal bars growing left/right from a central
6017
+ * zero over a signed `y`, on a symmetric scale.
6018
+ */
6019
+ export function drawDiverging(ctx: object): object;
6020
+ export default drawDiverging;
6021
+ }
6022
+
6023
+ declare module 'lattice-grid/modules/chart-parallel' {
6024
+ /**
6025
+ * The parallel-coordinates extension type (BACKLOG-0000886). Importing this
6026
+ * module registers `parallel`. One polyline per row across the numeric
6027
+ * `columns`, each a vertical axis with its own scale; `spec.colourBy` colours
6028
+ * by a category.
6029
+ */
6030
+ export function drawParallel(ctx: object): object;
6031
+ /** The parallel-coordinates binding: reads the dimension columns off the rows. */
6032
+ export function bindParallel(grid: Grid, spec: object): object;
6033
+ export default drawParallel;
6034
+ }
6035
+
6036
+ declare module 'lattice-grid/modules/chart-icicle' {
6037
+ /**
6038
+ * The icicle extension type (BACKLOG-0000886). Importing this module registers
6039
+ * `icicle`. A hierarchy (the grid's group tree) as nested rectangles in rows,
6040
+ * sized by `y`; drills like the built-in hierarchical types.
6041
+ */
6042
+ export function drawIcicle(ctx: object): object;
6043
+ export default drawIcicle;
6044
+ }
6045
+
6046
+ declare module 'lattice-grid/modules/chart-waffle' {
6047
+ /**
6048
+ * The waffle / dot-matrix extension type (BACKLOG-0000886). Importing this
6049
+ * module registers `waffle`. Proportion as counted squares (default 100), one
6050
+ * colour per `x` category sized by `y`.
6051
+ */
6052
+ export function drawWaffle(ctx: object): object;
6053
+ export default drawWaffle;
6054
+ }
6055
+
6056
+ declare module 'lattice-grid/modules/chart-alluvial' {
6057
+ /**
6058
+ * The alluvial extension type (BACKLOG-0000886). Importing this module
6059
+ * registers `alluvial`. Ribbons from `source` categories to `target`
6060
+ * categories sized by `value` — categorical flow between two dimensions.
6061
+ */
6062
+ export function drawAlluvial(ctx: object): object;
6063
+ /** The alluvial binding: aggregates source→target flows off the grid's rows. */
6064
+ export function bindAlluvial(grid: Grid, spec: object): object;
6065
+ export default drawAlluvial;
6066
+ }
6067
+
6068
+ declare module 'lattice-grid/modules/chart-arc' {
6069
+ /**
6070
+ * The arc-diagram extension type (BACKLOG-0000886). Importing this module
6071
+ * registers `arc`. Nodes on a baseline with `source`→`target` relationships as
6072
+ * semicircular arcs, thickness by `value`.
6073
+ */
6074
+ export function drawArc(ctx: object): object;
6075
+ /** The arc-diagram binding: collects nodes and edges off the grid's rows. */
6076
+ export function bindArc(grid: Grid, spec: object): object;
6077
+ export default drawArc;
6078
+ }
6079
+
6080
+ declare module 'lattice-grid/modules/chart-bubblemap' {
6081
+ /**
6082
+ * The symbol / bubble-map extension type (BACKLOG-0000886). Importing this
6083
+ * module registers `bubblemap`. Points placed by `lon`/`lat`, each a bubble
6084
+ * with a square-root radius from `size`; needs no outlines and fetches nothing.
6085
+ */
6086
+ export function drawBubbleMap(ctx: object): object;
6087
+ /** The bubble-map binding: reads the coordinate and size columns off the rows. */
6088
+ export function bindBubbleMap(grid: Grid, spec: object): object;
6089
+ export default drawBubbleMap;
6090
+ }
6091
+
6092
+ declare module 'lattice-grid/modules/chart-hexmap' {
6093
+ /**
6094
+ * The hexbin-map extension type (BACKLOG-0000886). Importing this module
6095
+ * registers `hexmap`. `lon`/`lat` points binned into hexagons shaded by count,
6096
+ * so a geographic density reads without overplotting or outlines.
6097
+ */
6098
+ export function drawHexMap(ctx: object): object;
6099
+ /** The hexbin-map binding: reads the coordinate columns off the grid's rows. */
6100
+ export function bindHexMap(grid: Grid, spec: object): object;
6101
+ export default drawHexMap;
6102
+ }
6103
+
5869
6104
  declare module 'lattice-grid/modules/react' {
5870
6105
  /**
5871
6106
  * Build the React component.
@@ -6037,6 +6272,189 @@ declare module 'lattice-grid/modules/data-router' {
6037
6272
  export default createDataRouter;
6038
6273
  }
6039
6274
 
6275
+ declare module 'lattice-grid/modules/gantt' {
6276
+ /** One of the four dependency link types (finish-to-start, start-to-start, finish-to-finish, start-to-finish). */
6277
+ export type GanttLinkType = 'FS' | 'SS' | 'FF' | 'SF';
6278
+
6279
+ /**
6280
+ * A task in a Gantt plan. Give a `duration` or a numeric `start`+`end` (one is
6281
+ * derived from the other). `milestone: true` (or `duration: 0`) is a
6282
+ * zero-duration point. `parent` nests a task under a summary task, whose window
6283
+ * and progress are DERIVED from its children rather than scheduled.
6284
+ */
6285
+ export interface GanttTask {
6286
+ id: string | number;
6287
+ name?: string;
6288
+ start?: number;
6289
+ end?: number;
6290
+ duration?: number;
6291
+ percentComplete?: number;
6292
+ milestone?: boolean;
6293
+ parent?: string | number;
6294
+ }
6295
+
6296
+ /**
6297
+ * A typed dependency between two tasks (by id), with optional lag/lead. `type`
6298
+ * defaults to `'FS'`; either endpoint may be a leaf or a summary.
6299
+ */
6300
+ export interface GanttDependency {
6301
+ from: string | number;
6302
+ to: string | number;
6303
+ type?: GanttLinkType;
6304
+ lag?: number;
6305
+ }
6306
+
6307
+ /** The computed CPM values for one task (a leaf is scheduled, a summary derived). */
6308
+ interface GanttScheduledTask {
6309
+ id: string;
6310
+ name: string;
6311
+ duration: number;
6312
+ es: number;
6313
+ ef: number;
6314
+ ls: number;
6315
+ lf: number;
6316
+ totalFloat: number;
6317
+ critical: boolean;
6318
+ percentComplete: number | null;
6319
+ parent: string | null;
6320
+ isSummary: boolean;
6321
+ isMilestone: boolean;
6322
+ children: string[];
6323
+ }
6324
+
6325
+ /** A CPM schedule result: per-task dates/float and the critical path, or an error. */
6326
+ interface GanttSchedule {
6327
+ ok: boolean;
6328
+ error?: { code: string; message: string; cycle?: string[] };
6329
+ tasks?: Map<string, GanttScheduledTask>;
6330
+ order?: string[];
6331
+ critical?: string[];
6332
+ criticalPaths?: string[][];
6333
+ projectStart?: number;
6334
+ projectFinish?: number;
6335
+ projectDuration?: number;
6336
+ }
6337
+
6338
+ /** A placement violation flagged by `findViolations`. */
6339
+ interface GanttViolation {
6340
+ id: string;
6341
+ placedStart: number;
6342
+ earliestStart: number;
6343
+ by: number;
6344
+ }
6345
+
6346
+ /** The four link types, in documented order. */
6347
+ export const LINK_TYPES: readonly GanttLinkType[];
6348
+
6349
+ /** Error codes the scheduler reports (rather than throwing) on bad input. */
6350
+ export const SCHEDULE_ERROR: Record<string, string>;
6351
+
6352
+ /**
6353
+ * Compute the CPM schedule for a set of tasks and dependencies: forward and
6354
+ * backward passes over the leaf tasks honouring FS/SS/FF/SF + lag, slack/float
6355
+ * and the zero-float critical path, with summaries derived from their children,
6356
+ * milestones scheduled as points, and dependency cycles refused (never looped).
6357
+ */
6358
+ export function computeSchedule(tasks: GanttTask[], deps?: GanttDependency[], options?: { projectStart?: number; deadline?: number }): GanttSchedule;
6359
+
6360
+ /** The tasks placed earlier than their earliest feasible start (manual validation). */
6361
+ export function findViolations(tasks: GanttTask[], schedule: GanttSchedule): GanttViolation[];
6362
+
6363
+ /** Format an engine day-number as an ISO calendar date (`YYYY-MM-DD`, UTC). */
6364
+ export function toISODate(day: number): string | null;
6365
+
6366
+ /** A headless Gantt controller: holds the model, recomputes on edits, emits changes. */
6367
+ interface Gantt {
6368
+ readonly tasks: GanttTask[];
6369
+ readonly dependencies: GanttDependency[];
6370
+ readonly schedule: GanttSchedule | null;
6371
+ readonly critical: string[];
6372
+ readonly autoSchedule: boolean;
6373
+ readonly grid: unknown;
6374
+ setTasks(tasks: GanttTask[]): GanttSchedule;
6375
+ setDependencies(deps: GanttDependency[]): GanttSchedule;
6376
+ applyEdit(patch: { id: string | number; start?: number; end?: number; duration?: number }, editOpts?: { writeBack?: boolean }): GanttSchedule;
6377
+ compute(): GanttSchedule;
6378
+ findViolations(): GanttViolation[];
6379
+ /** Export the scheduled tasks as CSV; `{ dates: true }` writes ISO dates. */
6380
+ toCSV(csvOpts?: { dates?: boolean }): string;
6381
+ /**
6382
+ * The live consumer surface, mirroring `grid.rows.apply`, so a Data Router
6383
+ * can drive the Gantt like any other view. Keyed by the controller's rowKey.
6384
+ */
6385
+ readonly rows: {
6386
+ apply(change: { add?: GanttTask[]; update?: GanttTask[]; remove?: Array<string | GanttTask> }): {
6387
+ added: GanttTask[]; updated: GanttTask[]; removed: string[];
6388
+ };
6389
+ };
6390
+ on(event: 'schedule' | 'error', fn: (payload: unknown) => void): () => void;
6391
+ off(event: 'schedule' | 'error', fn: (payload: unknown) => void): void;
6392
+ /**
6393
+ * Render the plan into a container as an SVG timeline (bars, dependency
6394
+ * arrows, critical-path highlight, today line, non-working shading,
6395
+ * milestones, progress). The view redraws when the schedule recomputes.
6396
+ */
6397
+ mount(container: unknown, options?: {
6398
+ width?: number;
6399
+ rowHeight?: number;
6400
+ labelWidth?: number;
6401
+ rowLabels?: boolean;
6402
+ showArrows?: boolean;
6403
+ showCritical?: boolean;
6404
+ showProgress?: boolean;
6405
+ dateAxis?: boolean;
6406
+ today?: number;
6407
+ nonWorking?: 'weekends' | ((day: number) => boolean);
6408
+ label?: 'name' | 'percent' | 'dates' | 'none' | ((task: GanttScheduledTask) => string);
6409
+ /** Whether bars can be dragged to move/resize (default true). */
6410
+ editable?: boolean;
6411
+ /** Pixels from a bar's right edge that begin a resize rather than a move. */
6412
+ resizeZone?: number;
6413
+ /** Time-scale zoom: a level, or raw pixels-per-day. Omit to fit the width. */
6414
+ zoom?: 'day' | 'week' | 'month' | 'quarter' | number;
6415
+ /** Scroll so the today line is in view after drawing. */
6416
+ scrollToToday?: boolean;
6417
+ /** Show a hover tooltip (dates/duration/%/slack); default true. */
6418
+ tooltip?: boolean;
6419
+ /** Group tasks into swimlanes by a task property name or `fn(task)`. */
6420
+ groupBy?: string | ((task: GanttTask) => unknown);
6421
+ /** Keyboard editing + focusable bars + ARIA announcements (default true). */
6422
+ keyboard?: boolean;
6423
+ /** Days a keyboard arrow moves/resizes a task (default 1). */
6424
+ moveStep?: number;
6425
+ }): unknown;
6426
+ /** Detach the mounted view, if any. The host still owns the container. */
6427
+ unmount(): void;
6428
+ /** The mounted view, or null. */
6429
+ readonly view: unknown;
6430
+ destroy(): void;
6431
+ }
6432
+
6433
+ /**
6434
+ * Create a Gantt controller over a task list and a dependency list. Computes
6435
+ * the CPM schedule immediately and again on every `setTasks`/`setDependencies`/
6436
+ * `applyEdit`, emitting `schedule` on success and `error` on a cycle or bad
6437
+ * input. `grid` is stored for the write-back binding; `autoSchedule` requests
6438
+ * dependent cascading.
6439
+ */
6440
+ export function createGantt(opts?: {
6441
+ tasks?: GanttTask[];
6442
+ dependencies?: GanttDependency[];
6443
+ projectStart?: number;
6444
+ /** A project deadline (day-number); tasks that cannot meet it get negative float. */
6445
+ deadline?: number;
6446
+ autoSchedule?: boolean;
6447
+ grid?: unknown;
6448
+ /** Map task fields to grid column ids to enable drag write-back. */
6449
+ columns?: { start?: string; end?: string; duration?: string };
6450
+ /** Task identity for the live `rows.apply` surface (a field or fn); default 'id'. */
6451
+ rowKey?: string | ((row: GanttTask) => unknown);
6452
+ /** Auto-mount into this element at construction. */
6453
+ element?: unknown;
6454
+ }): Gantt;
6455
+ export default createGantt;
6456
+ }
6457
+
6040
6458
  declare module 'lattice-grid/modules/webcomponent' {
6041
6459
  /**
6042
6460
  * Register `<lattice-grid>`.
@@ -6261,3 +6679,314 @@ declare module 'lattice-grid/modules/mock-socket' {
6261
6679
 
6262
6680
  export default MockWebSocket;
6263
6681
  }
6682
+
6683
+ declare module 'lattice-grid/modules/kanban' {
6684
+ /** A row backing a card: any object. Its column comes from `columnProperty` and its identity from `rowKey`. */
6685
+ type KanbanRow = Record<string, unknown>;
6686
+
6687
+ /**
6688
+ * A card model — one row as it appears on the board. `fields` holds the
6689
+ * resolved display text for each mapped card field; `columnId` is the column
6690
+ * the card sits in; `points` is the numeric points value (0 when absent).
6691
+ * `swimlane`/`sprint`/`epic`/`order` are read from their configured properties
6692
+ * and carried for the later cycles that render them.
6693
+ */
6694
+ interface KanbanCard {
6695
+ key: unknown;
6696
+ row: KanbanRow;
6697
+ columnId: string | null;
6698
+ points: number;
6699
+ hasPoints: boolean;
6700
+ order?: unknown;
6701
+ swimlane?: unknown;
6702
+ sprint?: unknown;
6703
+ epic?: unknown;
6704
+ fields: Record<string, string>;
6705
+ }
6706
+
6707
+ /** A column with its cards and aggregates. `over` is true when `count` exceeds `wipLimit`. */
6708
+ interface KanbanColumn {
6709
+ id: string;
6710
+ title: string;
6711
+ color: string | null;
6712
+ wipLimit: number | null;
6713
+ collapsed: boolean;
6714
+ cards: KanbanCard[];
6715
+ count: number;
6716
+ points: number;
6717
+ over: boolean;
6718
+ }
6719
+
6720
+ /** A column definition: an id string, or an object configuring one column. */
6721
+ type KanbanColumnDef = string | {
6722
+ id: string;
6723
+ title?: string;
6724
+ color?: string;
6725
+ wipLimit?: number;
6726
+ collapsed?: boolean;
6727
+ };
6728
+
6729
+ /** A card field editor handle returned by a host editor factory. */
6730
+ interface KanbanEditor {
6731
+ el: HTMLElement;
6732
+ focus?: () => void;
6733
+ destroy?: () => void;
6734
+ }
6735
+
6736
+ /** A card field mapping: a property path, a function, or an object opting into inline edit. */
6737
+ type KanbanFieldMap = string | ((row: KanbanRow) => unknown) | {
6738
+ field: string;
6739
+ edit?: boolean;
6740
+ editor?: (ctx: { card: KanbanCard; field: string; value: string; commit: (value: unknown) => void; cancel: () => void }) => KanbanEditor;
6741
+ };
6742
+
6743
+ /** The field-to-property mapping that drives the card template. */
6744
+ interface KanbanCardMap {
6745
+ title?: KanbanFieldMap;
6746
+ subtitle?: KanbanFieldMap;
6747
+ labels?: KanbanFieldMap;
6748
+ assignee?: KanbanFieldMap;
6749
+ due?: KanbanFieldMap;
6750
+ cover?: KanbanFieldMap;
6751
+ progress?: KanbanFieldMap;
6752
+ badges?: KanbanFieldMap;
6753
+ accent?: KanbanFieldMap;
6754
+ [field: string]: KanbanFieldMap | undefined;
6755
+ }
6756
+
6757
+ /** Granular readonly: the whole board, or selectively by column id and card key. */
6758
+ type KanbanReadonly = boolean | {
6759
+ board?: boolean;
6760
+ columns?: Record<string, boolean>;
6761
+ cards?: Record<string, boolean>;
6762
+ };
6763
+
6764
+ /** The payload every board event carries. */
6765
+ interface KanbanEvent {
6766
+ card: KanbanCard;
6767
+ column: string | null;
6768
+ el?: unknown;
6769
+ originalEvent?: unknown;
6770
+ }
6771
+
6772
+ /**
6773
+ * Kanban configuration. Every structural property is named here so the same
6774
+ * board maps DemandFlow (a status field, `points`, `sprint`, `epic`, a
6775
+ * swimlane property) and any customer schema without code change.
6776
+ */
6777
+ interface KanbanConfig {
6778
+ rows?: KanbanRow[];
6779
+ grid?: unknown;
6780
+ rowKey?: string | ((row: KanbanRow) => unknown);
6781
+ columnProperty?: string;
6782
+ columns?: KanbanColumnDef[];
6783
+ columnOrder?: string[];
6784
+ pointsProperty?: string;
6785
+ showPoints?: boolean;
6786
+ orderProperty?: string;
6787
+ swimlaneProperty?: string;
6788
+ /** Render the 2D swimlane layout using `swimlaneProperty` (default false). */
6789
+ swimlanes?: boolean;
6790
+ /** Explicit lane definitions; otherwise lanes come from the distinct swimlane values. */
6791
+ lanes?: (string | { id: string; title?: string })[];
6792
+ sprintProperty?: string;
6793
+ epicProperty?: string;
6794
+ /** The initially selected sprint id, `Kanban.BACKLOG`, or undefined for all. */
6795
+ sprint?: unknown;
6796
+ /** The initially selected epic id, or undefined for all. */
6797
+ epic?: unknown;
6798
+ /** Column ids that count as "done" for a rollup's progress (also a column def's `done: true`). */
6799
+ doneColumns?: string[];
6800
+ /** Card pop-out: a nested child grid or board (master-detail by composition). */
6801
+ children?: KanbanChildren;
6802
+ /** Card virtualization for tall columns: true, or `{ rowHeight, overscan, threshold, viewport }`. */
6803
+ virtualize?: boolean | { rowHeight?: number; overscan?: number; threshold?: number; viewport?: number };
6804
+ /** A saved board state (from `getState`) to restore on construction. */
6805
+ state?: object;
6806
+ /** Show a per-column add-card affordance. */
6807
+ addCard?: boolean;
6808
+ /** Persist a standalone inline edit; return false or a rejected promise to revert. */
6809
+ onCardEdit?: (event: { card: KanbanCard; key: unknown; field: string; fieldPath: string; value: unknown }) => boolean | void | Promise<boolean | void>;
6810
+ /** Create a card for a column on add-card; return the row to create (with its key), or nothing to auto-generate. */
6811
+ onAddCard?: (columnId: string) => KanbanRow | void;
6812
+ /** A predicate filter over cards; only matching cards are shown. */
6813
+ filter?: (row: KanbanRow, card: KanbanCard) => boolean;
6814
+ /** Quick-filter text matched case-insensitively across card fields. */
6815
+ quickFilter?: string;
6816
+ card?: KanbanCardMap;
6817
+ readonly?: KanbanReadonly;
6818
+ ariaLabel?: string;
6819
+ emptyText?: string;
6820
+ /** Whether card selection is enabled (default true). */
6821
+ selectable?: boolean;
6822
+ /** Host-localised words for the move announcements (grabbed/moved/dropped/reverted/cancelled). */
6823
+ labels?: Record<string, string>;
6824
+ /**
6825
+ * Veto/confirm a move before any write. Return `false` (or a promise of it)
6826
+ * to refuse; `from`/`to` are column ids, `index` the target position.
6827
+ */
6828
+ onBeforeMove?: (card: KanbanCard, from: string | null, to: string, index: number | null) => boolean | Promise<boolean>;
6829
+ /**
6830
+ * Persist a move on a standalone (non-grid) board. Return `false` or a
6831
+ * rejected promise to revert the optimistic move. On a grid-bound board the
6832
+ * grid's write-back pipeline persists instead and this is not called.
6833
+ */
6834
+ onCardMove?: (event: KanbanMoveEvent) => boolean | void | Promise<boolean | void>;
6835
+ /** A per-card context menu: items, or `fn(card, selectedCards)` returning items. Suppresses `card:contextmenu`. */
6836
+ contextMenu?: KanbanMenuItem[] | ((card: KanbanCard, selected: KanbanCard[]) => KanbanMenuItem[]);
6837
+ onCardClick?: (event: KanbanEvent) => void;
6838
+ onCardDblClick?: (event: KanbanEvent) => void;
6839
+ onCardContextMenu?: (event: KanbanEvent) => void;
6840
+ }
6841
+
6842
+ /**
6843
+ * Card pop-out configuration. The child view is a full composed grid (via
6844
+ * `factory`, a `createGrid`), a nested board (`asBoard`), or a custom `render`.
6845
+ * The child set is the rows whose `property` equals the card key, or the
6846
+ * `load(card)` result. Recursion falls out: a nested board can pop its own
6847
+ * children.
6848
+ */
6849
+ interface KanbanChildren {
6850
+ /** Parent-id property linking child rows to a card within the same dataset. */
6851
+ property?: string;
6852
+ /** Per-card child rows, sync or async — an alternative (or addition) to `property`. */
6853
+ load?: (card: KanbanCard) => KanbanRow[] | Promise<KanbanRow[]>;
6854
+ /** Whether a card can be expanded, overriding the property/load inference. */
6855
+ hasChildren?: (card: KanbanCard) => boolean;
6856
+ /** Where the pop-out appears (default `drawer`). */
6857
+ present?: 'drawer' | 'modal' | 'inline';
6858
+ /** The grid factory (a `createGrid`) that builds the child grid. */
6859
+ factory?: (container: HTMLElement, options: object) => { destroy?: () => void };
6860
+ /** Make the child a nested board (recursive) instead of a grid. */
6861
+ asBoard?: boolean;
6862
+ /** Options for the child grid/board — an object or `fn(card)`. */
6863
+ gridOptions?: object | ((card: KanbanCard) => object);
6864
+ /** Fully custom child render; returns a cleanup function. */
6865
+ render?: (container: HTMLElement, ctx: { card: KanbanCard; rows: KanbanRow[]; board: Kanban; depth: number }) => (void | (() => void));
6866
+ /** The pop-out title (default the card title). */
6867
+ title?: (card: KanbanCard) => string;
6868
+ }
6869
+
6870
+ /** One context-menu item. `action` receives the card, the selected cards, and the board. */
6871
+ interface KanbanMenuItem {
6872
+ label: string;
6873
+ action?: (ctx: { card: KanbanCard; cards: KanbanCard[]; board: Kanban }) => void;
6874
+ disabled?: boolean;
6875
+ }
6876
+
6877
+ /** The payload of a `card:move` (and `card:reverted`) event. */
6878
+ interface KanbanMoveEvent {
6879
+ keys: unknown[];
6880
+ cards: KanbanCard[];
6881
+ from: (string | null)[];
6882
+ to: string;
6883
+ index: number | null;
6884
+ orders: number[] | null;
6885
+ }
6886
+
6887
+ /** The keyed-diff consumer surface a board shares with a grid, so a Data Router routes to it directly. */
6888
+ interface KanbanRows {
6889
+ apply(change: { add?: KanbanRow[]; update?: KanbanRow[]; remove?: unknown[] }): void;
6890
+ forEach(fn: (row: KanbanRow, key: unknown) => void): void;
6891
+ readonly count: number;
6892
+ }
6893
+
6894
+ /**
6895
+ * A board instance: a kanban view of grid rows as cards grouped into columns.
6896
+ * It consumes data through the same keyed-diff `rows.apply` contract a grid
6897
+ * exposes, so `dataRouter.attach(value, board)` drives it like any other
6898
+ * viewer.
6899
+ */
6900
+ interface Kanban {
6901
+ readonly el: unknown | null;
6902
+ readonly rowKey: string | ((row: KanbanRow) => unknown);
6903
+ rows: KanbanRows;
6904
+ columns(): KanbanColumn[];
6905
+ column(id: string): KanbanColumn | undefined;
6906
+ count(id: string): number;
6907
+ points(id: string): number;
6908
+ cards(): KanbanCard[];
6909
+ card(key: unknown): KanbanCard | undefined;
6910
+ on(name: string, fn: (event: KanbanEvent) => void): () => void;
6911
+ off(name: string, fn: (event: KanbanEvent) => void): void;
6912
+ readonly(scope?: { column?: string; card?: unknown }): boolean;
6913
+ /**
6914
+ * Move one or more cards to a column (and, with an order property, to a
6915
+ * position within it), through the `onBeforeMove` veto and the grid's
6916
+ * shipped write-back path. The single entry point behind drag-and-drop and
6917
+ * keyboard move.
6918
+ */
6919
+ move(keys: unknown | unknown[], toColumn: string, toIndex?: number | null, toLane?: string): Promise<{ moved: unknown[]; reverted: boolean }>;
6920
+ /** The selected card keys. */
6921
+ selection(): unknown[];
6922
+ /** Whether a card is selected. */
6923
+ isSelected(key: unknown): boolean;
6924
+ /** Change the selection: `set` (replace), `add`, `toggle` or `remove`. */
6925
+ select(keys: unknown | unknown[], mode?: 'set' | 'add' | 'toggle' | 'remove'): Kanban;
6926
+ /** Clear the selection. */
6927
+ clearSelection(): Kanban;
6928
+ /** Collapse, expand or toggle a column (emits `column:collapse`). */
6929
+ collapseColumn(id: string, collapsed?: boolean): Kanban;
6930
+ /** Collapse, expand or toggle a swimlane (emits `swimlane:collapse`). */
6931
+ collapseLane(id: string, collapsed?: boolean): Kanban;
6932
+ /** Reorder the columns to the given id order (emits `column:reorder`). */
6933
+ reorderColumns(order: string[]): Kanban;
6934
+ /** Move one column before another (or to the end); emits `column:reorder`. */
6935
+ moveColumn(id: string, beforeId: string | null): Kanban;
6936
+ /** Set a predicate filter over cards, or clear it with null. */
6937
+ setFilter(fn: ((row: KanbanRow, card: KanbanCard) => boolean) | null): Kanban;
6938
+ /** Set the quick-filter text matched across card fields. */
6939
+ setQuickFilter(text: string): Kanban;
6940
+ /** Distinct values of a property with card counts — the raw material for a facet control. */
6941
+ facets(property: string): { value: unknown; count: number }[];
6942
+ /** The sentinel `setSprint` value that selects the backlog (cards with no sprint). */
6943
+ readonly BACKLOG: unknown;
6944
+ /** Select the shown sprint (`BACKLOG` for the backlog, undefined for all); emits `sprint:changed`. */
6945
+ setSprint(sprint: unknown): Kanban;
6946
+ /** Show only the backlog (cards with no sprint). */
6947
+ showBacklog(): Kanban;
6948
+ /** Select the shown epic (undefined for all); emits `epic:changed`. */
6949
+ setEpic(epic: unknown): Kanban;
6950
+ /** The distinct sprint values (the switcher's options). */
6951
+ sprints(): unknown[];
6952
+ /** The distinct epic values. */
6953
+ epics(): unknown[];
6954
+ /** Roll rows up by a property: per-bucket count, points, done and progress. */
6955
+ rollup(property: string): { value: unknown; count: number; points: number; doneCount: number; donePoints: number; progress: number }[];
6956
+ /** The epic rollup (empty when no epic property is configured). */
6957
+ epicRollup(): { value: unknown; count: number; points: number; doneCount: number; donePoints: number; progress: number }[];
6958
+ /** Whether a card can be expanded to a child pop-out. */
6959
+ canExpand(card: KanbanCard): boolean;
6960
+ /** Open a card's children in a pop-out (drawer/modal/inline); emits `card:expand`/`card:drill`. */
6961
+ expand(key: unknown): Promise<object | null>;
6962
+ /** Close any open card pop-out. */
6963
+ closeDetail(): Kanban;
6964
+ /** Whether a mapped card field is opted into inline edit and writable. */
6965
+ isFieldEditable(name: string): boolean;
6966
+ /** Start inline editing a card's field (the grid's own field editor when bound); no-op headless. */
6967
+ editCard(key: unknown, name?: string): object | null;
6968
+ /** Commit an inline edit through the write-back path (grid.edit.setCells when bound); emits `card:edit`. */
6969
+ applyEdit(key: unknown, name: string, value: unknown): Promise<boolean>;
6970
+ /** Add a card to a column and open it in inline edit; emits `card:add`. */
6971
+ addCard(columnId: string, seed?: KanbanRow): unknown;
6972
+ /** Serialise the restorable state: collapsed columns/lanes, order, filter, sprint/epic, selection. */
6973
+ getState(): object;
6974
+ /** Restore a state snapshot from {@link Kanban#getState}. */
6975
+ setState(snapshot: object): Kanban;
6976
+ /** Mark the board loading (renders a host-localised loading state). */
6977
+ setLoading(loading: boolean): Kanban;
6978
+ /** Set (or clear with null) an error state, rendered as a host-supplied message. */
6979
+ setError(message: string | null): Kanban;
6980
+ setRows(rows: KanbanRow[]): Kanban;
6981
+ refresh(): Kanban;
6982
+ destroy(): void;
6983
+ }
6984
+
6985
+ /**
6986
+ * Create a board (kanban) view of rows, grouped into columns by a configurable
6987
+ * property. Pass a DOM element to render into, or `null` for a headless board
6988
+ * that computes the same column/card model without a DOM.
6989
+ */
6990
+ export function createKanban(el: HTMLElement | null, config?: KanbanConfig): Kanban;
6991
+ export default createKanban;
6992
+ }