dockview-angular 4.13.1 → 5.0.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 (133) hide show
  1. package/README.md +49 -17
  2. package/dist/README.md +88 -0
  3. package/dist/dockview-angular.d.ts.map +1 -0
  4. package/dist/dockview.css +63 -7
  5. package/dist/esm2022/dockview-angular.mjs +5 -0
  6. package/dist/esm2022/lib/dockview/dockview-angular.component.mjs +185 -0
  7. package/dist/esm2022/lib/dockview/types.mjs +3 -0
  8. package/dist/esm2022/lib/dockview-angular.module.mjs +38 -0
  9. package/dist/esm2022/lib/gridview/angular-gridview-panel.mjs +24 -0
  10. package/dist/esm2022/lib/gridview/gridview-angular.component.mjs +98 -0
  11. package/dist/esm2022/lib/gridview/types.mjs +3 -0
  12. package/dist/esm2022/lib/paneview/angular-pane-part.mjs +26 -0
  13. package/dist/esm2022/lib/paneview/paneview-angular.component.mjs +122 -0
  14. package/dist/esm2022/lib/paneview/types.mjs +3 -0
  15. package/dist/esm2022/lib/splitview/angular-splitview-panel.mjs +24 -0
  16. package/dist/esm2022/lib/splitview/splitview-angular.component.mjs +98 -0
  17. package/dist/esm2022/lib/splitview/types.mjs +3 -0
  18. package/dist/esm2022/lib/utils/angular-renderer.mjs +83 -0
  19. package/dist/esm2022/lib/utils/component-factory.mjs +100 -0
  20. package/dist/esm2022/lib/utils/lifecycle-utils.mjs +69 -0
  21. package/dist/esm2022/public-api.mjs +17 -0
  22. package/dist/fesm2022/dockview-angular.mjs +846 -0
  23. package/dist/fesm2022/dockview-angular.mjs.map +1 -0
  24. package/dist/index.d.ts +6 -0
  25. package/dist/{cjs/lib → lib}/dockview/dockview-angular.component.d.ts +4 -0
  26. package/dist/lib/dockview/dockview-angular.component.d.ts.map +1 -0
  27. package/dist/{cjs/lib → lib}/dockview/types.d.ts +2 -1
  28. package/dist/lib/dockview/types.d.ts.map +1 -0
  29. package/dist/lib/dockview-angular.module.d.ts +12 -0
  30. package/dist/lib/dockview-angular.module.d.ts.map +1 -0
  31. package/dist/{cjs/lib → lib}/gridview/angular-gridview-panel.d.ts +1 -0
  32. package/dist/lib/gridview/angular-gridview-panel.d.ts.map +1 -0
  33. package/dist/{esm/lib → lib}/gridview/gridview-angular.component.d.ts +4 -0
  34. package/dist/lib/gridview/gridview-angular.component.d.ts.map +1 -0
  35. package/dist/{esm/lib → lib}/gridview/types.d.ts +1 -0
  36. package/dist/lib/gridview/types.d.ts.map +1 -0
  37. package/dist/{esm/lib → lib}/paneview/angular-pane-part.d.ts +1 -0
  38. package/dist/lib/paneview/angular-pane-part.d.ts.map +1 -0
  39. package/dist/{esm/lib → lib}/paneview/paneview-angular.component.d.ts +4 -0
  40. package/dist/lib/paneview/paneview-angular.component.d.ts.map +1 -0
  41. package/dist/{esm/lib → lib}/paneview/types.d.ts +1 -0
  42. package/dist/lib/paneview/types.d.ts.map +1 -0
  43. package/dist/{cjs/lib → lib}/splitview/angular-splitview-panel.d.ts +1 -0
  44. package/dist/lib/splitview/angular-splitview-panel.d.ts.map +1 -0
  45. package/dist/{cjs/lib → lib}/splitview/splitview-angular.component.d.ts +4 -0
  46. package/dist/lib/splitview/splitview-angular.component.d.ts.map +1 -0
  47. package/dist/{cjs/lib → lib}/splitview/types.d.ts +1 -0
  48. package/dist/lib/splitview/types.d.ts.map +1 -0
  49. package/dist/lib/utils/angular-renderer.d.ts +21 -0
  50. package/dist/lib/utils/angular-renderer.d.ts.map +1 -0
  51. package/dist/{cjs/lib → lib}/utils/component-factory.d.ts +1 -0
  52. package/dist/lib/utils/component-factory.d.ts.map +1 -0
  53. package/dist/{cjs/lib → lib}/utils/lifecycle-utils.d.ts +1 -0
  54. package/dist/lib/utils/lifecycle-utils.d.ts.map +1 -0
  55. package/dist/{cjs/public-api.d.ts → public-api.d.ts} +5 -4
  56. package/dist/public-api.d.ts.map +1 -0
  57. package/package.json +72 -66
  58. package/dist/cjs/index.d.ts +0 -1
  59. package/dist/cjs/index.js +0 -17
  60. package/dist/cjs/lib/dockview/dockview-angular.component.js +0 -256
  61. package/dist/cjs/lib/dockview/types.js +0 -8
  62. package/dist/cjs/lib/dockview-angular.module.d.ts +0 -2
  63. package/dist/cjs/lib/dockview-angular.module.js +0 -35
  64. package/dist/cjs/lib/gridview/angular-gridview-panel.js +0 -21
  65. package/dist/cjs/lib/gridview/gridview-angular.component.d.ts +0 -28
  66. package/dist/cjs/lib/gridview/gridview-angular.component.js +0 -140
  67. package/dist/cjs/lib/gridview/types.d.ts +0 -12
  68. package/dist/cjs/lib/gridview/types.js +0 -6
  69. package/dist/cjs/lib/paneview/angular-pane-part.d.ts +0 -13
  70. package/dist/cjs/lib/paneview/angular-pane-part.js +0 -29
  71. package/dist/cjs/lib/paneview/paneview-angular.component.d.ts +0 -31
  72. package/dist/cjs/lib/paneview/paneview-angular.component.js +0 -166
  73. package/dist/cjs/lib/paneview/types.d.ts +0 -14
  74. package/dist/cjs/lib/paneview/types.js +0 -6
  75. package/dist/cjs/lib/splitview/angular-splitview-panel.js +0 -21
  76. package/dist/cjs/lib/splitview/splitview-angular.component.js +0 -140
  77. package/dist/cjs/lib/splitview/types.js +0 -6
  78. package/dist/cjs/lib/utils/angular-renderer.d.ts +0 -18
  79. package/dist/cjs/lib/utils/angular-renderer.js +0 -70
  80. package/dist/cjs/lib/utils/component-factory.js +0 -103
  81. package/dist/cjs/lib/utils/lifecycle-utils.js +0 -74
  82. package/dist/cjs/public-api.js +0 -32
  83. package/dist/dockview-angular.amd.js +0 -13209
  84. package/dist/dockview-angular.amd.js.map +0 -1
  85. package/dist/dockview-angular.amd.min.js +0 -8
  86. package/dist/dockview-angular.amd.min.js.map +0 -1
  87. package/dist/dockview-angular.amd.min.noStyle.js +0 -8
  88. package/dist/dockview-angular.amd.min.noStyle.js.map +0 -1
  89. package/dist/dockview-angular.amd.noStyle.js +0 -13179
  90. package/dist/dockview-angular.amd.noStyle.js.map +0 -1
  91. package/dist/dockview-angular.cjs.js +0 -13211
  92. package/dist/dockview-angular.cjs.js.map +0 -1
  93. package/dist/dockview-angular.esm.js +0 -13139
  94. package/dist/dockview-angular.esm.js.map +0 -1
  95. package/dist/dockview-angular.esm.min.js +0 -8
  96. package/dist/dockview-angular.esm.min.js.map +0 -1
  97. package/dist/dockview-angular.js +0 -13213
  98. package/dist/dockview-angular.js.map +0 -1
  99. package/dist/dockview-angular.min.js +0 -8
  100. package/dist/dockview-angular.min.js.map +0 -1
  101. package/dist/dockview-angular.min.noStyle.js +0 -8
  102. package/dist/dockview-angular.min.noStyle.js.map +0 -1
  103. package/dist/dockview-angular.noStyle.js +0 -13183
  104. package/dist/dockview-angular.noStyle.js.map +0 -1
  105. package/dist/esm/index.d.ts +0 -1
  106. package/dist/esm/index.js +0 -1
  107. package/dist/esm/lib/dockview/dockview-angular.component.d.ts +0 -49
  108. package/dist/esm/lib/dockview/dockview-angular.component.js +0 -253
  109. package/dist/esm/lib/dockview/types.d.ts +0 -27
  110. package/dist/esm/lib/dockview/types.js +0 -2
  111. package/dist/esm/lib/dockview-angular.module.d.ts +0 -2
  112. package/dist/esm/lib/dockview-angular.module.js +0 -32
  113. package/dist/esm/lib/gridview/angular-gridview-panel.d.ts +0 -9
  114. package/dist/esm/lib/gridview/angular-gridview-panel.js +0 -17
  115. package/dist/esm/lib/gridview/gridview-angular.component.js +0 -137
  116. package/dist/esm/lib/gridview/types.js +0 -2
  117. package/dist/esm/lib/paneview/angular-pane-part.js +0 -25
  118. package/dist/esm/lib/paneview/paneview-angular.component.js +0 -163
  119. package/dist/esm/lib/paneview/types.js +0 -2
  120. package/dist/esm/lib/splitview/angular-splitview-panel.d.ts +0 -9
  121. package/dist/esm/lib/splitview/angular-splitview-panel.js +0 -17
  122. package/dist/esm/lib/splitview/splitview-angular.component.d.ts +0 -28
  123. package/dist/esm/lib/splitview/splitview-angular.component.js +0 -137
  124. package/dist/esm/lib/splitview/types.d.ts +0 -12
  125. package/dist/esm/lib/splitview/types.js +0 -2
  126. package/dist/esm/lib/utils/angular-renderer.d.ts +0 -18
  127. package/dist/esm/lib/utils/angular-renderer.js +0 -66
  128. package/dist/esm/lib/utils/component-factory.d.ts +0 -20
  129. package/dist/esm/lib/utils/component-factory.js +0 -99
  130. package/dist/esm/lib/utils/lifecycle-utils.d.ts +0 -18
  131. package/dist/esm/lib/utils/lifecycle-utils.js +0 -68
  132. package/dist/esm/public-api.d.ts +0 -13
  133. package/dist/esm/public-api.js +0 -16
@@ -0,0 +1,846 @@
1
+ import { GridviewPanel, SplitviewPanel, PROPERTY_KEYS_DOCKVIEW, createDockview, PROPERTY_KEYS_GRIDVIEW, createGridview, PROPERTY_KEYS_PANEVIEW, createPaneview, PROPERTY_KEYS_SPLITVIEW, createSplitview } from 'dockview-core';
2
+ export * from 'dockview-core';
3
+ import * as i0 from '@angular/core';
4
+ import { ApplicationRef, createComponent, EventEmitter, inject, Injector, EnvironmentInjector, Output, Input, ViewChild, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
5
+ import { CommonModule } from '@angular/common';
6
+ import { Subject } from 'rxjs';
7
+ import { takeUntil } from 'rxjs/operators';
8
+
9
+ class AngularRenderer {
10
+ constructor(options) {
11
+ this.options = options;
12
+ this.componentRef = null;
13
+ this._element = null;
14
+ this.appRef = options.injector.get(ApplicationRef);
15
+ }
16
+ get element() {
17
+ if (!this._element) {
18
+ throw new Error('Angular renderer not initialized');
19
+ }
20
+ return this._element;
21
+ }
22
+ get component() {
23
+ return this.componentRef;
24
+ }
25
+ init(parameters) {
26
+ // Only forward params, api, and containerApi to the component
27
+ // (matching the React renderer). Other init parameters like
28
+ // 'title' are internal to the framework.
29
+ const filtered = {};
30
+ if ('params' in parameters) {
31
+ filtered['params'] = parameters['params'];
32
+ }
33
+ if ('api' in parameters) {
34
+ filtered['api'] = parameters['api'];
35
+ }
36
+ if ('containerApi' in parameters) {
37
+ filtered['containerApi'] = parameters['containerApi'];
38
+ }
39
+ if (this.componentRef) {
40
+ this.update(filtered);
41
+ }
42
+ else {
43
+ this.render(filtered);
44
+ }
45
+ }
46
+ update(params) {
47
+ if (!this.componentRef) {
48
+ return;
49
+ }
50
+ const instance = this.componentRef.instance;
51
+ for (const key of Object.keys(params)) {
52
+ if (key in instance) {
53
+ instance[key] = params[key];
54
+ }
55
+ }
56
+ // trigger change detection
57
+ this.componentRef.changeDetectorRef.markForCheck();
58
+ }
59
+ render(parameters) {
60
+ try {
61
+ // Create the component using modern Angular API
62
+ this.componentRef = createComponent(this.options.component, {
63
+ environmentInjector: this.options.environmentInjector ||
64
+ this.options.injector,
65
+ elementInjector: this.options.injector,
66
+ });
67
+ // Set initial parameters
68
+ this.update(parameters);
69
+ // Get the DOM element
70
+ const hostView = this.componentRef.hostView;
71
+ this._element = hostView.rootNodes[0];
72
+ // attach to change detection
73
+ this.appRef.attachView(hostView);
74
+ // trigger change detection
75
+ this.componentRef.changeDetectorRef.markForCheck();
76
+ }
77
+ catch (error) {
78
+ console.error('Error creating Angular component:', error);
79
+ throw error;
80
+ }
81
+ }
82
+ dispose() {
83
+ if (this.componentRef) {
84
+ this.componentRef.destroy();
85
+ this.componentRef = null;
86
+ }
87
+ this._element = null;
88
+ }
89
+ }
90
+
91
+ class AngularGridviewPanel extends GridviewPanel {
92
+ constructor(id, component, angularComponent, injector, environmentInjector) {
93
+ super(id, component);
94
+ this.angularComponent = angularComponent;
95
+ this.injector = injector;
96
+ this.environmentInjector = environmentInjector;
97
+ }
98
+ getComponent() {
99
+ const renderer = new AngularRenderer({
100
+ component: this.angularComponent,
101
+ injector: this.injector,
102
+ environmentInjector: this.environmentInjector,
103
+ });
104
+ renderer.init({
105
+ params: this._params?.params ?? {},
106
+ api: this.api,
107
+ });
108
+ this.element.appendChild(renderer.element);
109
+ return renderer;
110
+ }
111
+ }
112
+
113
+ class AngularSplitviewPanel extends SplitviewPanel {
114
+ constructor(id, component, angularComponent, injector, environmentInjector) {
115
+ super(id, component);
116
+ this.angularComponent = angularComponent;
117
+ this.injector = injector;
118
+ this.environmentInjector = environmentInjector;
119
+ }
120
+ getComponent() {
121
+ const renderer = new AngularRenderer({
122
+ component: this.angularComponent,
123
+ injector: this.injector,
124
+ environmentInjector: this.environmentInjector,
125
+ });
126
+ renderer.init({
127
+ params: this._params?.params ?? {},
128
+ api: this.api,
129
+ });
130
+ this.element.appendChild(renderer.element);
131
+ return renderer;
132
+ }
133
+ }
134
+
135
+ class AngularPanePart {
136
+ constructor(angularComponent, injector, environmentInjector) {
137
+ this.angularComponent = angularComponent;
138
+ this.injector = injector;
139
+ this.environmentInjector = environmentInjector;
140
+ this.renderer = new AngularRenderer({
141
+ component: this.angularComponent,
142
+ injector: this.injector,
143
+ environmentInjector: this.environmentInjector,
144
+ });
145
+ }
146
+ get element() {
147
+ return this.renderer.element;
148
+ }
149
+ init(parameters) {
150
+ this.renderer.init(parameters);
151
+ }
152
+ update(params) {
153
+ this.renderer.update(params);
154
+ }
155
+ dispose() {
156
+ this.renderer.dispose();
157
+ }
158
+ }
159
+
160
+ class AngularFrameworkComponentFactory {
161
+ constructor(components, injector, environmentInjector, tabComponents, watermarkComponent, headerActionsComponents, defaultTabComponent) {
162
+ this.components = components;
163
+ this.injector = injector;
164
+ this.environmentInjector = environmentInjector;
165
+ this.tabComponents = tabComponents;
166
+ this.watermarkComponent = watermarkComponent;
167
+ this.headerActionsComponents = headerActionsComponents;
168
+ this.defaultTabComponent = defaultTabComponent;
169
+ }
170
+ // For DockviewComponent
171
+ createDockviewComponent(options) {
172
+ const component = this.components[options.name];
173
+ if (!component) {
174
+ throw new Error(`Component '${options.name}' not found in component registry`);
175
+ }
176
+ const renderer = new AngularRenderer({
177
+ component,
178
+ injector: this.injector,
179
+ environmentInjector: this.environmentInjector,
180
+ });
181
+ renderer.init(options);
182
+ return renderer;
183
+ }
184
+ // For GridviewComponent
185
+ createGridviewComponent(options) {
186
+ const component = this.components[options.name];
187
+ if (!component) {
188
+ throw new Error(`Component '${options.name}' not found in component registry`);
189
+ }
190
+ return new AngularGridviewPanel(options.id, options.name, component, this.injector, this.environmentInjector);
191
+ }
192
+ // For SplitviewComponent
193
+ createSplitviewComponent(options) {
194
+ const component = this.components[options.name];
195
+ if (!component) {
196
+ throw new Error(`Component '${options.name}' not found in component registry`);
197
+ }
198
+ return new AngularSplitviewPanel(options.id, options.name, component, this.injector, this.environmentInjector);
199
+ }
200
+ // For PaneviewComponent
201
+ createPaneviewComponent(options) {
202
+ const component = this.components[options.name];
203
+ if (!component) {
204
+ throw new Error(`Component '${options.name}' not found in component registry`);
205
+ }
206
+ return new AngularPanePart(component, this.injector, this.environmentInjector);
207
+ }
208
+ // Legacy method for backward compatibility
209
+ createComponent(options) {
210
+ return this.createDockviewComponent(options);
211
+ }
212
+ createTabComponent(options) {
213
+ let component = this.tabComponents?.[options.name];
214
+ if (!component && this.defaultTabComponent) {
215
+ component = this.defaultTabComponent;
216
+ }
217
+ if (!component) {
218
+ return undefined;
219
+ }
220
+ const renderer = new AngularRenderer({
221
+ component,
222
+ injector: this.injector,
223
+ environmentInjector: this.environmentInjector,
224
+ });
225
+ renderer.init(options);
226
+ return renderer;
227
+ }
228
+ createWatermarkComponent() {
229
+ if (!this.watermarkComponent) {
230
+ throw new Error('Watermark component not provided');
231
+ }
232
+ const renderer = new AngularRenderer({
233
+ component: this.watermarkComponent,
234
+ injector: this.injector,
235
+ environmentInjector: this.environmentInjector,
236
+ });
237
+ renderer.init({});
238
+ return renderer;
239
+ }
240
+ createHeaderActionsComponent(name) {
241
+ const component = this.headerActionsComponents?.[name];
242
+ if (!component) {
243
+ return undefined;
244
+ }
245
+ const renderer = new AngularRenderer({
246
+ component,
247
+ injector: this.injector,
248
+ environmentInjector: this.environmentInjector,
249
+ });
250
+ // Initialize with empty props - dockview-core will call init() again with actual IGroupHeaderProps
251
+ renderer.init({});
252
+ return renderer;
253
+ }
254
+ }
255
+
256
+ class AngularDisposable {
257
+ constructor() {
258
+ this._isDisposed = false;
259
+ this.disposeCallbacks = [];
260
+ }
261
+ get isDisposed() {
262
+ return this._isDisposed;
263
+ }
264
+ addDisposeCallback(callback) {
265
+ if (this._isDisposed) {
266
+ callback();
267
+ return;
268
+ }
269
+ this.disposeCallbacks.push(callback);
270
+ }
271
+ dispose() {
272
+ if (this._isDisposed) {
273
+ return;
274
+ }
275
+ this._isDisposed = true;
276
+ this.disposeCallbacks.forEach((callback) => {
277
+ try {
278
+ callback();
279
+ }
280
+ catch (error) {
281
+ console.error('Error in dispose callback:', error);
282
+ }
283
+ });
284
+ this.disposeCallbacks = [];
285
+ }
286
+ }
287
+ class AngularLifecycleManager {
288
+ constructor() {
289
+ this.destroySubject = new Subject();
290
+ this.disposables = [];
291
+ }
292
+ get destroy$() {
293
+ return this.destroySubject.asObservable();
294
+ }
295
+ addDisposable(disposable) {
296
+ this.disposables.push(disposable);
297
+ }
298
+ takeUntilDestroy() {
299
+ return takeUntil(this.destroySubject);
300
+ }
301
+ destroy() {
302
+ this.destroySubject.next();
303
+ this.destroySubject.complete();
304
+ this.disposables.forEach((disposable) => {
305
+ try {
306
+ disposable.dispose();
307
+ }
308
+ catch (error) {
309
+ console.error('Error disposing resource:', error);
310
+ }
311
+ });
312
+ this.disposables = [];
313
+ }
314
+ }
315
+ function createAngularDisposable(disposeCallback) {
316
+ const disposable = new AngularDisposable();
317
+ if (disposeCallback) {
318
+ disposable.addDisposeCallback(disposeCallback);
319
+ }
320
+ return disposable;
321
+ }
322
+
323
+ class DockviewAngularComponent {
324
+ constructor() {
325
+ this.ready = new EventEmitter();
326
+ this.didDrop = new EventEmitter();
327
+ this.willDrop = new EventEmitter();
328
+ this.lifecycleManager = new AngularLifecycleManager();
329
+ this.injector = inject(Injector);
330
+ this.environmentInjector = inject(EnvironmentInjector);
331
+ }
332
+ ngOnInit() {
333
+ this.initializeDockview();
334
+ }
335
+ ngOnDestroy() {
336
+ this.lifecycleManager.destroy();
337
+ if (this.dockviewApi) {
338
+ this.dockviewApi.dispose();
339
+ }
340
+ }
341
+ ngOnChanges(changes) {
342
+ if (this.dockviewApi) {
343
+ const coreChanges = {};
344
+ let hasChanges = false;
345
+ // Check for changes in core dockview properties
346
+ PROPERTY_KEYS_DOCKVIEW.forEach((key) => {
347
+ if (changes[key] && !changes[key].isFirstChange()) {
348
+ coreChanges[key] = changes[key].currentValue;
349
+ hasChanges = true;
350
+ }
351
+ });
352
+ if (hasChanges) {
353
+ this.dockviewApi.updateOptions(coreChanges);
354
+ }
355
+ }
356
+ }
357
+ getDockviewApi() {
358
+ return this.dockviewApi;
359
+ }
360
+ initializeDockview() {
361
+ if (!this.components) {
362
+ throw new Error('DockviewAngularComponent: components input is required');
363
+ }
364
+ const coreOptions = this.extractCoreOptions();
365
+ const frameworkOptions = this.createFrameworkOptions();
366
+ this.dockviewApi = createDockview(this.containerRef.nativeElement, {
367
+ ...coreOptions,
368
+ ...frameworkOptions,
369
+ });
370
+ // Set up event listeners
371
+ this.setupEventListeners();
372
+ // Emit ready event
373
+ this.ready.emit({ api: this.dockviewApi });
374
+ }
375
+ extractCoreOptions() {
376
+ const coreOptions = {};
377
+ PROPERTY_KEYS_DOCKVIEW.forEach((key) => {
378
+ const value = this[key];
379
+ if (value !== undefined) {
380
+ coreOptions[key] = value;
381
+ }
382
+ });
383
+ return coreOptions;
384
+ }
385
+ createFrameworkOptions() {
386
+ const headerActionsComponents = {};
387
+ if (this.leftHeaderActionsComponent) {
388
+ headerActionsComponents['left'] = this.leftHeaderActionsComponent;
389
+ }
390
+ if (this.rightHeaderActionsComponent) {
391
+ headerActionsComponents['right'] = this.rightHeaderActionsComponent;
392
+ }
393
+ if (this.prefixHeaderActionsComponent) {
394
+ headerActionsComponents['prefix'] =
395
+ this.prefixHeaderActionsComponent;
396
+ }
397
+ const componentFactory = new AngularFrameworkComponentFactory(this.components, this.injector, this.environmentInjector, this.tabComponents, this.watermarkComponent, headerActionsComponents, this.defaultTabComponent);
398
+ return {
399
+ createComponent: (options) => {
400
+ return componentFactory.createDockviewComponent(options);
401
+ },
402
+ createTabComponent: (options) => {
403
+ return componentFactory.createTabComponent(options);
404
+ },
405
+ createWatermarkComponent: this.watermarkComponent
406
+ ? () => {
407
+ return componentFactory.createWatermarkComponent();
408
+ }
409
+ : undefined,
410
+ createLeftHeaderActionComponent: this.leftHeaderActionsComponent
411
+ ? (group) => {
412
+ return componentFactory.createHeaderActionsComponent('left');
413
+ }
414
+ : undefined,
415
+ createRightHeaderActionComponent: this.rightHeaderActionsComponent
416
+ ? (group) => {
417
+ return componentFactory.createHeaderActionsComponent('right');
418
+ }
419
+ : undefined,
420
+ createPrefixHeaderActionComponent: this.prefixHeaderActionsComponent
421
+ ? (group) => {
422
+ return componentFactory.createHeaderActionsComponent('prefix');
423
+ }
424
+ : undefined,
425
+ };
426
+ }
427
+ setupEventListeners() {
428
+ if (!this.dockviewApi) {
429
+ return;
430
+ }
431
+ // Set up event subscriptions using lifecycle manager
432
+ const api = this.dockviewApi;
433
+ if (this.didDrop.observers.length > 0) {
434
+ const disposable = api.onDidDrop((event) => {
435
+ this.didDrop.emit(event);
436
+ });
437
+ this.lifecycleManager.addDisposable(disposable);
438
+ }
439
+ if (this.willDrop.observers.length > 0) {
440
+ const disposable = api.onWillDrop((event) => {
441
+ this.willDrop.emit(event);
442
+ });
443
+ this.lifecycleManager.addDisposable(disposable);
444
+ }
445
+ }
446
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DockviewAngularComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
447
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: DockviewAngularComponent, isStandalone: true, selector: "dv-dockview", inputs: { components: "components", tabComponents: "tabComponents", watermarkComponent: "watermarkComponent", defaultTabComponent: "defaultTabComponent", leftHeaderActionsComponent: "leftHeaderActionsComponent", rightHeaderActionsComponent: "rightHeaderActionsComponent", prefixHeaderActionsComponent: "prefixHeaderActionsComponent", className: "className", orientation: "orientation", hideBorders: "hideBorders", rootOverlayModel: "rootOverlayModel", defaultTabComponent_: "defaultTabComponent_", tabHeight: "tabHeight", disableFloatingGroups: "disableFloatingGroups", floatingGroupBounds: "floatingGroupBounds", popoutUrl: "popoutUrl", debug: "debug", locked: "locked", disableAutoResizing: "disableAutoResizing", singleTabMode: "singleTabMode" }, outputs: { ready: "ready", didDrop: "didDrop", willDrop: "willDrop" }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["dockviewContainer"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: '<div #dockviewContainer class="dockview-container"></div>', isInline: true, styles: [":host{display:block;width:100%;height:100%}.dockview-container{width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
448
+ }
449
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DockviewAngularComponent, decorators: [{
450
+ type: Component,
451
+ args: [{ selector: 'dv-dockview', standalone: true, template: '<div #dockviewContainer class="dockview-container"></div>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%}.dockview-container{width:100%;height:100%}\n"] }]
452
+ }], propDecorators: { containerRef: [{
453
+ type: ViewChild,
454
+ args: ['dockviewContainer', { static: true }]
455
+ }], components: [{
456
+ type: Input
457
+ }], tabComponents: [{
458
+ type: Input
459
+ }], watermarkComponent: [{
460
+ type: Input
461
+ }], defaultTabComponent: [{
462
+ type: Input
463
+ }], leftHeaderActionsComponent: [{
464
+ type: Input
465
+ }], rightHeaderActionsComponent: [{
466
+ type: Input
467
+ }], prefixHeaderActionsComponent: [{
468
+ type: Input
469
+ }], className: [{
470
+ type: Input
471
+ }], orientation: [{
472
+ type: Input
473
+ }], hideBorders: [{
474
+ type: Input
475
+ }], rootOverlayModel: [{
476
+ type: Input
477
+ }], defaultTabComponent_: [{
478
+ type: Input
479
+ }], tabHeight: [{
480
+ type: Input
481
+ }], disableFloatingGroups: [{
482
+ type: Input
483
+ }], floatingGroupBounds: [{
484
+ type: Input
485
+ }], popoutUrl: [{
486
+ type: Input
487
+ }], debug: [{
488
+ type: Input
489
+ }], locked: [{
490
+ type: Input
491
+ }], disableAutoResizing: [{
492
+ type: Input
493
+ }], singleTabMode: [{
494
+ type: Input
495
+ }], ready: [{
496
+ type: Output
497
+ }], didDrop: [{
498
+ type: Output
499
+ }], willDrop: [{
500
+ type: Output
501
+ }] } });
502
+
503
+ class GridviewAngularComponent {
504
+ constructor() {
505
+ this.ready = new EventEmitter();
506
+ this.lifecycleManager = new AngularLifecycleManager();
507
+ this.injector = inject(Injector);
508
+ this.environmentInjector = inject(EnvironmentInjector);
509
+ }
510
+ ngOnInit() {
511
+ this.initializeGridview();
512
+ }
513
+ ngOnDestroy() {
514
+ this.lifecycleManager.destroy();
515
+ if (this.gridviewApi) {
516
+ this.gridviewApi.dispose();
517
+ }
518
+ }
519
+ ngOnChanges(changes) {
520
+ if (this.gridviewApi) {
521
+ const coreChanges = {};
522
+ let hasChanges = false;
523
+ // Check for changes in core gridview properties
524
+ PROPERTY_KEYS_GRIDVIEW.forEach((key) => {
525
+ if (changes[key] && !changes[key].isFirstChange()) {
526
+ coreChanges[key] = changes[key].currentValue;
527
+ hasChanges = true;
528
+ }
529
+ });
530
+ if (hasChanges) {
531
+ this.gridviewApi.updateOptions(coreChanges);
532
+ }
533
+ }
534
+ }
535
+ getGridviewApi() {
536
+ return this.gridviewApi;
537
+ }
538
+ initializeGridview() {
539
+ if (!this.components) {
540
+ throw new Error('GridviewAngularComponent: components input is required');
541
+ }
542
+ const coreOptions = this.extractCoreOptions();
543
+ const frameworkOptions = this.createFrameworkOptions();
544
+ this.gridviewApi = createGridview(this.containerRef.nativeElement, {
545
+ ...coreOptions,
546
+ ...frameworkOptions,
547
+ });
548
+ // Emit ready event
549
+ this.ready.emit({ api: this.gridviewApi });
550
+ }
551
+ extractCoreOptions() {
552
+ const coreOptions = {};
553
+ PROPERTY_KEYS_GRIDVIEW.forEach((key) => {
554
+ const value = this[key];
555
+ if (value !== undefined) {
556
+ coreOptions[key] = value;
557
+ }
558
+ });
559
+ return coreOptions;
560
+ }
561
+ createFrameworkOptions() {
562
+ const componentFactory = new AngularFrameworkComponentFactory(this.components, this.injector, this.environmentInjector);
563
+ return {
564
+ createComponent: (options) => {
565
+ return componentFactory.createGridviewComponent(options);
566
+ },
567
+ };
568
+ }
569
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: GridviewAngularComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
570
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: GridviewAngularComponent, isStandalone: true, selector: "dv-gridview", inputs: { components: "components", className: "className", orientation: "orientation", proportionalLayout: "proportionalLayout", hideBorders: "hideBorders", debug: "debug", disableAutoResizing: "disableAutoResizing" }, outputs: { ready: "ready" }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["gridviewContainer"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: '<div #gridviewContainer class="gridview-container"></div>', isInline: true, styles: [":host{display:block;width:100%;height:100%}.gridview-container{width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
571
+ }
572
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: GridviewAngularComponent, decorators: [{
573
+ type: Component,
574
+ args: [{ selector: 'dv-gridview', standalone: true, template: '<div #gridviewContainer class="gridview-container"></div>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%}.gridview-container{width:100%;height:100%}\n"] }]
575
+ }], propDecorators: { containerRef: [{
576
+ type: ViewChild,
577
+ args: ['gridviewContainer', { static: true }]
578
+ }], components: [{
579
+ type: Input
580
+ }], className: [{
581
+ type: Input
582
+ }], orientation: [{
583
+ type: Input
584
+ }], proportionalLayout: [{
585
+ type: Input
586
+ }], hideBorders: [{
587
+ type: Input
588
+ }], debug: [{
589
+ type: Input
590
+ }], disableAutoResizing: [{
591
+ type: Input
592
+ }], ready: [{
593
+ type: Output
594
+ }] } });
595
+
596
+ class PaneviewAngularComponent {
597
+ constructor() {
598
+ this.ready = new EventEmitter();
599
+ this.drop = new EventEmitter();
600
+ this.lifecycleManager = new AngularLifecycleManager();
601
+ this.injector = inject(Injector);
602
+ this.environmentInjector = inject(EnvironmentInjector);
603
+ }
604
+ ngOnInit() {
605
+ this.initializePaneview();
606
+ }
607
+ ngOnDestroy() {
608
+ this.lifecycleManager.destroy();
609
+ if (this.paneviewApi) {
610
+ this.paneviewApi.dispose();
611
+ }
612
+ }
613
+ ngOnChanges(changes) {
614
+ if (this.paneviewApi) {
615
+ const coreChanges = {};
616
+ let hasChanges = false;
617
+ // Check for changes in core paneview properties
618
+ PROPERTY_KEYS_PANEVIEW.forEach((key) => {
619
+ if (changes[key] && !changes[key].isFirstChange()) {
620
+ coreChanges[key] = changes[key].currentValue;
621
+ hasChanges = true;
622
+ }
623
+ });
624
+ if (hasChanges) {
625
+ this.paneviewApi.updateOptions(coreChanges);
626
+ }
627
+ }
628
+ }
629
+ getPaneviewApi() {
630
+ return this.paneviewApi;
631
+ }
632
+ initializePaneview() {
633
+ if (!this.components) {
634
+ throw new Error('PaneviewAngularComponent: components input is required');
635
+ }
636
+ const coreOptions = this.extractCoreOptions();
637
+ const frameworkOptions = this.createFrameworkOptions();
638
+ this.paneviewApi = createPaneview(this.containerRef.nativeElement, {
639
+ ...coreOptions,
640
+ ...frameworkOptions,
641
+ });
642
+ // Set up event listeners
643
+ this.setupEventListeners();
644
+ // Emit ready event
645
+ this.ready.emit({ api: this.paneviewApi });
646
+ }
647
+ extractCoreOptions() {
648
+ const coreOptions = {};
649
+ PROPERTY_KEYS_PANEVIEW.forEach((key) => {
650
+ const value = this[key];
651
+ if (value !== undefined) {
652
+ coreOptions[key] = value;
653
+ }
654
+ });
655
+ return coreOptions;
656
+ }
657
+ createFrameworkOptions() {
658
+ const componentFactory = new AngularFrameworkComponentFactory(this.components, this.injector, this.environmentInjector, this.headerComponents);
659
+ return {
660
+ createComponent: (options) => {
661
+ return componentFactory.createPaneviewComponent(options);
662
+ },
663
+ createHeaderComponent: this.headerComponents
664
+ ? (options) => {
665
+ return new AngularPanePart(this.headerComponents[options.name], this.injector, this.environmentInjector);
666
+ }
667
+ : undefined,
668
+ };
669
+ }
670
+ setupEventListeners() {
671
+ if (!this.paneviewApi) {
672
+ return;
673
+ }
674
+ // Set up event subscriptions using lifecycle manager
675
+ const api = this.paneviewApi;
676
+ if (this.drop.observers.length > 0) {
677
+ const disposable = api.onDidDrop((event) => {
678
+ this.drop.emit(event);
679
+ });
680
+ this.lifecycleManager.addDisposable(disposable);
681
+ }
682
+ }
683
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PaneviewAngularComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
684
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: PaneviewAngularComponent, isStandalone: true, selector: "dv-paneview", inputs: { components: "components", headerComponents: "headerComponents", className: "className", orientation: "orientation", hideBorders: "hideBorders", debug: "debug", disableAutoResizing: "disableAutoResizing" }, outputs: { ready: "ready", drop: "drop" }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["paneviewContainer"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: '<div #paneviewContainer class="paneview-container"></div>', isInline: true, styles: [":host{display:block;width:100%;height:100%}.paneview-container{width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
685
+ }
686
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PaneviewAngularComponent, decorators: [{
687
+ type: Component,
688
+ args: [{ selector: 'dv-paneview', standalone: true, template: '<div #paneviewContainer class="paneview-container"></div>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%}.paneview-container{width:100%;height:100%}\n"] }]
689
+ }], propDecorators: { containerRef: [{
690
+ type: ViewChild,
691
+ args: ['paneviewContainer', { static: true }]
692
+ }], components: [{
693
+ type: Input
694
+ }], headerComponents: [{
695
+ type: Input
696
+ }], className: [{
697
+ type: Input
698
+ }], orientation: [{
699
+ type: Input
700
+ }], hideBorders: [{
701
+ type: Input
702
+ }], debug: [{
703
+ type: Input
704
+ }], disableAutoResizing: [{
705
+ type: Input
706
+ }], ready: [{
707
+ type: Output
708
+ }], drop: [{
709
+ type: Output
710
+ }] } });
711
+
712
+ class SplitviewAngularComponent {
713
+ constructor() {
714
+ this.ready = new EventEmitter();
715
+ this.lifecycleManager = new AngularLifecycleManager();
716
+ this.injector = inject(Injector);
717
+ this.environmentInjector = inject(EnvironmentInjector);
718
+ }
719
+ ngOnInit() {
720
+ this.initializeSplitview();
721
+ }
722
+ ngOnDestroy() {
723
+ this.lifecycleManager.destroy();
724
+ if (this.splitviewApi) {
725
+ this.splitviewApi.dispose();
726
+ }
727
+ }
728
+ ngOnChanges(changes) {
729
+ if (this.splitviewApi) {
730
+ const coreChanges = {};
731
+ let hasChanges = false;
732
+ // Check for changes in core splitview properties
733
+ PROPERTY_KEYS_SPLITVIEW.forEach((key) => {
734
+ if (changes[key] && !changes[key].isFirstChange()) {
735
+ coreChanges[key] = changes[key].currentValue;
736
+ hasChanges = true;
737
+ }
738
+ });
739
+ if (hasChanges) {
740
+ this.splitviewApi.updateOptions(coreChanges);
741
+ }
742
+ }
743
+ }
744
+ getSplitviewApi() {
745
+ return this.splitviewApi;
746
+ }
747
+ initializeSplitview() {
748
+ if (!this.components) {
749
+ throw new Error('SplitviewAngularComponent: components input is required');
750
+ }
751
+ const coreOptions = this.extractCoreOptions();
752
+ const frameworkOptions = this.createFrameworkOptions();
753
+ this.splitviewApi = createSplitview(this.containerRef.nativeElement, {
754
+ ...coreOptions,
755
+ ...frameworkOptions,
756
+ });
757
+ // Emit ready event
758
+ this.ready.emit({ api: this.splitviewApi });
759
+ }
760
+ extractCoreOptions() {
761
+ const coreOptions = {};
762
+ PROPERTY_KEYS_SPLITVIEW.forEach((key) => {
763
+ const value = this[key];
764
+ if (value !== undefined) {
765
+ coreOptions[key] = value;
766
+ }
767
+ });
768
+ return coreOptions;
769
+ }
770
+ createFrameworkOptions() {
771
+ const componentFactory = new AngularFrameworkComponentFactory(this.components, this.injector, this.environmentInjector);
772
+ return {
773
+ createComponent: (options) => {
774
+ return componentFactory.createSplitviewComponent(options);
775
+ },
776
+ };
777
+ }
778
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SplitviewAngularComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
779
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SplitviewAngularComponent, isStandalone: true, selector: "dv-splitview", inputs: { components: "components", className: "className", orientation: "orientation", proportionalLayout: "proportionalLayout", hideBorders: "hideBorders", debug: "debug", disableAutoResizing: "disableAutoResizing" }, outputs: { ready: "ready" }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["splitviewContainer"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: '<div #splitviewContainer class="splitview-container"></div>', isInline: true, styles: [":host{display:block;width:100%;height:100%}.splitview-container{width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
780
+ }
781
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SplitviewAngularComponent, decorators: [{
782
+ type: Component,
783
+ args: [{ selector: 'dv-splitview', standalone: true, template: '<div #splitviewContainer class="splitview-container"></div>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%;height:100%}.splitview-container{width:100%;height:100%}\n"] }]
784
+ }], propDecorators: { containerRef: [{
785
+ type: ViewChild,
786
+ args: ['splitviewContainer', { static: true }]
787
+ }], components: [{
788
+ type: Input
789
+ }], className: [{
790
+ type: Input
791
+ }], orientation: [{
792
+ type: Input
793
+ }], proportionalLayout: [{
794
+ type: Input
795
+ }], hideBorders: [{
796
+ type: Input
797
+ }], debug: [{
798
+ type: Input
799
+ }], disableAutoResizing: [{
800
+ type: Input
801
+ }], ready: [{
802
+ type: Output
803
+ }] } });
804
+
805
+ class DockviewAngularModule {
806
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DockviewAngularModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
807
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: DockviewAngularModule, imports: [CommonModule,
808
+ DockviewAngularComponent,
809
+ GridviewAngularComponent,
810
+ PaneviewAngularComponent,
811
+ SplitviewAngularComponent], exports: [DockviewAngularComponent,
812
+ GridviewAngularComponent,
813
+ PaneviewAngularComponent,
814
+ SplitviewAngularComponent] }); }
815
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DockviewAngularModule, imports: [CommonModule] }); }
816
+ }
817
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DockviewAngularModule, decorators: [{
818
+ type: NgModule,
819
+ args: [{
820
+ imports: [
821
+ CommonModule,
822
+ DockviewAngularComponent,
823
+ GridviewAngularComponent,
824
+ PaneviewAngularComponent,
825
+ SplitviewAngularComponent,
826
+ ],
827
+ exports: [
828
+ DockviewAngularComponent,
829
+ GridviewAngularComponent,
830
+ PaneviewAngularComponent,
831
+ SplitviewAngularComponent,
832
+ ],
833
+ }]
834
+ }] });
835
+
836
+ /*
837
+ * Public API Surface of dockview-angular
838
+ */
839
+ // Re-export everything from dockview-core
840
+
841
+ /**
842
+ * Generated bundle index. Do not edit.
843
+ */
844
+
845
+ export { AngularDisposable, AngularFrameworkComponentFactory, AngularLifecycleManager, AngularRenderer, DockviewAngularComponent, DockviewAngularModule, GridviewAngularComponent, PaneviewAngularComponent, SplitviewAngularComponent, createAngularDisposable };
846
+ //# sourceMappingURL=dockview-angular.mjs.map