dockview-angular 0.0.0-beta-0 → 0.0.0-experimental-4e3871a-20251228
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -56
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/lib/dockview/dockview-angular.component.d.ts +49 -0
- package/dist/cjs/lib/dockview/dockview-angular.component.js +256 -0
- package/dist/cjs/lib/dockview/types.d.ts +27 -0
- package/dist/cjs/lib/dockview/types.js +8 -0
- package/dist/cjs/lib/dockview-angular.module.d.ts +2 -0
- package/dist/cjs/lib/dockview-angular.module.js +35 -0
- package/dist/cjs/lib/gridview/angular-gridview-panel.d.ts +9 -0
- package/dist/cjs/lib/gridview/angular-gridview-panel.js +21 -0
- package/dist/cjs/lib/gridview/gridview-angular.component.d.ts +28 -0
- package/dist/cjs/lib/gridview/gridview-angular.component.js +140 -0
- package/dist/cjs/lib/gridview/types.d.ts +12 -0
- package/dist/cjs/lib/gridview/types.js +6 -0
- package/dist/cjs/lib/paneview/angular-pane-part.d.ts +13 -0
- package/dist/cjs/lib/paneview/angular-pane-part.js +29 -0
- package/dist/cjs/lib/paneview/paneview-angular.component.d.ts +31 -0
- package/dist/cjs/lib/paneview/paneview-angular.component.js +166 -0
- package/dist/cjs/lib/paneview/types.d.ts +14 -0
- package/dist/cjs/lib/paneview/types.js +6 -0
- package/dist/cjs/lib/splitview/angular-splitview-panel.d.ts +9 -0
- package/dist/cjs/lib/splitview/angular-splitview-panel.js +21 -0
- package/dist/cjs/lib/splitview/splitview-angular.component.d.ts +28 -0
- package/dist/cjs/lib/splitview/splitview-angular.component.js +140 -0
- package/dist/cjs/lib/splitview/types.d.ts +12 -0
- package/dist/cjs/lib/splitview/types.js +6 -0
- package/dist/cjs/lib/utils/angular-renderer.d.ts +18 -0
- package/dist/cjs/lib/utils/angular-renderer.js +70 -0
- package/dist/cjs/lib/utils/component-factory.d.ts +20 -0
- package/dist/cjs/lib/utils/component-factory.js +103 -0
- package/dist/cjs/lib/utils/lifecycle-utils.d.ts +18 -0
- package/dist/cjs/lib/utils/lifecycle-utils.js +74 -0
- package/dist/cjs/public-api.d.ts +13 -0
- package/dist/cjs/public-api.js +32 -0
- package/dist/dockview-angular.amd.js +7677 -3744
- package/dist/dockview-angular.amd.js.map +1 -1
- package/dist/dockview-angular.amd.min.js +2 -2
- package/dist/dockview-angular.amd.min.js.map +1 -1
- package/dist/dockview-angular.amd.min.noStyle.js +2 -2
- package/dist/dockview-angular.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-angular.amd.noStyle.js +7688 -3755
- package/dist/dockview-angular.amd.noStyle.js.map +1 -1
- package/dist/dockview-angular.cjs.js +6703 -2766
- package/dist/dockview-angular.cjs.js.map +1 -1
- package/dist/dockview-angular.esm.js +7649 -3733
- package/dist/dockview-angular.esm.js.map +1 -1
- package/dist/dockview-angular.esm.min.js +2 -2
- package/dist/dockview-angular.esm.min.js.map +1 -1
- package/dist/dockview-angular.js +7680 -3747
- package/dist/dockview-angular.js.map +1 -1
- package/dist/dockview-angular.min.js +2 -2
- package/dist/dockview-angular.min.js.map +1 -1
- package/dist/dockview-angular.min.noStyle.js +2 -2
- package/dist/dockview-angular.min.noStyle.js.map +1 -1
- package/dist/dockview-angular.noStyle.js +7691 -3758
- package/dist/dockview-angular.noStyle.js.map +1 -1
- package/dist/dockview.css +1229 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lib/dockview/dockview-angular.component.d.ts +49 -0
- package/dist/esm/lib/dockview/dockview-angular.component.js +253 -0
- package/dist/esm/lib/dockview/types.d.ts +27 -0
- package/dist/esm/lib/dockview/types.js +2 -0
- package/dist/esm/lib/dockview-angular.module.d.ts +2 -0
- package/dist/esm/lib/dockview-angular.module.js +32 -0
- package/dist/esm/lib/gridview/angular-gridview-panel.d.ts +9 -0
- package/dist/esm/lib/gridview/angular-gridview-panel.js +17 -0
- package/dist/esm/lib/gridview/gridview-angular.component.d.ts +28 -0
- package/dist/esm/lib/gridview/gridview-angular.component.js +137 -0
- package/dist/esm/lib/gridview/types.d.ts +12 -0
- package/dist/esm/lib/gridview/types.js +2 -0
- package/dist/esm/lib/paneview/angular-pane-part.d.ts +13 -0
- package/dist/esm/lib/paneview/angular-pane-part.js +25 -0
- package/dist/esm/lib/paneview/paneview-angular.component.d.ts +31 -0
- package/dist/esm/lib/paneview/paneview-angular.component.js +163 -0
- package/dist/esm/lib/paneview/types.d.ts +14 -0
- package/dist/esm/lib/paneview/types.js +2 -0
- package/dist/esm/lib/splitview/angular-splitview-panel.d.ts +9 -0
- package/dist/esm/lib/splitview/angular-splitview-panel.js +17 -0
- package/dist/esm/lib/splitview/splitview-angular.component.d.ts +28 -0
- package/dist/esm/lib/splitview/splitview-angular.component.js +137 -0
- package/dist/esm/lib/splitview/types.d.ts +12 -0
- package/dist/esm/lib/splitview/types.js +2 -0
- package/dist/esm/lib/utils/angular-renderer.d.ts +18 -0
- package/dist/esm/lib/utils/angular-renderer.js +66 -0
- package/dist/esm/lib/utils/component-factory.d.ts +20 -0
- package/dist/esm/lib/utils/component-factory.js +99 -0
- package/dist/esm/lib/utils/lifecycle-utils.d.ts +18 -0
- package/dist/esm/lib/utils/lifecycle-utils.js +68 -0
- package/dist/esm/public-api.d.ts +13 -0
- package/dist/esm/public-api.js +16 -0
- package/package.json +67 -58
- package/dist/cjs/utils.d.ts +0 -49
- package/dist/cjs/utils.js +0 -141
- package/dist/esm/utils.d.ts +0 -49
- package/dist/esm/utils.js +0 -119
- package/dist/styles/dockview.css +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Component, ElementRef, EventEmitter, Injector, Input, Output, ViewChild, ChangeDetectionStrategy, EnvironmentInjector, inject } from '@angular/core';
|
|
11
|
+
import { createPaneview, PROPERTY_KEYS_PANEVIEW } from 'dockview-core';
|
|
12
|
+
import { AngularFrameworkComponentFactory } from '../utils/component-factory';
|
|
13
|
+
import { AngularLifecycleManager } from '../utils/lifecycle-utils';
|
|
14
|
+
import { AngularPanePart } from './angular-pane-part';
|
|
15
|
+
let PaneviewAngularComponent = class PaneviewAngularComponent {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.ready = new EventEmitter();
|
|
18
|
+
this.drop = new EventEmitter();
|
|
19
|
+
this.lifecycleManager = new AngularLifecycleManager();
|
|
20
|
+
this.injector = inject(Injector);
|
|
21
|
+
this.environmentInjector = inject(EnvironmentInjector);
|
|
22
|
+
}
|
|
23
|
+
ngOnInit() {
|
|
24
|
+
this.initializePaneview();
|
|
25
|
+
}
|
|
26
|
+
ngOnDestroy() {
|
|
27
|
+
this.lifecycleManager.destroy();
|
|
28
|
+
if (this.paneviewApi) {
|
|
29
|
+
this.paneviewApi.dispose();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
ngOnChanges(changes) {
|
|
33
|
+
if (this.paneviewApi) {
|
|
34
|
+
const coreChanges = {};
|
|
35
|
+
let hasChanges = false;
|
|
36
|
+
// Check for changes in core paneview properties
|
|
37
|
+
PROPERTY_KEYS_PANEVIEW.forEach(key => {
|
|
38
|
+
if (changes[key] && !changes[key].isFirstChange()) {
|
|
39
|
+
coreChanges[key] = changes[key].currentValue;
|
|
40
|
+
hasChanges = true;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
if (hasChanges) {
|
|
44
|
+
this.paneviewApi.updateOptions(coreChanges);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
getPaneviewApi() {
|
|
49
|
+
return this.paneviewApi;
|
|
50
|
+
}
|
|
51
|
+
initializePaneview() {
|
|
52
|
+
if (!this.components) {
|
|
53
|
+
throw new Error('PaneviewAngularComponent: components input is required');
|
|
54
|
+
}
|
|
55
|
+
const coreOptions = this.extractCoreOptions();
|
|
56
|
+
const frameworkOptions = this.createFrameworkOptions();
|
|
57
|
+
this.paneviewApi = createPaneview(this.containerRef.nativeElement, {
|
|
58
|
+
...coreOptions,
|
|
59
|
+
...frameworkOptions
|
|
60
|
+
});
|
|
61
|
+
// Set up event listeners
|
|
62
|
+
this.setupEventListeners();
|
|
63
|
+
// Emit ready event
|
|
64
|
+
this.ready.emit({ api: this.paneviewApi });
|
|
65
|
+
}
|
|
66
|
+
extractCoreOptions() {
|
|
67
|
+
const coreOptions = {};
|
|
68
|
+
PROPERTY_KEYS_PANEVIEW.forEach(key => {
|
|
69
|
+
const value = this[key];
|
|
70
|
+
if (value !== undefined) {
|
|
71
|
+
coreOptions[key] = value;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return coreOptions;
|
|
75
|
+
}
|
|
76
|
+
createFrameworkOptions() {
|
|
77
|
+
const componentFactory = new AngularFrameworkComponentFactory(this.components, this.injector, this.environmentInjector, this.headerComponents);
|
|
78
|
+
return {
|
|
79
|
+
createComponent: (options) => {
|
|
80
|
+
return componentFactory.createPaneviewComponent(options);
|
|
81
|
+
},
|
|
82
|
+
createHeaderComponent: this.headerComponents
|
|
83
|
+
? (options) => {
|
|
84
|
+
return new AngularPanePart(this.headerComponents[options.name], this.injector, this.environmentInjector);
|
|
85
|
+
}
|
|
86
|
+
: undefined
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
setupEventListeners() {
|
|
90
|
+
if (!this.paneviewApi) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
// Set up event subscriptions using lifecycle manager
|
|
94
|
+
const api = this.paneviewApi;
|
|
95
|
+
if (this.drop.observers.length > 0) {
|
|
96
|
+
const disposable = api.onDidDrop(event => {
|
|
97
|
+
this.drop.emit(event);
|
|
98
|
+
});
|
|
99
|
+
this.lifecycleManager.addDisposable(disposable);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
__decorate([
|
|
104
|
+
ViewChild('paneviewContainer', { static: true }),
|
|
105
|
+
__metadata("design:type", ElementRef)
|
|
106
|
+
], PaneviewAngularComponent.prototype, "containerRef", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
Input(),
|
|
109
|
+
__metadata("design:type", Object)
|
|
110
|
+
], PaneviewAngularComponent.prototype, "components", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
Input(),
|
|
113
|
+
__metadata("design:type", Object)
|
|
114
|
+
], PaneviewAngularComponent.prototype, "headerComponents", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
Input(),
|
|
117
|
+
__metadata("design:type", String)
|
|
118
|
+
], PaneviewAngularComponent.prototype, "className", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
Input(),
|
|
121
|
+
__metadata("design:type", String)
|
|
122
|
+
], PaneviewAngularComponent.prototype, "orientation", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
Input(),
|
|
125
|
+
__metadata("design:type", Boolean)
|
|
126
|
+
], PaneviewAngularComponent.prototype, "hideBorders", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
Input(),
|
|
129
|
+
__metadata("design:type", Boolean)
|
|
130
|
+
], PaneviewAngularComponent.prototype, "debug", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
Input(),
|
|
133
|
+
__metadata("design:type", Boolean)
|
|
134
|
+
], PaneviewAngularComponent.prototype, "disableAutoResizing", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
Output(),
|
|
137
|
+
__metadata("design:type", Object)
|
|
138
|
+
], PaneviewAngularComponent.prototype, "ready", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
Output(),
|
|
141
|
+
__metadata("design:type", Object)
|
|
142
|
+
], PaneviewAngularComponent.prototype, "drop", void 0);
|
|
143
|
+
PaneviewAngularComponent = __decorate([
|
|
144
|
+
Component({
|
|
145
|
+
selector: 'dv-paneview',
|
|
146
|
+
standalone: true,
|
|
147
|
+
template: '<div #paneviewContainer class="paneview-container"></div>',
|
|
148
|
+
styles: [`
|
|
149
|
+
:host {
|
|
150
|
+
display: block;
|
|
151
|
+
width: 100%;
|
|
152
|
+
height: 100%;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.paneview-container {
|
|
156
|
+
width: 100%;
|
|
157
|
+
height: 100%;
|
|
158
|
+
}
|
|
159
|
+
`],
|
|
160
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
161
|
+
})
|
|
162
|
+
], PaneviewAngularComponent);
|
|
163
|
+
export { PaneviewAngularComponent };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { PaneviewOptions, PaneviewApi, PaneviewDropEvent } from 'dockview-core';
|
|
3
|
+
export interface PaneviewAngularReadyEvent {
|
|
4
|
+
api: PaneviewApi;
|
|
5
|
+
}
|
|
6
|
+
export interface PaneviewAngularOptions extends PaneviewOptions {
|
|
7
|
+
components: Record<string, Type<any>>;
|
|
8
|
+
headerComponents?: Record<string, Type<any>>;
|
|
9
|
+
}
|
|
10
|
+
export interface PaneviewAngularEvents {
|
|
11
|
+
ready: PaneviewAngularReadyEvent;
|
|
12
|
+
drop: PaneviewDropEvent;
|
|
13
|
+
}
|
|
14
|
+
export { PaneviewApi, PaneviewDropEvent, PaneviewOptions } from 'dockview-core';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Type, Injector, EnvironmentInjector } from '@angular/core';
|
|
2
|
+
import { SplitviewPanel, IFrameworkPart } from 'dockview-core';
|
|
3
|
+
export declare class AngularSplitviewPanel extends SplitviewPanel {
|
|
4
|
+
private readonly angularComponent;
|
|
5
|
+
private readonly injector;
|
|
6
|
+
private readonly environmentInjector?;
|
|
7
|
+
constructor(id: string, component: string, angularComponent: Type<any>, injector: Injector, environmentInjector?: EnvironmentInjector | undefined);
|
|
8
|
+
getComponent(): IFrameworkPart;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SplitviewPanel, } from 'dockview-core';
|
|
2
|
+
import { AngularRenderer } from '../utils/angular-renderer';
|
|
3
|
+
export class AngularSplitviewPanel extends SplitviewPanel {
|
|
4
|
+
constructor(id, component, angularComponent, injector, environmentInjector) {
|
|
5
|
+
super(id, component);
|
|
6
|
+
this.angularComponent = angularComponent;
|
|
7
|
+
this.injector = injector;
|
|
8
|
+
this.environmentInjector = environmentInjector;
|
|
9
|
+
}
|
|
10
|
+
getComponent() {
|
|
11
|
+
return new AngularRenderer({
|
|
12
|
+
component: this.angularComponent,
|
|
13
|
+
injector: this.injector,
|
|
14
|
+
environmentInjector: this.environmentInjector
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit, Type, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { SplitviewApi, SplitviewOptions } from 'dockview-core';
|
|
3
|
+
import { SplitviewAngularReadyEvent } from './types';
|
|
4
|
+
export interface SplitviewAngularOptions extends SplitviewOptions {
|
|
5
|
+
components: Record<string, Type<any>>;
|
|
6
|
+
}
|
|
7
|
+
export declare class SplitviewAngularComponent implements OnInit, OnDestroy, OnChanges {
|
|
8
|
+
private containerRef;
|
|
9
|
+
components: Record<string, Type<any>>;
|
|
10
|
+
className?: string;
|
|
11
|
+
orientation?: 'horizontal' | 'vertical';
|
|
12
|
+
proportionalLayout?: boolean;
|
|
13
|
+
hideBorders?: boolean;
|
|
14
|
+
debug?: boolean;
|
|
15
|
+
disableAutoResizing?: boolean;
|
|
16
|
+
ready: EventEmitter<SplitviewAngularReadyEvent>;
|
|
17
|
+
private splitviewApi?;
|
|
18
|
+
private lifecycleManager;
|
|
19
|
+
private injector;
|
|
20
|
+
private environmentInjector;
|
|
21
|
+
ngOnInit(): void;
|
|
22
|
+
ngOnDestroy(): void;
|
|
23
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
24
|
+
getSplitviewApi(): SplitviewApi | undefined;
|
|
25
|
+
private initializeSplitview;
|
|
26
|
+
private extractCoreOptions;
|
|
27
|
+
private createFrameworkOptions;
|
|
28
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Component, ElementRef, EventEmitter, Injector, Input, Output, ViewChild, ChangeDetectionStrategy, EnvironmentInjector, inject } from '@angular/core';
|
|
11
|
+
import { createSplitview, PROPERTY_KEYS_SPLITVIEW } from 'dockview-core';
|
|
12
|
+
import { AngularFrameworkComponentFactory } from '../utils/component-factory';
|
|
13
|
+
import { AngularLifecycleManager } from '../utils/lifecycle-utils';
|
|
14
|
+
let SplitviewAngularComponent = class SplitviewAngularComponent {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.ready = new EventEmitter();
|
|
17
|
+
this.lifecycleManager = new AngularLifecycleManager();
|
|
18
|
+
this.injector = inject(Injector);
|
|
19
|
+
this.environmentInjector = inject(EnvironmentInjector);
|
|
20
|
+
}
|
|
21
|
+
ngOnInit() {
|
|
22
|
+
this.initializeSplitview();
|
|
23
|
+
}
|
|
24
|
+
ngOnDestroy() {
|
|
25
|
+
this.lifecycleManager.destroy();
|
|
26
|
+
if (this.splitviewApi) {
|
|
27
|
+
this.splitviewApi.dispose();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
ngOnChanges(changes) {
|
|
31
|
+
if (this.splitviewApi) {
|
|
32
|
+
const coreChanges = {};
|
|
33
|
+
let hasChanges = false;
|
|
34
|
+
// Check for changes in core splitview properties
|
|
35
|
+
PROPERTY_KEYS_SPLITVIEW.forEach(key => {
|
|
36
|
+
if (changes[key] && !changes[key].isFirstChange()) {
|
|
37
|
+
coreChanges[key] = changes[key].currentValue;
|
|
38
|
+
hasChanges = true;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
if (hasChanges) {
|
|
42
|
+
this.splitviewApi.updateOptions(coreChanges);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
getSplitviewApi() {
|
|
47
|
+
return this.splitviewApi;
|
|
48
|
+
}
|
|
49
|
+
initializeSplitview() {
|
|
50
|
+
if (!this.components) {
|
|
51
|
+
throw new Error('SplitviewAngularComponent: components input is required');
|
|
52
|
+
}
|
|
53
|
+
const coreOptions = this.extractCoreOptions();
|
|
54
|
+
const frameworkOptions = this.createFrameworkOptions();
|
|
55
|
+
this.splitviewApi = createSplitview(this.containerRef.nativeElement, {
|
|
56
|
+
...coreOptions,
|
|
57
|
+
...frameworkOptions
|
|
58
|
+
});
|
|
59
|
+
// Emit ready event
|
|
60
|
+
this.ready.emit({ api: this.splitviewApi });
|
|
61
|
+
}
|
|
62
|
+
extractCoreOptions() {
|
|
63
|
+
const coreOptions = {};
|
|
64
|
+
PROPERTY_KEYS_SPLITVIEW.forEach(key => {
|
|
65
|
+
const value = this[key];
|
|
66
|
+
if (value !== undefined) {
|
|
67
|
+
coreOptions[key] = value;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return coreOptions;
|
|
71
|
+
}
|
|
72
|
+
createFrameworkOptions() {
|
|
73
|
+
const componentFactory = new AngularFrameworkComponentFactory(this.components, this.injector, this.environmentInjector);
|
|
74
|
+
return {
|
|
75
|
+
createComponent: (options) => {
|
|
76
|
+
return componentFactory.createSplitviewComponent(options);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
__decorate([
|
|
82
|
+
ViewChild('splitviewContainer', { static: true }),
|
|
83
|
+
__metadata("design:type", ElementRef)
|
|
84
|
+
], SplitviewAngularComponent.prototype, "containerRef", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
Input(),
|
|
87
|
+
__metadata("design:type", Object)
|
|
88
|
+
], SplitviewAngularComponent.prototype, "components", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
Input(),
|
|
91
|
+
__metadata("design:type", String)
|
|
92
|
+
], SplitviewAngularComponent.prototype, "className", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
Input(),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], SplitviewAngularComponent.prototype, "orientation", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
Input(),
|
|
99
|
+
__metadata("design:type", Boolean)
|
|
100
|
+
], SplitviewAngularComponent.prototype, "proportionalLayout", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
Input(),
|
|
103
|
+
__metadata("design:type", Boolean)
|
|
104
|
+
], SplitviewAngularComponent.prototype, "hideBorders", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
Input(),
|
|
107
|
+
__metadata("design:type", Boolean)
|
|
108
|
+
], SplitviewAngularComponent.prototype, "debug", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
Input(),
|
|
111
|
+
__metadata("design:type", Boolean)
|
|
112
|
+
], SplitviewAngularComponent.prototype, "disableAutoResizing", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
Output(),
|
|
115
|
+
__metadata("design:type", Object)
|
|
116
|
+
], SplitviewAngularComponent.prototype, "ready", void 0);
|
|
117
|
+
SplitviewAngularComponent = __decorate([
|
|
118
|
+
Component({
|
|
119
|
+
selector: 'dv-splitview',
|
|
120
|
+
standalone: true,
|
|
121
|
+
template: '<div #splitviewContainer class="splitview-container"></div>',
|
|
122
|
+
styles: [`
|
|
123
|
+
:host {
|
|
124
|
+
display: block;
|
|
125
|
+
width: 100%;
|
|
126
|
+
height: 100%;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.splitview-container {
|
|
130
|
+
width: 100%;
|
|
131
|
+
height: 100%;
|
|
132
|
+
}
|
|
133
|
+
`],
|
|
134
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
135
|
+
})
|
|
136
|
+
], SplitviewAngularComponent);
|
|
137
|
+
export { SplitviewAngularComponent };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { SplitviewOptions, SplitviewApi } from 'dockview-core';
|
|
3
|
+
export interface SplitviewAngularReadyEvent {
|
|
4
|
+
api: SplitviewApi;
|
|
5
|
+
}
|
|
6
|
+
export interface SplitviewAngularOptions extends SplitviewOptions {
|
|
7
|
+
components: Record<string, Type<any>>;
|
|
8
|
+
}
|
|
9
|
+
export interface SplitviewAngularEvents {
|
|
10
|
+
ready: SplitviewAngularReadyEvent;
|
|
11
|
+
}
|
|
12
|
+
export { SplitviewApi, SplitviewOptions } from 'dockview-core';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Injector, Type, EnvironmentInjector } from '@angular/core';
|
|
2
|
+
import { IContentRenderer, IFrameworkPart, Parameters } from 'dockview-core';
|
|
3
|
+
export interface AngularRendererOptions {
|
|
4
|
+
component: Type<any>;
|
|
5
|
+
injector: Injector;
|
|
6
|
+
environmentInjector?: EnvironmentInjector;
|
|
7
|
+
}
|
|
8
|
+
export declare class AngularRenderer implements IContentRenderer, IFrameworkPart {
|
|
9
|
+
private options;
|
|
10
|
+
private componentRef;
|
|
11
|
+
private _element;
|
|
12
|
+
constructor(options: AngularRendererOptions);
|
|
13
|
+
get element(): HTMLElement;
|
|
14
|
+
init(parameters: Parameters): void;
|
|
15
|
+
update(params: Parameters): void;
|
|
16
|
+
private render;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { createComponent } from '@angular/core';
|
|
2
|
+
export class AngularRenderer {
|
|
3
|
+
constructor(options) {
|
|
4
|
+
this.options = options;
|
|
5
|
+
this.componentRef = null;
|
|
6
|
+
this._element = null;
|
|
7
|
+
}
|
|
8
|
+
get element() {
|
|
9
|
+
if (!this._element) {
|
|
10
|
+
throw new Error('Angular renderer not initialized');
|
|
11
|
+
}
|
|
12
|
+
return this._element;
|
|
13
|
+
}
|
|
14
|
+
init(parameters) {
|
|
15
|
+
// If already initialized, just update the parameters
|
|
16
|
+
if (this.componentRef) {
|
|
17
|
+
this.update(parameters);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
this.render(parameters);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
update(params) {
|
|
24
|
+
if (this.componentRef) {
|
|
25
|
+
Object.keys(params).forEach(key => {
|
|
26
|
+
// Use 'in' operator instead of hasOwnProperty to support getter/setter properties
|
|
27
|
+
if (key in this.componentRef.instance) {
|
|
28
|
+
this.componentRef.instance[key] = params[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
this.componentRef.changeDetectorRef.detectChanges();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
render(parameters) {
|
|
35
|
+
try {
|
|
36
|
+
// Create the component using modern Angular API
|
|
37
|
+
this.componentRef = createComponent(this.options.component, {
|
|
38
|
+
environmentInjector: this.options.environmentInjector || this.options.injector,
|
|
39
|
+
elementInjector: this.options.injector
|
|
40
|
+
});
|
|
41
|
+
// Set initial parameters
|
|
42
|
+
Object.keys(parameters).forEach(key => {
|
|
43
|
+
// Use 'in' operator instead of hasOwnProperty to support getter/setter properties
|
|
44
|
+
if (key in this.componentRef.instance) {
|
|
45
|
+
this.componentRef.instance[key] = parameters[key];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
// Get the DOM element
|
|
49
|
+
const hostView = this.componentRef.hostView;
|
|
50
|
+
this._element = hostView.rootNodes[0];
|
|
51
|
+
// Trigger change detection
|
|
52
|
+
this.componentRef.changeDetectorRef.detectChanges();
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
console.error('Error creating Angular component:', error);
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
dispose() {
|
|
60
|
+
if (this.componentRef) {
|
|
61
|
+
this.componentRef.destroy();
|
|
62
|
+
this.componentRef = null;
|
|
63
|
+
}
|
|
64
|
+
this._element = null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Type, Injector, EnvironmentInjector } from '@angular/core';
|
|
2
|
+
import { IContentRenderer, ITabRenderer, IWatermarkRenderer, IHeaderActionsRenderer, CreateComponentOptions, GridviewPanel, SplitviewPanel, IPanePart } from 'dockview-core';
|
|
3
|
+
export declare class AngularFrameworkComponentFactory {
|
|
4
|
+
private components;
|
|
5
|
+
private injector;
|
|
6
|
+
private environmentInjector?;
|
|
7
|
+
private tabComponents?;
|
|
8
|
+
private watermarkComponent?;
|
|
9
|
+
private headerActionsComponents?;
|
|
10
|
+
private defaultTabComponent?;
|
|
11
|
+
constructor(components: Record<string, Type<any>>, injector: Injector, environmentInjector?: EnvironmentInjector | undefined, tabComponents?: Record<string, Type<any>> | undefined, watermarkComponent?: Type<any> | undefined, headerActionsComponents?: Record<string, Type<any>> | undefined, defaultTabComponent?: Type<any> | undefined);
|
|
12
|
+
createDockviewComponent(options: CreateComponentOptions): IContentRenderer;
|
|
13
|
+
createGridviewComponent(options: CreateComponentOptions): GridviewPanel;
|
|
14
|
+
createSplitviewComponent(options: CreateComponentOptions): SplitviewPanel;
|
|
15
|
+
createPaneviewComponent(options: CreateComponentOptions): IPanePart;
|
|
16
|
+
createComponent(options: CreateComponentOptions): IContentRenderer;
|
|
17
|
+
createTabComponent(options: CreateComponentOptions): ITabRenderer | undefined;
|
|
18
|
+
createWatermarkComponent(): IWatermarkRenderer;
|
|
19
|
+
createHeaderActionsComponent(name: string): IHeaderActionsRenderer | undefined;
|
|
20
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { AngularRenderer } from './angular-renderer';
|
|
2
|
+
import { AngularGridviewPanel } from '../gridview/angular-gridview-panel';
|
|
3
|
+
import { AngularSplitviewPanel } from '../splitview/angular-splitview-panel';
|
|
4
|
+
import { AngularPanePart } from '../paneview/angular-pane-part';
|
|
5
|
+
export class AngularFrameworkComponentFactory {
|
|
6
|
+
constructor(components, injector, environmentInjector, tabComponents, watermarkComponent, headerActionsComponents, defaultTabComponent) {
|
|
7
|
+
this.components = components;
|
|
8
|
+
this.injector = injector;
|
|
9
|
+
this.environmentInjector = environmentInjector;
|
|
10
|
+
this.tabComponents = tabComponents;
|
|
11
|
+
this.watermarkComponent = watermarkComponent;
|
|
12
|
+
this.headerActionsComponents = headerActionsComponents;
|
|
13
|
+
this.defaultTabComponent = defaultTabComponent;
|
|
14
|
+
}
|
|
15
|
+
// For DockviewComponent
|
|
16
|
+
createDockviewComponent(options) {
|
|
17
|
+
const component = this.components[options.name];
|
|
18
|
+
if (!component) {
|
|
19
|
+
throw new Error(`Component '${options.name}' not found in component registry`);
|
|
20
|
+
}
|
|
21
|
+
const renderer = new AngularRenderer({
|
|
22
|
+
component,
|
|
23
|
+
injector: this.injector,
|
|
24
|
+
environmentInjector: this.environmentInjector
|
|
25
|
+
});
|
|
26
|
+
renderer.init(options);
|
|
27
|
+
return renderer;
|
|
28
|
+
}
|
|
29
|
+
// For GridviewComponent
|
|
30
|
+
createGridviewComponent(options) {
|
|
31
|
+
const component = this.components[options.name];
|
|
32
|
+
if (!component) {
|
|
33
|
+
throw new Error(`Component '${options.name}' not found in component registry`);
|
|
34
|
+
}
|
|
35
|
+
return new AngularGridviewPanel(options.id, options.name, component, this.injector, this.environmentInjector);
|
|
36
|
+
}
|
|
37
|
+
// For SplitviewComponent
|
|
38
|
+
createSplitviewComponent(options) {
|
|
39
|
+
const component = this.components[options.name];
|
|
40
|
+
if (!component) {
|
|
41
|
+
throw new Error(`Component '${options.name}' not found in component registry`);
|
|
42
|
+
}
|
|
43
|
+
return new AngularSplitviewPanel(options.id, options.name, component, this.injector, this.environmentInjector);
|
|
44
|
+
}
|
|
45
|
+
// For PaneviewComponent
|
|
46
|
+
createPaneviewComponent(options) {
|
|
47
|
+
const component = this.components[options.name];
|
|
48
|
+
if (!component) {
|
|
49
|
+
throw new Error(`Component '${options.name}' not found in component registry`);
|
|
50
|
+
}
|
|
51
|
+
return new AngularPanePart(component, this.injector, this.environmentInjector);
|
|
52
|
+
}
|
|
53
|
+
// Legacy method for backward compatibility
|
|
54
|
+
createComponent(options) {
|
|
55
|
+
return this.createDockviewComponent(options);
|
|
56
|
+
}
|
|
57
|
+
createTabComponent(options) {
|
|
58
|
+
let component = this.tabComponents?.[options.name];
|
|
59
|
+
if (!component && this.defaultTabComponent) {
|
|
60
|
+
component = this.defaultTabComponent;
|
|
61
|
+
}
|
|
62
|
+
if (!component) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
const renderer = new AngularRenderer({
|
|
66
|
+
component,
|
|
67
|
+
injector: this.injector,
|
|
68
|
+
environmentInjector: this.environmentInjector
|
|
69
|
+
});
|
|
70
|
+
renderer.init(options);
|
|
71
|
+
return renderer;
|
|
72
|
+
}
|
|
73
|
+
createWatermarkComponent() {
|
|
74
|
+
if (!this.watermarkComponent) {
|
|
75
|
+
throw new Error('Watermark component not provided');
|
|
76
|
+
}
|
|
77
|
+
const renderer = new AngularRenderer({
|
|
78
|
+
component: this.watermarkComponent,
|
|
79
|
+
injector: this.injector,
|
|
80
|
+
environmentInjector: this.environmentInjector
|
|
81
|
+
});
|
|
82
|
+
renderer.init({});
|
|
83
|
+
return renderer;
|
|
84
|
+
}
|
|
85
|
+
createHeaderActionsComponent(name) {
|
|
86
|
+
const component = this.headerActionsComponents?.[name];
|
|
87
|
+
if (!component) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
const renderer = new AngularRenderer({
|
|
91
|
+
component,
|
|
92
|
+
injector: this.injector,
|
|
93
|
+
environmentInjector: this.environmentInjector
|
|
94
|
+
});
|
|
95
|
+
// Initialize with empty props - dockview-core will call init() again with actual IGroupHeaderProps
|
|
96
|
+
renderer.init({});
|
|
97
|
+
return renderer;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { DockviewIDisposable } from 'dockview-core';
|
|
3
|
+
export declare class AngularDisposable implements DockviewIDisposable {
|
|
4
|
+
private _isDisposed;
|
|
5
|
+
private disposeCallbacks;
|
|
6
|
+
get isDisposed(): boolean;
|
|
7
|
+
addDisposeCallback(callback: () => void): void;
|
|
8
|
+
dispose(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare class AngularLifecycleManager {
|
|
11
|
+
private destroySubject;
|
|
12
|
+
private disposables;
|
|
13
|
+
get destroy$(): Observable<void>;
|
|
14
|
+
addDisposable(disposable: DockviewIDisposable): void;
|
|
15
|
+
takeUntilDestroy<T>(): (source: Observable<T>) => Observable<T>;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
18
|
+
export declare function createAngularDisposable(disposeCallback?: () => void): AngularDisposable;
|