@toclocoinc/lattice-grid 1.58.0 → 1.60.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 +3 -3
- package/docs/API.html +1773 -73
- package/docs/api-detail.html +321 -5
- package/lattice-grid.d.ts +281 -2842
- package/lattice-grid.esm.min.js +879 -148
- package/lattice-grid.min.cjs +879 -148
- package/lattice-grid.min.css +1 -1
- package/lattice-grid.min.js +879 -148
- package/modules/ai.d.ts +401 -0
- package/modules/ai.esm.min.js +25 -6
- package/modules/ai.min.cjs +25 -6
- package/modules/ai.min.js +25 -6
- package/modules/angular.d.ts +31 -0
- package/modules/angular.esm.min.js +3 -2
- package/modules/angular.min.cjs +3 -2
- package/modules/angular.min.js +3 -2
- package/modules/chart-alluvial.d.ts +18 -0
- package/modules/chart-alluvial.esm.min.js +1 -1
- package/modules/chart-arc.d.ts +18 -0
- package/modules/chart-arc.esm.min.js +1 -1
- package/modules/chart-bubblemap.d.ts +18 -0
- package/modules/chart-bubblemap.esm.min.js +1 -1
- package/modules/chart-bump.d.ts +12 -0
- package/modules/chart-bump.esm.min.js +1 -1
- package/modules/chart-calendar.d.ts +12 -0
- package/modules/chart-calendar.esm.min.js +1 -1
- package/modules/chart-decomposition.d.ts +20 -0
- package/modules/chart-decomposition.esm.min.js +1 -1
- package/modules/chart-diverging.d.ts +12 -0
- package/modules/chart-diverging.esm.min.js +1 -1
- package/modules/chart-dumbbell.d.ts +18 -0
- package/modules/chart-dumbbell.esm.min.js +1 -1
- package/modules/chart-fan.d.ts +18 -0
- package/modules/chart-fan.esm.min.js +1 -1
- package/modules/chart-hexbin.d.ts +18 -0
- package/modules/chart-hexbin.esm.min.js +1 -1
- package/modules/chart-hexmap.d.ts +18 -0
- package/modules/chart-hexmap.esm.min.js +1 -1
- package/modules/chart-icicle.d.ts +12 -0
- package/modules/chart-icicle.esm.min.js +1 -1
- package/modules/chart-parallel.d.ts +19 -0
- package/modules/chart-parallel.esm.min.js +1 -1
- package/modules/chart-ridgeline.d.ts +14 -0
- package/modules/chart-ridgeline.esm.min.js +1 -1
- package/modules/chart-roc.d.ts +20 -0
- package/modules/chart-roc.esm.min.js +1 -1
- package/modules/chart-slope.d.ts +12 -0
- package/modules/chart-slope.esm.min.js +1 -1
- package/modules/chart-splom.d.ts +19 -0
- package/modules/chart-splom.esm.min.js +1 -1
- package/modules/chart-waffle.d.ts +12 -0
- package/modules/chart-waffle.esm.min.js +1 -1
- package/modules/charts.d.ts +122 -0
- package/modules/charts.esm.min.js +4 -4
- package/modules/charts.min.cjs +4 -4
- package/modules/charts.min.js +4 -4
- package/modules/data-router.d.ts +91 -0
- package/modules/data-router.esm.min.js +109 -17
- package/modules/data-router.min.cjs +109 -17
- package/modules/data-router.min.js +109 -17
- package/modules/devtools.d.ts +28 -0
- 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 +19 -0
- package/modules/dhtmlx-compat.esm.min.js +4 -4
- package/modules/dhtmlx-compat.min.cjs +4 -4
- package/modules/dhtmlx-compat.min.js +4 -4
- package/modules/gantt.d.ts +515 -0
- package/modules/gantt.esm.min.js +109 -33
- package/modules/gantt.min.cjs +109 -33
- package/modules/gantt.min.js +109 -33
- package/modules/htmx.d.ts +176 -0
- package/modules/htmx.esm.min.js +879 -148
- package/modules/htmx.min.cjs +879 -148
- package/modules/htmx.min.js +879 -148
- package/modules/kanban.d.ts +492 -0
- package/modules/kanban.esm.min.js +4 -4
- package/modules/kanban.min.cjs +4 -4
- package/modules/kanban.min.js +4 -4
- package/modules/kpi.d.ts +255 -0
- package/modules/kpi.esm.min.js +40 -7
- package/modules/kpi.min.cjs +40 -7
- package/modules/kpi.min.js +40 -7
- package/modules/layout.d.ts +332 -0
- package/modules/layout.esm.min.js +59 -6
- package/modules/layout.min.cjs +59 -6
- package/modules/layout.min.js +59 -6
- package/modules/mock-socket.d.ts +114 -0
- 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 +25 -0
- package/modules/react.esm.min.js +3 -2
- package/modules/react.min.cjs +3 -2
- package/modules/react.min.js +3 -2
- package/modules/svelte.d.ts +26 -0
- package/modules/svelte.esm.min.js +3 -2
- package/modules/svelte.min.cjs +3 -2
- package/modules/svelte.min.js +3 -2
- package/modules/tabs.d.ts +133 -0
- package/modules/tabs.esm.min.js +411 -9
- package/modules/tabs.min.cjs +411 -9
- package/modules/tabs.min.js +411 -9
- package/modules/vue.d.ts +24 -0
- package/modules/vue.esm.min.js +3 -2
- package/modules/vue.min.cjs +3 -2
- package/modules/vue.min.js +3 -2
- package/modules/webcomponent.d.ts +47 -0
- package/modules/webcomponent.esm.min.js +879 -148
- package/modules/webcomponent.min.cjs +879 -148
- package/modules/webcomponent.min.js +879 -148
- package/package.json +2 -2
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Lattice Grid 1.60.0, layout module type declarations
|
|
3
|
+
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
|
+
* https://latticegrid.dev
|
|
5
|
+
*/
|
|
6
|
+
import type {
|
|
7
|
+
version,
|
|
8
|
+
} from '../lattice-grid.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* One window on the cell grid.
|
|
12
|
+
*
|
|
13
|
+
* Deliberately **not** named `WindowSpec`: that name is already taken by the
|
|
14
|
+
* rolling-statistics window (`{ kind: 'count'|'time'|'session', span, size }`)
|
|
15
|
+
* and reusing it would put `kind: 'session'` next to a dashboard pane.
|
|
16
|
+
*/
|
|
17
|
+
interface LayoutWindow {
|
|
18
|
+
/** A stable, unique id. Required. */
|
|
19
|
+
id: string;
|
|
20
|
+
/** The 1-based column the window starts in. Auto-placed when omitted. */
|
|
21
|
+
xPos?: number;
|
|
22
|
+
/** The 1-based row the window starts in. Auto-placed when omitted. */
|
|
23
|
+
yPos?: number;
|
|
24
|
+
/** How many columns it spans (default 1). */
|
|
25
|
+
xSize?: number;
|
|
26
|
+
/** How many rows it spans (default 1). */
|
|
27
|
+
ySize?: number;
|
|
28
|
+
/** The title shown in the chrome bar, and the name every control takes. */
|
|
29
|
+
title?: string;
|
|
30
|
+
/** Whether to draw the title bar (default `true`). */
|
|
31
|
+
chrome?: boolean;
|
|
32
|
+
/** Whether to offer a close button (default `false`). */
|
|
33
|
+
closable?: boolean;
|
|
34
|
+
/** Whether the window can be moved by drag or keyboard (default `false`). */
|
|
35
|
+
movable?: boolean;
|
|
36
|
+
/** Whether the window can be resized by drag or keyboard (default `false`). */
|
|
37
|
+
resizable?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether to offer a maximise control in the chrome (default `false`).
|
|
40
|
+
*
|
|
41
|
+
* Maximising fills the **layout host**, not the browser window, and hides
|
|
42
|
+
* every other window for the duration. Escape restores it, unless a payload
|
|
43
|
+
* has already claimed the key.
|
|
44
|
+
*/
|
|
45
|
+
maximisable?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to offer a minimise control in the chrome (default `false`).
|
|
48
|
+
*
|
|
49
|
+
* A window with `chrome: false` cannot be minimised whatever this says:
|
|
50
|
+
* there would be nothing left on screen to restore it with.
|
|
51
|
+
*/
|
|
52
|
+
minimisable?: boolean;
|
|
53
|
+
/** Padding inside the window; the layout's `padding` (default `'5px'`) otherwise. */
|
|
54
|
+
padding?: number | string;
|
|
55
|
+
/** The `id` given to the payload container (default `` `${id}-body` ``). */
|
|
56
|
+
payloadId?: string;
|
|
57
|
+
/** The window's accessible name, when the title alone is not enough context. */
|
|
58
|
+
ariaLabel?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The three capabilities a layout-level default and `setInteractive()` cover.
|
|
63
|
+
*
|
|
64
|
+
* These are the layout **defaults**, not the per-window resolution: a window
|
|
65
|
+
* that declared `movable: false` stays pinned whatever these say.
|
|
66
|
+
*
|
|
67
|
+
* Three values, not two. `undefined` means no layout-level default is in force
|
|
68
|
+
* and each window's own flag decides; `true` unlocks everything that did not
|
|
69
|
+
* opt out; `false` is an active lock. Reporting `undefined` as `false` would
|
|
70
|
+
* read correctly and round-trip wrongly, so it is reported as it is.
|
|
71
|
+
*/
|
|
72
|
+
interface LayoutInteractive {
|
|
73
|
+
movable: boolean | undefined;
|
|
74
|
+
resizable: boolean | undefined;
|
|
75
|
+
closable: boolean | undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The plain, JSON-safe arrangement `getLayout()` returns and `setLayout()` takes. */
|
|
79
|
+
interface LayoutSnapshot {
|
|
80
|
+
columns: number;
|
|
81
|
+
rows: number;
|
|
82
|
+
windows: { id: string; xPos: number; yPos: number; xSize: number; ySize: number }[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** A cell placement, as carried on the move and resize events. */
|
|
86
|
+
interface LayoutPlacement {
|
|
87
|
+
xPos: number;
|
|
88
|
+
yPos: number;
|
|
89
|
+
xSize: number;
|
|
90
|
+
ySize: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** The payload of `window:moved`, `beforeWindowMove`, `beforeWindowResize`. */
|
|
94
|
+
interface LayoutMoveEvent {
|
|
95
|
+
id: string;
|
|
96
|
+
from: LayoutPlacement;
|
|
97
|
+
/** Where the window was asked to go. */
|
|
98
|
+
to: LayoutPlacement;
|
|
99
|
+
/** Where it actually ended up, which under `compact: 'vertical'` may differ. */
|
|
100
|
+
landed?: LayoutPlacement;
|
|
101
|
+
origin?: 'api' | 'user' | 'init';
|
|
102
|
+
reason?: string | null;
|
|
103
|
+
/** Cancel the action (only meaningful on a `before*` event). */
|
|
104
|
+
preventDefault?: (reason?: string) => void;
|
|
105
|
+
defaultPrevented?: boolean;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The payload of `window:resized` — the measured **content box** of the
|
|
110
|
+
* payload container, not a cell count. Emitted when the container genuinely
|
|
111
|
+
* changes size, including on the opening frame; never with a zero box.
|
|
112
|
+
*/
|
|
113
|
+
interface LayoutResizeEvent {
|
|
114
|
+
id: string;
|
|
115
|
+
payloadId: string;
|
|
116
|
+
/** The payload container itself, so a host can act on it directly. */
|
|
117
|
+
payload: HTMLElement;
|
|
118
|
+
width: number;
|
|
119
|
+
height: number;
|
|
120
|
+
xPos: number;
|
|
121
|
+
yPos: number;
|
|
122
|
+
xSize: number;
|
|
123
|
+
ySize: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** The payload of `window:closed` and `beforeWindowClose`. */
|
|
127
|
+
interface LayoutCloseEvent {
|
|
128
|
+
id: string;
|
|
129
|
+
payloadId: string;
|
|
130
|
+
/** The payload container, handed back so the host can destroy what it mounted. */
|
|
131
|
+
payload?: HTMLElement;
|
|
132
|
+
origin?: 'api' | 'user';
|
|
133
|
+
reason?: string | null;
|
|
134
|
+
preventDefault?: (reason?: string) => void;
|
|
135
|
+
defaultPrevented?: boolean;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** The payload of `layout:changed`: the whole arrangement, plus what moved it. */
|
|
139
|
+
interface LayoutChangedEvent extends LayoutSnapshot {
|
|
140
|
+
cause: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Dashboard layout configuration. */
|
|
144
|
+
interface LayoutConfig {
|
|
145
|
+
/** Cell columns across the mounted element (default 12). */
|
|
146
|
+
columns?: number;
|
|
147
|
+
/** Cell rows down the mounted element (default 6). */
|
|
148
|
+
rows?: number;
|
|
149
|
+
/** Horizontal overflow (default `'static'`). */
|
|
150
|
+
overflowX?: 'static' | 'scroll';
|
|
151
|
+
/** Vertical overflow (default `'static'`). */
|
|
152
|
+
overflowY?: 'static' | 'scroll';
|
|
153
|
+
/** Fixed column track size, used only when `overflowX` is `'scroll'` (default `'240px'`). */
|
|
154
|
+
columnWidth?: number | string;
|
|
155
|
+
/** Fixed row track size, used only when `overflowY` is `'scroll'` (default `'160px'`). */
|
|
156
|
+
rowHeight?: number | string;
|
|
157
|
+
/** The gap between cells (default `'8px'`). */
|
|
158
|
+
gap?: number | string;
|
|
159
|
+
/** The default padding inside a window (default `'5px'`). */
|
|
160
|
+
padding?: number | string;
|
|
161
|
+
/**
|
|
162
|
+
* Rearrangement (default `'vertical'`). One gravity direction, never two:
|
|
163
|
+
* `'vertical'` pushes displaced windows down and then floats everything up,
|
|
164
|
+
* `'horizontal'` pushes them right and then floats everything left — so
|
|
165
|
+
* dragging a window out of a row closes the hole sideways — and `'none'`
|
|
166
|
+
* leaves every placement exactly where it was put. An unrecognised value
|
|
167
|
+
* warns once, naming what it got, and falls back to `'vertical'`.
|
|
168
|
+
*/
|
|
169
|
+
compact?: 'vertical' | 'horizontal' | 'none';
|
|
170
|
+
/**
|
|
171
|
+
* The default `movable` for every window that does not declare its own
|
|
172
|
+
* (default `false`). This states a default, so `false` takes nothing away
|
|
173
|
+
* from a window that declared `movable: true`; `setInteractive(false)` is
|
|
174
|
+
* the active lock that does.
|
|
175
|
+
*/
|
|
176
|
+
movable?: boolean;
|
|
177
|
+
/** The default `resizable` for windows that declare none (default `false`); see `movable`. */
|
|
178
|
+
resizable?: boolean;
|
|
179
|
+
/** The default `closable` for windows that declare none (default `false`); see `movable`. */
|
|
180
|
+
closable?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* The default `maximisable` for windows that declare none (default `false`).
|
|
183
|
+
*
|
|
184
|
+
* Not touched by `setInteractive()`: a display mode neither moves nor resizes
|
|
185
|
+
* a window in the arrangement, so a locked dashboard can still be blown up
|
|
186
|
+
* to read.
|
|
187
|
+
*/
|
|
188
|
+
maximisable?: boolean;
|
|
189
|
+
/** The default `minimisable` for windows that declare none (default `false`); see `maximisable`. */
|
|
190
|
+
minimisable?: boolean;
|
|
191
|
+
/** The windows, in mount order. */
|
|
192
|
+
windows?: LayoutWindow[];
|
|
193
|
+
/** An arrangement to apply at mount, as produced by `getLayout()`. */
|
|
194
|
+
layout?: LayoutSnapshot;
|
|
195
|
+
/** The layout region's accessible name. */
|
|
196
|
+
ariaLabel?: string;
|
|
197
|
+
/** A message catalogue, e.g. `grid.messages`; built-in English seeds otherwise. */
|
|
198
|
+
messages?: { t(key: string, params?: Record<string, unknown>): string };
|
|
199
|
+
onWindowMoved?: (event: LayoutMoveEvent) => void;
|
|
200
|
+
onWindowResized?: (event: LayoutResizeEvent) => void;
|
|
201
|
+
onWindowClosed?: (event: LayoutCloseEvent) => void;
|
|
202
|
+
onLayoutChanged?: (event: LayoutChangedEvent) => void;
|
|
203
|
+
onBeforeWindowMove?: (event: LayoutMoveEvent) => boolean | void | Promise<boolean>;
|
|
204
|
+
onBeforeWindowResize?: (event: LayoutMoveEvent) => boolean | void | Promise<boolean>;
|
|
205
|
+
onBeforeWindowClose?: (event: LayoutCloseEvent) => boolean | void | Promise<boolean>;
|
|
206
|
+
onWindowMoveCancelled?: (event: LayoutMoveEvent) => void;
|
|
207
|
+
onWindowResizeCancelled?: (event: LayoutMoveEvent) => void;
|
|
208
|
+
onWindowCloseCancelled?: (event: LayoutCloseEvent) => void;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* A reconfigurable dashboard: a cell grid inside an element, and a set of
|
|
213
|
+
* windows on it that a user can move, resize and close by pointer or by
|
|
214
|
+
* keyboard (BACKLOG-0001108).
|
|
215
|
+
*
|
|
216
|
+
* The module is **payload-agnostic**: a window body is a container with an id,
|
|
217
|
+
* which this module creates and sizes and never reads. It tells a payload it
|
|
218
|
+
* was resized by emitting `window:resized`; it never calls into one, because it
|
|
219
|
+
* cannot know what one is.
|
|
220
|
+
*/
|
|
221
|
+
interface Layout {
|
|
222
|
+
readonly el: HTMLElement;
|
|
223
|
+
/** The window ids, in mount order. */
|
|
224
|
+
windows(): string[];
|
|
225
|
+
/** The payload container for a window, or `null`. */
|
|
226
|
+
payload(id: string): HTMLElement | null;
|
|
227
|
+
/** A copy of one window's current descriptor, or `null`. */
|
|
228
|
+
window(id: string): LayoutWindow | null;
|
|
229
|
+
/** Add a window after mount; returns its payload container. */
|
|
230
|
+
add(spec: LayoutWindow): HTMLElement;
|
|
231
|
+
/** Move or resize a window, through the same before-events the drag uses. */
|
|
232
|
+
move(id: string, to: Partial<LayoutPlacement>): boolean | Promise<boolean>;
|
|
233
|
+
/** Close a window through `beforeWindowClose`; the payload is not destroyed. */
|
|
234
|
+
close(id: string): boolean | Promise<boolean>;
|
|
235
|
+
/**
|
|
236
|
+
* Blow one window up to fill the layout host, hiding the rest.
|
|
237
|
+
*
|
|
238
|
+
* It fills the **host element**, not the browser window, so there is no
|
|
239
|
+
* `position: fixed` (whose containing block is the nearest ancestor carrying
|
|
240
|
+
* a `transform` or a `contain`, which is why the same rule fills the screen
|
|
241
|
+
* on one page and lands in a 300px box on the next), no reparenting and
|
|
242
|
+
* nothing that can disturb the page around the dashboard.
|
|
243
|
+
*
|
|
244
|
+
* **Nothing moves**: no compaction runs, no placement changes, and the
|
|
245
|
+
* payload container is the same DOM node throughout. **Escape restores it**,
|
|
246
|
+
* from anywhere inside the layout — a focused grid body cell or column
|
|
247
|
+
* heading included — unless a payload has already claimed the key: an open
|
|
248
|
+
* cell editor, filter menu or column menu closes first, and the next Escape
|
|
249
|
+
* restores the window. Afterwards focus lands on the window's maximise
|
|
250
|
+
* control. A minimised window is expanded first, and maximising a second
|
|
251
|
+
* window restores the first.
|
|
252
|
+
*/
|
|
253
|
+
maximise(id: string): boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Collapse one window to a single row: its payload is hidden and its chrome
|
|
256
|
+
* stays, carrying the control that brings it back.
|
|
257
|
+
*
|
|
258
|
+
* On screen it becomes one row and the windows below pull up into the space
|
|
259
|
+
* under `compact: 'vertical'`. In the arrangement nothing moves at all — the
|
|
260
|
+
* collapse is a projection of it — so `restore()` gives back exactly the
|
|
261
|
+
* arrangement that was there, in **any** order and with any number of other
|
|
262
|
+
* windows still collapsed.
|
|
263
|
+
*
|
|
264
|
+
* A window with `chrome: false` is refused, with a warning naming it.
|
|
265
|
+
*/
|
|
266
|
+
minimise(id: string): boolean;
|
|
267
|
+
/** Leave whichever display mode a window is in; `false` when it was in none. */
|
|
268
|
+
restore(id: string): boolean;
|
|
269
|
+
/** The id of the window filling the host, or `null`. At most one. */
|
|
270
|
+
maximised(): string | null;
|
|
271
|
+
/** The ids of every currently minimised window, in mount order. */
|
|
272
|
+
minimised(): string[];
|
|
273
|
+
/**
|
|
274
|
+
* The full current arrangement.
|
|
275
|
+
*
|
|
276
|
+
* **A mode is not an arrangement**: this reports the *underlying* placement
|
|
277
|
+
* of a maximised or minimised window — where it will be when restored — never
|
|
278
|
+
* the geometry it is drawn at.
|
|
279
|
+
*/
|
|
280
|
+
getLayout(): LayoutSnapshot;
|
|
281
|
+
/** Restore an arrangement; never throws on garbage. */
|
|
282
|
+
setLayout(incoming: LayoutSnapshot | LayoutWindow[]): number;
|
|
283
|
+
/** A versioned snapshot, following core's and gantt's shape. */
|
|
284
|
+
getState(): { version: number; layout: LayoutSnapshot };
|
|
285
|
+
/** Restore a `getState()` snapshot; never throws on garbage. */
|
|
286
|
+
setState(snapshot: unknown): number;
|
|
287
|
+
/**
|
|
288
|
+
* Lock or unlock the dashboard at runtime — the "Edit layout" button. A
|
|
289
|
+
* boolean sets all three capabilities; an object sets only the keys it
|
|
290
|
+
* carries. Nothing is destroyed, so every payload survives the toggle.
|
|
291
|
+
*
|
|
292
|
+
* The asymmetry is deliberate: **you can always take a capability away; you
|
|
293
|
+
* can never grant one where the developer said no.** `setInteractive(false)`
|
|
294
|
+
* locks every window, including one whose own spec says `movable: true`;
|
|
295
|
+
* `setInteractive(true)` unlocks only the windows that never opted out.
|
|
296
|
+
*
|
|
297
|
+
* `config.movable: false` and `setInteractive(false)` are deliberately not
|
|
298
|
+
* the same thing: the config states the *default* for windows that declare
|
|
299
|
+
* nothing (and `false` is already that default, so it takes nothing away from
|
|
300
|
+
* a window that opted in), while this is an *active lock*.
|
|
301
|
+
*
|
|
302
|
+
* A key carrying `undefined` is treated as absent, so
|
|
303
|
+
* `setInteractive(getInteractive())` is a no-op in every state.
|
|
304
|
+
*
|
|
305
|
+
* A locked layout is not a read-only dashboard: this module never reads or
|
|
306
|
+
* writes a payload, so a grid inside a window is made read-only with the
|
|
307
|
+
* grid's own settings.
|
|
308
|
+
*/
|
|
309
|
+
setInteractive(value: boolean | Partial<LayoutInteractive>): LayoutInteractive;
|
|
310
|
+
/**
|
|
311
|
+
* The layout-level interactivity now in force, as a copy — `undefined` where
|
|
312
|
+
* no layout-level default is set, so the result round-trips through
|
|
313
|
+
* `setInteractive`.
|
|
314
|
+
*/
|
|
315
|
+
getInteractive(): LayoutInteractive;
|
|
316
|
+
/** Re-measure every window and emit `window:resized` for those that changed. */
|
|
317
|
+
refresh(): number;
|
|
318
|
+
on(
|
|
319
|
+
name: 'window:moved' | 'window:resized' | 'window:closed' | 'layout:changed'
|
|
320
|
+
| 'beforeWindowMove' | 'beforeWindowResize' | 'beforeWindowClose'
|
|
321
|
+
| 'windowMove:cancelled' | 'windowResize:cancelled' | 'windowClose:cancelled'
|
|
322
|
+
| '*' | string,
|
|
323
|
+
fn: (event: any) => unknown,
|
|
324
|
+
): () => void;
|
|
325
|
+
off(name: string, fn: (event: any) => unknown): void;
|
|
326
|
+
/** Tear the layout down; whatever the host mounted in a payload is the host's to destroy. */
|
|
327
|
+
destroy(): void;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/** Create a reconfigurable dashboard layout over a host element. */
|
|
331
|
+
export function createLayout(el: HTMLElement, config?: LayoutConfig): Layout;
|
|
332
|
+
export default createLayout;
|