@toclocoinc/lattice-grid 1.62.1 → 1.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/API.html +526 -16
- package/docs/CHART-CODES.md +141 -2
- package/docs/api-detail.html +194 -5
- package/lattice-grid.d.ts +235 -5
- package/lattice-grid.esm.min.js +786 -67
- package/lattice-grid.min.cjs +786 -67
- package/lattice-grid.min.js +786 -67
- package/modules/ai.d.ts +1 -1
- package/modules/ai.esm.min.js +13 -16
- package/modules/ai.min.cjs +13 -16
- package/modules/ai.min.js +13 -16
- package/modules/angular.d.ts +1 -1
- package/modules/angular.esm.min.js +2 -2
- package/modules/angular.min.cjs +2 -2
- package/modules/angular.min.js +2 -2
- package/modules/chart-alluvial.d.ts +1 -1
- package/modules/chart-alluvial.esm.min.js +1 -1
- package/modules/chart-alluvial.min.cjs +1 -1
- package/modules/chart-alluvial.min.js +1 -1
- package/modules/chart-arc.d.ts +1 -1
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-arc.min.cjs +1 -1
- package/modules/chart-arc.min.js +1 -1
- package/modules/chart-bubblemap.d.ts +1 -1
- package/modules/chart-bubblemap.esm.min.js +42 -6
- package/modules/chart-bubblemap.min.cjs +42 -6
- package/modules/chart-bubblemap.min.js +42 -6
- package/modules/chart-bump.d.ts +1 -1
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-bump.min.cjs +1 -1
- package/modules/chart-bump.min.js +1 -1
- package/modules/chart-calendar.d.ts +1 -1
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-calendar.min.cjs +1 -1
- package/modules/chart-calendar.min.js +1 -1
- package/modules/chart-decomposition.d.ts +1 -1
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-decomposition.min.cjs +1 -1
- package/modules/chart-decomposition.min.js +1 -1
- package/modules/chart-diverging.d.ts +1 -1
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-diverging.min.cjs +1 -1
- package/modules/chart-diverging.min.js +1 -1
- package/modules/chart-dumbbell.d.ts +1 -1
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-dumbbell.min.cjs +1 -1
- package/modules/chart-dumbbell.min.js +1 -1
- package/modules/chart-fan.d.ts +1 -1
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-fan.min.cjs +1 -1
- package/modules/chart-fan.min.js +1 -1
- package/modules/chart-hexbin.d.ts +1 -1
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexbin.min.cjs +1 -1
- package/modules/chart-hexbin.min.js +1 -1
- package/modules/chart-hexmap.d.ts +1 -1
- package/modules/chart-hexmap.esm.min.js +46 -6
- package/modules/chart-hexmap.min.cjs +46 -6
- package/modules/chart-hexmap.min.js +46 -6
- package/modules/chart-icicle.d.ts +1 -1
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-icicle.min.cjs +1 -1
- package/modules/chart-icicle.min.js +1 -1
- package/modules/chart-parallel.d.ts +1 -1
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-parallel.min.cjs +1 -1
- package/modules/chart-parallel.min.js +1 -1
- package/modules/chart-ridgeline.d.ts +1 -1
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-ridgeline.min.cjs +1 -1
- package/modules/chart-ridgeline.min.js +1 -1
- package/modules/chart-roc.d.ts +1 -1
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-roc.min.cjs +1 -1
- package/modules/chart-roc.min.js +1 -1
- package/modules/chart-slope.d.ts +1 -1
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-slope.min.cjs +1 -1
- package/modules/chart-slope.min.js +1 -1
- package/modules/chart-splom.d.ts +1 -1
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-splom.min.cjs +1 -1
- package/modules/chart-splom.min.js +1 -1
- package/modules/chart-waffle.d.ts +1 -1
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/chart-waffle.min.cjs +1 -1
- package/modules/chart-waffle.min.js +1 -1
- package/modules/charts.d.ts +1 -1
- package/modules/charts.esm.min.js +1917 -662
- package/modules/charts.min.cjs +1917 -662
- package/modules/charts.min.js +1917 -662
- package/modules/data-router.d.ts +1 -1
- package/modules/data-router.esm.min.js +129 -20
- package/modules/data-router.min.cjs +129 -20
- package/modules/data-router.min.js +129 -20
- package/modules/devtools.d.ts +1 -1
- package/modules/devtools.esm.min.js +2 -2
- package/modules/devtools.min.cjs +2 -2
- package/modules/devtools.min.js +2 -2
- package/modules/dhtmlx-compat.d.ts +1 -1
- package/modules/dhtmlx-compat.esm.min.js +4 -16
- package/modules/dhtmlx-compat.min.cjs +4 -16
- package/modules/dhtmlx-compat.min.js +4 -16
- package/modules/gantt.d.ts +1 -1
- package/modules/gantt.esm.min.js +187 -82
- package/modules/gantt.min.cjs +187 -82
- package/modules/gantt.min.js +187 -82
- package/modules/geo-europe-nuts.d.ts +16 -0
- package/modules/geo-europe-nuts.esm.min.js +29 -0
- package/modules/geo-uk.d.ts +18 -0
- package/modules/geo-uk.esm.min.js +29 -0
- package/modules/geo-us-states.d.ts +16 -0
- package/modules/geo-us-states.esm.min.js +29 -0
- package/modules/geo-world-110m.d.ts +17 -0
- package/modules/geo-world-110m.esm.min.js +29 -0
- package/modules/geo-world-50m.d.ts +16 -0
- package/modules/geo-world-50m.esm.min.js +29 -0
- package/modules/htmx.d.ts +1 -1
- package/modules/htmx.esm.min.js +786 -67
- package/modules/htmx.min.cjs +786 -67
- package/modules/htmx.min.js +786 -67
- package/modules/kanban.d.ts +1 -1
- package/modules/kanban.esm.min.js +4 -16
- package/modules/kanban.min.cjs +4 -16
- package/modules/kanban.min.js +4 -16
- package/modules/kpi.d.ts +1 -1
- package/modules/kpi.esm.min.js +29 -24
- package/modules/kpi.min.cjs +29 -24
- package/modules/kpi.min.js +29 -24
- package/modules/layout.d.ts +1 -1
- package/modules/layout.esm.min.js +4 -16
- package/modules/layout.min.cjs +4 -16
- package/modules/layout.min.js +4 -16
- package/modules/mock-socket.d.ts +1 -1
- package/modules/mock-socket.esm.min.js +2 -2
- package/modules/mock-socket.min.cjs +2 -2
- package/modules/mock-socket.min.js +2 -2
- package/modules/react.d.ts +308 -3
- package/modules/react.esm.min.js +1072 -22
- package/modules/react.min.cjs +1056 -21
- package/modules/react.min.js +1056 -21
- package/modules/svelte.d.ts +1 -1
- package/modules/svelte.esm.min.js +2 -2
- package/modules/svelte.min.cjs +2 -2
- package/modules/svelte.min.js +2 -2
- package/modules/tabs.d.ts +1 -1
- package/modules/tabs.esm.min.js +4 -16
- package/modules/tabs.min.cjs +4 -16
- package/modules/tabs.min.js +4 -16
- package/modules/vue.d.ts +1 -1
- package/modules/vue.esm.min.js +2 -2
- package/modules/vue.min.cjs +2 -2
- package/modules/vue.min.js +2 -2
- package/modules/webcomponent.d.ts +1 -1
- package/modules/webcomponent.esm.min.js +786 -67
- package/modules/webcomponent.min.cjs +786 -67
- package/modules/webcomponent.min.js +786 -67
- package/package.json +1 -1
package/modules/react.d.ts
CHANGED
|
@@ -1,14 +1,100 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Lattice Grid 1.
|
|
2
|
+
* Lattice Grid 1.63.0, react module type declarations
|
|
3
3
|
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
4
|
* https://latticegrid.dev
|
|
5
5
|
*/
|
|
6
6
|
import type {
|
|
7
|
+
EventName,
|
|
8
|
+
FilterSet,
|
|
9
|
+
Grid,
|
|
10
|
+
GridConfig,
|
|
11
|
+
GridEvent,
|
|
12
|
+
Row,
|
|
13
|
+
RowChange,
|
|
14
|
+
SortEntry,
|
|
7
15
|
createGrid,
|
|
8
16
|
} from '../lattice-grid.js';
|
|
9
17
|
|
|
10
18
|
/**
|
|
11
|
-
*
|
|
19
|
+
* The handler prop name one event maps to, as a type: `'cell:changed'`
|
|
20
|
+
* becomes `'onCellChanged'` (BACKLOG-0001307).
|
|
21
|
+
*
|
|
22
|
+
* Recursive over the `:` segments, so a three-part name like
|
|
23
|
+
* `'cell:edit:start'` becomes `'onCellEditStart'` — the same rule
|
|
24
|
+
* `handlerName` applies at runtime, stated once so the props type and the
|
|
25
|
+
* implementation cannot disagree.
|
|
26
|
+
*/
|
|
27
|
+
export type PascalJoin<E extends string> =
|
|
28
|
+
E extends `${infer Head}:${infer Tail}`
|
|
29
|
+
? `${Capitalize<Head>}${PascalJoin<Tail>}`
|
|
30
|
+
: Capitalize<E>;
|
|
31
|
+
export type HandlerProp<E extends string> = `on${PascalJoin<E>}`;
|
|
32
|
+
|
|
33
|
+
/** Every grid event as a React callback prop, each receiving the `GridEvent`. */
|
|
34
|
+
export type LatticeGridEventProps = {
|
|
35
|
+
[E in EventName as HandlerProp<E>]?: (event: GridEvent) => void;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** The live instance a `<LatticeGrid>` ref exposes; `null` before mount. */
|
|
39
|
+
export interface LatticeGridHandle {
|
|
40
|
+
readonly grid: Grid | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* What `<LatticeGrid>` takes.
|
|
45
|
+
*
|
|
46
|
+
* Generic over the row type so `rows`, `predicates` and the keyed-diff prop
|
|
47
|
+
* are checked against the host's own record shape rather than `unknown`.
|
|
48
|
+
*
|
|
49
|
+
* Every **grid configuration key** is accepted as a prop and diffed with
|
|
50
|
+
* `Object.is` — an inline `columns={[…]}` is a new array on every render and
|
|
51
|
+
* reconfigures the grid on every render, so hoist it or `useMemo` it. `sort`,
|
|
52
|
+
* `filters`, `quickFilter` and `selectedKeys` are query/selection state rather
|
|
53
|
+
* than configuration and go through their own setters.
|
|
54
|
+
*/
|
|
55
|
+
export type LatticeGridProps<Row = unknown> =
|
|
56
|
+
Omit<GridConfig, 'rows'> & LatticeGridEventProps & {
|
|
57
|
+
/** The rows, copied on ingest (BACKLOG-0001334) so two grids may share one array. */
|
|
58
|
+
rows?: Row[];
|
|
59
|
+
/** Applied through `grid.sort.set`, not as configuration. */
|
|
60
|
+
sort?: SortEntry[];
|
|
61
|
+
/** Applied through `grid.filters.set` — replaces the whole tree; see `predicates`. */
|
|
62
|
+
filters?: FilterSet | null;
|
|
63
|
+
/** Applied through `grid.filters.quick`. */
|
|
64
|
+
quickFilter?: string | { text: string; mode?: string };
|
|
65
|
+
/** Applied through `grid.selection.set`. */
|
|
66
|
+
selectedKeys?: string[];
|
|
67
|
+
/**
|
|
68
|
+
* Named row predicates through `grid.filters.where(name, fn)`, diffed by
|
|
69
|
+
* name and removed when a name goes. These **compose** with whatever
|
|
70
|
+
* filter the reader set in the tool panel; `filters` does not.
|
|
71
|
+
*/
|
|
72
|
+
predicates?: Record<string, ((row: Row) => boolean) | null>;
|
|
73
|
+
/**
|
|
74
|
+
* A keyed diff handed to `grid.rows.apply()`, applied when the object's
|
|
75
|
+
* identity changes — a feed produces a new change object per batch.
|
|
76
|
+
*/
|
|
77
|
+
rowUpdates?: RowChange;
|
|
78
|
+
/** Told when the grid exists, for a parent that cannot use a ref. */
|
|
79
|
+
onGridReady?: (grid: Grid) => void;
|
|
80
|
+
/** Told just before the grid is destroyed. */
|
|
81
|
+
onGridDestroy?: () => void;
|
|
82
|
+
/** The name this grid publishes itself under in a `LatticeGridProvider`. */
|
|
83
|
+
name?: string;
|
|
84
|
+
/** The route value to `attach` to the router in context, if any. */
|
|
85
|
+
route?: unknown;
|
|
86
|
+
/** Per-route options for that `attach`. */
|
|
87
|
+
routeOptions?: Record<string, unknown>;
|
|
88
|
+
/** Applied to the host element rather than to the grid. */
|
|
89
|
+
className?: string;
|
|
90
|
+
/** Applied to the host element rather than to the grid. */
|
|
91
|
+
style?: Record<string, unknown>;
|
|
92
|
+
/** Applied to the host element rather than to the grid. */
|
|
93
|
+
id?: string;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Build the React grid component.
|
|
12
98
|
*
|
|
13
99
|
* A factory rather than a component, because the adapter imports neither
|
|
14
100
|
* React nor the grid: you pass both in. That is what keeps the package's
|
|
@@ -17,9 +103,228 @@ import type {
|
|
|
17
103
|
*
|
|
18
104
|
* The live grid is reached through a forwarded ref: `ref.current.grid` is the
|
|
19
105
|
* same `Grid` the vanilla `createGrid` returns, or null before mount.
|
|
106
|
+
*
|
|
107
|
+
* React 18's StrictMode double mount creates exactly **one** grid: the
|
|
108
|
+
* component builds it in an effect with an empty dependency list and destroys
|
|
109
|
+
* it in that effect's cleanup.
|
|
110
|
+
*/
|
|
111
|
+
export function createLatticeGrid<Row = unknown>(deps: {
|
|
112
|
+
React: unknown;
|
|
113
|
+
createGrid: (el: unknown, config: GridConfig) => Grid;
|
|
114
|
+
}): (props: LatticeGridProps<Row> & { ref?: unknown }) => unknown;
|
|
115
|
+
|
|
116
|
+
/** The live instance a viewer component's ref exposes; `null` before mount. */
|
|
117
|
+
export interface LatticeViewerHandle<Instance = unknown> {
|
|
118
|
+
readonly instance: Instance | null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* What every viewer component takes beyond its own configuration
|
|
123
|
+
* (BACKLOG-0001307): the grid it binds to, which published grid to take when
|
|
124
|
+
* that is left off, the lifecycle callbacks, and the host-element props.
|
|
125
|
+
*/
|
|
126
|
+
export interface LatticeViewerCommonProps<Instance = unknown> {
|
|
127
|
+
/** The grid this viewer is built against; taken from context when absent. */
|
|
128
|
+
grid?: Grid | null;
|
|
129
|
+
/** Which published grid to take from context; `'default'` when absent. */
|
|
130
|
+
gridName?: string;
|
|
131
|
+
/** Told when the viewer exists. */
|
|
132
|
+
onReady?: (instance: Instance) => void;
|
|
133
|
+
/** Told just before it is destroyed. */
|
|
134
|
+
onDestroy?: () => void;
|
|
135
|
+
/** Applied to the host element rather than to the viewer. */
|
|
136
|
+
className?: string;
|
|
137
|
+
/** Applied to the host element rather than to the viewer. */
|
|
138
|
+
style?: Record<string, unknown>;
|
|
139
|
+
/** Applied to the host element rather than to the viewer. */
|
|
140
|
+
id?: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** The KPI panel's React props: its own config, plus the common ones and its events. */
|
|
144
|
+
export type LatticeKPIProps<Row = unknown> =
|
|
145
|
+
Record<string, unknown> & LatticeViewerCommonProps & {
|
|
146
|
+
rows?: Row[];
|
|
147
|
+
onTileClick?: (payload: unknown) => void;
|
|
148
|
+
onTileDblclick?: (payload: unknown) => void;
|
|
149
|
+
onTileContextmenu?: (payload: unknown) => void;
|
|
150
|
+
onNodeToggle?: (payload: unknown) => void;
|
|
151
|
+
onChange?: (payload: unknown) => void;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/** A chart's React props: the spec, the common ones, and its five events. */
|
|
155
|
+
export type LatticeChartProps = Record<string, unknown> & LatticeViewerCommonProps & {
|
|
156
|
+
/** Required: a chart is always built against a grid. */
|
|
157
|
+
grid?: Grid | null;
|
|
158
|
+
onClick?: (payload: unknown) => void;
|
|
159
|
+
onHover?: (payload: unknown) => void;
|
|
160
|
+
onLeave?: (payload: unknown) => void;
|
|
161
|
+
onDraw?: (payload: unknown) => void;
|
|
162
|
+
onLegend?: (payload: unknown) => void;
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
/** The board's React props. */
|
|
166
|
+
export type LatticeKanbanProps<Row = unknown> =
|
|
167
|
+
Record<string, unknown> & LatticeViewerCommonProps & {
|
|
168
|
+
rows?: Row[];
|
|
169
|
+
quickFilter?: string;
|
|
170
|
+
sprint?: unknown;
|
|
171
|
+
epic?: unknown;
|
|
172
|
+
loading?: boolean;
|
|
173
|
+
error?: string | null;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/** The Gantt's React props. */
|
|
177
|
+
export type LatticeGanttProps = Record<string, unknown> & LatticeViewerCommonProps & {
|
|
178
|
+
tasks?: unknown[];
|
|
179
|
+
dependencies?: unknown[];
|
|
180
|
+
onSchedule?: (payload: unknown) => void;
|
|
181
|
+
onError?: (payload: unknown) => void;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/** The layout's React props. */
|
|
185
|
+
export type LatticeLayoutProps = Record<string, unknown> & LatticeViewerCommonProps;
|
|
186
|
+
|
|
187
|
+
/** One tab of a `<LatticeTabs>`; `content` makes it React's rather than the module's. */
|
|
188
|
+
export interface LatticeTabSpec {
|
|
189
|
+
id: string;
|
|
190
|
+
label?: string;
|
|
191
|
+
/** A React element, or a function returning one, rendered through a portal. */
|
|
192
|
+
content?: unknown | (() => unknown);
|
|
193
|
+
[key: string]: unknown;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** The tab strip's React props. */
|
|
197
|
+
export type LatticeTabsProps = Record<string, unknown> & {
|
|
198
|
+
tabs: LatticeTabSpec[];
|
|
199
|
+
/** The open tab; changing it calls `activate`. */
|
|
200
|
+
active?: string;
|
|
201
|
+
onBeforeTabChange?: (payload: unknown) => void;
|
|
202
|
+
onTabChanged?: (payload: unknown) => void;
|
|
203
|
+
onTabChangeCancelled?: (payload: unknown) => void;
|
|
204
|
+
className?: string;
|
|
205
|
+
style?: Record<string, unknown>;
|
|
206
|
+
id?: string;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Build a React component around any Lattice viewer factory.
|
|
211
|
+
*
|
|
212
|
+
* `viewer` selects the event and live-prop tables; `requires` names the props
|
|
213
|
+
* the viewer cannot be built without (and which rebuild it when their identity
|
|
214
|
+
* changes); `fromContext` names the prop filled from the grid context.
|
|
215
|
+
*/
|
|
216
|
+
export function createLatticeViewer(options: {
|
|
217
|
+
React: unknown;
|
|
218
|
+
viewer: 'kpi' | 'kanban' | 'tabs' | 'chart' | 'gantt' | 'layout' | 'router';
|
|
219
|
+
mount: (el: unknown, config: Record<string, unknown>) => unknown;
|
|
220
|
+
name?: string;
|
|
221
|
+
requires?: string[];
|
|
222
|
+
fromContext?: string;
|
|
223
|
+
}): (props: Record<string, unknown> & { ref?: unknown }) => unknown;
|
|
224
|
+
|
|
225
|
+
/** The KPI panel as a React component. Grid-bound through context by default. */
|
|
226
|
+
export function createLatticeKPI<Row = unknown>(deps: {
|
|
227
|
+
React: unknown; createKPI: (el: unknown, config: Record<string, unknown>) => unknown;
|
|
228
|
+
}): (props: LatticeKPIProps<Row> & { ref?: unknown }) => unknown;
|
|
229
|
+
|
|
230
|
+
/** A chart as a React component. Requires a grid; a new grid rebuilds the chart. */
|
|
231
|
+
export function createLatticeChart(deps: {
|
|
232
|
+
React: unknown; createChart: (opts: Record<string, unknown>) => unknown;
|
|
233
|
+
}): (props: LatticeChartProps & { ref?: unknown }) => unknown;
|
|
234
|
+
|
|
235
|
+
/** The kanban board as a React component. */
|
|
236
|
+
export function createLatticeKanban<Row = unknown>(deps: {
|
|
237
|
+
React: unknown; createKanban: (el: unknown, config: Record<string, unknown>) => unknown;
|
|
238
|
+
}): (props: LatticeKanbanProps<Row> & { ref?: unknown }) => unknown;
|
|
239
|
+
|
|
240
|
+
/** The Gantt as a React component. */
|
|
241
|
+
export function createLatticeGantt(deps: {
|
|
242
|
+
React: unknown; createGantt: (opts: Record<string, unknown>) => unknown;
|
|
243
|
+
}): (props: LatticeGanttProps & { ref?: unknown }) => unknown;
|
|
244
|
+
|
|
245
|
+
/** The layout as a React component. */
|
|
246
|
+
export function createLatticeLayout(deps: {
|
|
247
|
+
React: unknown; createLayout: (el: unknown, config: Record<string, unknown>) => unknown;
|
|
248
|
+
}): (props: LatticeLayoutProps & { ref?: unknown }) => unknown;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* The tab strip, with React-rendered tab content.
|
|
252
|
+
*
|
|
253
|
+
* `react-dom` is needed for `createPortal`: a tab's content is rendered into
|
|
254
|
+
* the panel element the module created, so it stays a genuine child of the
|
|
255
|
+
* React tree that declared it — props, refs and context all reach it.
|
|
20
256
|
*/
|
|
21
|
-
export function
|
|
257
|
+
export function createLatticeTabs(deps: {
|
|
258
|
+
React: unknown;
|
|
259
|
+
ReactDOM: unknown;
|
|
260
|
+
createTabs: (el: unknown, config: Record<string, unknown>) => unknown;
|
|
261
|
+
createGrid?: (el: unknown, config: GridConfig) => Grid;
|
|
262
|
+
}): (props: LatticeTabsProps & { ref?: unknown }) => unknown;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* The provider and hook that let a grid-bound viewer find its grid.
|
|
266
|
+
*
|
|
267
|
+
* A ref cannot help here: writing to a ref re-renders nobody, so a sibling
|
|
268
|
+
* that needs the instance never learns it arrived.
|
|
269
|
+
*/
|
|
270
|
+
export function createLatticeGridContext(deps: { React: unknown }): {
|
|
271
|
+
LatticeGridProvider: (props: { children?: unknown }) => unknown;
|
|
272
|
+
useLatticeGrid: (name?: string) => Grid | null;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The Data Router hook and its provider.
|
|
277
|
+
*
|
|
278
|
+
* `useLatticeRouter` creates the router in an effect and destroys it in that
|
|
279
|
+
* effect's cleanup, so it returns `null` on the first render. The config is
|
|
280
|
+
* read once: rebuilding would drop every attached grid and every row held.
|
|
281
|
+
*/
|
|
282
|
+
export function createLatticeRouter(deps: {
|
|
283
|
+
React: unknown; createDataRouter: (opts: Record<string, unknown>) => unknown;
|
|
284
|
+
}): {
|
|
285
|
+
useLatticeRouter: (config?: Record<string, unknown>) => unknown | null;
|
|
286
|
+
LatticeRouterProvider: (props: { router?: unknown; children?: unknown }) => unknown;
|
|
287
|
+
useRouter: () => unknown | null;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/** Every React binding this package ships, from one call. */
|
|
291
|
+
export function createLatticeReact(deps: {
|
|
292
|
+
React: unknown;
|
|
293
|
+
ReactDOM?: unknown;
|
|
294
|
+
createGrid?: (el: unknown, config: GridConfig) => Grid;
|
|
295
|
+
createKPI?: (el: unknown, config: Record<string, unknown>) => unknown;
|
|
296
|
+
createChart?: (opts: Record<string, unknown>) => unknown;
|
|
297
|
+
createKanban?: (el: unknown, config: Record<string, unknown>) => unknown;
|
|
298
|
+
createGantt?: (opts: Record<string, unknown>) => unknown;
|
|
299
|
+
createLayout?: (el: unknown, config: Record<string, unknown>) => unknown;
|
|
300
|
+
createTabs?: (el: unknown, config: Record<string, unknown>) => unknown;
|
|
301
|
+
createDataRouter?: (opts: Record<string, unknown>) => unknown;
|
|
302
|
+
}): Record<string, unknown>;
|
|
303
|
+
|
|
22
304
|
/** Every grid event, as the prop name a React caller writes. */
|
|
23
305
|
export const EVENT_NAMES: readonly string[];
|
|
24
306
|
export function handlerName(event: string): string;
|
|
307
|
+
/** Every event each non-grid viewer emits, keyed by viewer name. */
|
|
308
|
+
export const VIEWER_EVENTS: Readonly<Record<string, readonly string[]>>;
|
|
309
|
+
/** The props each viewer can take live, and the instance call each becomes. */
|
|
310
|
+
export const VIEWER_APPLY: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
|
|
311
|
+
/** `card:move` → `onCardMove`, for a viewer event. */
|
|
312
|
+
export function viewerHandlerName(event: string): string;
|
|
313
|
+
/**
|
|
314
|
+
* The framework-free viewer lifecycle every adapter drives an instance
|
|
315
|
+
* through: mount once, push changed props into the live instance, destroy.
|
|
316
|
+
*/
|
|
317
|
+
export function createViewerController(opts: {
|
|
318
|
+
viewer: string;
|
|
319
|
+
mount: (el: unknown, config: Record<string, unknown>) => unknown;
|
|
320
|
+
element: unknown;
|
|
321
|
+
props?: Record<string, unknown>;
|
|
322
|
+
name?: string;
|
|
323
|
+
}): {
|
|
324
|
+
instance: unknown;
|
|
325
|
+
update: (next: Record<string, unknown>) => void;
|
|
326
|
+
destroy: () => void;
|
|
327
|
+
};
|
|
328
|
+
/** The name a grid publishes itself under when the host does not choose one. */
|
|
329
|
+
export const DEFAULT_GRID_NAME: string;
|
|
25
330
|
export default createLatticeGrid;
|