dockview-angular 0.0.0-beta-0 → 0.0.0-experimental-e3d91d1-20251227
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 +7632 -3730
- 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 +7629 -3727
- package/dist/dockview-angular.amd.noStyle.js.map +1 -1
- package/dist/dockview-angular.cjs.js +7644 -3738
- package/dist/dockview-angular.cjs.js.map +1 -1
- package/dist/dockview-angular.esm.js +7607 -3721
- 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 +7635 -3733
- 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 +7632 -3730
- 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
package/dist/esm/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from './public-api';
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from './public-api';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit, Type, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { DockviewApi, DockviewOptions, DockviewReadyEvent, DockviewDidDropEvent, DockviewWillDropEvent } from 'dockview-core';
|
|
3
|
+
export interface DockviewAngularOptions extends DockviewOptions {
|
|
4
|
+
components: Record<string, Type<any>>;
|
|
5
|
+
tabComponents?: Record<string, Type<any>>;
|
|
6
|
+
watermarkComponent?: Type<any>;
|
|
7
|
+
defaultTabComponent?: Type<any>;
|
|
8
|
+
leftHeaderActionsComponent?: Type<any>;
|
|
9
|
+
rightHeaderActionsComponent?: Type<any>;
|
|
10
|
+
prefixHeaderActionsComponent?: Type<any>;
|
|
11
|
+
}
|
|
12
|
+
export declare class DockviewAngularComponent implements OnInit, OnDestroy, OnChanges {
|
|
13
|
+
private containerRef;
|
|
14
|
+
components: Record<string, Type<any>>;
|
|
15
|
+
tabComponents?: Record<string, Type<any>>;
|
|
16
|
+
watermarkComponent?: Type<any>;
|
|
17
|
+
defaultTabComponent?: Type<any>;
|
|
18
|
+
leftHeaderActionsComponent?: Type<any>;
|
|
19
|
+
rightHeaderActionsComponent?: Type<any>;
|
|
20
|
+
prefixHeaderActionsComponent?: Type<any>;
|
|
21
|
+
className?: string;
|
|
22
|
+
orientation?: 'horizontal' | 'vertical';
|
|
23
|
+
hideBorders?: boolean;
|
|
24
|
+
rootOverlayModel?: 'always' | 'never';
|
|
25
|
+
defaultTabComponent_?: string;
|
|
26
|
+
tabHeight?: number;
|
|
27
|
+
disableFloatingGroups?: boolean;
|
|
28
|
+
floatingGroupBounds?: 'boundedWithinViewport';
|
|
29
|
+
popoutUrl?: string;
|
|
30
|
+
debug?: boolean;
|
|
31
|
+
locked?: boolean;
|
|
32
|
+
disableAutoResizing?: boolean;
|
|
33
|
+
singleTabMode?: 'fullwidth' | 'default';
|
|
34
|
+
ready: EventEmitter<DockviewReadyEvent>;
|
|
35
|
+
didDrop: EventEmitter<DockviewDidDropEvent>;
|
|
36
|
+
willDrop: EventEmitter<DockviewWillDropEvent>;
|
|
37
|
+
private dockviewApi?;
|
|
38
|
+
private lifecycleManager;
|
|
39
|
+
private injector;
|
|
40
|
+
private environmentInjector;
|
|
41
|
+
ngOnInit(): void;
|
|
42
|
+
ngOnDestroy(): void;
|
|
43
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
44
|
+
getDockviewApi(): DockviewApi | undefined;
|
|
45
|
+
private initializeDockview;
|
|
46
|
+
private extractCoreOptions;
|
|
47
|
+
private createFrameworkOptions;
|
|
48
|
+
private setupEventListeners;
|
|
49
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
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, Type, ViewChild, ChangeDetectionStrategy, EnvironmentInjector, inject } from '@angular/core';
|
|
11
|
+
import { createDockview, PROPERTY_KEYS_DOCKVIEW } from 'dockview-core';
|
|
12
|
+
import { AngularFrameworkComponentFactory } from '../utils/component-factory';
|
|
13
|
+
import { AngularLifecycleManager } from '../utils/lifecycle-utils';
|
|
14
|
+
let DockviewAngularComponent = class DockviewAngularComponent {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.ready = new EventEmitter();
|
|
17
|
+
this.didDrop = new EventEmitter();
|
|
18
|
+
this.willDrop = new EventEmitter();
|
|
19
|
+
this.lifecycleManager = new AngularLifecycleManager();
|
|
20
|
+
this.injector = inject(Injector);
|
|
21
|
+
this.environmentInjector = inject(EnvironmentInjector);
|
|
22
|
+
}
|
|
23
|
+
ngOnInit() {
|
|
24
|
+
this.initializeDockview();
|
|
25
|
+
}
|
|
26
|
+
ngOnDestroy() {
|
|
27
|
+
this.lifecycleManager.destroy();
|
|
28
|
+
if (this.dockviewApi) {
|
|
29
|
+
this.dockviewApi.dispose();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
ngOnChanges(changes) {
|
|
33
|
+
if (this.dockviewApi) {
|
|
34
|
+
const coreChanges = {};
|
|
35
|
+
let hasChanges = false;
|
|
36
|
+
// Check for changes in core dockview properties
|
|
37
|
+
PROPERTY_KEYS_DOCKVIEW.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.dockviewApi.updateOptions(coreChanges);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
getDockviewApi() {
|
|
49
|
+
return this.dockviewApi;
|
|
50
|
+
}
|
|
51
|
+
initializeDockview() {
|
|
52
|
+
if (!this.components) {
|
|
53
|
+
throw new Error('DockviewAngularComponent: components input is required');
|
|
54
|
+
}
|
|
55
|
+
const coreOptions = this.extractCoreOptions();
|
|
56
|
+
const frameworkOptions = this.createFrameworkOptions();
|
|
57
|
+
this.dockviewApi = createDockview(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.dockviewApi });
|
|
65
|
+
}
|
|
66
|
+
extractCoreOptions() {
|
|
67
|
+
const coreOptions = {};
|
|
68
|
+
PROPERTY_KEYS_DOCKVIEW.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 headerActionsComponents = {};
|
|
78
|
+
if (this.leftHeaderActionsComponent) {
|
|
79
|
+
headerActionsComponents['left'] = this.leftHeaderActionsComponent;
|
|
80
|
+
}
|
|
81
|
+
if (this.rightHeaderActionsComponent) {
|
|
82
|
+
headerActionsComponents['right'] = this.rightHeaderActionsComponent;
|
|
83
|
+
}
|
|
84
|
+
if (this.prefixHeaderActionsComponent) {
|
|
85
|
+
headerActionsComponents['prefix'] = this.prefixHeaderActionsComponent;
|
|
86
|
+
}
|
|
87
|
+
const componentFactory = new AngularFrameworkComponentFactory(this.components, this.injector, this.environmentInjector, this.tabComponents, this.watermarkComponent, headerActionsComponents, this.defaultTabComponent);
|
|
88
|
+
return {
|
|
89
|
+
createComponent: (options) => {
|
|
90
|
+
return componentFactory.createDockviewComponent(options);
|
|
91
|
+
},
|
|
92
|
+
createTabComponent: (options) => {
|
|
93
|
+
return componentFactory.createTabComponent(options);
|
|
94
|
+
},
|
|
95
|
+
createWatermarkComponent: this.watermarkComponent
|
|
96
|
+
? () => {
|
|
97
|
+
return componentFactory.createWatermarkComponent();
|
|
98
|
+
}
|
|
99
|
+
: undefined,
|
|
100
|
+
createLeftHeaderActionComponent: this.leftHeaderActionsComponent
|
|
101
|
+
? (group) => {
|
|
102
|
+
return componentFactory.createHeaderActionsComponent('left');
|
|
103
|
+
}
|
|
104
|
+
: undefined,
|
|
105
|
+
createRightHeaderActionComponent: this.rightHeaderActionsComponent
|
|
106
|
+
? (group) => {
|
|
107
|
+
return componentFactory.createHeaderActionsComponent('right');
|
|
108
|
+
}
|
|
109
|
+
: undefined,
|
|
110
|
+
createPrefixHeaderActionComponent: this.prefixHeaderActionsComponent
|
|
111
|
+
? (group) => {
|
|
112
|
+
return componentFactory.createHeaderActionsComponent('prefix');
|
|
113
|
+
}
|
|
114
|
+
: undefined
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
setupEventListeners() {
|
|
118
|
+
if (!this.dockviewApi) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
// Set up event subscriptions using lifecycle manager
|
|
122
|
+
const api = this.dockviewApi;
|
|
123
|
+
if (this.didDrop.observers.length > 0) {
|
|
124
|
+
const disposable = api.onDidDrop(event => {
|
|
125
|
+
this.didDrop.emit(event);
|
|
126
|
+
});
|
|
127
|
+
this.lifecycleManager.addDisposable(disposable);
|
|
128
|
+
}
|
|
129
|
+
if (this.willDrop.observers.length > 0) {
|
|
130
|
+
const disposable = api.onWillDrop(event => {
|
|
131
|
+
this.willDrop.emit(event);
|
|
132
|
+
});
|
|
133
|
+
this.lifecycleManager.addDisposable(disposable);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
__decorate([
|
|
138
|
+
ViewChild('dockviewContainer', { static: true }),
|
|
139
|
+
__metadata("design:type", ElementRef)
|
|
140
|
+
], DockviewAngularComponent.prototype, "containerRef", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
Input(),
|
|
143
|
+
__metadata("design:type", Object)
|
|
144
|
+
], DockviewAngularComponent.prototype, "components", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
Input(),
|
|
147
|
+
__metadata("design:type", Object)
|
|
148
|
+
], DockviewAngularComponent.prototype, "tabComponents", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
Input(),
|
|
151
|
+
__metadata("design:type", Type)
|
|
152
|
+
], DockviewAngularComponent.prototype, "watermarkComponent", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
Input(),
|
|
155
|
+
__metadata("design:type", Type)
|
|
156
|
+
], DockviewAngularComponent.prototype, "defaultTabComponent", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
Input(),
|
|
159
|
+
__metadata("design:type", Type)
|
|
160
|
+
], DockviewAngularComponent.prototype, "leftHeaderActionsComponent", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
Input(),
|
|
163
|
+
__metadata("design:type", Type)
|
|
164
|
+
], DockviewAngularComponent.prototype, "rightHeaderActionsComponent", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
Input(),
|
|
167
|
+
__metadata("design:type", Type)
|
|
168
|
+
], DockviewAngularComponent.prototype, "prefixHeaderActionsComponent", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
Input(),
|
|
171
|
+
__metadata("design:type", String)
|
|
172
|
+
], DockviewAngularComponent.prototype, "className", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
Input(),
|
|
175
|
+
__metadata("design:type", String)
|
|
176
|
+
], DockviewAngularComponent.prototype, "orientation", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
Input(),
|
|
179
|
+
__metadata("design:type", Boolean)
|
|
180
|
+
], DockviewAngularComponent.prototype, "hideBorders", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
Input(),
|
|
183
|
+
__metadata("design:type", String)
|
|
184
|
+
], DockviewAngularComponent.prototype, "rootOverlayModel", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
Input(),
|
|
187
|
+
__metadata("design:type", String)
|
|
188
|
+
], DockviewAngularComponent.prototype, "defaultTabComponent_", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
Input(),
|
|
191
|
+
__metadata("design:type", Number)
|
|
192
|
+
], DockviewAngularComponent.prototype, "tabHeight", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
Input(),
|
|
195
|
+
__metadata("design:type", Boolean)
|
|
196
|
+
], DockviewAngularComponent.prototype, "disableFloatingGroups", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
Input(),
|
|
199
|
+
__metadata("design:type", String)
|
|
200
|
+
], DockviewAngularComponent.prototype, "floatingGroupBounds", void 0);
|
|
201
|
+
__decorate([
|
|
202
|
+
Input(),
|
|
203
|
+
__metadata("design:type", String)
|
|
204
|
+
], DockviewAngularComponent.prototype, "popoutUrl", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
Input(),
|
|
207
|
+
__metadata("design:type", Boolean)
|
|
208
|
+
], DockviewAngularComponent.prototype, "debug", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
Input(),
|
|
211
|
+
__metadata("design:type", Boolean)
|
|
212
|
+
], DockviewAngularComponent.prototype, "locked", void 0);
|
|
213
|
+
__decorate([
|
|
214
|
+
Input(),
|
|
215
|
+
__metadata("design:type", Boolean)
|
|
216
|
+
], DockviewAngularComponent.prototype, "disableAutoResizing", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
Input(),
|
|
219
|
+
__metadata("design:type", String)
|
|
220
|
+
], DockviewAngularComponent.prototype, "singleTabMode", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
Output(),
|
|
223
|
+
__metadata("design:type", Object)
|
|
224
|
+
], DockviewAngularComponent.prototype, "ready", void 0);
|
|
225
|
+
__decorate([
|
|
226
|
+
Output(),
|
|
227
|
+
__metadata("design:type", Object)
|
|
228
|
+
], DockviewAngularComponent.prototype, "didDrop", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
Output(),
|
|
231
|
+
__metadata("design:type", Object)
|
|
232
|
+
], DockviewAngularComponent.prototype, "willDrop", void 0);
|
|
233
|
+
DockviewAngularComponent = __decorate([
|
|
234
|
+
Component({
|
|
235
|
+
selector: 'dv-dockview',
|
|
236
|
+
standalone: true,
|
|
237
|
+
template: '<div #dockviewContainer class="dockview-container"></div>',
|
|
238
|
+
styles: [`
|
|
239
|
+
:host {
|
|
240
|
+
display: block;
|
|
241
|
+
width: 100%;
|
|
242
|
+
height: 100%;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.dockview-container {
|
|
246
|
+
width: 100%;
|
|
247
|
+
height: 100%;
|
|
248
|
+
}
|
|
249
|
+
`],
|
|
250
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
251
|
+
})
|
|
252
|
+
], DockviewAngularComponent);
|
|
253
|
+
export { DockviewAngularComponent };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { DockviewOptions, DockviewReadyEvent, DockviewDidDropEvent, DockviewWillDropEvent, IDockviewPanelProps, IDockviewPanelHeaderProps, IWatermarkPanelProps, IDockviewHeaderActionsProps } from 'dockview-core';
|
|
3
|
+
export interface IDockviewAngularPanelProps extends IDockviewPanelProps {
|
|
4
|
+
}
|
|
5
|
+
export interface IDockviewAngularPanelHeaderProps extends IDockviewPanelHeaderProps {
|
|
6
|
+
}
|
|
7
|
+
export interface IDockviewAngularWatermarkProps extends IWatermarkPanelProps {
|
|
8
|
+
}
|
|
9
|
+
export interface IDockviewAngularHeaderActionsProps extends IDockviewHeaderActionsProps {
|
|
10
|
+
}
|
|
11
|
+
export interface DockviewAngularOptions extends DockviewOptions {
|
|
12
|
+
components: Record<string, Type<any>>;
|
|
13
|
+
tabComponents?: Record<string, Type<any>>;
|
|
14
|
+
watermarkComponent?: Type<any>;
|
|
15
|
+
defaultTabComponent?: Type<any>;
|
|
16
|
+
leftHeaderActionsComponent?: Type<any>;
|
|
17
|
+
rightHeaderActionsComponent?: Type<any>;
|
|
18
|
+
prefixHeaderActionsComponent?: Type<any>;
|
|
19
|
+
}
|
|
20
|
+
export interface DockviewAngularComponentOptions extends DockviewAngularOptions {
|
|
21
|
+
}
|
|
22
|
+
export interface DockviewAngularEvents {
|
|
23
|
+
ready: DockviewReadyEvent;
|
|
24
|
+
didDrop: DockviewDidDropEvent;
|
|
25
|
+
willDrop: DockviewWillDropEvent;
|
|
26
|
+
}
|
|
27
|
+
export { DockviewApi, DockviewReadyEvent, DockviewDidDropEvent, DockviewWillDropEvent, DockviewOptions } from 'dockview-core';
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
import { NgModule } from '@angular/core';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
9
|
+
import { DockviewAngularComponent } from './dockview/dockview-angular.component';
|
|
10
|
+
import { GridviewAngularComponent } from './gridview/gridview-angular.component';
|
|
11
|
+
import { PaneviewAngularComponent } from './paneview/paneview-angular.component';
|
|
12
|
+
import { SplitviewAngularComponent } from './splitview/splitview-angular.component';
|
|
13
|
+
let DockviewAngularModule = class DockviewAngularModule {
|
|
14
|
+
};
|
|
15
|
+
DockviewAngularModule = __decorate([
|
|
16
|
+
NgModule({
|
|
17
|
+
imports: [
|
|
18
|
+
CommonModule,
|
|
19
|
+
DockviewAngularComponent,
|
|
20
|
+
GridviewAngularComponent,
|
|
21
|
+
PaneviewAngularComponent,
|
|
22
|
+
SplitviewAngularComponent
|
|
23
|
+
],
|
|
24
|
+
exports: [
|
|
25
|
+
DockviewAngularComponent,
|
|
26
|
+
GridviewAngularComponent,
|
|
27
|
+
PaneviewAngularComponent,
|
|
28
|
+
SplitviewAngularComponent
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
], DockviewAngularModule);
|
|
32
|
+
export { DockviewAngularModule };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Type, Injector, EnvironmentInjector } from '@angular/core';
|
|
2
|
+
import { GridviewPanel, IFrameworkPart } from 'dockview-core';
|
|
3
|
+
export declare class AngularGridviewPanel extends GridviewPanel {
|
|
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 { GridviewPanel, } from 'dockview-core';
|
|
2
|
+
import { AngularRenderer } from '../utils/angular-renderer';
|
|
3
|
+
export class AngularGridviewPanel extends GridviewPanel {
|
|
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 { GridviewApi, GridviewOptions } from 'dockview-core';
|
|
3
|
+
import { GridviewAngularReadyEvent } from './types';
|
|
4
|
+
export interface GridviewAngularOptions extends GridviewOptions {
|
|
5
|
+
components: Record<string, Type<any>>;
|
|
6
|
+
}
|
|
7
|
+
export declare class GridviewAngularComponent 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<GridviewAngularReadyEvent>;
|
|
17
|
+
private gridviewApi?;
|
|
18
|
+
private lifecycleManager;
|
|
19
|
+
private injector;
|
|
20
|
+
private environmentInjector;
|
|
21
|
+
ngOnInit(): void;
|
|
22
|
+
ngOnDestroy(): void;
|
|
23
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
24
|
+
getGridviewApi(): GridviewApi | undefined;
|
|
25
|
+
private initializeGridview;
|
|
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 { createGridview, PROPERTY_KEYS_GRIDVIEW } from 'dockview-core';
|
|
12
|
+
import { AngularFrameworkComponentFactory } from '../utils/component-factory';
|
|
13
|
+
import { AngularLifecycleManager } from '../utils/lifecycle-utils';
|
|
14
|
+
let GridviewAngularComponent = class GridviewAngularComponent {
|
|
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.initializeGridview();
|
|
23
|
+
}
|
|
24
|
+
ngOnDestroy() {
|
|
25
|
+
this.lifecycleManager.destroy();
|
|
26
|
+
if (this.gridviewApi) {
|
|
27
|
+
this.gridviewApi.dispose();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
ngOnChanges(changes) {
|
|
31
|
+
if (this.gridviewApi) {
|
|
32
|
+
const coreChanges = {};
|
|
33
|
+
let hasChanges = false;
|
|
34
|
+
// Check for changes in core gridview properties
|
|
35
|
+
PROPERTY_KEYS_GRIDVIEW.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.gridviewApi.updateOptions(coreChanges);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
getGridviewApi() {
|
|
47
|
+
return this.gridviewApi;
|
|
48
|
+
}
|
|
49
|
+
initializeGridview() {
|
|
50
|
+
if (!this.components) {
|
|
51
|
+
throw new Error('GridviewAngularComponent: components input is required');
|
|
52
|
+
}
|
|
53
|
+
const coreOptions = this.extractCoreOptions();
|
|
54
|
+
const frameworkOptions = this.createFrameworkOptions();
|
|
55
|
+
this.gridviewApi = createGridview(this.containerRef.nativeElement, {
|
|
56
|
+
...coreOptions,
|
|
57
|
+
...frameworkOptions
|
|
58
|
+
});
|
|
59
|
+
// Emit ready event
|
|
60
|
+
this.ready.emit({ api: this.gridviewApi });
|
|
61
|
+
}
|
|
62
|
+
extractCoreOptions() {
|
|
63
|
+
const coreOptions = {};
|
|
64
|
+
PROPERTY_KEYS_GRIDVIEW.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.createGridviewComponent(options);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
__decorate([
|
|
82
|
+
ViewChild('gridviewContainer', { static: true }),
|
|
83
|
+
__metadata("design:type", ElementRef)
|
|
84
|
+
], GridviewAngularComponent.prototype, "containerRef", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
Input(),
|
|
87
|
+
__metadata("design:type", Object)
|
|
88
|
+
], GridviewAngularComponent.prototype, "components", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
Input(),
|
|
91
|
+
__metadata("design:type", String)
|
|
92
|
+
], GridviewAngularComponent.prototype, "className", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
Input(),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], GridviewAngularComponent.prototype, "orientation", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
Input(),
|
|
99
|
+
__metadata("design:type", Boolean)
|
|
100
|
+
], GridviewAngularComponent.prototype, "proportionalLayout", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
Input(),
|
|
103
|
+
__metadata("design:type", Boolean)
|
|
104
|
+
], GridviewAngularComponent.prototype, "hideBorders", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
Input(),
|
|
107
|
+
__metadata("design:type", Boolean)
|
|
108
|
+
], GridviewAngularComponent.prototype, "debug", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
Input(),
|
|
111
|
+
__metadata("design:type", Boolean)
|
|
112
|
+
], GridviewAngularComponent.prototype, "disableAutoResizing", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
Output(),
|
|
115
|
+
__metadata("design:type", Object)
|
|
116
|
+
], GridviewAngularComponent.prototype, "ready", void 0);
|
|
117
|
+
GridviewAngularComponent = __decorate([
|
|
118
|
+
Component({
|
|
119
|
+
selector: 'dv-gridview',
|
|
120
|
+
standalone: true,
|
|
121
|
+
template: '<div #gridviewContainer class="gridview-container"></div>',
|
|
122
|
+
styles: [`
|
|
123
|
+
:host {
|
|
124
|
+
display: block;
|
|
125
|
+
width: 100%;
|
|
126
|
+
height: 100%;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.gridview-container {
|
|
130
|
+
width: 100%;
|
|
131
|
+
height: 100%;
|
|
132
|
+
}
|
|
133
|
+
`],
|
|
134
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
135
|
+
})
|
|
136
|
+
], GridviewAngularComponent);
|
|
137
|
+
export { GridviewAngularComponent };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { GridviewOptions, GridviewApi } from 'dockview-core';
|
|
3
|
+
export interface GridviewAngularReadyEvent {
|
|
4
|
+
api: GridviewApi;
|
|
5
|
+
}
|
|
6
|
+
export interface GridviewAngularOptions extends GridviewOptions {
|
|
7
|
+
components: Record<string, Type<any>>;
|
|
8
|
+
}
|
|
9
|
+
export interface GridviewAngularEvents {
|
|
10
|
+
ready: GridviewAngularReadyEvent;
|
|
11
|
+
}
|
|
12
|
+
export { GridviewApi, GridviewOptions } from 'dockview-core';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Type, Injector, EnvironmentInjector } from '@angular/core';
|
|
2
|
+
import { IPanePart, PanelUpdateEvent, PanePanelComponentInitParameter } from 'dockview-core';
|
|
3
|
+
export declare class AngularPanePart implements IPanePart {
|
|
4
|
+
private readonly angularComponent;
|
|
5
|
+
private readonly injector;
|
|
6
|
+
private readonly environmentInjector?;
|
|
7
|
+
private renderer;
|
|
8
|
+
constructor(angularComponent: Type<any>, injector: Injector, environmentInjector?: EnvironmentInjector | undefined);
|
|
9
|
+
get element(): HTMLElement;
|
|
10
|
+
init(parameters: PanePanelComponentInitParameter): void;
|
|
11
|
+
update(params: PanelUpdateEvent): void;
|
|
12
|
+
dispose(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AngularRenderer } from '../utils/angular-renderer';
|
|
2
|
+
export class AngularPanePart {
|
|
3
|
+
constructor(angularComponent, injector, environmentInjector) {
|
|
4
|
+
this.angularComponent = angularComponent;
|
|
5
|
+
this.injector = injector;
|
|
6
|
+
this.environmentInjector = environmentInjector;
|
|
7
|
+
this.renderer = new AngularRenderer({
|
|
8
|
+
component: this.angularComponent,
|
|
9
|
+
injector: this.injector,
|
|
10
|
+
environmentInjector: this.environmentInjector
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
get element() {
|
|
14
|
+
return this.renderer.element;
|
|
15
|
+
}
|
|
16
|
+
init(parameters) {
|
|
17
|
+
this.renderer.init(parameters);
|
|
18
|
+
}
|
|
19
|
+
update(params) {
|
|
20
|
+
this.renderer.update(params);
|
|
21
|
+
}
|
|
22
|
+
dispose() {
|
|
23
|
+
this.renderer.dispose();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit, Type, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { PaneviewApi, PaneviewOptions, PaneviewDropEvent } from 'dockview-core';
|
|
3
|
+
import { PaneviewAngularReadyEvent } from './types';
|
|
4
|
+
export interface PaneviewAngularOptions extends PaneviewOptions {
|
|
5
|
+
components: Record<string, Type<any>>;
|
|
6
|
+
headerComponents?: Record<string, Type<any>>;
|
|
7
|
+
}
|
|
8
|
+
export declare class PaneviewAngularComponent implements OnInit, OnDestroy, OnChanges {
|
|
9
|
+
private containerRef;
|
|
10
|
+
components: Record<string, Type<any>>;
|
|
11
|
+
headerComponents?: Record<string, Type<any>>;
|
|
12
|
+
className?: string;
|
|
13
|
+
orientation?: 'horizontal' | 'vertical';
|
|
14
|
+
hideBorders?: boolean;
|
|
15
|
+
debug?: boolean;
|
|
16
|
+
disableAutoResizing?: boolean;
|
|
17
|
+
ready: EventEmitter<PaneviewAngularReadyEvent>;
|
|
18
|
+
drop: EventEmitter<PaneviewDropEvent>;
|
|
19
|
+
private paneviewApi?;
|
|
20
|
+
private lifecycleManager;
|
|
21
|
+
private injector;
|
|
22
|
+
private environmentInjector;
|
|
23
|
+
ngOnInit(): void;
|
|
24
|
+
ngOnDestroy(): void;
|
|
25
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
26
|
+
getPaneviewApi(): PaneviewApi | undefined;
|
|
27
|
+
private initializePaneview;
|
|
28
|
+
private extractCoreOptions;
|
|
29
|
+
private createFrameworkOptions;
|
|
30
|
+
private setupEventListeners;
|
|
31
|
+
}
|