@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,133 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Lattice Grid 1.60.0, tabs module type declarations
|
|
3
|
+
* Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
|
|
4
|
+
* https://latticegrid.dev
|
|
5
|
+
*/
|
|
6
|
+
import type {
|
|
7
|
+
createGrid,
|
|
8
|
+
createHeadlessGrid,
|
|
9
|
+
} from '../lattice-grid.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* One tab: an id, a display label, a grid config, and — for a derived tab —
|
|
13
|
+
* the parent tab id plus the narrowing forwarded onto the derived source
|
|
14
|
+
* built for it (`source: { mode: 'derived', from: <parent's grid>, ... }`).
|
|
15
|
+
* The derivation keys are the ones `packages/core/src/source/derive.js`
|
|
16
|
+
* already understands; this module invents none of its own.
|
|
17
|
+
*/
|
|
18
|
+
interface TabDescriptor {
|
|
19
|
+
/** A stable, unique id. Required. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** The tab button's text. Defaults to `id`. */
|
|
22
|
+
label?: string;
|
|
23
|
+
/** The config for this tab's body: the grid config passed to `createGrid` (merged with the derived `source`, when `from` is set), or — with `view` — that viewer's own config. */
|
|
24
|
+
config?: object;
|
|
25
|
+
/**
|
|
26
|
+
* Mount something other than a grid in this tab: the factory that builds
|
|
27
|
+
* it, called as `(el, config) => instance`. `createKanban` and `createKPI`
|
|
28
|
+
* have that signature already; a Gantt is adapted in a line
|
|
29
|
+
* (`(el, config) => createGantt({ ...config, element: el })`). The factory
|
|
30
|
+
* is injected rather than imported, exactly as `createGrid` is.
|
|
31
|
+
*
|
|
32
|
+
* A `view` tab derives from `from` exactly as a grid tab does: a headless
|
|
33
|
+
* grid carries the derived source and its rows are piped into the viewer
|
|
34
|
+
* through `rows.apply`, so deriving into one needs `createHeadlessGrid`
|
|
35
|
+
* injected too.
|
|
36
|
+
*/
|
|
37
|
+
view?: (el: HTMLElement, config: object) => unknown;
|
|
38
|
+
/** The parent tab id to derive from. When set, `config.source` is built for you and any of your own is replaced (with a warning). */
|
|
39
|
+
from?: string;
|
|
40
|
+
/** Row predicate forwarded to the derived source. */
|
|
41
|
+
where?: (row: unknown) => boolean;
|
|
42
|
+
/** Group-by forwarded to the derived source. */
|
|
43
|
+
group?: unknown;
|
|
44
|
+
groupBy?: unknown;
|
|
45
|
+
/** Time-bucketing forwarded to the derived source. */
|
|
46
|
+
bucket?: unknown;
|
|
47
|
+
/** Join spec forwarded to the derived source. */
|
|
48
|
+
join?: unknown;
|
|
49
|
+
/** Array-field unnesting forwarded to the derived source. */
|
|
50
|
+
unnest?: unknown;
|
|
51
|
+
/** `'live' | 'idle' | 'manual' | number` forwarded to the derived source. */
|
|
52
|
+
refresh?: 'live' | 'idle' | 'manual' | number;
|
|
53
|
+
/** Cross-filter wiring forwarded to the derived source. */
|
|
54
|
+
crossFilter?: unknown;
|
|
55
|
+
/** Which slice of the parent's rows to derive from: `'filtered' | 'all' | 'selected' | 'grouped'`. */
|
|
56
|
+
follow?: 'filtered' | 'all' | 'selected' | 'grouped';
|
|
57
|
+
/** Row limit forwarded to the derived source. */
|
|
58
|
+
limit?: number;
|
|
59
|
+
/** Sort forwarded to the derived source. */
|
|
60
|
+
sort?: unknown;
|
|
61
|
+
/** Statistical-profile derivation, forwarded to the derived source. */
|
|
62
|
+
profile?: unknown;
|
|
63
|
+
/** This tab's panel's own `aria-label`, when the label alone is not enough context. */
|
|
64
|
+
ariaLabel?: string;
|
|
65
|
+
/** A leading icon: a single character or emoji, or an element you built. Never a markup string — nothing here parses HTML. Decorative, so it is hidden from assistive technology. */
|
|
66
|
+
icon?: string | HTMLElement;
|
|
67
|
+
/** A count badge. `true` shows this tab's own live row count and follows it; a number or string is static; a function is given the live count and returns what to show (`null` hides it). Off when absent. */
|
|
68
|
+
badge?: true | number | string | ((count: number | null, tab: { id: string; label: string; from: string | null }) => unknown);
|
|
69
|
+
/** The badge's tone, declared by the host rather than derived from a threshold: `'good' | 'warn' | 'bad' | 'unknown'`, or a function of the live count returning one. */
|
|
70
|
+
badgeTone?: 'good' | 'warn' | 'bad' | 'unknown' | ((count: number | null, tab: { id: string; label: string; from: string | null }) => 'good' | 'warn' | 'bad' | 'unknown' | null);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** The payload every tab-change event carries. */
|
|
74
|
+
interface TabChangeEvent {
|
|
75
|
+
id: string;
|
|
76
|
+
previousId: string | null;
|
|
77
|
+
origin?: 'api' | 'user' | 'init';
|
|
78
|
+
reason?: string | null;
|
|
79
|
+
/** Cancel the switch (only meaningful on `beforeTabChange`). */
|
|
80
|
+
preventDefault?: (reason?: string) => void;
|
|
81
|
+
defaultPrevented?: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Tabbed-grid configuration. */
|
|
85
|
+
interface TabsConfig {
|
|
86
|
+
/** The grid factory to mount each tab with, e.g. `import { createGrid } from '../lattice-grid.js'`. Required. */
|
|
87
|
+
createGrid: (el: HTMLElement, config: object) => unknown;
|
|
88
|
+
/** The headless grid factory, injected the same way and for the same reason. Optional, and only needed for badges: with it, a tab that has never been activated still carries a live count, computed with no DOM. Without it, such a tab shows no badge until its first activation. */
|
|
89
|
+
createHeadlessGrid?: (config: object) => unknown;
|
|
90
|
+
/** The tabs, in display order. Required, at least one. */
|
|
91
|
+
tabs: TabDescriptor[];
|
|
92
|
+
/** The initially active tab id. Defaults to the first tab. */
|
|
93
|
+
active?: string;
|
|
94
|
+
/** The tablist landmark's accessible name. */
|
|
95
|
+
ariaLabel?: string;
|
|
96
|
+
/** An explicit message-catalogue override; otherwise a mounted tab's own `grid.messages` is used. */
|
|
97
|
+
messages?: { t(key: string, params?: Record<string, unknown>): string };
|
|
98
|
+
onTabChange?: (event: TabChangeEvent) => void;
|
|
99
|
+
onBeforeTabChange?: (event: TabChangeEvent) => boolean | void | Promise<boolean>;
|
|
100
|
+
onTabChangeCancelled?: (event: TabChangeEvent) => void;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* A tabbed grid: a `role="tablist"` strip above a stack of `role="tabpanel"`
|
|
105
|
+
* regions, each hosting its own, independently-configured grid instance
|
|
106
|
+
* (BACKLOG-0001039). A tab's grid mounts on first activation and is kept
|
|
107
|
+
* alive, hidden, until `destroy()`.
|
|
108
|
+
*/
|
|
109
|
+
interface Tabs {
|
|
110
|
+
readonly el: HTMLElement;
|
|
111
|
+
/** The currently active tab id. */
|
|
112
|
+
readonly activeId: string;
|
|
113
|
+
/** The configured tab ids, in order. */
|
|
114
|
+
tabs(): string[];
|
|
115
|
+
/** The live grid instance for a tab, or `null` before it has been materialised. */
|
|
116
|
+
tab(id: string): unknown | null;
|
|
117
|
+
/** Whether a tab's grid has been created yet. */
|
|
118
|
+
isMounted(id: string): boolean;
|
|
119
|
+
/** Switch the active tab, gated by `beforeTabChange`. */
|
|
120
|
+
activate(id: string, opts?: { origin?: 'api' | 'user' }): boolean | Promise<boolean>;
|
|
121
|
+
on(name: 'beforeTabChange' | 'tab:changed' | 'tabChange:cancelled' | string, fn: (event: TabChangeEvent) => void): () => void;
|
|
122
|
+
off(name: string, fn: (event: TabChangeEvent) => void): void;
|
|
123
|
+
/** Tear the whole strip down; destroys every mounted tab's grid. */
|
|
124
|
+
destroy(): void;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Create a tabbed grid over a host element. Each tab is a full,
|
|
129
|
+
* independently-configured grid instance; a tab may derive from another via
|
|
130
|
+
* `from`, reusing the shipped `source: { mode: 'derived' }` mechanism.
|
|
131
|
+
*/
|
|
132
|
+
export function createTabs(el: HTMLElement, config: TabsConfig): Tabs;
|
|
133
|
+
export default createTabs;
|