@dragonworks/ngx-dashboard 20.0.6 → 20.1.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 (78) hide show
  1. package/fesm2022/dragonworks-ngx-dashboard.mjs +2250 -0
  2. package/fesm2022/dragonworks-ngx-dashboard.mjs.map +1 -0
  3. package/index.d.ts +727 -0
  4. package/package.json +45 -34
  5. package/ng-package.json +0 -7
  6. package/src/lib/__tests__/dashboard-component-widget-state-integration.spec.ts +0 -537
  7. package/src/lib/cell/__tests__/cell-resize.component.spec.ts +0 -442
  8. package/src/lib/cell/__tests__/cell.component.spec.ts +0 -541
  9. package/src/lib/cell/cell-context-menu.component.ts +0 -138
  10. package/src/lib/cell/cell-context-menu.service.ts +0 -36
  11. package/src/lib/cell/cell.component.html +0 -37
  12. package/src/lib/cell/cell.component.scss +0 -198
  13. package/src/lib/cell/cell.component.ts +0 -375
  14. package/src/lib/dashboard/dashboard.component.html +0 -18
  15. package/src/lib/dashboard/dashboard.component.scss +0 -17
  16. package/src/lib/dashboard/dashboard.component.ts +0 -187
  17. package/src/lib/dashboard-editor/dashboard-editor.component.html +0 -57
  18. package/src/lib/dashboard-editor/dashboard-editor.component.scss +0 -87
  19. package/src/lib/dashboard-editor/dashboard-editor.component.ts +0 -219
  20. package/src/lib/dashboard-viewer/__tests__/dashboard-viewer.component.spec.ts +0 -258
  21. package/src/lib/dashboard-viewer/dashboard-viewer.component.html +0 -20
  22. package/src/lib/dashboard-viewer/dashboard-viewer.component.scss +0 -50
  23. package/src/lib/dashboard-viewer/dashboard-viewer.component.ts +0 -70
  24. package/src/lib/drop-zone/__tests__/drop-zone.component.spec.ts +0 -465
  25. package/src/lib/drop-zone/drop-zone.component.html +0 -20
  26. package/src/lib/drop-zone/drop-zone.component.scss +0 -67
  27. package/src/lib/drop-zone/drop-zone.component.ts +0 -122
  28. package/src/lib/internal-widgets/unknown-widget/unknown-widget.component.ts +0 -72
  29. package/src/lib/models/cell-data.ts +0 -13
  30. package/src/lib/models/cell-dialog.ts +0 -7
  31. package/src/lib/models/cell-id.ts +0 -85
  32. package/src/lib/models/cell-position.ts +0 -15
  33. package/src/lib/models/dashboard-data.dto.ts +0 -44
  34. package/src/lib/models/dashboard-data.utils.ts +0 -49
  35. package/src/lib/models/drag-data.ts +0 -6
  36. package/src/lib/models/index.ts +0 -11
  37. package/src/lib/models/reserved-space.ts +0 -24
  38. package/src/lib/models/widget-factory.ts +0 -33
  39. package/src/lib/models/widget-id.ts +0 -70
  40. package/src/lib/models/widget.ts +0 -21
  41. package/src/lib/providers/cell-settings-dialog/cell-settings-dialog.component.ts +0 -127
  42. package/src/lib/providers/cell-settings-dialog/cell-settings-dialog.provider.ts +0 -15
  43. package/src/lib/providers/cell-settings-dialog/cell-settings-dialog.tokens.ts +0 -20
  44. package/src/lib/providers/cell-settings-dialog/default-cell-settings-dialog.provider.ts +0 -32
  45. package/src/lib/providers/cell-settings-dialog/index.ts +0 -3
  46. package/src/lib/providers/index.ts +0 -1
  47. package/src/lib/services/__tests__/dashboard-bridge.service.spec.ts +0 -220
  48. package/src/lib/services/__tests__/dashboard-viewport.service.spec.ts +0 -362
  49. package/src/lib/services/dashboard-bridge.service.ts +0 -155
  50. package/src/lib/services/dashboard-viewport.service.ts +0 -148
  51. package/src/lib/services/dashboard.service.ts +0 -62
  52. package/src/lib/store/__tests__/dashboard-store-collision-detection.spec.ts +0 -756
  53. package/src/lib/store/__tests__/dashboard-store-computed-properties.spec.ts +0 -974
  54. package/src/lib/store/__tests__/dashboard-store-drag-drop.spec.ts +0 -279
  55. package/src/lib/store/__tests__/dashboard-store-export-import.spec.ts +0 -780
  56. package/src/lib/store/__tests__/dashboard-store-grid-config.spec.ts +0 -128
  57. package/src/lib/store/__tests__/dashboard-store-query-methods.spec.ts +0 -229
  58. package/src/lib/store/__tests__/dashboard-store-resize-operations.spec.ts +0 -652
  59. package/src/lib/store/__tests__/dashboard-store-widget-management.spec.ts +0 -461
  60. package/src/lib/store/__tests__/dashboard-store-widget-state-preservation.spec.ts +0 -369
  61. package/src/lib/store/dashboard-store.ts +0 -239
  62. package/src/lib/store/features/drag-drop.feature.ts +0 -140
  63. package/src/lib/store/features/grid-config.feature.ts +0 -43
  64. package/src/lib/store/features/resize.feature.ts +0 -140
  65. package/src/lib/store/features/utils/collision.utils.ts +0 -89
  66. package/src/lib/store/features/utils/grid-query-internal.utils.ts +0 -37
  67. package/src/lib/store/features/utils/resize.utils.ts +0 -165
  68. package/src/lib/store/features/widget-management.feature.ts +0 -158
  69. package/src/lib/styles/_dashboard-grid-vars.scss +0 -11
  70. package/src/lib/widget-list/__tests__/widget-list-bridge-integration.spec.ts +0 -137
  71. package/src/lib/widget-list/widget-list.component.html +0 -22
  72. package/src/lib/widget-list/widget-list.component.scss +0 -154
  73. package/src/lib/widget-list/widget-list.component.ts +0 -106
  74. package/src/public-api.ts +0 -21
  75. package/src/test-setup.ts +0 -10
  76. package/tsconfig.lib.json +0 -15
  77. package/tsconfig.lib.prod.json +0 -11
  78. package/tsconfig.spec.json +0 -14
package/index.d.ts ADDED
@@ -0,0 +1,727 @@
1
+ import * as _dragonworks_ngx_dashboard from '@dragonworks/ngx-dashboard';
2
+ import * as _ngrx_signals from '@ngrx/signals';
3
+ import * as _angular_core from '@angular/core';
4
+ import { Type, ViewContainerRef, ComponentRef, OnChanges, SimpleChanges, ElementRef, InjectionToken } from '@angular/core';
5
+ import { SafeHtml } from '@angular/platform-browser';
6
+
7
+ /**
8
+ * Branded type for cell identifiers to ensure type safety when working with grid coordinates.
9
+ * This prevents accidentally mixing up row/column numbers with cell IDs.
10
+ */
11
+ type CellId = number & {
12
+ __brand: 'CellId';
13
+ };
14
+ /**
15
+ * Utility functions for working with CellId branded type.
16
+ */
17
+ declare const CellIdUtils: {
18
+ /**
19
+ * Creates a CellId from row and column coordinates.
20
+ * @param row - The row number (1-based)
21
+ * @param col - The column number (1-based)
22
+ * @returns A branded CellId that encodes both coordinates
23
+ * @throws Error if row or col is less than 1, or if col exceeds MAX_COLUMNS
24
+ */
25
+ create(row: number, col: number): CellId;
26
+ /**
27
+ * Decodes a CellId back into row and column coordinates.
28
+ * @param cellId - The CellId to decode
29
+ * @returns A tuple of [row, col] coordinates (1-based)
30
+ */
31
+ decode(cellId: CellId): [number, number];
32
+ /**
33
+ * Gets the row coordinate from a CellId.
34
+ * @param cellId - The CellId to extract row from
35
+ * @returns The row number (1-based)
36
+ */
37
+ getRow(cellId: CellId): number;
38
+ /**
39
+ * Gets the column coordinate from a CellId.
40
+ * @param cellId - The CellId to extract column from
41
+ * @returns The column number (1-based)
42
+ */
43
+ getCol(cellId: CellId): number;
44
+ /**
45
+ * Creates a string representation of a CellId for debugging/display purposes.
46
+ * @param cellId - The CellId to convert to string
47
+ * @returns A string in the format "row-col"
48
+ */
49
+ toString(cellId: CellId): string;
50
+ /**
51
+ * Checks if two CellIds are equal.
52
+ * @param a - First CellId
53
+ * @param b - Second CellId
54
+ * @returns True if the CellIds represent the same cell
55
+ */
56
+ equals(a: CellId, b: CellId): boolean;
57
+ };
58
+
59
+ /**
60
+ * Branded type for widget identifiers to ensure type safety when working with widget instances.
61
+ * This prevents accidentally mixing up widget IDs with other string values.
62
+ */
63
+ type WidgetId = string & {
64
+ __brand: 'WidgetId';
65
+ };
66
+ /**
67
+ * Utility functions for working with WidgetId branded type.
68
+ * WidgetIds are UUIDs that uniquely identify widget instances throughout their lifecycle,
69
+ * independent of their position on the dashboard grid.
70
+ */
71
+ declare const WidgetIdUtils: {
72
+ /**
73
+ * Generates a new unique WidgetId.
74
+ * Uses crypto.randomUUID() when available, falls back to timestamp-based ID for older browsers.
75
+ * @returns A new unique WidgetId
76
+ */
77
+ generate(): WidgetId;
78
+ /**
79
+ * Validates if a string is a valid WidgetId format.
80
+ * @param id - The string to validate
81
+ * @returns True if the string is a valid WidgetId format
82
+ */
83
+ validate(id: string): id is WidgetId;
84
+ /**
85
+ * Converts a WidgetId to a string for use as map keys or serialization.
86
+ * @param id - The WidgetId to convert
87
+ * @returns The string representation of the WidgetId
88
+ */
89
+ toString(id: WidgetId): string;
90
+ /**
91
+ * Creates a WidgetId from a string, validating the format.
92
+ * @param str - The string to convert to WidgetId
93
+ * @returns A WidgetId
94
+ * @throws Error if the string is not a valid WidgetId format
95
+ */
96
+ fromString(str: string): WidgetId;
97
+ /**
98
+ * Checks if two WidgetIds are equal.
99
+ * @param a - First WidgetId
100
+ * @param b - Second WidgetId
101
+ * @returns True if the WidgetIds are the same
102
+ */
103
+ equals(a: WidgetId, b: WidgetId): boolean;
104
+ };
105
+
106
+ interface Widget {
107
+ dashboardGetState?(): unknown;
108
+ dashboardSetState?(state?: unknown): void;
109
+ dashboardEditState?(): void;
110
+ }
111
+ interface WidgetMetadata {
112
+ widgetTypeid: string;
113
+ name: string;
114
+ description: string;
115
+ svgIcon: string;
116
+ }
117
+ interface WidgetComponentClass<T extends Widget = Widget> extends Type<T> {
118
+ metadata: WidgetMetadata;
119
+ }
120
+
121
+ interface WidgetFactory<T extends Widget = Widget> {
122
+ widgetTypeid: string;
123
+ name: string;
124
+ description: string;
125
+ svgIcon: string;
126
+ createInstance(container: ViewContainerRef, state?: unknown): ComponentRef<T>;
127
+ }
128
+ declare function createFactoryFromComponent<T extends Widget>(component: WidgetComponentClass<T>): WidgetFactory;
129
+
130
+ interface CellPosition {
131
+ row: number;
132
+ col: number;
133
+ rowSpan: number;
134
+ colSpan: number;
135
+ }
136
+ interface CellComponentPosition extends CellPosition {
137
+ cellId: CellId;
138
+ widgetId: WidgetId;
139
+ }
140
+
141
+ interface CellData extends CellPosition {
142
+ widgetId: WidgetId;
143
+ cellId: CellId;
144
+ flat?: boolean;
145
+ widgetFactory: WidgetFactory;
146
+ widgetState: unknown;
147
+ }
148
+
149
+ /**
150
+ * Data structure for cell display settings
151
+ */
152
+ interface CellDisplayData {
153
+ id: string;
154
+ flat: boolean | undefined;
155
+ }
156
+
157
+ /**
158
+ * Serializable data format for dashboard export/import functionality.
159
+ * This format can be safely converted to/from JSON for persistence.
160
+ * Corresponds to the persistent state from the dashboard store features.
161
+ */
162
+ interface DashboardDataDto {
163
+ /** Version for future compatibility and migration support */
164
+ version: string;
165
+ /** Unique dashboard identifier managed by the client */
166
+ dashboardId: string;
167
+ /** Grid dimensions */
168
+ rows: number;
169
+ columns: number;
170
+ gutterSize: string;
171
+ /** Array of serializable cell data */
172
+ cells: CellDataDto[];
173
+ }
174
+ /**
175
+ * Serializable version of CellData that can be safely JSON stringified.
176
+ * Converts non-serializable types (CellId, WidgetFactory) to serializable equivalents.
177
+ */
178
+ interface CellDataDto {
179
+ /** Grid position */
180
+ row: number;
181
+ col: number;
182
+ /** Cell span */
183
+ rowSpan: number;
184
+ colSpan: number;
185
+ /** Display settings */
186
+ flat?: boolean;
187
+ /** Widget type identifier for factory lookup during import */
188
+ widgetTypeid: string;
189
+ /** Raw widget state (must be JSON serializable) */
190
+ widgetState: unknown;
191
+ }
192
+
193
+ /**
194
+ * Creates an empty dashboard configuration with the specified dimensions.
195
+ * This is a convenience function for creating a basic dashboard without any cells.
196
+ *
197
+ * @param dashboardId - Unique identifier for the dashboard (managed by client)
198
+ * @param rows - Number of rows in the dashboard grid
199
+ * @param columns - Number of columns in the dashboard grid
200
+ * @param gutterSize - CSS size for the gutter between cells (default: '0.5em')
201
+ * @returns A DashboardDataDto configured with the specified dimensions and no cells
202
+ *
203
+ * @example
204
+ * // Create an 8x16 dashboard with default gutter
205
+ * const dashboard = createEmptyDashboard('my-dashboard-1', 8, 16);
206
+ *
207
+ * @example
208
+ * // Create a 5x10 dashboard with custom gutter
209
+ * const dashboard = createEmptyDashboard('my-dashboard-2', 5, 10, '0.5rem');
210
+ */
211
+ declare function createEmptyDashboard(dashboardId: string, rows: number, columns: number, gutterSize?: string): DashboardDataDto;
212
+ /**
213
+ * Creates a default dashboard configuration with standard dimensions.
214
+ * This provides a reasonable starting point for most use cases.
215
+ *
216
+ * @param dashboardId - Unique identifier for the dashboard (managed by client)
217
+ * @returns A DashboardDataDto with 8 rows, 16 columns, and 0.5em gutter
218
+ *
219
+ * @example
220
+ * const dashboard = createDefaultDashboard('my-dashboard-id');
221
+ */
222
+ declare function createDefaultDashboard(dashboardId: string): DashboardDataDto;
223
+
224
+ type DragData = {
225
+ kind: 'cell';
226
+ content: CellComponentPosition;
227
+ } | {
228
+ kind: 'widget';
229
+ content: WidgetMetadata;
230
+ };
231
+
232
+ /**
233
+ * Defines space that should be reserved around the dashboard component
234
+ * when calculating viewport constraints.
235
+ */
236
+ interface ReservedSpace {
237
+ /** Space reserved at the top (e.g., toolbar height) */
238
+ top: number;
239
+ /** Space reserved on the right (e.g., padding, widget list) */
240
+ right: number;
241
+ /** Space reserved at the bottom (e.g., padding) */
242
+ bottom: number;
243
+ /** Space reserved on the left (e.g., padding) */
244
+ left: number;
245
+ }
246
+ /**
247
+ * Default reserved space when none is specified
248
+ */
249
+ declare const DEFAULT_RESERVED_SPACE: ReservedSpace;
250
+
251
+ interface ResizeData {
252
+ cellId: CellId;
253
+ originalRowSpan: number;
254
+ originalColSpan: number;
255
+ previewRowSpan: number;
256
+ previewColSpan: number;
257
+ }
258
+
259
+ interface ViewportSize {
260
+ width: number;
261
+ height: number;
262
+ }
263
+ interface DashboardConstraints {
264
+ maxWidth: number;
265
+ maxHeight: number;
266
+ constrainedBy: 'width' | 'height' | 'none';
267
+ }
268
+ /**
269
+ * Internal component-scoped service that provides viewport-aware constraints for a single dashboard.
270
+ * Each dashboard component gets its own instance of this service.
271
+ *
272
+ * This service is NOT part of the public API and should remain internal to the library.
273
+ */
274
+ declare class DashboardViewportService {
275
+ private readonly platformId;
276
+ private readonly destroyRef;
277
+ private readonly store;
278
+ private readonly viewportSize;
279
+ private readonly reservedSpace;
280
+ private resizeObserver;
281
+ constructor();
282
+ /**
283
+ * Initialize viewport size tracking using ResizeObserver on the window
284
+ */
285
+ private initializeViewportTracking;
286
+ /**
287
+ * Set reserved space that should be excluded from dashboard calculations
288
+ * (e.g., toolbar height, widget list width, padding)
289
+ */
290
+ setReservedSpace(space: ReservedSpace): void;
291
+ /**
292
+ * Get current viewport size
293
+ */
294
+ readonly currentViewportSize: _angular_core.Signal<ViewportSize>;
295
+ /**
296
+ * Get current reserved space
297
+ */
298
+ readonly currentReservedSpace: _angular_core.Signal<ReservedSpace>;
299
+ /**
300
+ * Calculate available space for dashboard after accounting for reserved areas
301
+ */
302
+ readonly availableSpace: _angular_core.Signal<ViewportSize>;
303
+ /**
304
+ * Calculate dashboard constraints for this dashboard instance
305
+ */
306
+ readonly constraints: _angular_core.Signal<DashboardConstraints>;
307
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DashboardViewportService, never>;
308
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<DashboardViewportService>;
309
+ }
310
+
311
+ declare class DashboardComponent implements OnChanges {
312
+ #private;
313
+ protected readonly store: {
314
+ dashboardId: _angular_core.Signal<string>;
315
+ rows: _angular_core.Signal<number>;
316
+ columns: _angular_core.Signal<number>;
317
+ gutterSize: _angular_core.Signal<string>;
318
+ isEditMode: _angular_core.Signal<boolean>;
319
+ gridCellDimensions: _ngrx_signals.DeepSignal<{
320
+ width: number;
321
+ height: number;
322
+ }>;
323
+ widgetsById: _angular_core.Signal<Record<string, _dragonworks_ngx_dashboard.CellData>>;
324
+ resizeData: _angular_core.Signal<ResizeData | null>;
325
+ dragData: _angular_core.Signal<_dragonworks_ngx_dashboard.DragData | null>;
326
+ hoveredDropZone: _angular_core.Signal<{
327
+ row: number;
328
+ col: number;
329
+ } | null>;
330
+ dashboardService: _dragonworks_ngx_dashboard.DashboardService;
331
+ cells: _angular_core.Signal<_dragonworks_ngx_dashboard.CellData[]>;
332
+ highlightedZones: _angular_core.Signal<{
333
+ row: number;
334
+ col: number;
335
+ }[]>;
336
+ highlightMap: _angular_core.Signal<Set<_dragonworks_ngx_dashboard.CellId>>;
337
+ invalidHighlightMap: _angular_core.Signal<Set<_dragonworks_ngx_dashboard.CellId>>;
338
+ isValidPlacement: _angular_core.Signal<boolean>;
339
+ resizePreviewCells: _angular_core.Signal<{
340
+ row: number;
341
+ col: number;
342
+ }[]>;
343
+ resizePreviewMap: _angular_core.Signal<Set<_dragonworks_ngx_dashboard.CellId>>;
344
+ setGridConfig: (config: {
345
+ rows?: number;
346
+ columns?: number;
347
+ gutterSize?: string;
348
+ }) => void;
349
+ setGridCellDimensions: (width: number, height: number) => void;
350
+ toggleEditMode: () => void;
351
+ setEditMode: (isEditMode: boolean) => void;
352
+ addWidget: (cell: _dragonworks_ngx_dashboard.CellData) => void;
353
+ removeWidget: (widgetId: _dragonworks_ngx_dashboard.WidgetId) => void;
354
+ updateWidgetPosition: (widgetId: _dragonworks_ngx_dashboard.WidgetId, row: number, col: number) => void;
355
+ createWidget: (row: number, col: number, widgetFactory: _dragonworks_ngx_dashboard.WidgetFactory, widgetState?: string) => void;
356
+ updateCellSettings: (widgetId: _dragonworks_ngx_dashboard.WidgetId, flat: boolean) => void;
357
+ updateWidgetSpan: (widgetId: _dragonworks_ngx_dashboard.WidgetId, rowSpan: number, colSpan: number) => void;
358
+ updateWidgetState: (widgetId: _dragonworks_ngx_dashboard.WidgetId, widgetState: unknown) => void;
359
+ updateAllWidgetStates: (cellStates: Map<string, unknown>) => void;
360
+ clearDashboard: () => void;
361
+ startDrag: (dragData: _dragonworks_ngx_dashboard.DragData) => void;
362
+ endDrag: () => void;
363
+ setHoveredDropZone: (zone: {
364
+ row: number;
365
+ col: number;
366
+ } | null) => void;
367
+ handleDrop: (dragData: _dragonworks_ngx_dashboard.DragData, targetPosition: {
368
+ row: number;
369
+ col: number;
370
+ }) => boolean;
371
+ startResize: (cellId: _dragonworks_ngx_dashboard.CellId) => void;
372
+ updateResizePreview: (direction: "horizontal" | "vertical", delta: number) => void;
373
+ endResize: (apply: boolean) => void;
374
+ exportDashboard: (getCurrentWidgetStates?: () => Map<string, unknown>) => DashboardDataDto;
375
+ loadDashboard: (data: DashboardDataDto) => void;
376
+ initializeFromDto: (dashboardData: DashboardDataDto) => void;
377
+ } & _ngrx_signals.StateSource<{
378
+ dashboardId: string;
379
+ rows: number;
380
+ columns: number;
381
+ gutterSize: string;
382
+ isEditMode: boolean;
383
+ gridCellDimensions: {
384
+ width: number;
385
+ height: number;
386
+ };
387
+ widgetsById: Record<string, _dragonworks_ngx_dashboard.CellData>;
388
+ resizeData: ResizeData | null;
389
+ dragData: _dragonworks_ngx_dashboard.DragData | null;
390
+ hoveredDropZone: {
391
+ row: number;
392
+ col: number;
393
+ } | null;
394
+ }>;
395
+ protected readonly viewport: DashboardViewportService;
396
+ dashboardData: _angular_core.InputSignal<DashboardDataDto>;
397
+ editMode: _angular_core.InputSignal<boolean>;
398
+ reservedSpace: _angular_core.InputSignal<ReservedSpace | undefined>;
399
+ cells: _angular_core.Signal<_dragonworks_ngx_dashboard.CellData[]>;
400
+ private dashboardEditor;
401
+ private dashboardViewer;
402
+ constructor();
403
+ ngOnChanges(changes: SimpleChanges): void;
404
+ exportDashboard(): DashboardDataDto;
405
+ loadDashboard(data: DashboardDataDto): void;
406
+ getCurrentDashboardData(): DashboardDataDto;
407
+ clearDashboard(): void;
408
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DashboardComponent, never>;
409
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DashboardComponent, "ngx-dashboard", never, { "dashboardData": { "alias": "dashboardData"; "required": true; "isSignal": true; }; "editMode": { "alias": "editMode"; "required": false; "isSignal": true; }; "reservedSpace": { "alias": "reservedSpace"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
410
+ }
411
+
412
+ declare class CellComponent {
413
+ #private;
414
+ widgetId: _angular_core.InputSignal<WidgetId>;
415
+ cellId: _angular_core.InputSignal<CellId>;
416
+ widgetFactory: _angular_core.InputSignal<WidgetFactory<Widget> | undefined>;
417
+ widgetState: _angular_core.InputSignal<unknown>;
418
+ isEditMode: _angular_core.InputSignal<boolean>;
419
+ flat: _angular_core.InputSignal<boolean | undefined>;
420
+ row: _angular_core.ModelSignal<number>;
421
+ column: _angular_core.ModelSignal<number>;
422
+ rowSpan: _angular_core.InputSignal<number>;
423
+ colSpan: _angular_core.InputSignal<number>;
424
+ draggable: _angular_core.InputSignal<boolean>;
425
+ dragStart: _angular_core.OutputEmitterRef<DragData>;
426
+ dragEnd: _angular_core.OutputEmitterRef<void>;
427
+ edit: _angular_core.OutputEmitterRef<WidgetId>;
428
+ delete: _angular_core.OutputEmitterRef<WidgetId>;
429
+ settings: _angular_core.OutputEmitterRef<{
430
+ id: WidgetId;
431
+ flat: boolean;
432
+ }>;
433
+ resizeStart: _angular_core.OutputEmitterRef<{
434
+ cellId: CellId;
435
+ direction: "horizontal" | "vertical";
436
+ }>;
437
+ resizeMove: _angular_core.OutputEmitterRef<{
438
+ cellId: CellId;
439
+ direction: "horizontal" | "vertical";
440
+ delta: number;
441
+ }>;
442
+ resizeEnd: _angular_core.OutputEmitterRef<{
443
+ cellId: CellId;
444
+ apply: boolean;
445
+ }>;
446
+ private container;
447
+ isDragging: _angular_core.WritableSignal<boolean>;
448
+ readonly gridRowStyle: _angular_core.Signal<string>;
449
+ readonly gridColumnStyle: _angular_core.Signal<string>;
450
+ isResizing: _angular_core.Signal<boolean>;
451
+ isDragActive: _angular_core.Signal<boolean>;
452
+ resizeData: _angular_core.Signal<ResizeData | null>;
453
+ gridCellDimensions: _ngrx_signals.DeepSignal<{
454
+ width: number;
455
+ height: number;
456
+ }>;
457
+ private resizeDirection;
458
+ private resizeStartPos;
459
+ constructor();
460
+ /**
461
+ * Setup document-level event listeners for resize operations
462
+ * Performance: Only creates listeners when actively resizing (not for every cell)
463
+ * Angular-idiomatic: Uses Renderer2 for dynamic listener management
464
+ */
465
+ private setupDocumentListeners;
466
+ setPosition(row: number, column: number): void;
467
+ onDragStart(event: DragEvent): void;
468
+ onDragEnd(): void;
469
+ /**
470
+ * Handle context menu events (called from template)
471
+ * Performance: Element-specific event binding, not document-level
472
+ * Angular-idiomatic: Template event binding instead of fromEvent
473
+ */
474
+ onContextMenu(event: MouseEvent): void;
475
+ canEdit(): boolean;
476
+ onEdit(): void;
477
+ onDelete(): void;
478
+ onSettings(): Promise<void>;
479
+ /**
480
+ * Start resize operation and setup document listeners
481
+ * Performance: Only THIS cell creates document listeners when actively resizing
482
+ * RxJS-free: Uses Renderer2 for dynamic listener management
483
+ */
484
+ onResizeStart(event: MouseEvent, direction: 'horizontal' | 'vertical'): void;
485
+ /**
486
+ * Handle resize move events (called from document listener)
487
+ * Performance: Only called for the actively resizing cell
488
+ * Bound method: Maintains component context without arrow functions
489
+ */
490
+ private handleResizeMove;
491
+ /**
492
+ * Handle resize end events (called from document listener)
493
+ * Performance: Cleans up document listeners immediately after resize
494
+ * State cleanup: Resets resize direction to stop further event processing
495
+ */
496
+ private handleResizeEnd;
497
+ /**
498
+ * Get the current widget state by calling dashboardGetState() on the widget instance.
499
+ * Used during dashboard export to get live widget state instead of stale stored state.
500
+ */
501
+ getCurrentWidgetState(): unknown | undefined;
502
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CellComponent, never>;
503
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CellComponent, "lib-cell", never, { "widgetId": { "alias": "widgetId"; "required": true; "isSignal": true; }; "cellId": { "alias": "cellId"; "required": true; "isSignal": true; }; "widgetFactory": { "alias": "widgetFactory"; "required": false; "isSignal": true; }; "widgetState": { "alias": "widgetState"; "required": false; "isSignal": true; }; "isEditMode": { "alias": "isEditMode"; "required": false; "isSignal": true; }; "flat": { "alias": "flat"; "required": false; "isSignal": true; }; "row": { "alias": "row"; "required": true; "isSignal": true; }; "column": { "alias": "column"; "required": true; "isSignal": true; }; "rowSpan": { "alias": "rowSpan"; "required": false; "isSignal": true; }; "colSpan": { "alias": "colSpan"; "required": false; "isSignal": true; }; "draggable": { "alias": "draggable"; "required": false; "isSignal": true; }; }, { "row": "rowChange"; "column": "columnChange"; "dragStart": "dragStart"; "dragEnd": "dragEnd"; "edit": "edit"; "delete": "delete"; "settings": "settings"; "resizeStart": "resizeStart"; "resizeMove": "resizeMove"; "resizeEnd": "resizeEnd"; }, never, never, true, never>;
504
+ }
505
+
506
+ declare class DropZoneComponent {
507
+ #private;
508
+ row: _angular_core.InputSignal<number>;
509
+ col: _angular_core.InputSignal<number>;
510
+ index: _angular_core.InputSignal<number>;
511
+ highlight: _angular_core.InputSignal<boolean>;
512
+ highlightInvalid: _angular_core.InputSignal<boolean>;
513
+ highlightResize: _angular_core.InputSignal<boolean>;
514
+ editMode: _angular_core.InputSignal<boolean>;
515
+ dragEnter: _angular_core.OutputEmitterRef<{
516
+ row: number;
517
+ col: number;
518
+ }>;
519
+ dragExit: _angular_core.OutputEmitterRef<void>;
520
+ dragOver: _angular_core.OutputEmitterRef<{
521
+ row: number;
522
+ col: number;
523
+ }>;
524
+ dragDrop: _angular_core.OutputEmitterRef<{
525
+ data: DragData;
526
+ target: {
527
+ row: number;
528
+ col: number;
529
+ };
530
+ }>;
531
+ dropZoneId: _angular_core.Signal<string>;
532
+ dropData: _angular_core.Signal<{
533
+ row: number;
534
+ col: number;
535
+ }>;
536
+ dragData: _angular_core.Signal<DragData | null>;
537
+ dropEffect: _angular_core.Signal<"none" | "copy" | "move">;
538
+ get nativeElement(): HTMLElement;
539
+ onDragEnter(event: DragEvent): void;
540
+ onDragOver(event: DragEvent): void;
541
+ onDragLeave(event: DragEvent): void;
542
+ onDrop(event: DragEvent): void;
543
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DropZoneComponent, never>;
544
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DropZoneComponent, "lib-drop-zone", never, { "row": { "alias": "row"; "required": true; "isSignal": true; }; "col": { "alias": "col"; "required": true; "isSignal": true; }; "index": { "alias": "index"; "required": true; "isSignal": true; }; "highlight": { "alias": "highlight"; "required": false; "isSignal": true; }; "highlightInvalid": { "alias": "highlightInvalid"; "required": false; "isSignal": true; }; "highlightResize": { "alias": "highlightResize"; "required": false; "isSignal": true; }; "editMode": { "alias": "editMode"; "required": false; "isSignal": true; }; }, { "dragEnter": "dragEnter"; "dragExit": "dragExit"; "dragOver": "dragOver"; "dragDrop": "dragDrop"; }, never, never, true, never>;
545
+ }
546
+
547
+ declare class DashboardEditorComponent {
548
+ #private;
549
+ bottomGridRef: _angular_core.Signal<ElementRef<HTMLDivElement>>;
550
+ dropZones: _angular_core.Signal<readonly DropZoneComponent[]>;
551
+ cellComponents: _angular_core.Signal<readonly CellComponent[]>;
552
+ rows: _angular_core.InputSignal<number>;
553
+ columns: _angular_core.InputSignal<number>;
554
+ gutterSize: _angular_core.InputSignal<string>;
555
+ gutters: _angular_core.Signal<number>;
556
+ cells: _angular_core.Signal<CellData[]>;
557
+ highlightedZones: _angular_core.Signal<{
558
+ row: number;
559
+ col: number;
560
+ }[]>;
561
+ highlightMap: _angular_core.Signal<Set<CellId>>;
562
+ invalidHighlightMap: _angular_core.Signal<Set<CellId>>;
563
+ hoveredDropZone: _angular_core.Signal<{
564
+ row: number;
565
+ col: number;
566
+ } | null>;
567
+ resizePreviewMap: _angular_core.Signal<Set<CellId>>;
568
+ dropzonePositions: _angular_core.Signal<{
569
+ row: number;
570
+ col: number;
571
+ id: string;
572
+ index: number;
573
+ }[]>;
574
+ createCellId(row: number, col: number): CellId;
575
+ constructor();
576
+ addWidget: (cellData: CellData) => void;
577
+ updateCellPosition: (id: WidgetId, row: number, column: number) => void;
578
+ updateCellSpan: (id: WidgetId, colSpan: number, rowSpan: number) => void;
579
+ updateCellSettings: (id: WidgetId, flat: boolean) => void;
580
+ onDragOver: (event: {
581
+ row: number;
582
+ col: number;
583
+ }) => void;
584
+ onDragEnter: (event: {
585
+ row: number;
586
+ col: number;
587
+ }) => void;
588
+ onDragExit: () => void;
589
+ dragEnd: () => void;
590
+ onCellDelete: (id: WidgetId) => void;
591
+ onCellSettings: (event: {
592
+ id: WidgetId;
593
+ flat: boolean;
594
+ }) => void;
595
+ onCellResize: (event: {
596
+ id: WidgetId;
597
+ rowSpan: number;
598
+ colSpan: number;
599
+ }) => void;
600
+ onCellDragStart: (dragData: DragData) => void;
601
+ onCellResizeStart: (event: {
602
+ cellId: CellId;
603
+ direction: "horizontal" | "vertical";
604
+ }) => void;
605
+ onCellResizeMove: (event: {
606
+ cellId: CellId;
607
+ direction: "horizontal" | "vertical";
608
+ delta: number;
609
+ }) => void;
610
+ onCellResizeEnd: (event: {
611
+ cellId: CellId;
612
+ apply: boolean;
613
+ }) => void;
614
+ onDragDrop(event: {
615
+ data: DragData;
616
+ target: {
617
+ row: number;
618
+ col: number;
619
+ };
620
+ }): void;
621
+ /**
622
+ * Get current widget states from all cell components.
623
+ * Used during dashboard export to get live widget states.
624
+ */
625
+ getCurrentWidgetStates(): Map<string, unknown>;
626
+ /**
627
+ * Export dashboard with live widget states from current component instances.
628
+ * This ensures the most up-to-date widget states are captured.
629
+ */
630
+ exportDashboard(): _dragonworks_ngx_dashboard.DashboardDataDto;
631
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DashboardEditorComponent, never>;
632
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DashboardEditorComponent, "ngx-dashboard-editor", never, { "rows": { "alias": "rows"; "required": true; "isSignal": true; }; "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "gutterSize": { "alias": "gutterSize"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
633
+ }
634
+
635
+ declare class DashboardViewerComponent {
636
+ #private;
637
+ cellComponents: _angular_core.Signal<readonly CellComponent[]>;
638
+ rows: _angular_core.InputSignal<number>;
639
+ columns: _angular_core.InputSignal<number>;
640
+ gutterSize: _angular_core.InputSignal<string>;
641
+ gutters: _angular_core.Signal<number>;
642
+ cells: _angular_core.Signal<_dragonworks_ngx_dashboard.CellData[]>;
643
+ constructor();
644
+ /**
645
+ * Get current widget states from all cell components.
646
+ * Used during dashboard export to get live widget states.
647
+ */
648
+ getCurrentWidgetStates(): Map<string, unknown>;
649
+ /**
650
+ * Export dashboard with live widget states from current component instances.
651
+ * This ensures the most up-to-date widget states are captured.
652
+ */
653
+ exportDashboard(): _dragonworks_ngx_dashboard.DashboardDataDto;
654
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DashboardViewerComponent, never>;
655
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DashboardViewerComponent, "ngx-dashboard-viewer", never, { "rows": { "alias": "rows"; "required": true; "isSignal": true; }; "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "gutterSize": { "alias": "gutterSize"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
656
+ }
657
+
658
+ interface WidgetDisplayItem extends WidgetMetadata {
659
+ safeSvgIcon?: SafeHtml;
660
+ }
661
+ declare class WidgetListComponent {
662
+ #private;
663
+ activeWidget: _angular_core.WritableSignal<string | null>;
664
+ gridCellDimensions: _angular_core.Signal<{
665
+ width: number;
666
+ height: number;
667
+ }>;
668
+ widgets: _angular_core.Signal<{
669
+ safeSvgIcon: SafeHtml;
670
+ widgetTypeid: string;
671
+ name: string;
672
+ description: string;
673
+ svgIcon: string;
674
+ }[]>;
675
+ onDragStart(event: DragEvent, widget: WidgetDisplayItem): void;
676
+ onDragEnd(): void;
677
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<WidgetListComponent, never>;
678
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<WidgetListComponent, "ngx-dashboard-widget-list", never, {}, {}, never, never, true, never>;
679
+ }
680
+
681
+ declare class DashboardService {
682
+ #private;
683
+ readonly widgetTypes: _angular_core.Signal<WidgetComponentClass<_dragonworks_ngx_dashboard.Widget>[]>;
684
+ registerWidgetType(widget: WidgetComponentClass): void;
685
+ getFactory(widgetTypeid: string): WidgetFactory;
686
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DashboardService, never>;
687
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<DashboardService>;
688
+ }
689
+
690
+ /**
691
+ * Abstract provider for cell settings dialogs.
692
+ * Implement this to provide custom dialog solutions.
693
+ */
694
+ declare abstract class CellSettingsDialogProvider {
695
+ /**
696
+ * Open a settings dialog for the given cell.
697
+ * Returns a promise that resolves to the new settings, or undefined if cancelled.
698
+ */
699
+ abstract openCellSettings(data: CellDisplayData): Promise<CellDisplayData | undefined>;
700
+ }
701
+
702
+ /**
703
+ * Default cell dialog provider that uses Material Design dialogs.
704
+ * Provides a modern, accessible dialog experience for cell settings.
705
+ */
706
+ declare class DefaultCellSettingsDialogProvider extends CellSettingsDialogProvider {
707
+ private dialog;
708
+ openCellSettings(data: CellDisplayData): Promise<CellDisplayData | undefined>;
709
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DefaultCellSettingsDialogProvider, never>;
710
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<DefaultCellSettingsDialogProvider>;
711
+ }
712
+
713
+ /**
714
+ * Injection token for the cell dialog provider.
715
+ * Use this to provide your custom dialog implementation.
716
+ *
717
+ * @example
718
+ * ```typescript
719
+ * providers: [
720
+ * { provide: CELL_SETTINGS_DIALOG_PROVIDER, useClass: MyCellSettingsDialogProvider }
721
+ * ]
722
+ * ```
723
+ */
724
+ declare const CELL_SETTINGS_DIALOG_PROVIDER: InjectionToken<CellSettingsDialogProvider>;
725
+
726
+ export { CELL_SETTINGS_DIALOG_PROVIDER, CellIdUtils, CellSettingsDialogProvider, DEFAULT_RESERVED_SPACE, DashboardComponent, DashboardEditorComponent, DashboardService, DashboardViewerComponent, DefaultCellSettingsDialogProvider, WidgetIdUtils, WidgetListComponent, createDefaultDashboard, createEmptyDashboard, createFactoryFromComponent };
727
+ export type { CellComponentPosition, CellData, CellDataDto, CellDisplayData, CellId, CellPosition, DashboardDataDto, DragData, ReservedSpace, Widget, WidgetComponentClass, WidgetFactory, WidgetId, WidgetMetadata };