dockview-core 1.16.0 → 1.16.1
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/dist/cjs/api/component.api.d.ts +6 -4
- package/dist/cjs/dockview/dockviewComponent.js +1 -0
- package/dist/cjs/gridview/baseComponentGridview.d.ts +2 -0
- package/dist/cjs/gridview/baseComponentGridview.js +53 -5
- package/dist/cjs/gridview/gridviewComponent.d.ts +2 -3
- package/dist/cjs/gridview/gridviewComponent.js +1 -0
- package/dist/cjs/paneview/paneviewComponent.d.ts +1 -0
- package/dist/cjs/paneview/paneviewComponent.js +66 -20
- package/dist/cjs/splitview/splitviewComponent.d.ts +4 -4
- package/dist/cjs/splitview/splitviewComponent.js +67 -21
- package/dist/dockview-core.amd.js +51 -8
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +51 -8
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +51 -8
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +51 -8
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +51 -8
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +51 -8
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/api/component.api.d.ts +6 -4
- package/dist/esm/dockview/dockviewComponent.js +1 -0
- package/dist/esm/gridview/baseComponentGridview.d.ts +2 -0
- package/dist/esm/gridview/baseComponentGridview.js +18 -2
- package/dist/esm/gridview/gridviewComponent.d.ts +2 -3
- package/dist/esm/gridview/gridviewComponent.js +1 -0
- package/dist/esm/paneview/paneviewComponent.d.ts +1 -0
- package/dist/esm/paneview/paneviewComponent.js +17 -3
- package/dist/esm/splitview/splitviewComponent.d.ts +4 -4
- package/dist/esm/splitview/splitviewComponent.js +16 -2
- package/package.json +1 -1
|
@@ -2,11 +2,11 @@ import { FloatingGroupOptions, IDockviewComponent, MovePanelEvent, SerializedDoc
|
|
|
2
2
|
import { AddGroupOptions, AddPanelOptions, DockviewComponentOptions, DockviewDndOverlayEvent, MovementOptions } from '../dockview/options';
|
|
3
3
|
import { Parameters } from '../panel/types';
|
|
4
4
|
import { Direction } from '../gridview/baseComponentGridview';
|
|
5
|
-
import { AddComponentOptions,
|
|
5
|
+
import { AddComponentOptions, IGridviewComponent, SerializedGridviewComponent } from '../gridview/gridviewComponent';
|
|
6
6
|
import { IGridviewPanel } from '../gridview/gridviewPanel';
|
|
7
7
|
import { AddPaneviewComponentOptions, SerializedPaneview, IPaneviewComponent } from '../paneview/paneviewComponent';
|
|
8
8
|
import { IPaneviewPanel } from '../paneview/paneviewPanel';
|
|
9
|
-
import { AddSplitviewComponentOptions, ISplitviewComponent, SerializedSplitview
|
|
9
|
+
import { AddSplitviewComponentOptions, ISplitviewComponent, SerializedSplitview } from '../splitview/splitviewComponent';
|
|
10
10
|
import { IView, Orientation, Sizing } from '../splitview/splitview';
|
|
11
11
|
import { ISplitviewPanel } from '../splitview/splitviewPanel';
|
|
12
12
|
import { DockviewGroupPanel, IDockviewGroupPanel } from '../dockview/dockviewGroupPanel';
|
|
@@ -17,6 +17,8 @@ import { GroupDragEvent, TabDragEvent } from '../dockview/components/titlebar/ta
|
|
|
17
17
|
import { Box } from '../types';
|
|
18
18
|
import { DockviewDidDropEvent, DockviewWillDropEvent, WillShowOverlayLocationEvent } from '../dockview/dockviewGroupPanelModel';
|
|
19
19
|
import { PaneviewComponentOptions } from '../paneview/options';
|
|
20
|
+
import { SplitviewComponentOptions } from '../splitview/options';
|
|
21
|
+
import { GridviewComponentOptions } from '../gridview/options';
|
|
20
22
|
export interface CommonApi<T = any> {
|
|
21
23
|
readonly height: number;
|
|
22
24
|
readonly width: number;
|
|
@@ -115,7 +117,7 @@ export declare class SplitviewApi implements CommonApi<SerializedSplitview> {
|
|
|
115
117
|
/**
|
|
116
118
|
* Update configuratable options.
|
|
117
119
|
*/
|
|
118
|
-
updateOptions(options: Partial<
|
|
120
|
+
updateOptions(options: Partial<SplitviewComponentOptions>): void;
|
|
119
121
|
/**
|
|
120
122
|
* Release resources and teardown component. Do not call when using framework versions of dockview.
|
|
121
123
|
*/
|
|
@@ -305,7 +307,7 @@ export declare class GridviewApi implements CommonApi<SerializedGridviewComponen
|
|
|
305
307
|
* Reset the component back to an empty and default state.
|
|
306
308
|
*/
|
|
307
309
|
clear(): void;
|
|
308
|
-
updateOptions(options: Partial<
|
|
310
|
+
updateOptions(options: Partial<GridviewComponentOptions>): void;
|
|
309
311
|
/**
|
|
310
312
|
* Release resources and teardown component. Do not call when using framework versions of dockview.
|
|
311
313
|
*/
|
|
@@ -593,6 +593,7 @@ export class DockviewComponent extends BaseGrid {
|
|
|
593
593
|
}
|
|
594
594
|
updateOptions(options) {
|
|
595
595
|
var _a, _b;
|
|
596
|
+
super.updateOptions(options);
|
|
596
597
|
const changed_floatingGroupBounds = 'floatingGroupBounds' in options &&
|
|
597
598
|
options.floatingGroupBounds !== this.options.floatingGroupBounds;
|
|
598
599
|
const changed_rootOverlayOptions = 'rootOverlayModel' in options &&
|
|
@@ -63,6 +63,7 @@ export declare abstract class BaseGrid<T extends IGridPanelView> extends Resizab
|
|
|
63
63
|
readonly onDidLayoutChange: Event<void>;
|
|
64
64
|
private readonly _onDidViewVisibilityChangeMicroTaskQueue;
|
|
65
65
|
readonly onDidViewVisibilityChangeMicroTaskQueue: Event<void>;
|
|
66
|
+
private classNames;
|
|
66
67
|
get id(): string;
|
|
67
68
|
get size(): number;
|
|
68
69
|
get groups(): T[];
|
|
@@ -81,6 +82,7 @@ export declare abstract class BaseGrid<T extends IGridPanelView> extends Resizab
|
|
|
81
82
|
abstract clear(): void;
|
|
82
83
|
setVisible(panel: T, visible: boolean): void;
|
|
83
84
|
isVisible(panel: T): boolean;
|
|
85
|
+
updateOptions(options: Partial<BaseGridOptions>): void;
|
|
84
86
|
maximizeGroup(panel: T): void;
|
|
85
87
|
isMaximizedGroup(panel: T): boolean;
|
|
86
88
|
exitMaximizedGroup(): void;
|
|
@@ -4,6 +4,7 @@ import { Disposable } from '../lifecycle';
|
|
|
4
4
|
import { sequentialNumberGenerator } from '../math';
|
|
5
5
|
import { Sizing } from '../splitview/splitview';
|
|
6
6
|
import { Resizable } from '../resizable';
|
|
7
|
+
import { toggleClass } from '../dom';
|
|
7
8
|
const nextLayoutId = sequentialNumberGenerator();
|
|
8
9
|
export function toTarget(direction) {
|
|
9
10
|
switch (direction) {
|
|
@@ -58,6 +59,7 @@ export class BaseGrid extends Resizable {
|
|
|
58
59
|
this.gridview.locked = value;
|
|
59
60
|
}
|
|
60
61
|
constructor(options) {
|
|
62
|
+
var _a, _b;
|
|
61
63
|
super(document.createElement('div'), options.disableAutoResizing);
|
|
62
64
|
this._id = nextLayoutId.next();
|
|
63
65
|
this._groups = new Map();
|
|
@@ -71,10 +73,12 @@ export class BaseGrid extends Resizable {
|
|
|
71
73
|
this.onDidLayoutChange = this._bufferOnDidLayoutChange.onEvent;
|
|
72
74
|
this._onDidViewVisibilityChangeMicroTaskQueue = new AsapEvent();
|
|
73
75
|
this.onDidViewVisibilityChangeMicroTaskQueue = this._onDidViewVisibilityChangeMicroTaskQueue.onEvent;
|
|
76
|
+
this.classNames = [];
|
|
74
77
|
this.element.style.height = '100%';
|
|
75
78
|
this.element.style.width = '100%';
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
|
|
80
|
+
for (const className of this.classNames) {
|
|
81
|
+
toggleClass(this.element, className, true);
|
|
78
82
|
}
|
|
79
83
|
options.parentElement.appendChild(this.element);
|
|
80
84
|
this.gridview = new Gridview(!!options.proportionalLayout, options.styles, options.orientation, options.locked, options.margin);
|
|
@@ -99,6 +103,18 @@ export class BaseGrid extends Resizable {
|
|
|
99
103
|
isVisible(panel) {
|
|
100
104
|
return this.gridview.isViewVisible(getGridLocation(panel.element));
|
|
101
105
|
}
|
|
106
|
+
updateOptions(options) {
|
|
107
|
+
var _a, _b;
|
|
108
|
+
if ('className' in options) {
|
|
109
|
+
for (const className of this.classNames) {
|
|
110
|
+
toggleClass(this.element, className, false);
|
|
111
|
+
}
|
|
112
|
+
this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
|
|
113
|
+
for (const className of this.classNames) {
|
|
114
|
+
toggleClass(this.element, className, true);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
102
118
|
maximizeGroup(panel) {
|
|
103
119
|
this.gridview.maximizeView(panel);
|
|
104
120
|
this.doSetGroupActive(panel);
|
|
@@ -25,11 +25,10 @@ export interface AddComponentOptions<T extends object = Parameters> extends Base
|
|
|
25
25
|
export interface IGridPanelComponentView extends IGridPanelView {
|
|
26
26
|
init: (params: GridviewInitParameters) => void;
|
|
27
27
|
}
|
|
28
|
-
export type GridviewComponentUpdateOptions = Pick<GridviewComponentOptions, 'orientation' | 'components' | 'frameworkComponents'>;
|
|
29
28
|
export interface IGridviewComponent extends IBaseGrid<GridviewPanel> {
|
|
30
29
|
readonly orientation: Orientation;
|
|
31
30
|
readonly onDidLayoutFromJSON: Event<void>;
|
|
32
|
-
updateOptions(options: Partial<
|
|
31
|
+
updateOptions(options: Partial<GridviewComponentOptions>): void;
|
|
33
32
|
addPanel<T extends object = Parameters>(options: AddComponentOptions<T>): IGridviewPanel;
|
|
34
33
|
removePanel(panel: IGridviewPanel, sizing?: Sizing): void;
|
|
35
34
|
focus(): void;
|
|
@@ -63,7 +62,7 @@ export declare class GridviewComponent extends BaseGrid<GridviewPanel> implement
|
|
|
63
62
|
get deserializer(): IPanelDeserializer | undefined;
|
|
64
63
|
set deserializer(value: IPanelDeserializer | undefined);
|
|
65
64
|
constructor(parentElement: HTMLElement, options: GridviewComponentOptions);
|
|
66
|
-
updateOptions(options: Partial<
|
|
65
|
+
updateOptions(options: Partial<GridviewComponentOptions>): void;
|
|
67
66
|
removePanel(panel: GridviewPanel): void;
|
|
68
67
|
/**
|
|
69
68
|
* Serialize the current state of the layout
|
|
@@ -53,6 +53,7 @@ export class GridviewComponent extends BaseGrid {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
updateOptions(options) {
|
|
56
|
+
super.updateOptions(options);
|
|
56
57
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
57
58
|
this.gridview.orientation !== options.orientation;
|
|
58
59
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
@@ -103,6 +103,7 @@ export declare class PaneviewComponent extends Resizable implements IPaneviewCom
|
|
|
103
103
|
readonly onDidAddView: Event<PaneviewPanel>;
|
|
104
104
|
private readonly _onDidRemoveView;
|
|
105
105
|
readonly onDidRemoveView: Event<PaneviewPanel>;
|
|
106
|
+
private classNames;
|
|
106
107
|
get id(): string;
|
|
107
108
|
get panels(): PaneviewPanel[];
|
|
108
109
|
set paneview(value: Paneview);
|
|
@@ -8,6 +8,7 @@ import { DraggablePaneviewPanel, } from './draggablePaneviewPanel';
|
|
|
8
8
|
import { DefaultHeader } from './defaultPaneviewHeader';
|
|
9
9
|
import { sequentialNumberGenerator } from '../math';
|
|
10
10
|
import { Resizable } from '../resizable';
|
|
11
|
+
import { toggleClass } from '../dom';
|
|
11
12
|
const nextLayoutId = sequentialNumberGenerator();
|
|
12
13
|
export class PaneFramework extends DraggablePaneviewPanel {
|
|
13
14
|
constructor(options) {
|
|
@@ -57,6 +58,7 @@ export class PaneviewComponent extends Resizable {
|
|
|
57
58
|
return this._options;
|
|
58
59
|
}
|
|
59
60
|
constructor(parentElement, options) {
|
|
61
|
+
var _a, _b;
|
|
60
62
|
super(parentElement, options.disableAutoResizing);
|
|
61
63
|
this._id = nextLayoutId.next();
|
|
62
64
|
this._disposable = new MutableDisposable();
|
|
@@ -71,10 +73,12 @@ export class PaneviewComponent extends Resizable {
|
|
|
71
73
|
this.onDidAddView = this._onDidAddView.event;
|
|
72
74
|
this._onDidRemoveView = new Emitter();
|
|
73
75
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
74
|
-
|
|
75
|
-
this.element.classList.add(options.className);
|
|
76
|
-
}
|
|
76
|
+
this.classNames = [];
|
|
77
77
|
this.addDisposables(this._onDidLayoutChange, this._onDidLayoutfromJSON, this._onDidDrop, this._onDidAddView, this._onDidRemoveView);
|
|
78
|
+
this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
|
|
79
|
+
for (const className of this.classNames) {
|
|
80
|
+
toggleClass(this.element, className, true);
|
|
81
|
+
}
|
|
78
82
|
this._options = options;
|
|
79
83
|
if (!options.components) {
|
|
80
84
|
options.components = {};
|
|
@@ -96,6 +100,16 @@ export class PaneviewComponent extends Resizable {
|
|
|
96
100
|
//noop
|
|
97
101
|
}
|
|
98
102
|
updateOptions(options) {
|
|
103
|
+
var _a, _b;
|
|
104
|
+
if ('className' in options) {
|
|
105
|
+
for (const className of this.classNames) {
|
|
106
|
+
toggleClass(this.element, className, false);
|
|
107
|
+
}
|
|
108
|
+
this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
|
|
109
|
+
for (const className of this.classNames) {
|
|
110
|
+
toggleClass(this.element, className, true);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
99
113
|
this._options = Object.assign(Object.assign({}, this.options), options);
|
|
100
114
|
}
|
|
101
115
|
addPanel(options) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IDisposable } from '../lifecycle';
|
|
2
|
-
import { IView, LayoutPriority, Orientation, Sizing, Splitview } from './splitview';
|
|
2
|
+
import { IView, LayoutPriority, Orientation, Sizing, Splitview, SplitViewOptions } from './splitview';
|
|
3
3
|
import { SplitviewComponentOptions } from './options';
|
|
4
4
|
import { BaseComponentOptions, Parameters } from '../panel/types';
|
|
5
5
|
import { Event } from '../events';
|
|
@@ -31,7 +31,6 @@ export interface AddSplitviewComponentOptions<T extends Parameters = Parameters>
|
|
|
31
31
|
minimumSize?: number;
|
|
32
32
|
maximumSize?: number;
|
|
33
33
|
}
|
|
34
|
-
export type SplitviewComponentUpdateOptions = Pick<SplitviewComponentOptions, 'orientation' | 'components' | 'frameworkComponents'>;
|
|
35
34
|
export interface ISplitviewComponent extends IDisposable {
|
|
36
35
|
readonly minimumSize: number;
|
|
37
36
|
readonly maximumSize: number;
|
|
@@ -43,7 +42,7 @@ export interface ISplitviewComponent extends IDisposable {
|
|
|
43
42
|
readonly onDidRemoveView: Event<IView>;
|
|
44
43
|
readonly onDidLayoutFromJSON: Event<void>;
|
|
45
44
|
readonly panels: SplitviewPanel[];
|
|
46
|
-
updateOptions(options: Partial<
|
|
45
|
+
updateOptions(options: Partial<SplitViewOptions>): void;
|
|
47
46
|
addPanel<T extends object = Parameters>(options: AddSplitviewComponentOptions<T>): ISplitviewPanel;
|
|
48
47
|
layout(width: number, height: number): void;
|
|
49
48
|
onDidLayoutChange: Event<void>;
|
|
@@ -73,6 +72,7 @@ export declare class SplitviewComponent extends Resizable implements ISplitviewC
|
|
|
73
72
|
readonly onDidRemoveView: Event<IView>;
|
|
74
73
|
private readonly _onDidLayoutChange;
|
|
75
74
|
readonly onDidLayoutChange: Event<void>;
|
|
75
|
+
private classNames;
|
|
76
76
|
get panels(): SplitviewPanel[];
|
|
77
77
|
get options(): SplitviewComponentOptions;
|
|
78
78
|
get length(): number;
|
|
@@ -84,7 +84,7 @@ export declare class SplitviewComponent extends Resizable implements ISplitviewC
|
|
|
84
84
|
get height(): number;
|
|
85
85
|
get width(): number;
|
|
86
86
|
constructor(parentElement: HTMLElement, options: SplitviewComponentOptions);
|
|
87
|
-
updateOptions(options: Partial<
|
|
87
|
+
updateOptions(options: Partial<SplitviewComponentOptions>): void;
|
|
88
88
|
focus(): void;
|
|
89
89
|
movePanel(from: number, to: number): void;
|
|
90
90
|
setVisible(panel: SplitviewPanel, visible: boolean): void;
|
|
@@ -3,6 +3,7 @@ import { Orientation, Sizing, Splitview, } from './splitview';
|
|
|
3
3
|
import { Emitter } from '../events';
|
|
4
4
|
import { createComponent } from '../panel/componentFactory';
|
|
5
5
|
import { Resizable } from '../resizable';
|
|
6
|
+
import { toggleClass } from '../dom';
|
|
6
7
|
/**
|
|
7
8
|
* A high-level implementation of splitview that works using 'panels'
|
|
8
9
|
*/
|
|
@@ -45,6 +46,7 @@ export class SplitviewComponent extends Resizable {
|
|
|
45
46
|
: this.splitview.orthogonalSize;
|
|
46
47
|
}
|
|
47
48
|
constructor(parentElement, options) {
|
|
49
|
+
var _a, _b;
|
|
48
50
|
super(parentElement, options.disableAutoResizing);
|
|
49
51
|
this._splitviewChangeDisposable = new MutableDisposable();
|
|
50
52
|
this._panels = new Map();
|
|
@@ -56,8 +58,10 @@ export class SplitviewComponent extends Resizable {
|
|
|
56
58
|
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
57
59
|
this._onDidLayoutChange = new Emitter();
|
|
58
60
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
this.classNames = [];
|
|
62
|
+
this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
|
|
63
|
+
for (const className of this.classNames) {
|
|
64
|
+
toggleClass(this.element, className, true);
|
|
61
65
|
}
|
|
62
66
|
this._options = options;
|
|
63
67
|
if (!options.components) {
|
|
@@ -70,6 +74,16 @@ export class SplitviewComponent extends Resizable {
|
|
|
70
74
|
this.addDisposables(this._onDidAddView, this._onDidLayoutfromJSON, this._onDidRemoveView, this._onDidLayoutChange);
|
|
71
75
|
}
|
|
72
76
|
updateOptions(options) {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
if ('className' in options) {
|
|
79
|
+
for (const className of this.classNames) {
|
|
80
|
+
toggleClass(this.element, className, false);
|
|
81
|
+
}
|
|
82
|
+
this.classNames = (_b = (_a = options.className) === null || _a === void 0 ? void 0 : _a.split(' ')) !== null && _b !== void 0 ? _b : [];
|
|
83
|
+
for (const className of this.classNames) {
|
|
84
|
+
toggleClass(this.element, className, true);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
73
87
|
const hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
74
88
|
this.options.orientation !== options.orientation;
|
|
75
89
|
this._options = Object.assign(Object.assign({}, this.options), options);
|