@toclocoinc/lattice-grid 1.65.0 → 1.67.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 (177) hide show
  1. package/README.md +6 -4
  2. package/angular/LICENSE +111 -0
  3. package/angular/README.md +78 -0
  4. package/angular/fesm2022/toclocoinc-lattice-grid-angular.mjs +2843 -0
  5. package/angular/package.json +16 -0
  6. package/angular/types/toclocoinc-lattice-grid-angular.d.ts +1366 -0
  7. package/docs/API.html +741 -27
  8. package/docs/api-detail.html +137 -4
  9. package/lattice-grid.d.ts +9 -6
  10. package/lattice-grid.esm.min.js +26 -10
  11. package/lattice-grid.min.cjs +26 -10
  12. package/lattice-grid.min.css +1 -1
  13. package/lattice-grid.min.js +26 -10
  14. package/modules/ai.d.ts +1 -1
  15. package/modules/ai.esm.min.js +3 -3
  16. package/modules/ai.min.cjs +3 -3
  17. package/modules/ai.min.js +3 -3
  18. package/modules/angular.d.ts +1 -1
  19. package/modules/angular.esm.min.js +7 -7
  20. package/modules/angular.min.cjs +7 -7
  21. package/modules/angular.min.js +7 -7
  22. package/modules/chart-alluvial.d.ts +1 -1
  23. package/modules/chart-alluvial.esm.min.js +1 -1
  24. package/modules/chart-alluvial.min.cjs +1 -1
  25. package/modules/chart-alluvial.min.js +1 -1
  26. package/modules/chart-arc.d.ts +1 -1
  27. package/modules/chart-arc.esm.min.js +1 -1
  28. package/modules/chart-arc.min.cjs +1 -1
  29. package/modules/chart-arc.min.js +1 -1
  30. package/modules/chart-bubblemap.d.ts +1 -1
  31. package/modules/chart-bubblemap.esm.min.js +1 -1
  32. package/modules/chart-bubblemap.min.cjs +1 -1
  33. package/modules/chart-bubblemap.min.js +1 -1
  34. package/modules/chart-bump.d.ts +1 -1
  35. package/modules/chart-bump.esm.min.js +1 -1
  36. package/modules/chart-bump.min.cjs +1 -1
  37. package/modules/chart-bump.min.js +1 -1
  38. package/modules/chart-calendar.d.ts +1 -1
  39. package/modules/chart-calendar.esm.min.js +1 -1
  40. package/modules/chart-calendar.min.cjs +1 -1
  41. package/modules/chart-calendar.min.js +1 -1
  42. package/modules/chart-decomposition.d.ts +1 -1
  43. package/modules/chart-decomposition.esm.min.js +1 -1
  44. package/modules/chart-decomposition.min.cjs +1 -1
  45. package/modules/chart-decomposition.min.js +1 -1
  46. package/modules/chart-diverging.d.ts +1 -1
  47. package/modules/chart-diverging.esm.min.js +1 -1
  48. package/modules/chart-diverging.min.cjs +1 -1
  49. package/modules/chart-diverging.min.js +1 -1
  50. package/modules/chart-dumbbell.d.ts +1 -1
  51. package/modules/chart-dumbbell.esm.min.js +1 -1
  52. package/modules/chart-dumbbell.min.cjs +1 -1
  53. package/modules/chart-dumbbell.min.js +1 -1
  54. package/modules/chart-fan.d.ts +1 -1
  55. package/modules/chart-fan.esm.min.js +1 -1
  56. package/modules/chart-fan.min.cjs +1 -1
  57. package/modules/chart-fan.min.js +1 -1
  58. package/modules/chart-hexbin.d.ts +1 -1
  59. package/modules/chart-hexbin.esm.min.js +1 -1
  60. package/modules/chart-hexbin.min.cjs +1 -1
  61. package/modules/chart-hexbin.min.js +1 -1
  62. package/modules/chart-hexmap.d.ts +1 -1
  63. package/modules/chart-hexmap.esm.min.js +1 -1
  64. package/modules/chart-hexmap.min.cjs +1 -1
  65. package/modules/chart-hexmap.min.js +1 -1
  66. package/modules/chart-icicle.d.ts +1 -1
  67. package/modules/chart-icicle.esm.min.js +1 -1
  68. package/modules/chart-icicle.min.cjs +1 -1
  69. package/modules/chart-icicle.min.js +1 -1
  70. package/modules/chart-markermap.d.ts +1 -1
  71. package/modules/chart-markermap.esm.min.js +1 -1
  72. package/modules/chart-markermap.min.cjs +1 -1
  73. package/modules/chart-markermap.min.js +1 -1
  74. package/modules/chart-parallel.d.ts +1 -1
  75. package/modules/chart-parallel.esm.min.js +1 -1
  76. package/modules/chart-parallel.min.cjs +1 -1
  77. package/modules/chart-parallel.min.js +1 -1
  78. package/modules/chart-ridgeline.d.ts +1 -1
  79. package/modules/chart-ridgeline.esm.min.js +1 -1
  80. package/modules/chart-ridgeline.min.cjs +1 -1
  81. package/modules/chart-ridgeline.min.js +1 -1
  82. package/modules/chart-roc.d.ts +1 -1
  83. package/modules/chart-roc.esm.min.js +1 -1
  84. package/modules/chart-roc.min.cjs +1 -1
  85. package/modules/chart-roc.min.js +1 -1
  86. package/modules/chart-slope.d.ts +1 -1
  87. package/modules/chart-slope.esm.min.js +1 -1
  88. package/modules/chart-slope.min.cjs +1 -1
  89. package/modules/chart-slope.min.js +1 -1
  90. package/modules/chart-splom.d.ts +1 -1
  91. package/modules/chart-splom.esm.min.js +1 -1
  92. package/modules/chart-splom.min.cjs +1 -1
  93. package/modules/chart-splom.min.js +1 -1
  94. package/modules/chart-waffle.d.ts +1 -1
  95. package/modules/chart-waffle.esm.min.js +1 -1
  96. package/modules/chart-waffle.min.cjs +1 -1
  97. package/modules/chart-waffle.min.js +1 -1
  98. package/modules/charts.d.ts +1 -1
  99. package/modules/charts.esm.min.js +261 -48
  100. package/modules/charts.min.cjs +261 -48
  101. package/modules/charts.min.js +261 -48
  102. package/modules/data-router.d.ts +8 -3
  103. package/modules/data-router.esm.min.js +28 -6
  104. package/modules/data-router.min.cjs +28 -6
  105. package/modules/data-router.min.js +28 -6
  106. package/modules/devtools.d.ts +1 -1
  107. package/modules/devtools.esm.min.js +1 -1
  108. package/modules/devtools.min.cjs +1 -1
  109. package/modules/devtools.min.js +1 -1
  110. package/modules/dhtmlx-compat.d.ts +1 -1
  111. package/modules/dhtmlx-compat.esm.min.js +3 -3
  112. package/modules/dhtmlx-compat.min.cjs +3 -3
  113. package/modules/dhtmlx-compat.min.js +3 -3
  114. package/modules/gantt.d.ts +8 -3
  115. package/modules/gantt.esm.min.js +27 -4
  116. package/modules/gantt.min.cjs +27 -4
  117. package/modules/gantt.min.js +27 -4
  118. package/modules/geo-europe-nuts.d.ts +1 -1
  119. package/modules/geo-europe-nuts.esm.min.js +1 -1
  120. package/modules/geo-uk.d.ts +1 -1
  121. package/modules/geo-uk.esm.min.js +1 -1
  122. package/modules/geo-us-states.d.ts +1 -1
  123. package/modules/geo-us-states.esm.min.js +1 -1
  124. package/modules/geo-world-110m.d.ts +1 -1
  125. package/modules/geo-world-110m.esm.min.js +1 -1
  126. package/modules/geo-world-50m.d.ts +1 -1
  127. package/modules/geo-world-50m.esm.min.js +1 -1
  128. package/modules/htmx.d.ts +1 -1
  129. package/modules/htmx.esm.min.js +26 -10
  130. package/modules/htmx.min.cjs +26 -10
  131. package/modules/htmx.min.js +26 -10
  132. package/modules/kanban.d.ts +10 -3
  133. package/modules/kanban.esm.min.js +24 -4
  134. package/modules/kanban.min.cjs +24 -4
  135. package/modules/kanban.min.js +24 -4
  136. package/modules/kpi.d.ts +10 -3
  137. package/modules/kpi.esm.min.js +27 -4
  138. package/modules/kpi.min.cjs +27 -4
  139. package/modules/kpi.min.js +27 -4
  140. package/modules/layout.d.ts +1 -1
  141. package/modules/layout.esm.min.js +3 -3
  142. package/modules/layout.min.cjs +3 -3
  143. package/modules/layout.min.js +3 -3
  144. package/modules/mock-socket.d.ts +1 -1
  145. package/modules/mock-socket.esm.min.js +1 -1
  146. package/modules/mock-socket.min.cjs +1 -1
  147. package/modules/mock-socket.min.js +1 -1
  148. package/modules/react.d.ts +1 -1
  149. package/modules/react.esm.min.js +3 -3
  150. package/modules/react.min.cjs +3 -3
  151. package/modules/react.min.js +3 -3
  152. package/modules/svelte.d.ts +251 -2
  153. package/modules/svelte.esm.min.js +960 -6
  154. package/modules/svelte.min.cjs +942 -5
  155. package/modules/svelte.min.js +942 -5
  156. package/modules/tabs.d.ts +1 -1
  157. package/modules/tabs.esm.min.js +3 -3
  158. package/modules/tabs.min.cjs +3 -3
  159. package/modules/tabs.min.js +3 -3
  160. package/modules/vue.d.ts +398 -9
  161. package/modules/vue.esm.min.js +1163 -31
  162. package/modules/vue.min.cjs +1147 -30
  163. package/modules/vue.min.js +1147 -30
  164. package/modules/webcomponent.d.ts +233 -1
  165. package/modules/webcomponent.esm.min.js +1274 -41
  166. package/modules/webcomponent.min.cjs +1256 -41
  167. package/modules/webcomponent.min.js +1256 -41
  168. package/package.json +27 -2
  169. package/svelte/Chart.svelte +34 -0
  170. package/svelte/Gantt.svelte +34 -0
  171. package/svelte/Grid.svelte +30 -0
  172. package/svelte/GridProvider.svelte +13 -0
  173. package/svelte/KPI.svelte +34 -0
  174. package/svelte/Kanban.svelte +34 -0
  175. package/svelte/Layout.svelte +34 -0
  176. package/svelte/Router.svelte +16 -0
  177. package/svelte/Tabs.svelte +53 -0
@@ -0,0 +1,2843 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, makeEnvironmentProviders, signal, computed, Injectable, inject, ElementRef, NgZone, PLATFORM_ID, Injector, EventEmitter, afterNextRender, Output, Input, Directive, ViewEncapsulation, Component, effect, TemplateRef, ViewContainerRef, ContentChildren } from '@angular/core';
3
+ import { isPlatformBrowser } from '@angular/common';
4
+
5
+ const LATTICE_FACTORIES = new InjectionToken('lattice.factories');
6
+
7
+ function provideLattice(factories) {
8
+ return makeEnvironmentProviders([
9
+ { provide: LATTICE_FACTORIES, useValue: factories ?? {} },
10
+ ]);
11
+ }
12
+
13
+ function requireFactory(factories, key, specifier, element) {
14
+ const factory = factories ? factories[key] : undefined;
15
+ if (typeof factory !== 'function') {
16
+ throw new TypeError(`[lattice] <${element}> needs ${String(key)}. Add it to the provider: `
17
+ + `import { ${String(key)} } from '${specifier}'; `
18
+ + `provideLattice({ ${String(key)} }).`);
19
+ }
20
+ return factory;
21
+ }
22
+
23
+ const DEFAULT_GRID_NAME = 'default';
24
+ class LatticeGridRegistry {
25
+ constructor() {
26
+
27
+ this.published = signal({},
28
+ ...(ngDevMode ? [{ debugName: "published" }] : []));
29
+
30
+ this.byName = new Map();
31
+
32
+ this.grids = this.published.asReadonly();
33
+ }
34
+
35
+ publish(name, grid) {
36
+ const key = name || DEFAULT_GRID_NAME;
37
+ this.published.update((held) => {
38
+ if (held[key] === grid)
39
+ return held;
40
+ const next = { ...held };
41
+ if (grid)
42
+ next[key] = grid;
43
+ else
44
+ delete next[key];
45
+ return next;
46
+ });
47
+ }
48
+
49
+ grid(name = DEFAULT_GRID_NAME) {
50
+ const key = name || DEFAULT_GRID_NAME;
51
+ let held = this.byName.get(key);
52
+ if (!held) {
53
+ held = computed(() => this.published()[key] ?? null);
54
+ this.byName.set(key, held);
55
+ }
56
+ return held;
57
+ }
58
+
59
+ snapshot(name = DEFAULT_GRID_NAME) {
60
+ return this.published()[name || DEFAULT_GRID_NAME] ?? null;
61
+ }
62
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeGridRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
63
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeGridRegistry, providedIn: 'root' }); }
64
+ }
65
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeGridRegistry, decorators: [{
66
+ type: Injectable,
67
+ args: [{ providedIn: 'root' }]
68
+ }] });
69
+
70
+ const EVENT_NAMES$1 = Object.freeze([
71
+ 'ready', 'destroy', 'render:first', 'render:done', 'config:changed', 'licence:changed',
72
+ 'model:changed', 'rows:changed', 'rows:queued', 'rows:deferred', 'rows:paused',
73
+ 'rows:resumed', 'row:received', 'row:sent', 'row:copied', 'row:moved', 'source:error',
74
+ 'stream:chunk', 'stream:end', 'stream:evicted',
75
+ 'rowDrag:started', 'rowDrag:moved', 'rowDrag:left', 'rowDrag:ended',
76
+ 'cell:changed', 'cell:pending',
77
+ 'cell:confirmed', 'cell:reverted', 'cell:conflict', 'cell:clicked', 'cell:dblclicked', 'cell:contextmenu',
78
+ 'cell:mouseover', 'cell:mouseout', 'cell:mousedown', 'cell:mouseup',
79
+ 'cell:edit:start', 'cell:edit:end', 'row:edit:start', 'row:edit:end', 'row:clicked',
80
+ 'row:dblclicked', 'row:pending', 'row:confirmed', 'row:reverted', 'row:conflict',
81
+ 'form:opened', 'form:closed', 'form:saved', 'form:error',
82
+ 'sort:changed', 'filter:changed', 'group:toggled', 'facet:computed', 'facet:filtered',
83
+ 'facet:expanded', 'facet:failed', 'column:moved', 'column:resized', 'column:visible',
84
+ 'column:pinned', 'column:grouped', 'column:pivoted', 'column:filter:open',
85
+ 'column:profile:open',
86
+ 'column:menu:open', 'columns:changed', 'columns:tagged', 'columngroup:changed',
87
+ 'header:contextmenu', 'pivot:drill',
88
+ 'selection:changed', 'range:changed', 'clipboard:copy', 'page:changed', 'scroll',
89
+ 'scroll:end', 'size:changed', 'detail:toggled', 'toolpanel:focus', 'highlight:changed', 'find:changed',
90
+ 'tree:loading', 'tree:loaded', 'tree:loadFailed', 'tree:loadAborted', 'state:changed',
91
+ 'state:reset', 'history:changed', 'history:applied', 'views:changed', 'view:applied',
92
+ 'view:saved', 'view:removed', 'view:renamed', 'view:default', 'formatting:changed',
93
+ 'redaction:changed', 'permissions:changed', 'presentation:changed',
94
+ 'presentation:started', 'presentation:ended', 'presentation:view', 'presentation:scale',
95
+ 'presentation:spotlight', 'presentation:captured', 'comment:added', 'comment:edited',
96
+ 'comment:deleted', 'comment:failed', 'comment:resolved', 'comment:unresolved',
97
+ 'comment:threadOpened', 'comment:threadClosed', 'comment:indexLoaded',
98
+ 'presence:published', 'presence:joined', 'presence:updated', 'presence:left',
99
+ 'presence:failed', 'presence:lockRefused', 'diff:changed', 'diff:swapped',
100
+ 'timeline:attached', 'timeline:detached', 'timeline:seek', 'timeline:seeking',
101
+ 'annotation:changed',
102
+
103
+ 'validation:failed', 'validation:cleared',
104
+ 'export:progress', 'export:request', 'export:done',
105
+
106
+ 'shortcuts:opened', 'shortcuts:closed',
107
+
108
+ 'print:before', 'print:after',
109
+
110
+ 'beforeEdit', 'beforeSort', 'beforeFilter',
111
+ 'beforeColumnMove', 'beforeColumnResize', 'beforeColumnHide',
112
+ 'beforeSelect', 'beforeRowAdd', 'beforeDelete', 'beforeRowMove', 'beforeGroup',
113
+ 'beforeRowReceive',
114
+ 'edit:cancelled', 'sort:cancelled', 'filter:cancelled',
115
+ 'columnMove:cancelled', 'columnResize:cancelled', 'columnHide:cancelled',
116
+ 'selection:cancelled', 'rowAdd:cancelled', 'delete:cancelled',
117
+ 'rowMove:cancelled', 'group:cancelled', 'rowReceive:cancelled',
118
+ ]);
119
+
120
+ const IMPERATIVE = Object.freeze({
121
+
122
+ sort: (grid, value) => grid.sort.set(value || []),
123
+
124
+ filters: (grid, value) => grid.filters.set(value || null),
125
+
126
+ quickFilter: (grid, value) => {
127
+ if (value && typeof value === 'object') {
128
+ grid.filters.quick( (value).text || '', { mode: (value).mode });
129
+ return;
130
+ }
131
+ grid.filters.quick(typeof value === 'string' ? value : '');
132
+ },
133
+
134
+ selectedKeys: (grid, value) => grid.selection.set(Array.isArray(value) ? value : []),
135
+ });
136
+
137
+ function handlerName$1(event) {
138
+ const parts = String(event).split(':');
139
+ return `on${parts.map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join('')}`;
140
+ }
141
+
142
+ function dashedName$1(event) {
143
+ return String(event).replace(/:/g, '-');
144
+ }
145
+
146
+ const CONFIG_KEY_ALIASES = Object.freeze({
147
+ 'row-key': 'rowKey',
148
+ 'row-height': 'rowHeight',
149
+ 'header-height': 'headerHeight',
150
+ 'auto-height': 'autoHeight',
151
+ });
152
+
153
+ function aliasConfigKey(key) {
154
+ return Object.hasOwn(CONFIG_KEY_ALIASES, key) ? CONFIG_KEY_ALIASES[key] : key;
155
+ }
156
+
157
+ const BY_HANDLER$1 = Object.freeze(Object.fromEntries(EVENT_NAMES$1.map((name) => [handlerName$1(name), name])));
158
+
159
+ function isHandlerProp(key) {
160
+ return Object.hasOwn(BY_HANDLER$1, key);
161
+ }
162
+
163
+ function partition(props) {
164
+
165
+ const config = {};
166
+
167
+ const imperative = {};
168
+
169
+ const handlers = {};
170
+ for (const [key, value] of Object.entries(props || {})) {
171
+ if (isHandlerProp(key)) {
172
+ handlers[key] = value;
173
+ continue;
174
+ }
175
+ if (Object.hasOwn(IMPERATIVE, key)) {
176
+ imperative[key] = value;
177
+ continue;
178
+ }
179
+ config[key] = value;
180
+ }
181
+ return { config, imperative, handlers };
182
+ }
183
+
184
+ function createGridController$1(opts) {
185
+ const create = opts.createGrid;
186
+ if (typeof create !== 'function') {
187
+ throw new TypeError('createGridController needs createGrid; pass it in from the grid package.');
188
+ }
189
+ const initial = partition(opts.props || {});
190
+ const grid = create(opts.element, { ...initial.config });
191
+
192
+ let handlers = initial.handlers;
193
+ let config = initial.config;
194
+ let imperative = {};
195
+
196
+ const dispatch = (event) => {
197
+ if (!event || typeof event.type !== 'string')
198
+ return;
199
+ const fn = handlers[handlerName$1(event.type)];
200
+ if (typeof fn === 'function')
201
+ fn(event);
202
+ };
203
+ const unsubscribe = grid.on('*', dispatch);
204
+
205
+ for (const [key, value] of Object.entries(initial.imperative)) {
206
+ if (value === undefined)
207
+ continue;
208
+ IMPERATIVE[key](grid, value);
209
+ imperative[key] = value;
210
+ }
211
+ let destroyed = false;
212
+ return {
213
+ grid,
214
+
215
+ update(next) {
216
+ if (destroyed)
217
+ return;
218
+ const parts = partition(next || {});
219
+ handlers = parts.handlers;
220
+
221
+ const changed = {};
222
+ for (const [key, value] of Object.entries(parts.config)) {
223
+
224
+ if (!Object.is(config[key], value))
225
+ changed[key] = value;
226
+ }
227
+
228
+ for (const key of Object.keys(config)) {
229
+ if (!Object.hasOwn(parts.config, key))
230
+ changed[key] = undefined;
231
+ }
232
+ if (Object.keys(changed).length)
233
+ grid.setAll(changed);
234
+ config = parts.config;
235
+ for (const [key, apply] of Object.entries(IMPERATIVE)) {
236
+ const value = parts.imperative[key];
237
+ if (Object.is(imperative[key], value))
238
+ continue;
239
+ if (value === undefined && !Object.hasOwn(imperative, key))
240
+ continue;
241
+ apply(grid, value);
242
+ imperative[key] = value;
243
+ }
244
+ },
245
+
246
+ destroy() {
247
+ if (destroyed)
248
+ return;
249
+ destroyed = true;
250
+ unsubscribe();
251
+ grid.destroy();
252
+ },
253
+ };
254
+ }
255
+
256
+ const STAMPED_VERSION = '0.0.0-source';
257
+
258
+ async function resolveVersion() {
259
+ if (STAMPED_VERSION !== '0.0.0-source')
260
+ return STAMPED_VERSION;
261
+
262
+ try {
263
+ if (typeof process !== 'undefined' && process.versions && process.versions.node) {
264
+ const mod = await import('node:' + 'module');
265
+ const req = mod.createRequire(import.meta.url);
266
+ const fs = req('node:' + 'fs');
267
+ const url = new URL('../../../../package.json', import.meta.url);
268
+ const text = fs.readFileSync(url, 'utf8');
269
+ return JSON.parse(text).version || STAMPED_VERSION;
270
+ }
271
+ }
272
+ catch { }
273
+
274
+ return STAMPED_VERSION;
275
+ }
276
+
277
+ const VERSION = await resolveVersion();
278
+
279
+ const warned = new Set();
280
+
281
+ const WARNED_LIMIT = 2000;
282
+
283
+ function rememberWarned(key) {
284
+ warned.add(key);
285
+ if (warned.size > WARNED_LIMIT) {
286
+
287
+ const oldest = warned.values().next().value;
288
+ if (oldest !== undefined)
289
+ warned.delete(oldest);
290
+ }
291
+ }
292
+
293
+ const reported = [];
294
+
295
+ const REPORT_LIMIT = 500;
296
+
297
+ function record(key, level, message) {
298
+ reported.push({
299
+ key,
300
+ level,
301
+
302
+ message: message.map((m) => (typeof m === 'string' ? m : safeString(m))).join(' '),
303
+ at: Date.now(),
304
+ });
305
+ if (reported.length > REPORT_LIMIT)
306
+ reported.shift();
307
+ }
308
+
309
+ function safeString(value) {
310
+ if (value instanceof Error)
311
+ return value.message;
312
+ try {
313
+ return JSON.stringify(value);
314
+ }
315
+ catch {
316
+ return String(value);
317
+ }
318
+ }
319
+
320
+ function reportedWarnings() { return reported.map((r) => ({ ...r })); }
321
+
322
+ function warnOnce$1(key, ...message) {
323
+ if (warned.has(key))
324
+ return;
325
+ rememberWarned(key);
326
+ record(key, 'warn', message);
327
+ console.warn('[lattice]', ...message);
328
+ }
329
+
330
+ function infoOnce(key, ...message) {
331
+ if (warned.has(key))
332
+ return;
333
+ rememberWarned(key);
334
+ record(key, 'info', message);
335
+ console.info('[lattice]', ...message);
336
+ }
337
+
338
+ function resetWarnings() {
339
+ warned.clear();
340
+
341
+ reported.length = 0;
342
+ }
343
+
344
+ function fail(message, extra) {
345
+ const err = new Error(`[lattice] ${message}`);
346
+ if (extra !== undefined)
347
+ err.cause = extra;
348
+ throw err;
349
+ }
350
+
351
+ function invariant(condition, message) {
352
+ if (!condition)
353
+ fail(message);
354
+ }
355
+
356
+ const DEV = (() => {
357
+ try {
358
+ return !(typeof process !== 'undefined' && process.env
359
+ && process.env.NODE_ENV === 'production');
360
+ }
361
+ catch {
362
+ return true;
363
+ }
364
+ })();
365
+
366
+ function isObject(v) {
367
+ return v !== null && typeof v === 'object' && !Array.isArray(v);
368
+ }
369
+
370
+ function isFunction(v) {
371
+ return typeof v === 'function';
372
+ }
373
+
374
+ function isNil(v) {
375
+ return v === null || v === undefined;
376
+ }
377
+
378
+ function isBlank(v) {
379
+ return v === null || v === undefined || v === '';
380
+ }
381
+
382
+ function isCtor(v) {
383
+ if (typeof v !== 'function')
384
+ return false;
385
+ if (/^class[\s{]/.test(Function.prototype.toString.call(v)))
386
+ return true;
387
+ return !!(v.prototype && Object.getOwnPropertyNames(v.prototype).length > 1);
388
+ }
389
+
390
+ const pathCache = new Map();
391
+
392
+ function pathGetter(path) {
393
+ let fn = pathCache.get(path);
394
+ if (fn)
395
+ return fn;
396
+ if (!path.includes('.')) {
397
+ fn = (o) => (o == null ? undefined : o[path]);
398
+ }
399
+ else {
400
+ const parts = path.split('.');
401
+ const n = parts.length;
402
+ fn = (o) => {
403
+ let cur = o;
404
+ for (let i = 0; i < n; i++) {
405
+ if (cur == null)
406
+ return undefined;
407
+ cur = cur[parts[i]];
408
+ }
409
+ return cur;
410
+ };
411
+ }
412
+ pathCache.set(path, fn);
413
+ return fn;
414
+ }
415
+
416
+ const setterCache = new Map();
417
+
418
+ function pathSetter(path) {
419
+ let fn = setterCache.get(path);
420
+ if (fn)
421
+ return fn;
422
+ if (!path.includes('.')) {
423
+ fn = (o, v) => { if (o != null)
424
+ o[path] = v; };
425
+ }
426
+ else {
427
+ const parts = path.split('.');
428
+ const last = parts.length - 1;
429
+ fn = (o, v) => {
430
+ let cur = o;
431
+ for (let i = 0; i < last; i++) {
432
+ if (cur == null)
433
+ return;
434
+ const k = parts[i];
435
+ if (cur[k] == null)
436
+ cur[k] = {};
437
+ cur = cur[k];
438
+ }
439
+ if (cur != null)
440
+ cur[parts[last]] = v;
441
+ };
442
+ }
443
+ setterCache.set(path, fn);
444
+ return fn;
445
+ }
446
+
447
+ function getPath(obj, path) {
448
+ return pathGetter(path)(obj);
449
+ }
450
+
451
+ function setPath(obj, path, value) {
452
+ pathSetter(path)(obj, value);
453
+ }
454
+
455
+ function humanise(field) {
456
+ if (!field)
457
+ return '';
458
+ const leaf = field.includes('.') ? field.slice(field.lastIndexOf('.') + 1) : field;
459
+ return leaf
460
+ .replace(/[_-]+/g, ' ')
461
+ .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
462
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
463
+ .replace(/\s+/g, ' ')
464
+ .trim()
465
+ .replace(/^./, (c) => c.toUpperCase());
466
+ }
467
+
468
+ const ESCAPES = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' };
469
+
470
+ function escapeHtml(s) {
471
+ const str = s == null ? '' : String(s);
472
+ return /[&<>"']/.test(str) ? str.replace(/[&<>"']/g, (c) => ESCAPES[c]) : str;
473
+ }
474
+
475
+ function titleCase(s) {
476
+ return String(s).replace(/\w\S*/g, (t) => t[0].toUpperCase() + t.slice(1).toLowerCase());
477
+ }
478
+
479
+ function expand(value, key, whenTrue) {
480
+ if (value === undefined)
481
+ return undefined;
482
+ if (value === true)
483
+ return { enabled: true, ...whenTrue };
484
+ if (value === false)
485
+ return { enabled: false };
486
+ if (isObject(value))
487
+ return value;
488
+ return { [key]: value, enabled: true };
489
+ }
490
+
491
+ function toArray(v) {
492
+ if (v === undefined || v === null)
493
+ return [];
494
+ return Array.isArray(v) ? v : [v];
495
+ }
496
+
497
+ const MERGE_FORBIDDEN_KEYS = Object.freeze(new Set(['__proto__', 'constructor', 'prototype']));
498
+
499
+ function merge(a, b) {
500
+ if (!isObject(a))
501
+ return isObject(b) ? { ...b } : b;
502
+ if (!isObject(b))
503
+ return b === undefined ? a : b;
504
+ const out = { ...a };
505
+ for (const k of Object.keys(b)) {
506
+ if (MERGE_FORBIDDEN_KEYS.has(k))
507
+ continue;
508
+ const bv = b[k];
509
+ if (bv === undefined)
510
+ continue;
511
+ out[k] = isObject(bv) && isObject(out[k]) ? merge(out[k], bv) : bv;
512
+ }
513
+ return out;
514
+ }
515
+
516
+ function mergeRow(previous, patch) {
517
+ if (!isObject(previous) || !isObject(patch) || previous === patch)
518
+ return patch;
519
+ const out = Object.create(Object.getPrototypeOf(previous));
520
+ Object.assign(out, previous, patch);
521
+ return out;
522
+ }
523
+
524
+ class Lru {
525
+
526
+ #max;
527
+
528
+ #map = new Map();
529
+
530
+ #onEvict;
531
+
532
+ constructor(max = 256, onEvict = null) {
533
+ this.#max = max;
534
+ this.#onEvict = onEvict;
535
+ }
536
+
537
+ get size() {
538
+ return this.#map.size;
539
+ }
540
+
541
+ get max() {
542
+ return this.#max;
543
+ }
544
+
545
+ set max(v) {
546
+ this.#max = v;
547
+ this.#trim();
548
+ }
549
+
550
+ has(k) {
551
+ return this.#map.has(k);
552
+ }
553
+
554
+ get(k) {
555
+ const m = this.#map;
556
+ if (!m.has(k))
557
+ return undefined;
558
+ const v = m.get(k);
559
+ m.delete(k);
560
+ m.set(k, v);
561
+ return v;
562
+ }
563
+
564
+ peek(k) {
565
+ return this.#map.get(k);
566
+ }
567
+
568
+ set(k, v) {
569
+ const m = this.#map;
570
+ if (m.has(k))
571
+ m.delete(k);
572
+ m.set(k, v);
573
+ this.#trim();
574
+ return v;
575
+ }
576
+
577
+ delete(k) {
578
+ const v = this.#map.get(k);
579
+ if (this.#map.delete(k) && this.#onEvict)
580
+ this.#onEvict(v, k);
581
+ return v;
582
+ }
583
+
584
+ clear() {
585
+ if (this.#onEvict)
586
+ for (const [k, v] of this.#map)
587
+ this.#onEvict(v, k);
588
+ this.#map.clear();
589
+ }
590
+
591
+ keys() {
592
+ return this.#map.keys();
593
+ }
594
+
595
+ values() {
596
+ return this.#map.values();
597
+ }
598
+
599
+ #trim() {
600
+ const m = this.#map;
601
+ while (m.size > this.#max) {
602
+ const oldest = m.keys().next().value;
603
+ const v = m.get(oldest);
604
+ m.delete(oldest);
605
+ if (this.#onEvict)
606
+ this.#onEvict(v, oldest);
607
+ }
608
+ }
609
+ }
610
+
611
+ const collators = new Map();
612
+
613
+ function collator(locale, opts) {
614
+ const key = `${locale || ''}|${opts ? JSON.stringify(opts) : ''}`;
615
+ let c = collators.get(key);
616
+ if (!c) {
617
+ c = new Intl.Collator(locale || undefined, {
618
+ numeric: true, sensitivity: 'variant', ...opts,
619
+ });
620
+ collators.set(key, c);
621
+ }
622
+ return c;
623
+ }
624
+
625
+ function defaultCompare(a, b) {
626
+ if (a === b)
627
+ return 0;
628
+ if (a === null || a === undefined)
629
+ return 1;
630
+ if (b === null || b === undefined)
631
+ return -1;
632
+ if (typeof a === 'number' && typeof b === 'number') {
633
+ if (Number.isNaN(a))
634
+ return Number.isNaN(b) ? 0 : 1;
635
+ if (Number.isNaN(b))
636
+ return -1;
637
+ return a < b ? -1 : a > b ? 1 : 0;
638
+ }
639
+ const sa = String(a);
640
+ const sb = String(b);
641
+ return sa < sb ? -1 : sa > sb ? 1 : 0;
642
+ }
643
+
644
+ function now() {
645
+ return typeof performance !== 'undefined' && performance.now
646
+ ? performance.now()
647
+ : Date.now();
648
+ }
649
+
650
+ const hasRaf = typeof requestAnimationFrame === 'function';
651
+
652
+ function nextFrame(fn) {
653
+ if (hasRaf)
654
+ return requestAnimationFrame(fn);
655
+ return setTimeout(() => fn(now()), 16);
656
+ }
657
+
658
+ function cancelFrame(handle) {
659
+ if (handle == null)
660
+ return;
661
+ if (hasRaf)
662
+ cancelAnimationFrame(handle);
663
+ else
664
+ clearTimeout(handle);
665
+ }
666
+
667
+ function frameBatched(fn) {
668
+ let handle = null;
669
+ let lastArgs = null;
670
+
671
+ const run = () => {
672
+ handle = null;
673
+ const a = lastArgs;
674
+ lastArgs = null;
675
+ fn(...(a || []));
676
+ };
677
+
678
+ const wrapped = (...args) => {
679
+ lastArgs = args;
680
+ if (handle === null)
681
+ handle = nextFrame(run);
682
+ };
683
+
684
+ wrapped.cancel = () => {
685
+ cancelFrame(handle);
686
+ handle = null;
687
+ lastArgs = null;
688
+ };
689
+
690
+ wrapped.flush = () => {
691
+ if (handle !== null) {
692
+ cancelFrame(handle);
693
+ run();
694
+ }
695
+ };
696
+ return wrapped;
697
+ }
698
+
699
+ function settleDebounce(fn, waitMs) {
700
+
701
+ let timer = null;
702
+
703
+ let held = null;
704
+
705
+ const trailing = () => {
706
+ timer = null;
707
+ if (held === null)
708
+ return;
709
+ const args = held;
710
+ held = null;
711
+ fn(...args);
712
+
713
+ arm();
714
+ };
715
+
716
+ const arm = () => {
717
+ timer = setTimeout(trailing, waitMs);
718
+
719
+ if (typeof timer?.unref === 'function')
720
+ timer.unref();
721
+ };
722
+
723
+ const wrapped = (...args) => {
724
+ if (timer === null) {
725
+
726
+ fn(...args);
727
+ arm();
728
+ }
729
+ else {
730
+
731
+ held = args;
732
+ clearTimeout(timer);
733
+ arm();
734
+ }
735
+ };
736
+
737
+ wrapped.flush = () => {
738
+ if (timer !== null)
739
+ clearTimeout(timer);
740
+ timer = null;
741
+ if (held === null)
742
+ return;
743
+ const args = held;
744
+ held = null;
745
+ fn(...args);
746
+ };
747
+
748
+ wrapped.cancel = () => {
749
+ if (timer !== null)
750
+ clearTimeout(timer);
751
+ timer = null;
752
+ held = null;
753
+ };
754
+
755
+ wrapped.pending = () => timer !== null || held !== null;
756
+ return wrapped;
757
+ }
758
+
759
+ function whenIdle(fn, timeout = 50) {
760
+ if (typeof requestIdleCallback === 'function') {
761
+ return requestIdleCallback(fn, { timeout });
762
+ }
763
+ return setTimeout(() => fn({ timeRemaining: () => 0, didTimeout: true }), 1);
764
+ }
765
+
766
+ let idSeq = 0;
767
+
768
+ function uid(prefix = 'l') {
769
+ return `${prefix}${(++idSeq).toString(36)}`;
770
+ }
771
+
772
+ const VIEWER_EVENTS$1 = Object.freeze({
773
+ kpi: Object.freeze([
774
+ 'tile:click', 'tile:dblclick', 'tile:contextmenu', 'node:toggle', 'change',
775
+ ]),
776
+ kanban: Object.freeze([
777
+ 'card:click', 'card:dblclick', 'card:contextmenu',
778
+ 'card:move', 'card:reverted', 'card:confirmed', 'selection:changed', 'column:collapse', 'card:add',
779
+ 'drag:start', 'drag:end', 'swimlane:collapse', 'swimlane:reorder', 'column:reorder',
780
+ 'filter:changed', 'sprint:changed', 'epic:changed', 'card:expand', 'card:drill', 'card:edit',
781
+ 'card:sla',
782
+ 'beforeMove', 'beforeAdd', 'beforeEdit',
783
+ 'beforeLaneReorder', 'beforeColumnReorder', 'beforeColumnChange',
784
+ 'move:cancelled', 'add:cancelled', 'edit:cancelled',
785
+ 'laneReorder:cancelled', 'columnReorder:cancelled', 'columnChange:cancelled',
786
+ ]),
787
+ tabs: Object.freeze(['beforeTabChange', 'tab:changed', 'tabChange:cancelled']),
788
+
789
+ chart: Object.freeze(['click', 'hover', 'leave', 'draw', 'legend']),
790
+
791
+ gantt: Object.freeze(['schedule', 'error']),
792
+ layout: Object.freeze([
793
+ 'layout:changed', 'window:moved', 'window:resized', 'window:closed',
794
+ 'beforeWindowClose', 'windowClose:cancelled',
795
+ ]),
796
+
797
+ router: Object.freeze(['metrics']),
798
+ });
799
+
800
+ const VIEWER_APPLY$1 = Object.freeze({
801
+ kpi: Object.freeze({
802
+
803
+ rows: (kpi, value) => kpi.setRows(Array.isArray(value) ? value : []),
804
+ }),
805
+ kanban: Object.freeze({
806
+
807
+ rows: (board, value) => board.setRows(Array.isArray(value) ? value : []),
808
+
809
+ quickFilter: (board, value) => board.setQuickFilter(typeof value === 'string' ? value : ''),
810
+
811
+ sprint: (board, value) => board.setSprint(value),
812
+
813
+ epic: (board, value) => board.setEpic(value),
814
+
815
+ loading: (board, value) => board.setLoading(!!value),
816
+
817
+ error: (board, value) => board.setError(value ?? null),
818
+ }),
819
+ gantt: Object.freeze({
820
+
821
+ tasks: (gantt, value) => gantt.setTasks(Array.isArray(value) ? value : []),
822
+
823
+ dependencies: (gantt, value) => gantt.setDependencies(Array.isArray(value) ? value : []),
824
+ }),
825
+ tabs: Object.freeze({
826
+
827
+ active: (tabs, value) => { if (typeof value === 'string')
828
+ tabs.activate(value); },
829
+ }),
830
+
831
+ chart: Object.freeze({}),
832
+ layout: Object.freeze({}),
833
+ });
834
+
835
+ const VIEWER_BULK_UPDATE = Object.freeze({ chart: 'update' });
836
+
837
+ function viewerHandlerName$1(event) {
838
+ const parts = String(event).split(':');
839
+ return `on${parts.map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join('')}`;
840
+ }
841
+
842
+ const BY_HANDLER = Object.freeze(Object.fromEntries(Object.entries(VIEWER_EVENTS$1).map(([viewer, events]) => [
843
+ viewer,
844
+ Object.freeze(Object.fromEntries(events.map((e) => [viewerHandlerName$1(e), e]))),
845
+ ])));
846
+
847
+ function partitionViewerProps(viewer, props) {
848
+ const byHandler = BY_HANDLER[viewer] || {};
849
+ const applies = VIEWER_APPLY$1[viewer] || {};
850
+
851
+ const config = {};
852
+
853
+ const live = {};
854
+
855
+ const handlers = {};
856
+ for (const [key, value] of Object.entries(props || {})) {
857
+ if (Object.hasOwn(byHandler, key)) {
858
+ handlers[key] = value;
859
+ continue;
860
+ }
861
+ if (Object.hasOwn(applies, key)) {
862
+ live[key] = value;
863
+ config[key] = value;
864
+ continue;
865
+ }
866
+ config[key] = value;
867
+ }
868
+ return { config, live, handlers };
869
+ }
870
+
871
+ function createViewerController$1(opts) {
872
+ const viewer = String(opts.viewer);
873
+ const mount = opts.mount;
874
+ const label = opts.name || viewer;
875
+ if (typeof mount !== 'function') {
876
+ throw new TypeError(`createViewerController needs a mount factory for "${viewer}"; pass the module's own `
877
+ + 'factory in, e.g. { createKPI } from lattice-grid/modules/kpi.');
878
+ }
879
+ const initial = partitionViewerProps(viewer, opts.props || {});
880
+ const instance = mount(opts.element, { ...initial.config });
881
+ if (!instance || typeof instance !== 'object') {
882
+ throw new TypeError(`the ${label} factory returned no instance; nothing can be driven.`);
883
+ }
884
+ let handlers = initial.handlers;
885
+ let config = initial.config;
886
+
887
+ const live = { ...initial.live };
888
+
889
+ const off = [];
890
+ if (typeof instance.on === 'function') {
891
+ for (const event of VIEWER_EVENTS$1[viewer] || []) {
892
+ const prop = viewerHandlerName$1(event);
893
+
894
+ const stop = instance.on(event, (payload) => {
895
+ const fn = handlers[prop];
896
+ if (typeof fn === 'function')
897
+ fn(payload);
898
+ });
899
+ if (typeof stop === 'function')
900
+ off.push(stop);
901
+ }
902
+ }
903
+ const bulk = VIEWER_BULK_UPDATE[viewer];
904
+ const applies = VIEWER_APPLY$1[viewer] || {};
905
+ let destroyed = false;
906
+ return {
907
+ instance,
908
+
909
+ update(next) {
910
+ if (destroyed)
911
+ return;
912
+ const parts = partitionViewerProps(viewer, next || {});
913
+ handlers = parts.handlers;
914
+
915
+ const changed = {};
916
+ for (const [key, value] of Object.entries(parts.config)) {
917
+
918
+ if (!Object.is(config[key], value))
919
+ changed[key] = value;
920
+ }
921
+ config = parts.config;
922
+ if (!Object.keys(changed).length)
923
+ return;
924
+
925
+ const unapplied = [];
926
+ for (const key of Object.keys(changed)) {
927
+ const apply = applies[key];
928
+ if (apply) {
929
+
930
+ apply(instance, changed[key]);
931
+ live[key] = changed[key];
932
+ continue;
933
+ }
934
+ if (bulk && typeof instance[bulk] === 'function')
935
+ continue;
936
+ unapplied.push(key);
937
+ }
938
+ if (bulk && typeof instance[bulk] === 'function') {
939
+
940
+ const spec = {};
941
+ for (const key of Object.keys(changed))
942
+ if (!applies[key])
943
+ spec[key] = changed[key];
944
+ if (Object.keys(spec).length)
945
+ instance[bulk](spec);
946
+ }
947
+ if (unapplied.length) {
948
+ warnOnce$1(`react.viewer.${viewer}.mountOnly.${unapplied.join('.')}`, `${label}: ${unapplied.map((k) => `\`${k}\``).join(', ')} changed, but `
949
+ + `${label} takes ${unapplied.length === 1 ? 'it' : 'them'} only when the viewer is `
950
+ + 'created. Nothing was applied and the viewer was NOT rebuilt — rebuilding it silently '
951
+ + 'would throw away scroll position, selection and expansion. Give the component a '
952
+ + '`key` that changes when this must take effect, so the rebuild is yours and visible, '
953
+ + 'or drive the instance through the ref.');
954
+ }
955
+ },
956
+
957
+ destroy() {
958
+ if (destroyed)
959
+ return;
960
+ destroyed = true;
961
+ for (const stop of off) {
962
+ try {
963
+ stop();
964
+ }
965
+ catch { }
966
+ }
967
+ off.length = 0;
968
+ if (typeof instance.destroy === 'function')
969
+ instance.destroy();
970
+ },
971
+ };
972
+ }
973
+
974
+ const EVENT_NAMES = EVENT_NAMES$1;
975
+
976
+ const VIEWER_EVENTS = VIEWER_EVENTS$1;
977
+
978
+ const VIEWER_APPLY = VIEWER_APPLY$1;
979
+
980
+ function dashedName(event) {
981
+ return dashedName$1(event);
982
+ }
983
+
984
+ function handlerName(event) {
985
+ return handlerName$1(event);
986
+ }
987
+
988
+ function viewerHandlerName(event) {
989
+ return viewerHandlerName$1(event);
990
+ }
991
+
992
+ function warnOnce(key, message) {
993
+ warnOnce$1(key, message);
994
+ }
995
+
996
+ function createGridController(opts) {
997
+ return createGridController$1(opts);
998
+ }
999
+
1000
+ function createViewerController(opts) {
1001
+ return createViewerController$1(opts);
1002
+ }
1003
+
1004
+ function eventProp(event) {
1005
+ const parts = String(event).split(':');
1006
+ return parts[0] + parts.slice(1).map((p) => p.charAt(0).toUpperCase() + p.slice(1)).join('');
1007
+ }
1008
+
1009
+ function hasObservers(emitter) {
1010
+ const subject = emitter;
1011
+ if (typeof subject.observed === 'boolean')
1012
+ return subject.observed;
1013
+ return Array.isArray(subject.observers) && subject.observers.length > 0;
1014
+ }
1015
+
1016
+ function emitInZone(zone, emitter, payload) {
1017
+ if (!hasObservers(emitter))
1018
+ return;
1019
+ zone.run(() => emitter.emit(payload));
1020
+ }
1021
+
1022
+ const LATTICE_ROUTER_OPTIONS = new InjectionToken('lattice.router.options');
1023
+ class LatticeRouter {
1024
+ constructor() {
1025
+
1026
+ this.instance = null;
1027
+
1028
+ this.torn = false;
1029
+
1030
+ this.factories = inject(LATTICE_FACTORIES, { optional: true });
1031
+
1032
+ this.options = inject(LATTICE_ROUTER_OPTIONS, { optional: true });
1033
+ }
1034
+
1035
+ get router() {
1036
+ if (!this.instance) {
1037
+ const createDataRouter = requireFactory(this.factories, 'createDataRouter', '@toclocoinc/lattice-grid/modules/data-router', 'lattice-grid route="…"');
1038
+ this.instance = createDataRouter(this.options ?? {});
1039
+ }
1040
+ return this.instance;
1041
+ }
1042
+
1043
+ attach(grid, route, opts = {}) {
1044
+ if (this.torn)
1045
+ return;
1046
+ this.router.attach(grid, route, opts);
1047
+ }
1048
+
1049
+ detach(grid) {
1050
+ if (this.torn || !this.instance)
1051
+ return;
1052
+ this.instance.detach(grid);
1053
+ }
1054
+
1055
+ ngOnDestroy() {
1056
+ this.torn = true;
1057
+ const router = this.instance;
1058
+ this.instance = null;
1059
+ router?.destroy();
1060
+ }
1061
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeRouter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1062
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeRouter }); }
1063
+ }
1064
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeRouter, decorators: [{
1065
+ type: Injectable
1066
+ }] });
1067
+
1068
+ function provideLatticeRouter(options = {}) {
1069
+ return [
1070
+ { provide: LATTICE_ROUTER_OPTIONS, useValue: options },
1071
+ LatticeRouter,
1072
+ ];
1073
+ }
1074
+
1075
+ class LatticeGridBase {
1076
+
1077
+ constructor() {
1078
+
1079
+ this.elementRef = inject(ElementRef);
1080
+
1081
+ this.zone = inject(NgZone);
1082
+
1083
+ this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
1084
+
1085
+ this.factories = inject(LATTICE_FACTORIES, { optional: true });
1086
+
1087
+ this.registry = inject(LatticeGridRegistry, { optional: true });
1088
+
1089
+ this.router = inject(LatticeRouter, { optional: true });
1090
+
1091
+ this.injector = inject(Injector);
1092
+
1093
+ this.controller = null;
1094
+
1095
+ this.torn = false;
1096
+
1097
+ this.publishedAs = DEFAULT_GRID_NAME;
1098
+
1099
+ this.handlers = {};
1100
+
1101
+ this.gridReady = new EventEmitter();
1102
+
1103
+ this.gridDestroyed = new EventEmitter();
1104
+
1105
+ this.ready = new EventEmitter();
1106
+
1107
+ this.destroy = new EventEmitter();
1108
+
1109
+ this.renderFirst = new EventEmitter();
1110
+
1111
+ this.renderDone = new EventEmitter();
1112
+
1113
+ this.configChanged = new EventEmitter();
1114
+
1115
+ this.licenceChanged = new EventEmitter();
1116
+
1117
+ this.modelChanged = new EventEmitter();
1118
+
1119
+ this.rowsChanged = new EventEmitter();
1120
+
1121
+ this.rowsQueued = new EventEmitter();
1122
+
1123
+ this.rowsDeferred = new EventEmitter();
1124
+
1125
+ this.rowsPaused = new EventEmitter();
1126
+
1127
+ this.rowsResumed = new EventEmitter();
1128
+
1129
+ this.rowReceived = new EventEmitter();
1130
+
1131
+ this.rowSent = new EventEmitter();
1132
+
1133
+ this.rowCopied = new EventEmitter();
1134
+
1135
+ this.rowMoved = new EventEmitter();
1136
+
1137
+ this.sourceError = new EventEmitter();
1138
+
1139
+ this.streamChunk = new EventEmitter();
1140
+
1141
+ this.streamEnd = new EventEmitter();
1142
+
1143
+ this.streamEvicted = new EventEmitter();
1144
+
1145
+ this.rowDragStarted = new EventEmitter();
1146
+
1147
+ this.rowDragMoved = new EventEmitter();
1148
+
1149
+ this.rowDragLeft = new EventEmitter();
1150
+
1151
+ this.rowDragEnded = new EventEmitter();
1152
+
1153
+ this.cellChanged = new EventEmitter();
1154
+
1155
+ this.cellPending = new EventEmitter();
1156
+
1157
+ this.cellConfirmed = new EventEmitter();
1158
+
1159
+ this.cellReverted = new EventEmitter();
1160
+
1161
+ this.cellConflict = new EventEmitter();
1162
+
1163
+ this.cellClicked = new EventEmitter();
1164
+
1165
+ this.cellDblclicked = new EventEmitter();
1166
+
1167
+ this.cellContextmenu = new EventEmitter();
1168
+
1169
+ this.cellMouseover = new EventEmitter();
1170
+
1171
+ this.cellMouseout = new EventEmitter();
1172
+
1173
+ this.cellMousedown = new EventEmitter();
1174
+
1175
+ this.cellMouseup = new EventEmitter();
1176
+
1177
+ this.cellEditStart = new EventEmitter();
1178
+
1179
+ this.cellEditEnd = new EventEmitter();
1180
+
1181
+ this.rowEditStart = new EventEmitter();
1182
+
1183
+ this.rowEditEnd = new EventEmitter();
1184
+
1185
+ this.rowClicked = new EventEmitter();
1186
+
1187
+ this.rowDblclicked = new EventEmitter();
1188
+
1189
+ this.rowPending = new EventEmitter();
1190
+
1191
+ this.rowConfirmed = new EventEmitter();
1192
+
1193
+ this.rowReverted = new EventEmitter();
1194
+
1195
+ this.rowConflict = new EventEmitter();
1196
+
1197
+ this.formOpened = new EventEmitter();
1198
+
1199
+ this.formClosed = new EventEmitter();
1200
+
1201
+ this.formSaved = new EventEmitter();
1202
+
1203
+ this.formError = new EventEmitter();
1204
+
1205
+ this.sortChanged = new EventEmitter();
1206
+
1207
+ this.filterChanged = new EventEmitter();
1208
+
1209
+ this.groupToggled = new EventEmitter();
1210
+
1211
+ this.facetComputed = new EventEmitter();
1212
+
1213
+ this.facetFiltered = new EventEmitter();
1214
+
1215
+ this.facetExpanded = new EventEmitter();
1216
+
1217
+ this.facetFailed = new EventEmitter();
1218
+
1219
+ this.columnMoved = new EventEmitter();
1220
+
1221
+ this.columnResized = new EventEmitter();
1222
+
1223
+ this.columnVisible = new EventEmitter();
1224
+
1225
+ this.columnPinned = new EventEmitter();
1226
+
1227
+ this.columnGrouped = new EventEmitter();
1228
+
1229
+ this.columnPivoted = new EventEmitter();
1230
+
1231
+ this.columnFilterOpen = new EventEmitter();
1232
+
1233
+ this.columnProfileOpen = new EventEmitter();
1234
+
1235
+ this.columnMenuOpen = new EventEmitter();
1236
+
1237
+ this.columnsChanged = new EventEmitter();
1238
+
1239
+ this.columnsTagged = new EventEmitter();
1240
+
1241
+ this.columngroupChanged = new EventEmitter();
1242
+
1243
+ this.headerContextmenu = new EventEmitter();
1244
+
1245
+ this.pivotDrill = new EventEmitter();
1246
+
1247
+ this.selectionChanged = new EventEmitter();
1248
+
1249
+ this.rangeChanged = new EventEmitter();
1250
+
1251
+ this.clipboardCopy = new EventEmitter();
1252
+
1253
+ this.pageChanged = new EventEmitter();
1254
+
1255
+ this.scroll = new EventEmitter();
1256
+
1257
+ this.scrollEnd = new EventEmitter();
1258
+
1259
+ this.sizeChanged = new EventEmitter();
1260
+
1261
+ this.detailToggled = new EventEmitter();
1262
+
1263
+ this.toolpanelFocus = new EventEmitter();
1264
+
1265
+ this.highlightChanged = new EventEmitter();
1266
+
1267
+ this.findChanged = new EventEmitter();
1268
+
1269
+ this.treeLoading = new EventEmitter();
1270
+
1271
+ this.treeLoaded = new EventEmitter();
1272
+
1273
+ this.treeLoadFailed = new EventEmitter();
1274
+
1275
+ this.treeLoadAborted = new EventEmitter();
1276
+
1277
+ this.stateChanged = new EventEmitter();
1278
+
1279
+ this.stateReset = new EventEmitter();
1280
+
1281
+ this.historyChanged = new EventEmitter();
1282
+
1283
+ this.historyApplied = new EventEmitter();
1284
+
1285
+ this.viewsChanged = new EventEmitter();
1286
+
1287
+ this.viewApplied = new EventEmitter();
1288
+
1289
+ this.viewSaved = new EventEmitter();
1290
+
1291
+ this.viewRemoved = new EventEmitter();
1292
+
1293
+ this.viewRenamed = new EventEmitter();
1294
+
1295
+ this.viewDefault = new EventEmitter();
1296
+
1297
+ this.formattingChanged = new EventEmitter();
1298
+
1299
+ this.redactionChanged = new EventEmitter();
1300
+
1301
+ this.permissionsChanged = new EventEmitter();
1302
+
1303
+ this.presentationChanged = new EventEmitter();
1304
+
1305
+ this.presentationStarted = new EventEmitter();
1306
+
1307
+ this.presentationEnded = new EventEmitter();
1308
+
1309
+ this.presentationView = new EventEmitter();
1310
+
1311
+ this.presentationScale = new EventEmitter();
1312
+
1313
+ this.presentationSpotlight = new EventEmitter();
1314
+
1315
+ this.presentationCaptured = new EventEmitter();
1316
+
1317
+ this.commentAdded = new EventEmitter();
1318
+
1319
+ this.commentEdited = new EventEmitter();
1320
+
1321
+ this.commentDeleted = new EventEmitter();
1322
+
1323
+ this.commentFailed = new EventEmitter();
1324
+
1325
+ this.commentResolved = new EventEmitter();
1326
+
1327
+ this.commentUnresolved = new EventEmitter();
1328
+
1329
+ this.commentThreadOpened = new EventEmitter();
1330
+
1331
+ this.commentThreadClosed = new EventEmitter();
1332
+
1333
+ this.commentIndexLoaded = new EventEmitter();
1334
+
1335
+ this.presencePublished = new EventEmitter();
1336
+
1337
+ this.presenceJoined = new EventEmitter();
1338
+
1339
+ this.presenceUpdated = new EventEmitter();
1340
+
1341
+ this.presenceLeft = new EventEmitter();
1342
+
1343
+ this.presenceFailed = new EventEmitter();
1344
+
1345
+ this.presenceLockRefused = new EventEmitter();
1346
+
1347
+ this.diffChanged = new EventEmitter();
1348
+
1349
+ this.diffSwapped = new EventEmitter();
1350
+
1351
+ this.timelineAttached = new EventEmitter();
1352
+
1353
+ this.timelineDetached = new EventEmitter();
1354
+
1355
+ this.timelineSeek = new EventEmitter();
1356
+
1357
+ this.timelineSeeking = new EventEmitter();
1358
+
1359
+ this.annotationChanged = new EventEmitter();
1360
+
1361
+ this.validationFailed = new EventEmitter();
1362
+
1363
+ this.validationCleared = new EventEmitter();
1364
+
1365
+ this.exportProgress = new EventEmitter();
1366
+
1367
+ this.exportRequest = new EventEmitter();
1368
+
1369
+ this.exportDone = new EventEmitter();
1370
+
1371
+ this.shortcutsOpened = new EventEmitter();
1372
+
1373
+ this.shortcutsClosed = new EventEmitter();
1374
+
1375
+ this.printBefore = new EventEmitter();
1376
+
1377
+ this.printAfter = new EventEmitter();
1378
+
1379
+ this.beforeEdit = new EventEmitter();
1380
+
1381
+ this.beforeSort = new EventEmitter();
1382
+
1383
+ this.beforeFilter = new EventEmitter();
1384
+
1385
+ this.beforeColumnMove = new EventEmitter();
1386
+
1387
+ this.beforeColumnResize = new EventEmitter();
1388
+
1389
+ this.beforeColumnHide = new EventEmitter();
1390
+
1391
+ this.beforeSelect = new EventEmitter();
1392
+
1393
+ this.beforeRowAdd = new EventEmitter();
1394
+
1395
+ this.beforeDelete = new EventEmitter();
1396
+
1397
+ this.beforeRowMove = new EventEmitter();
1398
+
1399
+ this.beforeGroup = new EventEmitter();
1400
+
1401
+ this.beforeRowReceive = new EventEmitter();
1402
+
1403
+ this.editCancelled = new EventEmitter();
1404
+
1405
+ this.sortCancelled = new EventEmitter();
1406
+
1407
+ this.filterCancelled = new EventEmitter();
1408
+
1409
+ this.columnMoveCancelled = new EventEmitter();
1410
+
1411
+ this.columnResizeCancelled = new EventEmitter();
1412
+
1413
+ this.columnHideCancelled = new EventEmitter();
1414
+
1415
+ this.selectionCancelled = new EventEmitter();
1416
+
1417
+ this.rowAddCancelled = new EventEmitter();
1418
+
1419
+ this.deleteCancelled = new EventEmitter();
1420
+
1421
+ this.rowMoveCancelled = new EventEmitter();
1422
+
1423
+ this.groupCancelled = new EventEmitter();
1424
+
1425
+ this.rowReceiveCancelled = new EventEmitter();
1426
+ for (const event of EVENT_NAMES) {
1427
+ const emitter = this[eventProp(event)];
1428
+ this.handlers[handlerName(event)] = (payload) => {
1429
+ emitInZone(this.zone, emitter, payload);
1430
+ };
1431
+ }
1432
+ afterNextRender(() => this.build(), { injector: this.injector });
1433
+ }
1434
+
1435
+ get grid() {
1436
+ return this.controller ? this.controller.grid : null;
1437
+ }
1438
+
1439
+ props() {
1440
+ const out = { ...this.handlers };
1441
+ const config = this.config;
1442
+ if (config && typeof config === 'object')
1443
+ Object.assign(out, config);
1444
+ if (this.sort !== undefined)
1445
+ out['sort'] = this.sort;
1446
+ if (this.filters !== undefined)
1447
+ out['filters'] = this.filters;
1448
+ if (this.quickFilter !== undefined)
1449
+ out['quickFilter'] = this.quickFilter;
1450
+ if (this.selectedKeys !== undefined)
1451
+ out['selectedKeys'] = this.selectedKeys;
1452
+ return out;
1453
+ }
1454
+
1455
+ build() {
1456
+ if (this.controller || this.torn || !this.isBrowser)
1457
+ return;
1458
+ const element = this.elementRef.nativeElement;
1459
+ if (!element)
1460
+ return;
1461
+ const createGrid = requireFactory(this.factories, 'createGrid', '@toclocoinc/lattice-grid', 'lattice-grid');
1462
+ const controller = this.zone.runOutsideAngular(() => createGridController({
1463
+ createGrid,
1464
+ element,
1465
+ props: this.props(),
1466
+ }));
1467
+ this.controller = controller;
1468
+ const { grid } = controller;
1469
+
1470
+ if (this.predicates) {
1471
+ this.applyPredicates(grid, this.predicates, undefined);
1472
+ this.appliedPredicates = this.predicates;
1473
+ }
1474
+ if (this.rowUpdates) {
1475
+ this.appliedRowUpdates = this.rowUpdates;
1476
+ grid.rows.apply(this.rowUpdates);
1477
+ }
1478
+ this.publishedAs = this.name || DEFAULT_GRID_NAME;
1479
+ this.registry?.publish(this.publishedAs, grid);
1480
+ if (this.route !== undefined) {
1481
+ this.router?.attach(grid, this.route, this.routeOptions ?? {});
1482
+ }
1483
+ emitInZone(this.zone, this.gridReady, grid);
1484
+ }
1485
+
1486
+ ngOnChanges() {
1487
+ const controller = this.controller;
1488
+ if (!controller)
1489
+ return;
1490
+ controller.update(this.props());
1491
+ const { grid } = controller;
1492
+ if (!Object.is(this.appliedPredicates, this.predicates)) {
1493
+ this.applyPredicates(grid, this.predicates, this.appliedPredicates);
1494
+ this.appliedPredicates = this.predicates;
1495
+ }
1496
+ const updates = this.rowUpdates;
1497
+ if (updates && !Object.is(this.appliedRowUpdates, updates)) {
1498
+ this.appliedRowUpdates = updates;
1499
+ grid.rows.apply(updates);
1500
+ }
1501
+ }
1502
+
1503
+ applyPredicates(grid, next, previous) {
1504
+ const now = next && typeof next === 'object' ? next : {};
1505
+ const before = previous && typeof previous === 'object' ? previous : {};
1506
+ for (const [name, fn] of Object.entries(now)) {
1507
+ if (Object.is(before[name], fn))
1508
+ continue;
1509
+ grid.filters.where(name, typeof fn === 'function' ? fn : null);
1510
+ }
1511
+ for (const name of Object.keys(before)) {
1512
+ if (!Object.hasOwn(now, name))
1513
+ grid.filters.where(name, null);
1514
+ }
1515
+ }
1516
+
1517
+ ngOnDestroy() {
1518
+ this.torn = true;
1519
+ const controller = this.controller;
1520
+ this.controller = null;
1521
+ if (!controller)
1522
+ return;
1523
+ emitInZone(this.zone, this.gridDestroyed, undefined);
1524
+ const { grid } = controller;
1525
+ if (this.route !== undefined) {
1526
+ try {
1527
+ this.router?.detach(grid);
1528
+ }
1529
+ catch { }
1530
+ }
1531
+ this.registry?.publish(this.publishedAs, null);
1532
+ this.appliedPredicates = undefined;
1533
+ this.appliedRowUpdates = undefined;
1534
+ controller.destroy();
1535
+ }
1536
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeGridBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1537
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: LatticeGridBase, isStandalone: true, inputs: { config: "config", sort: "sort", filters: "filters", quickFilter: "quickFilter", selectedKeys: "selectedKeys", rowUpdates: "rowUpdates", predicates: "predicates", name: "name", route: "route", routeOptions: "routeOptions" }, outputs: { gridReady: "grid-ready", gridDestroyed: "grid-destroyed", ready: "ready", destroy: "destroy", renderFirst: "render-first", renderDone: "render-done", configChanged: "config-changed", licenceChanged: "licence-changed", modelChanged: "model-changed", rowsChanged: "rows-changed", rowsQueued: "rows-queued", rowsDeferred: "rows-deferred", rowsPaused: "rows-paused", rowsResumed: "rows-resumed", rowReceived: "row-received", rowSent: "row-sent", rowCopied: "row-copied", rowMoved: "row-moved", sourceError: "source-error", streamChunk: "stream-chunk", streamEnd: "stream-end", streamEvicted: "stream-evicted", rowDragStarted: "rowDrag-started", rowDragMoved: "rowDrag-moved", rowDragLeft: "rowDrag-left", rowDragEnded: "rowDrag-ended", cellChanged: "cell-changed", cellPending: "cell-pending", cellConfirmed: "cell-confirmed", cellReverted: "cell-reverted", cellConflict: "cell-conflict", cellClicked: "cell-clicked", cellDblclicked: "cell-dblclicked", cellContextmenu: "cell-contextmenu", cellMouseover: "cell-mouseover", cellMouseout: "cell-mouseout", cellMousedown: "cell-mousedown", cellMouseup: "cell-mouseup", cellEditStart: "cell-edit-start", cellEditEnd: "cell-edit-end", rowEditStart: "row-edit-start", rowEditEnd: "row-edit-end", rowClicked: "row-clicked", rowDblclicked: "row-dblclicked", rowPending: "row-pending", rowConfirmed: "row-confirmed", rowReverted: "row-reverted", rowConflict: "row-conflict", formOpened: "form-opened", formClosed: "form-closed", formSaved: "form-saved", formError: "form-error", sortChanged: "sort-changed", filterChanged: "filter-changed", groupToggled: "group-toggled", facetComputed: "facet-computed", facetFiltered: "facet-filtered", facetExpanded: "facet-expanded", facetFailed: "facet-failed", columnMoved: "column-moved", columnResized: "column-resized", columnVisible: "column-visible", columnPinned: "column-pinned", columnGrouped: "column-grouped", columnPivoted: "column-pivoted", columnFilterOpen: "column-filter-open", columnProfileOpen: "column-profile-open", columnMenuOpen: "column-menu-open", columnsChanged: "columns-changed", columnsTagged: "columns-tagged", columngroupChanged: "columngroup-changed", headerContextmenu: "header-contextmenu", pivotDrill: "pivot-drill", selectionChanged: "selection-changed", rangeChanged: "range-changed", clipboardCopy: "clipboard-copy", pageChanged: "page-changed", scroll: "scroll", scrollEnd: "scroll-end", sizeChanged: "size-changed", detailToggled: "detail-toggled", toolpanelFocus: "toolpanel-focus", highlightChanged: "highlight-changed", findChanged: "find-changed", treeLoading: "tree-loading", treeLoaded: "tree-loaded", treeLoadFailed: "tree-loadFailed", treeLoadAborted: "tree-loadAborted", stateChanged: "state-changed", stateReset: "state-reset", historyChanged: "history-changed", historyApplied: "history-applied", viewsChanged: "views-changed", viewApplied: "view-applied", viewSaved: "view-saved", viewRemoved: "view-removed", viewRenamed: "view-renamed", viewDefault: "view-default", formattingChanged: "formatting-changed", redactionChanged: "redaction-changed", permissionsChanged: "permissions-changed", presentationChanged: "presentation-changed", presentationStarted: "presentation-started", presentationEnded: "presentation-ended", presentationView: "presentation-view", presentationScale: "presentation-scale", presentationSpotlight: "presentation-spotlight", presentationCaptured: "presentation-captured", commentAdded: "comment-added", commentEdited: "comment-edited", commentDeleted: "comment-deleted", commentFailed: "comment-failed", commentResolved: "comment-resolved", commentUnresolved: "comment-unresolved", commentThreadOpened: "comment-threadOpened", commentThreadClosed: "comment-threadClosed", commentIndexLoaded: "comment-indexLoaded", presencePublished: "presence-published", presenceJoined: "presence-joined", presenceUpdated: "presence-updated", presenceLeft: "presence-left", presenceFailed: "presence-failed", presenceLockRefused: "presence-lockRefused", diffChanged: "diff-changed", diffSwapped: "diff-swapped", timelineAttached: "timeline-attached", timelineDetached: "timeline-detached", timelineSeek: "timeline-seek", timelineSeeking: "timeline-seeking", annotationChanged: "annotation-changed", validationFailed: "validation-failed", validationCleared: "validation-cleared", exportProgress: "export-progress", exportRequest: "export-request", exportDone: "export-done", shortcutsOpened: "shortcuts-opened", shortcutsClosed: "shortcuts-closed", printBefore: "print-before", printAfter: "print-after", beforeEdit: "beforeEdit", beforeSort: "beforeSort", beforeFilter: "beforeFilter", beforeColumnMove: "beforeColumnMove", beforeColumnResize: "beforeColumnResize", beforeColumnHide: "beforeColumnHide", beforeSelect: "beforeSelect", beforeRowAdd: "beforeRowAdd", beforeDelete: "beforeDelete", beforeRowMove: "beforeRowMove", beforeGroup: "beforeGroup", beforeRowReceive: "beforeRowReceive", editCancelled: "edit-cancelled", sortCancelled: "sort-cancelled", filterCancelled: "filter-cancelled", columnMoveCancelled: "columnMove-cancelled", columnResizeCancelled: "columnResize-cancelled", columnHideCancelled: "columnHide-cancelled", selectionCancelled: "selection-cancelled", rowAddCancelled: "rowAdd-cancelled", deleteCancelled: "delete-cancelled", rowMoveCancelled: "rowMove-cancelled", groupCancelled: "group-cancelled", rowReceiveCancelled: "rowReceive-cancelled" }, usesOnChanges: true, ngImport: i0 }); }
1538
+ }
1539
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeGridBase, decorators: [{
1540
+ type: Directive
1541
+ }], ctorParameters: () => [], propDecorators: { config: [{
1542
+ type: Input
1543
+ }], sort: [{
1544
+ type: Input
1545
+ }], filters: [{
1546
+ type: Input
1547
+ }], quickFilter: [{
1548
+ type: Input
1549
+ }], selectedKeys: [{
1550
+ type: Input
1551
+ }], rowUpdates: [{
1552
+ type: Input
1553
+ }], predicates: [{
1554
+ type: Input
1555
+ }], name: [{
1556
+ type: Input
1557
+ }], route: [{
1558
+ type: Input
1559
+ }], routeOptions: [{
1560
+ type: Input
1561
+ }], gridReady: [{
1562
+ type: Output,
1563
+ args: ['grid-ready']
1564
+ }], gridDestroyed: [{
1565
+ type: Output,
1566
+ args: ['grid-destroyed']
1567
+ }], ready: [{
1568
+ type: Output,
1569
+ args: ['ready']
1570
+ }], destroy: [{
1571
+ type: Output,
1572
+ args: ['destroy']
1573
+ }], renderFirst: [{
1574
+ type: Output,
1575
+ args: ['render-first']
1576
+ }], renderDone: [{
1577
+ type: Output,
1578
+ args: ['render-done']
1579
+ }], configChanged: [{
1580
+ type: Output,
1581
+ args: ['config-changed']
1582
+ }], licenceChanged: [{
1583
+ type: Output,
1584
+ args: ['licence-changed']
1585
+ }], modelChanged: [{
1586
+ type: Output,
1587
+ args: ['model-changed']
1588
+ }], rowsChanged: [{
1589
+ type: Output,
1590
+ args: ['rows-changed']
1591
+ }], rowsQueued: [{
1592
+ type: Output,
1593
+ args: ['rows-queued']
1594
+ }], rowsDeferred: [{
1595
+ type: Output,
1596
+ args: ['rows-deferred']
1597
+ }], rowsPaused: [{
1598
+ type: Output,
1599
+ args: ['rows-paused']
1600
+ }], rowsResumed: [{
1601
+ type: Output,
1602
+ args: ['rows-resumed']
1603
+ }], rowReceived: [{
1604
+ type: Output,
1605
+ args: ['row-received']
1606
+ }], rowSent: [{
1607
+ type: Output,
1608
+ args: ['row-sent']
1609
+ }], rowCopied: [{
1610
+ type: Output,
1611
+ args: ['row-copied']
1612
+ }], rowMoved: [{
1613
+ type: Output,
1614
+ args: ['row-moved']
1615
+ }], sourceError: [{
1616
+ type: Output,
1617
+ args: ['source-error']
1618
+ }], streamChunk: [{
1619
+ type: Output,
1620
+ args: ['stream-chunk']
1621
+ }], streamEnd: [{
1622
+ type: Output,
1623
+ args: ['stream-end']
1624
+ }], streamEvicted: [{
1625
+ type: Output,
1626
+ args: ['stream-evicted']
1627
+ }], rowDragStarted: [{
1628
+ type: Output,
1629
+ args: ['rowDrag-started']
1630
+ }], rowDragMoved: [{
1631
+ type: Output,
1632
+ args: ['rowDrag-moved']
1633
+ }], rowDragLeft: [{
1634
+ type: Output,
1635
+ args: ['rowDrag-left']
1636
+ }], rowDragEnded: [{
1637
+ type: Output,
1638
+ args: ['rowDrag-ended']
1639
+ }], cellChanged: [{
1640
+ type: Output,
1641
+ args: ['cell-changed']
1642
+ }], cellPending: [{
1643
+ type: Output,
1644
+ args: ['cell-pending']
1645
+ }], cellConfirmed: [{
1646
+ type: Output,
1647
+ args: ['cell-confirmed']
1648
+ }], cellReverted: [{
1649
+ type: Output,
1650
+ args: ['cell-reverted']
1651
+ }], cellConflict: [{
1652
+ type: Output,
1653
+ args: ['cell-conflict']
1654
+ }], cellClicked: [{
1655
+ type: Output,
1656
+ args: ['cell-clicked']
1657
+ }], cellDblclicked: [{
1658
+ type: Output,
1659
+ args: ['cell-dblclicked']
1660
+ }], cellContextmenu: [{
1661
+ type: Output,
1662
+ args: ['cell-contextmenu']
1663
+ }], cellMouseover: [{
1664
+ type: Output,
1665
+ args: ['cell-mouseover']
1666
+ }], cellMouseout: [{
1667
+ type: Output,
1668
+ args: ['cell-mouseout']
1669
+ }], cellMousedown: [{
1670
+ type: Output,
1671
+ args: ['cell-mousedown']
1672
+ }], cellMouseup: [{
1673
+ type: Output,
1674
+ args: ['cell-mouseup']
1675
+ }], cellEditStart: [{
1676
+ type: Output,
1677
+ args: ['cell-edit-start']
1678
+ }], cellEditEnd: [{
1679
+ type: Output,
1680
+ args: ['cell-edit-end']
1681
+ }], rowEditStart: [{
1682
+ type: Output,
1683
+ args: ['row-edit-start']
1684
+ }], rowEditEnd: [{
1685
+ type: Output,
1686
+ args: ['row-edit-end']
1687
+ }], rowClicked: [{
1688
+ type: Output,
1689
+ args: ['row-clicked']
1690
+ }], rowDblclicked: [{
1691
+ type: Output,
1692
+ args: ['row-dblclicked']
1693
+ }], rowPending: [{
1694
+ type: Output,
1695
+ args: ['row-pending']
1696
+ }], rowConfirmed: [{
1697
+ type: Output,
1698
+ args: ['row-confirmed']
1699
+ }], rowReverted: [{
1700
+ type: Output,
1701
+ args: ['row-reverted']
1702
+ }], rowConflict: [{
1703
+ type: Output,
1704
+ args: ['row-conflict']
1705
+ }], formOpened: [{
1706
+ type: Output,
1707
+ args: ['form-opened']
1708
+ }], formClosed: [{
1709
+ type: Output,
1710
+ args: ['form-closed']
1711
+ }], formSaved: [{
1712
+ type: Output,
1713
+ args: ['form-saved']
1714
+ }], formError: [{
1715
+ type: Output,
1716
+ args: ['form-error']
1717
+ }], sortChanged: [{
1718
+ type: Output,
1719
+ args: ['sort-changed']
1720
+ }], filterChanged: [{
1721
+ type: Output,
1722
+ args: ['filter-changed']
1723
+ }], groupToggled: [{
1724
+ type: Output,
1725
+ args: ['group-toggled']
1726
+ }], facetComputed: [{
1727
+ type: Output,
1728
+ args: ['facet-computed']
1729
+ }], facetFiltered: [{
1730
+ type: Output,
1731
+ args: ['facet-filtered']
1732
+ }], facetExpanded: [{
1733
+ type: Output,
1734
+ args: ['facet-expanded']
1735
+ }], facetFailed: [{
1736
+ type: Output,
1737
+ args: ['facet-failed']
1738
+ }], columnMoved: [{
1739
+ type: Output,
1740
+ args: ['column-moved']
1741
+ }], columnResized: [{
1742
+ type: Output,
1743
+ args: ['column-resized']
1744
+ }], columnVisible: [{
1745
+ type: Output,
1746
+ args: ['column-visible']
1747
+ }], columnPinned: [{
1748
+ type: Output,
1749
+ args: ['column-pinned']
1750
+ }], columnGrouped: [{
1751
+ type: Output,
1752
+ args: ['column-grouped']
1753
+ }], columnPivoted: [{
1754
+ type: Output,
1755
+ args: ['column-pivoted']
1756
+ }], columnFilterOpen: [{
1757
+ type: Output,
1758
+ args: ['column-filter-open']
1759
+ }], columnProfileOpen: [{
1760
+ type: Output,
1761
+ args: ['column-profile-open']
1762
+ }], columnMenuOpen: [{
1763
+ type: Output,
1764
+ args: ['column-menu-open']
1765
+ }], columnsChanged: [{
1766
+ type: Output,
1767
+ args: ['columns-changed']
1768
+ }], columnsTagged: [{
1769
+ type: Output,
1770
+ args: ['columns-tagged']
1771
+ }], columngroupChanged: [{
1772
+ type: Output,
1773
+ args: ['columngroup-changed']
1774
+ }], headerContextmenu: [{
1775
+ type: Output,
1776
+ args: ['header-contextmenu']
1777
+ }], pivotDrill: [{
1778
+ type: Output,
1779
+ args: ['pivot-drill']
1780
+ }], selectionChanged: [{
1781
+ type: Output,
1782
+ args: ['selection-changed']
1783
+ }], rangeChanged: [{
1784
+ type: Output,
1785
+ args: ['range-changed']
1786
+ }], clipboardCopy: [{
1787
+ type: Output,
1788
+ args: ['clipboard-copy']
1789
+ }], pageChanged: [{
1790
+ type: Output,
1791
+ args: ['page-changed']
1792
+ }], scroll: [{
1793
+ type: Output,
1794
+ args: ['scroll']
1795
+ }], scrollEnd: [{
1796
+ type: Output,
1797
+ args: ['scroll-end']
1798
+ }], sizeChanged: [{
1799
+ type: Output,
1800
+ args: ['size-changed']
1801
+ }], detailToggled: [{
1802
+ type: Output,
1803
+ args: ['detail-toggled']
1804
+ }], toolpanelFocus: [{
1805
+ type: Output,
1806
+ args: ['toolpanel-focus']
1807
+ }], highlightChanged: [{
1808
+ type: Output,
1809
+ args: ['highlight-changed']
1810
+ }], findChanged: [{
1811
+ type: Output,
1812
+ args: ['find-changed']
1813
+ }], treeLoading: [{
1814
+ type: Output,
1815
+ args: ['tree-loading']
1816
+ }], treeLoaded: [{
1817
+ type: Output,
1818
+ args: ['tree-loaded']
1819
+ }], treeLoadFailed: [{
1820
+ type: Output,
1821
+ args: ['tree-loadFailed']
1822
+ }], treeLoadAborted: [{
1823
+ type: Output,
1824
+ args: ['tree-loadAborted']
1825
+ }], stateChanged: [{
1826
+ type: Output,
1827
+ args: ['state-changed']
1828
+ }], stateReset: [{
1829
+ type: Output,
1830
+ args: ['state-reset']
1831
+ }], historyChanged: [{
1832
+ type: Output,
1833
+ args: ['history-changed']
1834
+ }], historyApplied: [{
1835
+ type: Output,
1836
+ args: ['history-applied']
1837
+ }], viewsChanged: [{
1838
+ type: Output,
1839
+ args: ['views-changed']
1840
+ }], viewApplied: [{
1841
+ type: Output,
1842
+ args: ['view-applied']
1843
+ }], viewSaved: [{
1844
+ type: Output,
1845
+ args: ['view-saved']
1846
+ }], viewRemoved: [{
1847
+ type: Output,
1848
+ args: ['view-removed']
1849
+ }], viewRenamed: [{
1850
+ type: Output,
1851
+ args: ['view-renamed']
1852
+ }], viewDefault: [{
1853
+ type: Output,
1854
+ args: ['view-default']
1855
+ }], formattingChanged: [{
1856
+ type: Output,
1857
+ args: ['formatting-changed']
1858
+ }], redactionChanged: [{
1859
+ type: Output,
1860
+ args: ['redaction-changed']
1861
+ }], permissionsChanged: [{
1862
+ type: Output,
1863
+ args: ['permissions-changed']
1864
+ }], presentationChanged: [{
1865
+ type: Output,
1866
+ args: ['presentation-changed']
1867
+ }], presentationStarted: [{
1868
+ type: Output,
1869
+ args: ['presentation-started']
1870
+ }], presentationEnded: [{
1871
+ type: Output,
1872
+ args: ['presentation-ended']
1873
+ }], presentationView: [{
1874
+ type: Output,
1875
+ args: ['presentation-view']
1876
+ }], presentationScale: [{
1877
+ type: Output,
1878
+ args: ['presentation-scale']
1879
+ }], presentationSpotlight: [{
1880
+ type: Output,
1881
+ args: ['presentation-spotlight']
1882
+ }], presentationCaptured: [{
1883
+ type: Output,
1884
+ args: ['presentation-captured']
1885
+ }], commentAdded: [{
1886
+ type: Output,
1887
+ args: ['comment-added']
1888
+ }], commentEdited: [{
1889
+ type: Output,
1890
+ args: ['comment-edited']
1891
+ }], commentDeleted: [{
1892
+ type: Output,
1893
+ args: ['comment-deleted']
1894
+ }], commentFailed: [{
1895
+ type: Output,
1896
+ args: ['comment-failed']
1897
+ }], commentResolved: [{
1898
+ type: Output,
1899
+ args: ['comment-resolved']
1900
+ }], commentUnresolved: [{
1901
+ type: Output,
1902
+ args: ['comment-unresolved']
1903
+ }], commentThreadOpened: [{
1904
+ type: Output,
1905
+ args: ['comment-threadOpened']
1906
+ }], commentThreadClosed: [{
1907
+ type: Output,
1908
+ args: ['comment-threadClosed']
1909
+ }], commentIndexLoaded: [{
1910
+ type: Output,
1911
+ args: ['comment-indexLoaded']
1912
+ }], presencePublished: [{
1913
+ type: Output,
1914
+ args: ['presence-published']
1915
+ }], presenceJoined: [{
1916
+ type: Output,
1917
+ args: ['presence-joined']
1918
+ }], presenceUpdated: [{
1919
+ type: Output,
1920
+ args: ['presence-updated']
1921
+ }], presenceLeft: [{
1922
+ type: Output,
1923
+ args: ['presence-left']
1924
+ }], presenceFailed: [{
1925
+ type: Output,
1926
+ args: ['presence-failed']
1927
+ }], presenceLockRefused: [{
1928
+ type: Output,
1929
+ args: ['presence-lockRefused']
1930
+ }], diffChanged: [{
1931
+ type: Output,
1932
+ args: ['diff-changed']
1933
+ }], diffSwapped: [{
1934
+ type: Output,
1935
+ args: ['diff-swapped']
1936
+ }], timelineAttached: [{
1937
+ type: Output,
1938
+ args: ['timeline-attached']
1939
+ }], timelineDetached: [{
1940
+ type: Output,
1941
+ args: ['timeline-detached']
1942
+ }], timelineSeek: [{
1943
+ type: Output,
1944
+ args: ['timeline-seek']
1945
+ }], timelineSeeking: [{
1946
+ type: Output,
1947
+ args: ['timeline-seeking']
1948
+ }], annotationChanged: [{
1949
+ type: Output,
1950
+ args: ['annotation-changed']
1951
+ }], validationFailed: [{
1952
+ type: Output,
1953
+ args: ['validation-failed']
1954
+ }], validationCleared: [{
1955
+ type: Output,
1956
+ args: ['validation-cleared']
1957
+ }], exportProgress: [{
1958
+ type: Output,
1959
+ args: ['export-progress']
1960
+ }], exportRequest: [{
1961
+ type: Output,
1962
+ args: ['export-request']
1963
+ }], exportDone: [{
1964
+ type: Output,
1965
+ args: ['export-done']
1966
+ }], shortcutsOpened: [{
1967
+ type: Output,
1968
+ args: ['shortcuts-opened']
1969
+ }], shortcutsClosed: [{
1970
+ type: Output,
1971
+ args: ['shortcuts-closed']
1972
+ }], printBefore: [{
1973
+ type: Output,
1974
+ args: ['print-before']
1975
+ }], printAfter: [{
1976
+ type: Output,
1977
+ args: ['print-after']
1978
+ }], beforeEdit: [{
1979
+ type: Output,
1980
+ args: ['beforeEdit']
1981
+ }], beforeSort: [{
1982
+ type: Output,
1983
+ args: ['beforeSort']
1984
+ }], beforeFilter: [{
1985
+ type: Output,
1986
+ args: ['beforeFilter']
1987
+ }], beforeColumnMove: [{
1988
+ type: Output,
1989
+ args: ['beforeColumnMove']
1990
+ }], beforeColumnResize: [{
1991
+ type: Output,
1992
+ args: ['beforeColumnResize']
1993
+ }], beforeColumnHide: [{
1994
+ type: Output,
1995
+ args: ['beforeColumnHide']
1996
+ }], beforeSelect: [{
1997
+ type: Output,
1998
+ args: ['beforeSelect']
1999
+ }], beforeRowAdd: [{
2000
+ type: Output,
2001
+ args: ['beforeRowAdd']
2002
+ }], beforeDelete: [{
2003
+ type: Output,
2004
+ args: ['beforeDelete']
2005
+ }], beforeRowMove: [{
2006
+ type: Output,
2007
+ args: ['beforeRowMove']
2008
+ }], beforeGroup: [{
2009
+ type: Output,
2010
+ args: ['beforeGroup']
2011
+ }], beforeRowReceive: [{
2012
+ type: Output,
2013
+ args: ['beforeRowReceive']
2014
+ }], editCancelled: [{
2015
+ type: Output,
2016
+ args: ['edit-cancelled']
2017
+ }], sortCancelled: [{
2018
+ type: Output,
2019
+ args: ['sort-cancelled']
2020
+ }], filterCancelled: [{
2021
+ type: Output,
2022
+ args: ['filter-cancelled']
2023
+ }], columnMoveCancelled: [{
2024
+ type: Output,
2025
+ args: ['columnMove-cancelled']
2026
+ }], columnResizeCancelled: [{
2027
+ type: Output,
2028
+ args: ['columnResize-cancelled']
2029
+ }], columnHideCancelled: [{
2030
+ type: Output,
2031
+ args: ['columnHide-cancelled']
2032
+ }], selectionCancelled: [{
2033
+ type: Output,
2034
+ args: ['selection-cancelled']
2035
+ }], rowAddCancelled: [{
2036
+ type: Output,
2037
+ args: ['rowAdd-cancelled']
2038
+ }], deleteCancelled: [{
2039
+ type: Output,
2040
+ args: ['delete-cancelled']
2041
+ }], rowMoveCancelled: [{
2042
+ type: Output,
2043
+ args: ['rowMove-cancelled']
2044
+ }], groupCancelled: [{
2045
+ type: Output,
2046
+ args: ['group-cancelled']
2047
+ }], rowReceiveCancelled: [{
2048
+ type: Output,
2049
+ args: ['rowReceive-cancelled']
2050
+ }] } });
2051
+
2052
+ class LatticeGridComponent extends LatticeGridBase {
2053
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeGridComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2054
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: LatticeGridComponent, isStandalone: true, selector: "lattice-grid", usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block}\n"] }); }
2055
+ }
2056
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeGridComponent, decorators: [{
2057
+ type: Component,
2058
+ args: [{ selector: 'lattice-grid', template: '', encapsulation: ViewEncapsulation.Emulated, styles: [":host{display:block}\n"] }]
2059
+ }] });
2060
+
2061
+ class LatticeGridDirective extends LatticeGridBase {
2062
+
2063
+ set latticeGrid(config) {
2064
+ if (config !== '')
2065
+ this.config = config;
2066
+ }
2067
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeGridDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
2068
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: LatticeGridDirective, isStandalone: true, selector: "[latticeGrid]", inputs: { latticeGrid: "latticeGrid" }, usesInheritance: true, ngImport: i0 }); }
2069
+ }
2070
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeGridDirective, decorators: [{
2071
+ type: Directive,
2072
+ args: [{ selector: '[latticeGrid]' }]
2073
+ }], propDecorators: { latticeGrid: [{
2074
+ type: Input,
2075
+ args: ['latticeGrid']
2076
+ }] } });
2077
+
2078
+ class LatticeViewerBase {
2079
+
2080
+ constructor() {
2081
+
2082
+ this.requiresGrid = false;
2083
+
2084
+ this.takesGrid = true;
2085
+
2086
+ this.fromRegistry = true;
2087
+
2088
+ this.elementRef = inject(ElementRef);
2089
+
2090
+ this.zone = inject(NgZone);
2091
+
2092
+ this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
2093
+
2094
+ this.registry = inject(LatticeGridRegistry, { optional: true });
2095
+
2096
+ this.injector = inject(Injector);
2097
+
2098
+ this.explicitGrid = signal(undefined,
2099
+ ...(ngDevMode ? [{ debugName: "explicitGrid" }] : []));
2100
+
2101
+ this.gridNameInput = signal(DEFAULT_GRID_NAME,
2102
+ ...(ngDevMode ? [{ debugName: "gridNameInput" }] : []));
2103
+
2104
+ this.controller = null;
2105
+
2106
+ this.builtAgainst = null;
2107
+
2108
+ this.rendered = false;
2109
+
2110
+ this.torn = false;
2111
+
2112
+ this.handlers = {};
2113
+
2114
+ this.ready = new EventEmitter();
2115
+
2116
+ this.destroyed = new EventEmitter();
2117
+
2118
+ this.boundGrid = computed(() => {
2119
+ if (!this.takesGrid)
2120
+ return null;
2121
+ const explicit = this.explicitGrid();
2122
+ if (explicit !== undefined)
2123
+ return explicit;
2124
+ if (!this.fromRegistry)
2125
+ return null;
2126
+ const registry = this.registry;
2127
+ return registry ? registry.grid(this.gridNameInput())() : null;
2128
+ },
2129
+ ...(ngDevMode ? [{ debugName: "boundGrid" }] : []));
2130
+ afterNextRender(() => {
2131
+ this.rendered = true;
2132
+ this.reconcile();
2133
+ }, { injector: this.injector });
2134
+ effect(() => {
2135
+
2136
+ this.boundGrid();
2137
+ if (this.rendered)
2138
+ this.reconcile();
2139
+ }, { injector: this.injector });
2140
+ }
2141
+
2142
+ get instance() {
2143
+ return this.controller ? this.controller.instance : null;
2144
+ }
2145
+
2146
+ liveProps() {
2147
+ return {};
2148
+ }
2149
+
2150
+ props() {
2151
+ const out = { ...this.handlers };
2152
+ if (this.config && typeof this.config === 'object')
2153
+ Object.assign(out, this.config);
2154
+ Object.assign(out, this.liveProps());
2155
+
2156
+ const grid = this.boundGrid();
2157
+ if (grid)
2158
+ out['grid'] = grid;
2159
+ return out;
2160
+ }
2161
+
2162
+ reconcile() {
2163
+ if (this.torn || !this.rendered || !this.isBrowser)
2164
+ return;
2165
+ const grid = this.boundGrid();
2166
+ if (this.controller) {
2167
+ if (Object.is(this.builtAgainst, grid))
2168
+ return;
2169
+
2170
+ this.teardown();
2171
+ }
2172
+ if (this.requiresGrid && !grid)
2173
+ return;
2174
+ const element = this.elementRef.nativeElement;
2175
+ if (!element)
2176
+ return;
2177
+ this.handlers = {};
2178
+ for (const event of VIEWER_EVENTS[this.viewer] ?? []) {
2179
+ const emitter = this[eventProp(event)];
2180
+ if (!emitter)
2181
+ continue;
2182
+ this.handlers[viewerHandlerName(event)] = (payload) => {
2183
+ emitInZone(this.zone, emitter, payload);
2184
+ };
2185
+ }
2186
+ const controller = this.zone.runOutsideAngular(() => createViewerController({
2187
+ viewer: this.viewer,
2188
+ mount: (el, config) => this.mount(el, config),
2189
+ element,
2190
+ props: this.props(),
2191
+ name: this.label,
2192
+ }));
2193
+ this.controller = controller;
2194
+ this.builtAgainst = grid;
2195
+ emitInZone(this.zone, this.ready, controller.instance);
2196
+ }
2197
+
2198
+ ngOnChanges() {
2199
+ this.explicitGrid.set(this.takesGrid ? this.grid ?? undefined : undefined);
2200
+ this.gridNameInput.set(this.gridName || DEFAULT_GRID_NAME);
2201
+ if (this.controller)
2202
+ this.controller.update(this.props());
2203
+ }
2204
+
2205
+ ngOnDestroy() {
2206
+ this.torn = true;
2207
+ this.teardown();
2208
+ }
2209
+
2210
+ teardown() {
2211
+ const controller = this.controller;
2212
+ this.controller = null;
2213
+ this.builtAgainst = null;
2214
+ if (!controller)
2215
+ return;
2216
+ emitInZone(this.zone, this.destroyed, undefined);
2217
+ controller.destroy();
2218
+ }
2219
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeViewerBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2220
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: LatticeViewerBase, isStandalone: true, inputs: { config: "config", grid: "grid", gridName: "gridName" }, outputs: { ready: "ready", destroyed: "destroyed" }, usesOnChanges: true, ngImport: i0 }); }
2221
+ }
2222
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeViewerBase, decorators: [{
2223
+ type: Directive
2224
+ }], ctorParameters: () => [], propDecorators: { config: [{
2225
+ type: Input
2226
+ }], grid: [{
2227
+ type: Input
2228
+ }], gridName: [{
2229
+ type: Input
2230
+ }], ready: [{
2231
+ type: Output
2232
+ }], destroyed: [{
2233
+ type: Output
2234
+ }] } });
2235
+
2236
+ class LatticeKpiComponent extends LatticeViewerBase {
2237
+ constructor() {
2238
+ super(...arguments);
2239
+
2240
+ this.viewer = 'kpi';
2241
+
2242
+ this.label = 'lattice-kpi';
2243
+
2244
+ this.factories = inject(LATTICE_FACTORIES, { optional: true });
2245
+
2246
+ this.tileClick = new EventEmitter();
2247
+
2248
+ this.tileDblclick = new EventEmitter();
2249
+
2250
+ this.tileContextmenu = new EventEmitter();
2251
+
2252
+ this.nodeToggle = new EventEmitter();
2253
+
2254
+ this.change = new EventEmitter();
2255
+ }
2256
+
2257
+ liveProps() {
2258
+ return this.rows === undefined ? {} : { rows: this.rows };
2259
+ }
2260
+
2261
+ mount(element, config) {
2262
+ const createKPI = requireFactory(this.factories, 'createKPI', '@toclocoinc/lattice-grid/modules/kpi', this.label);
2263
+ return createKPI(element, config);
2264
+ }
2265
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeKpiComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2266
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: LatticeKpiComponent, isStandalone: true, selector: "lattice-kpi", inputs: { config: "config", rows: "rows" }, outputs: { tileClick: "tile-click", tileDblclick: "tile-dblclick", tileContextmenu: "tile-contextmenu", nodeToggle: "node-toggle", change: "change" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block}\n"] }); }
2267
+ }
2268
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeKpiComponent, decorators: [{
2269
+ type: Component,
2270
+ args: [{ selector: 'lattice-kpi', template: '', encapsulation: ViewEncapsulation.Emulated, styles: [":host{display:block}\n"] }]
2271
+ }], propDecorators: { config: [{
2272
+ type: Input
2273
+ }], rows: [{
2274
+ type: Input
2275
+ }], tileClick: [{
2276
+ type: Output,
2277
+ args: ['tile-click']
2278
+ }], tileDblclick: [{
2279
+ type: Output,
2280
+ args: ['tile-dblclick']
2281
+ }], tileContextmenu: [{
2282
+ type: Output,
2283
+ args: ['tile-contextmenu']
2284
+ }], nodeToggle: [{
2285
+ type: Output,
2286
+ args: ['node-toggle']
2287
+ }], change: [{
2288
+ type: Output
2289
+ }] } });
2290
+
2291
+ class LatticeChartComponent extends LatticeViewerBase {
2292
+ constructor() {
2293
+ super(...arguments);
2294
+
2295
+ this.viewer = 'chart';
2296
+
2297
+ this.label = 'lattice-chart';
2298
+
2299
+ this.requiresGrid = true;
2300
+
2301
+ this.factories = inject(LATTICE_FACTORIES, { optional: true });
2302
+
2303
+ this.click = new EventEmitter();
2304
+
2305
+ this.hover = new EventEmitter();
2306
+
2307
+ this.leave = new EventEmitter();
2308
+
2309
+ this.draw = new EventEmitter();
2310
+
2311
+ this.legend = new EventEmitter();
2312
+ }
2313
+
2314
+ mount(element, config) {
2315
+ const createChart = requireFactory(this.factories, 'createChart', '@toclocoinc/lattice-grid/modules/charts', this.label);
2316
+ return createChart({ ...config, container: element });
2317
+ }
2318
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeChartComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2319
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: LatticeChartComponent, isStandalone: true, selector: "lattice-chart", inputs: { config: "config" }, outputs: { click: "click", hover: "hover", leave: "leave", draw: "draw", legend: "legend" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block}\n"] }); }
2320
+ }
2321
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeChartComponent, decorators: [{
2322
+ type: Component,
2323
+ args: [{ selector: 'lattice-chart', template: '', encapsulation: ViewEncapsulation.Emulated, styles: [":host{display:block}\n"] }]
2324
+ }], propDecorators: { config: [{
2325
+ type: Input
2326
+ }], click: [{
2327
+ type: Output
2328
+ }], hover: [{
2329
+ type: Output
2330
+ }], leave: [{
2331
+ type: Output
2332
+ }], draw: [{
2333
+ type: Output
2334
+ }], legend: [{
2335
+ type: Output
2336
+ }] } });
2337
+
2338
+ class LatticeKanbanComponent extends LatticeViewerBase {
2339
+ constructor() {
2340
+ super(...arguments);
2341
+
2342
+ this.viewer = 'kanban';
2343
+
2344
+ this.label = 'lattice-kanban';
2345
+
2346
+ this.factories = inject(LATTICE_FACTORIES, { optional: true });
2347
+
2348
+ this.cardClick = new EventEmitter();
2349
+
2350
+ this.cardDblclick = new EventEmitter();
2351
+
2352
+ this.cardContextmenu = new EventEmitter();
2353
+
2354
+ this.cardMove = new EventEmitter();
2355
+
2356
+ this.cardReverted = new EventEmitter();
2357
+
2358
+ this.cardConfirmed = new EventEmitter();
2359
+
2360
+ this.selectionChanged = new EventEmitter();
2361
+
2362
+ this.columnCollapse = new EventEmitter();
2363
+
2364
+ this.cardAdd = new EventEmitter();
2365
+
2366
+ this.dragStart = new EventEmitter();
2367
+
2368
+ this.dragEnd = new EventEmitter();
2369
+
2370
+ this.swimlaneCollapse = new EventEmitter();
2371
+
2372
+ this.swimlaneReorder = new EventEmitter();
2373
+
2374
+ this.columnReorder = new EventEmitter();
2375
+
2376
+ this.filterChanged = new EventEmitter();
2377
+
2378
+ this.sprintChanged = new EventEmitter();
2379
+
2380
+ this.epicChanged = new EventEmitter();
2381
+
2382
+ this.cardExpand = new EventEmitter();
2383
+
2384
+ this.cardDrill = new EventEmitter();
2385
+
2386
+ this.cardEdit = new EventEmitter();
2387
+
2388
+ this.cardSla = new EventEmitter();
2389
+
2390
+ this.beforeMove = new EventEmitter();
2391
+
2392
+ this.beforeAdd = new EventEmitter();
2393
+
2394
+ this.beforeEdit = new EventEmitter();
2395
+
2396
+ this.beforeLaneReorder = new EventEmitter();
2397
+
2398
+ this.beforeColumnReorder = new EventEmitter();
2399
+
2400
+ this.beforeColumnChange = new EventEmitter();
2401
+
2402
+ this.moveCancelled = new EventEmitter();
2403
+
2404
+ this.addCancelled = new EventEmitter();
2405
+
2406
+ this.editCancelled = new EventEmitter();
2407
+
2408
+ this.laneReorderCancelled = new EventEmitter();
2409
+
2410
+ this.columnReorderCancelled = new EventEmitter();
2411
+
2412
+ this.columnChangeCancelled = new EventEmitter();
2413
+ }
2414
+
2415
+ liveProps() {
2416
+ const out = {};
2417
+ if (this.rows !== undefined)
2418
+ out['rows'] = this.rows;
2419
+ if (this.quickFilter !== undefined)
2420
+ out['quickFilter'] = this.quickFilter;
2421
+ if (this.sprint !== undefined)
2422
+ out['sprint'] = this.sprint;
2423
+ if (this.epic !== undefined)
2424
+ out['epic'] = this.epic;
2425
+ if (this.loading !== undefined)
2426
+ out['loading'] = this.loading;
2427
+ if (this.error !== undefined)
2428
+ out['error'] = this.error;
2429
+ return out;
2430
+ }
2431
+
2432
+ mount(element, config) {
2433
+ const createKanban = requireFactory(this.factories, 'createKanban', '@toclocoinc/lattice-grid/modules/kanban', this.label);
2434
+ return createKanban(element, config);
2435
+ }
2436
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeKanbanComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2437
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: LatticeKanbanComponent, isStandalone: true, selector: "lattice-kanban", inputs: { config: "config", rows: "rows", quickFilter: "quickFilter", sprint: "sprint", epic: "epic", loading: "loading", error: "error" }, outputs: { cardClick: "card-click", cardDblclick: "card-dblclick", cardContextmenu: "card-contextmenu", cardMove: "card-move", cardReverted: "card-reverted", cardConfirmed: "card-confirmed", selectionChanged: "selection-changed", columnCollapse: "column-collapse", cardAdd: "card-add", dragStart: "drag-start", dragEnd: "drag-end", swimlaneCollapse: "swimlane-collapse", swimlaneReorder: "swimlane-reorder", columnReorder: "column-reorder", filterChanged: "filter-changed", sprintChanged: "sprint-changed", epicChanged: "epic-changed", cardExpand: "card-expand", cardDrill: "card-drill", cardEdit: "card-edit", cardSla: "card-sla", beforeMove: "beforeMove", beforeAdd: "beforeAdd", beforeEdit: "beforeEdit", beforeLaneReorder: "beforeLaneReorder", beforeColumnReorder: "beforeColumnReorder", beforeColumnChange: "beforeColumnChange", moveCancelled: "move-cancelled", addCancelled: "add-cancelled", editCancelled: "edit-cancelled", laneReorderCancelled: "laneReorder-cancelled", columnReorderCancelled: "columnReorder-cancelled", columnChangeCancelled: "columnChange-cancelled" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block}\n"] }); }
2438
+ }
2439
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeKanbanComponent, decorators: [{
2440
+ type: Component,
2441
+ args: [{ selector: 'lattice-kanban', template: '', encapsulation: ViewEncapsulation.Emulated, styles: [":host{display:block}\n"] }]
2442
+ }], propDecorators: { config: [{
2443
+ type: Input
2444
+ }], rows: [{
2445
+ type: Input
2446
+ }], quickFilter: [{
2447
+ type: Input
2448
+ }], sprint: [{
2449
+ type: Input
2450
+ }], epic: [{
2451
+ type: Input
2452
+ }], loading: [{
2453
+ type: Input
2454
+ }], error: [{
2455
+ type: Input
2456
+ }], cardClick: [{
2457
+ type: Output,
2458
+ args: ['card-click']
2459
+ }], cardDblclick: [{
2460
+ type: Output,
2461
+ args: ['card-dblclick']
2462
+ }], cardContextmenu: [{
2463
+ type: Output,
2464
+ args: ['card-contextmenu']
2465
+ }], cardMove: [{
2466
+ type: Output,
2467
+ args: ['card-move']
2468
+ }], cardReverted: [{
2469
+ type: Output,
2470
+ args: ['card-reverted']
2471
+ }], cardConfirmed: [{
2472
+ type: Output,
2473
+ args: ['card-confirmed']
2474
+ }], selectionChanged: [{
2475
+ type: Output,
2476
+ args: ['selection-changed']
2477
+ }], columnCollapse: [{
2478
+ type: Output,
2479
+ args: ['column-collapse']
2480
+ }], cardAdd: [{
2481
+ type: Output,
2482
+ args: ['card-add']
2483
+ }], dragStart: [{
2484
+ type: Output,
2485
+ args: ['drag-start']
2486
+ }], dragEnd: [{
2487
+ type: Output,
2488
+ args: ['drag-end']
2489
+ }], swimlaneCollapse: [{
2490
+ type: Output,
2491
+ args: ['swimlane-collapse']
2492
+ }], swimlaneReorder: [{
2493
+ type: Output,
2494
+ args: ['swimlane-reorder']
2495
+ }], columnReorder: [{
2496
+ type: Output,
2497
+ args: ['column-reorder']
2498
+ }], filterChanged: [{
2499
+ type: Output,
2500
+ args: ['filter-changed']
2501
+ }], sprintChanged: [{
2502
+ type: Output,
2503
+ args: ['sprint-changed']
2504
+ }], epicChanged: [{
2505
+ type: Output,
2506
+ args: ['epic-changed']
2507
+ }], cardExpand: [{
2508
+ type: Output,
2509
+ args: ['card-expand']
2510
+ }], cardDrill: [{
2511
+ type: Output,
2512
+ args: ['card-drill']
2513
+ }], cardEdit: [{
2514
+ type: Output,
2515
+ args: ['card-edit']
2516
+ }], cardSla: [{
2517
+ type: Output,
2518
+ args: ['card-sla']
2519
+ }], beforeMove: [{
2520
+ type: Output
2521
+ }], beforeAdd: [{
2522
+ type: Output
2523
+ }], beforeEdit: [{
2524
+ type: Output
2525
+ }], beforeLaneReorder: [{
2526
+ type: Output
2527
+ }], beforeColumnReorder: [{
2528
+ type: Output
2529
+ }], beforeColumnChange: [{
2530
+ type: Output
2531
+ }], moveCancelled: [{
2532
+ type: Output,
2533
+ args: ['move-cancelled']
2534
+ }], addCancelled: [{
2535
+ type: Output,
2536
+ args: ['add-cancelled']
2537
+ }], editCancelled: [{
2538
+ type: Output,
2539
+ args: ['edit-cancelled']
2540
+ }], laneReorderCancelled: [{
2541
+ type: Output,
2542
+ args: ['laneReorder-cancelled']
2543
+ }], columnReorderCancelled: [{
2544
+ type: Output,
2545
+ args: ['columnReorder-cancelled']
2546
+ }], columnChangeCancelled: [{
2547
+ type: Output,
2548
+ args: ['columnChange-cancelled']
2549
+ }] } });
2550
+
2551
+ class LatticeGanttComponent extends LatticeViewerBase {
2552
+ constructor() {
2553
+ super(...arguments);
2554
+
2555
+ this.viewer = 'gantt';
2556
+
2557
+ this.label = 'lattice-gantt';
2558
+
2559
+ this.fromRegistry = false;
2560
+
2561
+ this.factories = inject(LATTICE_FACTORIES, { optional: true });
2562
+
2563
+ this.schedule = new EventEmitter();
2564
+
2565
+ this.error = new EventEmitter();
2566
+ }
2567
+
2568
+ liveProps() {
2569
+ const out = {};
2570
+ if (this.tasks !== undefined)
2571
+ out['tasks'] = this.tasks;
2572
+ if (this.dependencies !== undefined)
2573
+ out['dependencies'] = this.dependencies;
2574
+ return out;
2575
+ }
2576
+
2577
+ mount(element, config) {
2578
+ const createGantt = requireFactory(this.factories, 'createGantt', '@toclocoinc/lattice-grid/modules/gantt', this.label);
2579
+ return createGantt({ ...config, element });
2580
+ }
2581
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeGanttComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2582
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: LatticeGanttComponent, isStandalone: true, selector: "lattice-gantt", inputs: { config: "config", tasks: "tasks", dependencies: "dependencies" }, outputs: { schedule: "schedule", error: "error" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block}\n"] }); }
2583
+ }
2584
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeGanttComponent, decorators: [{
2585
+ type: Component,
2586
+ args: [{ selector: 'lattice-gantt', template: '', encapsulation: ViewEncapsulation.Emulated, styles: [":host{display:block}\n"] }]
2587
+ }], propDecorators: { config: [{
2588
+ type: Input
2589
+ }], tasks: [{
2590
+ type: Input
2591
+ }], dependencies: [{
2592
+ type: Input
2593
+ }], schedule: [{
2594
+ type: Output
2595
+ }], error: [{
2596
+ type: Output
2597
+ }] } });
2598
+
2599
+ class LatticeLayoutComponent extends LatticeViewerBase {
2600
+ constructor() {
2601
+ super(...arguments);
2602
+
2603
+ this.viewer = 'layout';
2604
+
2605
+ this.label = 'lattice-layout';
2606
+
2607
+ this.takesGrid = false;
2608
+
2609
+ this.factories = inject(LATTICE_FACTORIES, { optional: true });
2610
+
2611
+ this.layoutChanged = new EventEmitter();
2612
+
2613
+ this.windowMoved = new EventEmitter();
2614
+
2615
+ this.windowResized = new EventEmitter();
2616
+
2617
+ this.windowClosed = new EventEmitter();
2618
+
2619
+ this.beforeWindowClose = new EventEmitter();
2620
+
2621
+ this.windowCloseCancelled = new EventEmitter();
2622
+ }
2623
+
2624
+ mount(element, config) {
2625
+ const createLayout = requireFactory(this.factories, 'createLayout', '@toclocoinc/lattice-grid/modules/layout', this.label);
2626
+ return createLayout(element, config);
2627
+ }
2628
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeLayoutComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2629
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: LatticeLayoutComponent, isStandalone: true, selector: "lattice-layout", inputs: { config: "config" }, outputs: { layoutChanged: "layout-changed", windowMoved: "window-moved", windowResized: "window-resized", windowClosed: "window-closed", beforeWindowClose: "beforeWindowClose", windowCloseCancelled: "windowClose-cancelled" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, styles: [":host{display:block}\n"] }); }
2630
+ }
2631
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeLayoutComponent, decorators: [{
2632
+ type: Component,
2633
+ args: [{ selector: 'lattice-layout', template: '', encapsulation: ViewEncapsulation.Emulated, styles: [":host{display:block}\n"] }]
2634
+ }], propDecorators: { config: [{
2635
+ type: Input
2636
+ }], layoutChanged: [{
2637
+ type: Output,
2638
+ args: ['layout-changed']
2639
+ }], windowMoved: [{
2640
+ type: Output,
2641
+ args: ['window-moved']
2642
+ }], windowResized: [{
2643
+ type: Output,
2644
+ args: ['window-resized']
2645
+ }], windowClosed: [{
2646
+ type: Output,
2647
+ args: ['window-closed']
2648
+ }], beforeWindowClose: [{
2649
+ type: Output
2650
+ }], windowCloseCancelled: [{
2651
+ type: Output,
2652
+ args: ['windowClose-cancelled']
2653
+ }] } });
2654
+
2655
+ class LatticeTabDirective {
2656
+ constructor() {
2657
+
2658
+ this.template = inject(TemplateRef);
2659
+
2660
+ this.tabId = '';
2661
+ }
2662
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeTabDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2663
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: LatticeTabDirective, isStandalone: true, selector: "ng-template[latticeTab]", inputs: { tabId: ["latticeTab", "tabId"] }, ngImport: i0 }); }
2664
+ }
2665
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeTabDirective, decorators: [{
2666
+ type: Directive,
2667
+ args: [{ selector: 'ng-template[latticeTab]' }]
2668
+ }], propDecorators: { tabId: [{
2669
+ type: Input,
2670
+ args: ['latticeTab']
2671
+ }] } });
2672
+ class LatticeTabsComponent {
2673
+
2674
+ constructor() {
2675
+
2676
+ this.elementRef = inject(ElementRef);
2677
+
2678
+ this.zone = inject(NgZone);
2679
+
2680
+ this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
2681
+
2682
+ this.factories = inject(LATTICE_FACTORIES, { optional: true });
2683
+
2684
+ this.viewContainer = inject(ViewContainerRef);
2685
+
2686
+ this.injector = inject(Injector);
2687
+
2688
+ this.strip = null;
2689
+
2690
+ this.torn = false;
2691
+
2692
+ this.off = [];
2693
+
2694
+ this.views = new Map();
2695
+
2696
+ this.ready = new EventEmitter();
2697
+
2698
+ this.destroyed = new EventEmitter();
2699
+
2700
+ this.beforeTabChange = new EventEmitter();
2701
+
2702
+ this.tabChanged = new EventEmitter();
2703
+
2704
+ this.tabChangeCancelled = new EventEmitter();
2705
+ afterNextRender(() => this.build(), { injector: this.injector });
2706
+ }
2707
+
2708
+ get instance() {
2709
+ return this.strip;
2710
+ }
2711
+
2712
+ templateFor(id) {
2713
+ return this.templates?.find((entry) => entry.tabId === id);
2714
+ }
2715
+
2716
+ renderInto(id, template, body) {
2717
+ const view = this.zone.run(() => this.viewContainer.createEmbeddedView(template));
2718
+ for (const node of view.rootNodes)
2719
+ body.append(node);
2720
+ view.detectChanges();
2721
+ this.views.set(id, view);
2722
+ return {
2723
+
2724
+ destroy: () => {
2725
+ this.views.delete(id);
2726
+ view.destroy();
2727
+ },
2728
+ };
2729
+ }
2730
+
2731
+ build() {
2732
+ if (this.strip || this.torn || !this.isBrowser)
2733
+ return;
2734
+ const host = this.elementRef.nativeElement.firstElementChild;
2735
+ if (!host)
2736
+ return;
2737
+ const createTabs = requireFactory(this.factories, 'createTabs', '@toclocoinc/lattice-grid/modules/tabs', 'lattice-tabs');
2738
+ const declared = Array.isArray(this.tabs) ? this.tabs : [];
2739
+ const descriptors = declared.map((tab) => {
2740
+ const id = String(tab['id'] ?? '');
2741
+ const content = this.templateFor(id);
2742
+ if (!content)
2743
+ return tab;
2744
+ return {
2745
+ ...tab,
2746
+
2747
+ view: (body) => this.renderInto(id, content.template, body),
2748
+ };
2749
+ });
2750
+ const config = { ...this.config };
2751
+ config['tabs'] = descriptors;
2752
+
2753
+ config['createGrid'] = this.factories?.createGrid ?? (() => {
2754
+ throw new Error('[lattice] <lattice-tabs>: a tab has neither an <ng-template latticeTab="…"> nor a '
2755
+ + 'provided createGrid, so there is nothing to build it with. Give the tab a template, '
2756
+ + 'or add createGrid to provideLattice({ … }).');
2757
+ });
2758
+ if (typeof this.active === 'string')
2759
+ config['active'] = this.active;
2760
+ const strip = this.zone.runOutsideAngular(() => createTabs(host, config));
2761
+ this.strip = strip;
2762
+ this.builtFrom = this.tabs;
2763
+ for (const event of VIEWER_EVENTS['tabs'] ?? []) {
2764
+ const emitter = this[eventProp(event)];
2765
+ if (!emitter)
2766
+ continue;
2767
+ const stop = strip.on(event, (payload) => {
2768
+ emitInZone(this.zone, emitter, payload);
2769
+ });
2770
+ if (typeof stop === 'function')
2771
+ this.off.push(stop);
2772
+ }
2773
+ emitInZone(this.zone, this.ready, strip);
2774
+ }
2775
+
2776
+ ngOnChanges() {
2777
+ const strip = this.strip;
2778
+ if (!strip)
2779
+ return;
2780
+ if (typeof this.active === 'string' && strip.activeId !== this.active) {
2781
+ strip.activate(this.active);
2782
+ }
2783
+ if (!Object.is(this.builtFrom, this.tabs)) {
2784
+ this.builtFrom = this.tabs;
2785
+ warnOnce('angular.tabs.mountOnly.tabs', '<lattice-tabs>: `tabs` changed (a label, a badge or a descriptor), but the strip takes '
2786
+ + 'it only when created — the module has no way to repaint an existing tab. Nothing was '
2787
+ + 'applied and the strip was NOT rebuilt, because rebuilding it would lose whichever tab '
2788
+ + 'is open and any state its content holds. Put the strip inside an `@if` keyed on what '
2789
+ + 'changed if a genuine rebuild is wanted; a live badge otherwise belongs in your own '
2790
+ + 'template.');
2791
+ }
2792
+ }
2793
+
2794
+ ngOnDestroy() {
2795
+ this.torn = true;
2796
+ const strip = this.strip;
2797
+ this.strip = null;
2798
+ if (!strip)
2799
+ return;
2800
+ emitInZone(this.zone, this.destroyed, undefined);
2801
+ for (const stop of this.off) {
2802
+ try {
2803
+ stop();
2804
+ }
2805
+ catch { }
2806
+ }
2807
+ this.off = [];
2808
+ strip.destroy();
2809
+ for (const view of this.views.values())
2810
+ view.destroy();
2811
+ this.views.clear();
2812
+ }
2813
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2814
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.7", type: LatticeTabsComponent, isStandalone: true, selector: "lattice-tabs", inputs: { config: "config", tabs: "tabs", active: "active" }, outputs: { ready: "ready", destroyed: "destroyed", beforeTabChange: "beforeTabChange", tabChanged: "tab-changed", tabChangeCancelled: "tabChange-cancelled" }, queries: [{ propertyName: "templates", predicate: LatticeTabDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: '<div #strip class="lattice-tabs-host"></div>', isInline: true, styles: [":host{display:block}.lattice-tabs-host{height:100%}\n"] }); }
2815
+ }
2816
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: LatticeTabsComponent, decorators: [{
2817
+ type: Component,
2818
+ args: [{ selector: 'lattice-tabs', template: '<div #strip class="lattice-tabs-host"></div>', encapsulation: ViewEncapsulation.Emulated, styles: [":host{display:block}.lattice-tabs-host{height:100%}\n"] }]
2819
+ }], ctorParameters: () => [], propDecorators: { templates: [{
2820
+ type: ContentChildren,
2821
+ args: [LatticeTabDirective, { descendants: true }]
2822
+ }], config: [{
2823
+ type: Input
2824
+ }], tabs: [{
2825
+ type: Input
2826
+ }], active: [{
2827
+ type: Input
2828
+ }], ready: [{
2829
+ type: Output
2830
+ }], destroyed: [{
2831
+ type: Output
2832
+ }], beforeTabChange: [{
2833
+ type: Output,
2834
+ args: ['beforeTabChange']
2835
+ }], tabChanged: [{
2836
+ type: Output,
2837
+ args: ['tab-changed']
2838
+ }], tabChangeCancelled: [{
2839
+ type: Output,
2840
+ args: ['tabChange-cancelled']
2841
+ }] } });
2842
+
2843
+ export { DEFAULT_GRID_NAME, EVENT_NAMES, LATTICE_FACTORIES, LATTICE_ROUTER_OPTIONS, LatticeChartComponent, LatticeGanttComponent, LatticeGridBase, LatticeGridComponent, LatticeGridDirective, LatticeGridRegistry, LatticeKanbanComponent, LatticeKpiComponent, LatticeLayoutComponent, LatticeRouter, LatticeTabDirective, LatticeTabsComponent, LatticeViewerBase, VIEWER_EVENTS, dashedName, eventProp, provideLattice, provideLatticeRouter, requireFactory };