dockview 1.0.2 → 1.2.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.
- package/README.md +243 -186
- package/dist/cjs/api/component.api.d.ts +32 -23
- package/dist/cjs/api/component.api.js +105 -34
- package/dist/cjs/api/component.api.js.map +1 -1
- package/dist/cjs/api/gridviewPanelApi.js +1 -0
- package/dist/cjs/api/gridviewPanelApi.js.map +1 -1
- package/dist/cjs/api/groupPanelApi.d.ts +11 -14
- package/dist/cjs/api/groupPanelApi.js +19 -17
- package/dist/cjs/api/groupPanelApi.js.map +1 -1
- package/dist/cjs/api/panelApi.d.ts +0 -25
- package/dist/cjs/api/panelApi.js +1 -20
- package/dist/cjs/api/panelApi.js.map +1 -1
- package/dist/cjs/api/paneviewPanelApi.js +1 -0
- package/dist/cjs/api/paneviewPanelApi.js.map +1 -1
- package/dist/cjs/api/splitviewPanelApi.d.ts +0 -1
- package/dist/cjs/api/splitviewPanelApi.js +1 -5
- package/dist/cjs/api/splitviewPanelApi.js.map +1 -1
- package/dist/cjs/dnd/abstractDragHandler.d.ts +2 -2
- package/dist/cjs/dnd/abstractDragHandler.js +14 -14
- package/dist/cjs/dnd/abstractDragHandler.js.map +1 -1
- package/dist/cjs/dnd/dataTransfer.d.ts +0 -25
- package/dist/cjs/dnd/dataTransfer.js +1 -45
- package/dist/cjs/dnd/dataTransfer.js.map +1 -1
- package/dist/cjs/dnd/dnd.d.ts +1 -14
- package/dist/cjs/dnd/dnd.js +1 -79
- package/dist/cjs/dnd/dnd.js.map +1 -1
- package/dist/cjs/dnd/droptarget.d.ts +3 -0
- package/dist/cjs/dnd/droptarget.js +69 -45
- package/dist/cjs/dnd/droptarget.js.map +1 -1
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +0 -1
- package/dist/cjs/dockview/components/tab/defaultTab.js +0 -8
- package/dist/cjs/dockview/components/tab/defaultTab.js.map +1 -1
- package/dist/cjs/dockview/deserializer.js.map +1 -1
- package/dist/cjs/dockview/dockviewComponent.d.ts +31 -21
- package/dist/cjs/dockview/dockviewComponent.js +103 -207
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +3 -5
- package/dist/cjs/dockview/dockviewGroupPanel.js +10 -31
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +1 -1
- package/dist/cjs/dockview/options.d.ts +2 -1
- package/dist/cjs/events.js +25 -4
- package/dist/cjs/events.js.map +1 -1
- package/dist/cjs/gridview/baseComponentGridview.d.ts +12 -20
- package/dist/cjs/gridview/baseComponentGridview.js +23 -45
- package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
- package/dist/cjs/gridview/basePanelView.d.ts +5 -8
- package/dist/cjs/gridview/basePanelView.js +14 -8
- package/dist/cjs/gridview/basePanelView.js.map +1 -1
- package/dist/cjs/gridview/branchNode.js +2 -2
- package/dist/cjs/gridview/branchNode.js.map +1 -1
- package/dist/cjs/gridview/gridview.js +20 -17
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +4 -0
- package/dist/cjs/gridview/gridviewComponent.js +5 -1
- package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
- package/dist/cjs/gridview/gridviewPanel.d.ts +0 -1
- package/dist/cjs/gridview/gridviewPanel.js +3 -6
- package/dist/cjs/gridview/gridviewPanel.js.map +1 -1
- package/dist/cjs/gridview/leafNode.js +2 -1
- package/dist/cjs/gridview/leafNode.js.map +1 -1
- package/dist/cjs/groupview/groupPanel.d.ts +1 -7
- package/dist/cjs/groupview/groupview.d.ts +15 -8
- package/dist/cjs/groupview/groupview.js +36 -123
- package/dist/cjs/groupview/groupview.js.map +1 -1
- package/dist/cjs/groupview/groupviewPanel.d.ts +5 -2
- package/dist/cjs/groupview/groupviewPanel.js.map +1 -1
- package/dist/cjs/groupview/panel/content.js +1 -0
- package/dist/cjs/groupview/panel/content.js.map +1 -1
- package/dist/cjs/groupview/tab.d.ts +10 -13
- package/dist/cjs/groupview/tab.js +22 -80
- package/dist/cjs/groupview/tab.js.map +1 -1
- package/dist/cjs/groupview/titlebar/tabsContainer.js +4 -6
- package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/index.js +8 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lifecycle.js +2 -1
- package/dist/cjs/lifecycle.js.map +1 -1
- package/dist/cjs/panel/types.d.ts +0 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/cjs/paneview/draggablePaneviewPanel.js +32 -29
- package/dist/cjs/paneview/draggablePaneviewPanel.js.map +1 -1
- package/dist/cjs/paneview/paneview.js +4 -3
- package/dist/cjs/paneview/paneview.js.map +1 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +5 -5
- package/dist/cjs/paneview/paneviewComponent.js +15 -16
- package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
- package/dist/cjs/paneview/paneviewPanel.d.ts +5 -1
- package/dist/cjs/paneview/paneviewPanel.js +14 -2
- package/dist/cjs/paneview/paneviewPanel.js.map +1 -1
- package/dist/cjs/react/deserializer.js +1 -3
- package/dist/cjs/react/deserializer.js.map +1 -1
- package/dist/cjs/react/dockview/components.js +5 -1
- package/dist/cjs/react/dockview/components.js.map +1 -1
- package/dist/cjs/react/dockview/dockview.d.ts +9 -9
- package/dist/cjs/react/dockview/dockview.js +28 -2
- package/dist/cjs/react/dockview/dockview.js.map +1 -1
- package/dist/cjs/react/dockview/reactContentPart.js +4 -4
- package/dist/cjs/react/dockview/reactContentPart.js.map +1 -1
- package/dist/cjs/react/dockview/reactHeaderPart.js +1 -0
- package/dist/cjs/react/dockview/reactHeaderPart.js.map +1 -1
- package/dist/cjs/react/dockview/reactWatermarkPart.d.ts +1 -2
- package/dist/cjs/react/dockview/reactWatermarkPart.js +1 -2
- package/dist/cjs/react/dockview/reactWatermarkPart.js.map +1 -1
- package/dist/cjs/react/gridview/gridview.js +9 -2
- package/dist/cjs/react/gridview/gridview.js.map +1 -1
- package/dist/cjs/react/gridview/view.js +2 -2
- package/dist/cjs/react/gridview/view.js.map +1 -1
- package/dist/cjs/react/index.d.ts +1 -0
- package/dist/cjs/react/index.js +5 -1
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/react/paneview/paneview.js +5 -1
- package/dist/cjs/react/paneview/paneview.js.map +1 -1
- package/dist/cjs/react/react.js +6 -3
- package/dist/cjs/react/react.js.map +1 -1
- package/dist/cjs/react/splitview/splitview.js +8 -2
- package/dist/cjs/react/splitview/splitview.js.map +1 -1
- package/dist/cjs/react/splitview/view.js +2 -2
- package/dist/cjs/react/splitview/view.js.map +1 -1
- package/dist/cjs/splitview/core/splitview.js +2 -2
- package/dist/cjs/splitview/core/splitview.js.map +1 -1
- package/dist/cjs/splitview/splitviewComponent.d.ts +9 -6
- package/dist/cjs/splitview/splitviewComponent.js +12 -1
- package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
- package/dist/cjs/splitview/splitviewPanel.d.ts +1 -6
- package/dist/cjs/splitview/splitviewPanel.js +5 -3
- package/dist/cjs/splitview/splitviewPanel.js.map +1 -1
- package/dist/dockview.amd.js +592 -745
- package/dist/dockview.amd.min.js +2 -16
- package/dist/dockview.amd.min.noStyle.js +2 -16
- package/dist/dockview.amd.noStyle.js +591 -744
- package/dist/dockview.cjs.js +592 -745
- package/dist/dockview.esm.js +592 -734
- package/dist/dockview.esm.min.js +2 -16
- package/dist/dockview.js +592 -745
- package/dist/dockview.min.js +2 -16
- package/dist/dockview.min.noStyle.js +2 -16
- package/dist/dockview.noStyle.js +591 -744
- package/dist/esm/api/component.api.d.ts +32 -23
- package/dist/esm/api/component.api.js +51 -24
- package/dist/esm/api/gridviewPanelApi.js +1 -0
- package/dist/esm/api/groupPanelApi.d.ts +11 -14
- package/dist/esm/api/groupPanelApi.js +18 -13
- package/dist/esm/api/panelApi.d.ts +0 -25
- package/dist/esm/api/panelApi.js +1 -20
- package/dist/esm/api/paneviewPanelApi.js +1 -0
- package/dist/esm/api/splitviewPanelApi.d.ts +0 -1
- package/dist/esm/api/splitviewPanelApi.js +1 -5
- package/dist/esm/dnd/abstractDragHandler.d.ts +2 -2
- package/dist/esm/dnd/abstractDragHandler.js +9 -9
- package/dist/esm/dnd/dataTransfer.d.ts +0 -25
- package/dist/esm/dnd/dataTransfer.js +0 -40
- package/dist/esm/dnd/dnd.d.ts +1 -14
- package/dist/esm/dnd/dnd.js +1 -69
- package/dist/esm/dnd/droptarget.d.ts +3 -0
- package/dist/esm/dnd/droptarget.js +69 -45
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +0 -1
- package/dist/esm/dockview/components/tab/defaultTab.js +1 -9
- package/dist/esm/dockview/dockviewComponent.d.ts +31 -21
- package/dist/esm/dockview/dockviewComponent.js +68 -148
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +3 -5
- package/dist/esm/dockview/dockviewGroupPanel.js +6 -30
- package/dist/esm/dockview/options.d.ts +2 -1
- package/dist/esm/events.js +2 -3
- package/dist/esm/gridview/baseComponentGridview.d.ts +12 -20
- package/dist/esm/gridview/baseComponentGridview.js +23 -45
- package/dist/esm/gridview/basePanelView.d.ts +5 -8
- package/dist/esm/gridview/basePanelView.js +10 -8
- package/dist/esm/gridview/branchNode.js +2 -2
- package/dist/esm/gridview/gridview.js +17 -15
- package/dist/esm/gridview/gridviewComponent.d.ts +4 -0
- package/dist/esm/gridview/gridviewComponent.js +6 -2
- package/dist/esm/gridview/gridviewPanel.d.ts +0 -1
- package/dist/esm/gridview/gridviewPanel.js +3 -6
- package/dist/esm/gridview/leafNode.js +1 -0
- package/dist/esm/groupview/groupPanel.d.ts +1 -7
- package/dist/esm/groupview/groupview.d.ts +15 -8
- package/dist/esm/groupview/groupview.js +22 -56
- package/dist/esm/groupview/groupviewPanel.d.ts +5 -2
- package/dist/esm/groupview/panel/content.js +1 -0
- package/dist/esm/groupview/tab.d.ts +10 -13
- package/dist/esm/groupview/tab.js +17 -24
- package/dist/esm/groupview/titlebar/tabsContainer.js +4 -6
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +1 -2
- package/dist/esm/lifecycle.js +2 -1
- package/dist/esm/panel/types.d.ts +0 -2
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +2 -2
- package/dist/esm/paneview/draggablePaneviewPanel.js +32 -29
- package/dist/esm/paneview/paneview.js +2 -2
- package/dist/esm/paneview/paneviewComponent.d.ts +5 -5
- package/dist/esm/paneview/paneviewComponent.js +15 -8
- package/dist/esm/paneview/paneviewPanel.d.ts +5 -1
- package/dist/esm/paneview/paneviewPanel.js +10 -2
- package/dist/esm/react/deserializer.js +1 -3
- package/dist/esm/react/dockview/dockview.d.ts +9 -9
- package/dist/esm/react/dockview/dockview.js +24 -2
- package/dist/esm/react/dockview/reactContentPart.js +4 -4
- package/dist/esm/react/dockview/reactHeaderPart.js +1 -0
- package/dist/esm/react/dockview/reactWatermarkPart.d.ts +1 -2
- package/dist/esm/react/dockview/reactWatermarkPart.js +1 -2
- package/dist/esm/react/gridview/gridview.js +4 -1
- package/dist/esm/react/gridview/view.js +2 -2
- package/dist/esm/react/index.d.ts +1 -0
- package/dist/esm/react/react.js +1 -2
- package/dist/esm/react/splitview/splitview.js +3 -1
- package/dist/esm/react/splitview/view.js +2 -2
- package/dist/esm/splitview/core/splitview.js +2 -2
- package/dist/esm/splitview/splitviewComponent.d.ts +9 -6
- package/dist/esm/splitview/splitviewComponent.js +11 -2
- package/dist/esm/splitview/splitviewPanel.d.ts +1 -6
- package/dist/esm/splitview/splitviewPanel.js +5 -3
- package/dist/styles/dockview.css +51 -54
- package/package.json +11 -11
- package/dist/cjs/functions.d.ts +0 -1
- package/dist/cjs/functions.js +0 -42
- package/dist/cjs/functions.js.map +0 -1
- package/dist/cjs/groupview/panel/hostedPanel.d.ts +0 -22
- package/dist/cjs/groupview/panel/hostedPanel.js +0 -57
- package/dist/cjs/groupview/panel/hostedPanel.js.map +0 -1
- package/dist/cjs/json.d.ts +0 -1
- package/dist/cjs/json.js +0 -14
- package/dist/cjs/json.js.map +0 -1
- package/dist/esm/functions.d.ts +0 -1
- package/dist/esm/functions.js +0 -8
- package/dist/esm/groupview/panel/hostedPanel.d.ts +0 -22
- package/dist/esm/groupview/panel/hostedPanel.js +0 -43
- package/dist/esm/json.d.ts +0 -1
- package/dist/esm/json.js +0 -9
|
@@ -28,7 +28,9 @@ export const GridviewReact = React.forwardRef((props, ref) => {
|
|
|
28
28
|
var _a;
|
|
29
29
|
const element = document.createElement('div');
|
|
30
30
|
const gridview = new GridviewComponent(element, {
|
|
31
|
-
proportionalLayout:
|
|
31
|
+
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
32
|
+
? props.proportionalLayout
|
|
33
|
+
: true,
|
|
32
34
|
orientation: props.orientation,
|
|
33
35
|
frameworkComponents: props.components,
|
|
34
36
|
frameworkComponentFactory: {
|
|
@@ -51,6 +53,7 @@ export const GridviewReact = React.forwardRef((props, ref) => {
|
|
|
51
53
|
gridviewRef.current = gridview;
|
|
52
54
|
return () => {
|
|
53
55
|
gridview.dispose();
|
|
56
|
+
element.remove();
|
|
54
57
|
};
|
|
55
58
|
}, []);
|
|
56
59
|
React.useEffect(() => {
|
|
@@ -9,9 +9,9 @@ export class ReactGridPanelView extends GridviewPanel {
|
|
|
9
9
|
getComponent() {
|
|
10
10
|
var _a;
|
|
11
11
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
12
|
-
params: ((_a = this.
|
|
12
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
13
13
|
api: this.api,
|
|
14
|
-
containerApi: this.
|
|
14
|
+
containerApi: this._params
|
|
15
15
|
.containerApi,
|
|
16
16
|
});
|
|
17
17
|
}
|
|
@@ -4,6 +4,7 @@ export * from './splitview/splitview';
|
|
|
4
4
|
export * from './gridview/gridview';
|
|
5
5
|
export * from './dockview/reactContentPart';
|
|
6
6
|
export * from './dockview/reactHeaderPart';
|
|
7
|
+
export { IWatermarkPanelProps } from './dockview/reactWatermarkPart';
|
|
7
8
|
export * from './paneview/paneview';
|
|
8
9
|
export * from './types';
|
|
9
10
|
export * from './react';
|
package/dist/esm/react/react.js
CHANGED
|
@@ -55,14 +55,13 @@ export class ReactPart {
|
|
|
55
55
|
if (this.disposed) {
|
|
56
56
|
throw new Error('invalid operation: resource is already disposed');
|
|
57
57
|
}
|
|
58
|
-
// TODO use a better check for isReactFunctionalComponent
|
|
59
58
|
if (typeof this.component !== 'function') {
|
|
60
59
|
/**
|
|
61
60
|
* we know this isn't a React.FunctionComponent so throw an error here.
|
|
62
61
|
* if we do not intercept this the React library will throw a very obsure error
|
|
63
62
|
* for the same reason, at least at this point we will emit a sensible stacktrace.
|
|
64
63
|
*/
|
|
65
|
-
throw new Error('
|
|
64
|
+
throw new Error('Invalid Operation. dockview only supports React Functional Components.');
|
|
66
65
|
}
|
|
67
66
|
const bridgeComponent = React.createElement(React.forwardRef(ReactComponentBridge), {
|
|
68
67
|
component: this
|
|
@@ -35,7 +35,9 @@ export const SplitviewReact = React.forwardRef((props, ref) => {
|
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
|
-
proportionalLayout: props.proportionalLayout
|
|
38
|
+
proportionalLayout: typeof props.proportionalLayout === 'boolean'
|
|
39
|
+
? props.proportionalLayout
|
|
40
|
+
: true,
|
|
39
41
|
styles: props.hideBorders
|
|
40
42
|
? { separatorBorder: 'transparent' }
|
|
41
43
|
: undefined,
|
|
@@ -9,9 +9,9 @@ export class ReactPanelView extends SplitviewPanel {
|
|
|
9
9
|
getComponent() {
|
|
10
10
|
var _a;
|
|
11
11
|
return new ReactPart(this.element, this.reactPortalStore, this.reactComponent, {
|
|
12
|
-
params: ((_a = this.
|
|
12
|
+
params: ((_a = this._params) === null || _a === void 0 ? void 0 : _a.params) || {},
|
|
13
13
|
api: this.api,
|
|
14
|
-
containerApi: this.
|
|
14
|
+
containerApi: this._params
|
|
15
15
|
.containerApi,
|
|
16
16
|
});
|
|
17
17
|
}
|
|
@@ -51,7 +51,7 @@ export class Splitview {
|
|
|
51
51
|
this._onDidAddView = new Emitter();
|
|
52
52
|
this.onDidAddView = this._onDidAddView.event;
|
|
53
53
|
this._onDidRemoveView = new Emitter();
|
|
54
|
-
this.onDidRemoveView = this.
|
|
54
|
+
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
55
55
|
this._startSnappingEnabled = true;
|
|
56
56
|
this._endSnappingEnabled = true;
|
|
57
57
|
this.resize = (index, delta, sizes = this.views.map((x) => x.size), lowPriorityIndexes, highPriorityIndexes, overloadMinDelta = Number.NEGATIVE_INFINITY, overloadMaxDelta = Number.POSITIVE_INFINITY, snapBefore, snapAfter) => {
|
|
@@ -678,12 +678,12 @@ export class Splitview {
|
|
|
678
678
|
this._onDidSashEnd.dispose();
|
|
679
679
|
this._onDidAddView.dispose();
|
|
680
680
|
this._onDidRemoveView.dispose();
|
|
681
|
-
this.element.remove();
|
|
682
681
|
for (let i = 0; i < this.element.children.length; i++) {
|
|
683
682
|
if (this.element.children.item(i) === this.element) {
|
|
684
683
|
this.element.removeChild(this.element);
|
|
685
684
|
break;
|
|
686
685
|
}
|
|
687
686
|
}
|
|
687
|
+
this.element.remove();
|
|
688
688
|
}
|
|
689
689
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CompositeDisposable, IDisposable } from '../lifecycle';
|
|
2
|
-
import { LayoutPriority, Orientation, Sizing, Splitview } from './core/splitview';
|
|
2
|
+
import { IView, LayoutPriority, Orientation, Sizing, Splitview } from './core/splitview';
|
|
3
3
|
import { SplitviewComponentOptions } from './core/options';
|
|
4
4
|
import { BaseComponentOptions } from '../panel/types';
|
|
5
5
|
import { Event } from '../events';
|
|
@@ -12,9 +12,6 @@ export interface SerializedSplitviewPanelData {
|
|
|
12
12
|
params?: {
|
|
13
13
|
[index: string]: any;
|
|
14
14
|
};
|
|
15
|
-
state?: {
|
|
16
|
-
[index: string]: any;
|
|
17
|
-
};
|
|
18
15
|
}
|
|
19
16
|
export interface SerializedSplitviewPanel {
|
|
20
17
|
snap?: boolean;
|
|
@@ -42,6 +39,8 @@ export interface ISplitviewComponent extends IDisposable {
|
|
|
42
39
|
readonly width: number;
|
|
43
40
|
readonly length: number;
|
|
44
41
|
readonly orientation: Orientation;
|
|
42
|
+
readonly onDidAddView: Event<IView>;
|
|
43
|
+
readonly onDidRemoveView: Event<IView>;
|
|
45
44
|
updateOptions(options: Partial<SplitviewComponentUpdateOptions>): void;
|
|
46
45
|
addPanel(options: AddSplitviewComponentOptions): void;
|
|
47
46
|
layout(width: number, height: number): void;
|
|
@@ -67,12 +66,16 @@ export declare class SplitviewComponent extends CompositeDisposable implements I
|
|
|
67
66
|
private _activePanel;
|
|
68
67
|
private panels;
|
|
69
68
|
private _options;
|
|
69
|
+
private readonly _onDidAddView;
|
|
70
|
+
readonly onDidAddView: Event<IView>;
|
|
71
|
+
private readonly _onDidRemoveView;
|
|
72
|
+
readonly onDidRemoveView: Event<IView>;
|
|
73
|
+
private readonly _onDidLayoutChange;
|
|
74
|
+
readonly onDidLayoutChange: Event<void>;
|
|
70
75
|
get options(): SplitviewComponentOptions;
|
|
71
76
|
get orientation(): Orientation;
|
|
72
77
|
get splitview(): Splitview;
|
|
73
78
|
set splitview(value: Splitview);
|
|
74
|
-
private readonly _onDidLayoutChange;
|
|
75
|
-
readonly onDidLayoutChange: Event<void>;
|
|
76
79
|
get minimumSize(): number;
|
|
77
80
|
get maximumSize(): number;
|
|
78
81
|
get height(): number;
|
|
@@ -12,6 +12,10 @@ export class SplitviewComponent extends CompositeDisposable {
|
|
|
12
12
|
this.element = element;
|
|
13
13
|
this._disposable = new MutableDisposable();
|
|
14
14
|
this.panels = new Map();
|
|
15
|
+
this._onDidAddView = new Emitter();
|
|
16
|
+
this.onDidAddView = this._onDidAddView.event;
|
|
17
|
+
this._onDidRemoveView = new Emitter();
|
|
18
|
+
this.onDidRemoveView = this._onDidRemoveView.event;
|
|
15
19
|
this._onDidLayoutChange = new Emitter();
|
|
16
20
|
this.onDidLayoutChange = this._onDidLayoutChange.event;
|
|
17
21
|
this._options = options;
|
|
@@ -22,7 +26,7 @@ export class SplitviewComponent extends CompositeDisposable {
|
|
|
22
26
|
options.frameworkComponents = {};
|
|
23
27
|
}
|
|
24
28
|
this.splitview = new Splitview(this.element, options);
|
|
25
|
-
this.addDisposables(this._disposable);
|
|
29
|
+
this.addDisposables(this._disposable, this._onDidAddView, this._onDidRemoveView, this._onDidLayoutChange);
|
|
26
30
|
}
|
|
27
31
|
get options() {
|
|
28
32
|
return this._options;
|
|
@@ -37,7 +41,7 @@ export class SplitviewComponent extends CompositeDisposable {
|
|
|
37
41
|
this._splitview = value;
|
|
38
42
|
this._disposable.value = new CompositeDisposable(this._splitview.onDidSashEnd(() => {
|
|
39
43
|
this._onDidLayoutChange.fire(undefined);
|
|
40
|
-
}));
|
|
44
|
+
}), this._splitview.onDidAddView((e) => this._onDidAddView.fire(e)), this._splitview.onDidRemoveView((e) => this._onDidRemoveView.fire(e)));
|
|
41
45
|
}
|
|
42
46
|
get minimumSize() {
|
|
43
47
|
return this.splitview.minimumSize;
|
|
@@ -211,6 +215,10 @@ export class SplitviewComponent extends CompositeDisposable {
|
|
|
211
215
|
});
|
|
212
216
|
panel.orientation = orientation;
|
|
213
217
|
this.doAddView(panel);
|
|
218
|
+
setTimeout(() => {
|
|
219
|
+
// the original onDidAddView events are missed since they are fired before we can subcribe to them
|
|
220
|
+
this._onDidAddView.fire(panel);
|
|
221
|
+
}, 0);
|
|
214
222
|
return { size: view.size, view: panel };
|
|
215
223
|
}),
|
|
216
224
|
},
|
|
@@ -236,6 +244,7 @@ export class SplitviewComponent extends CompositeDisposable {
|
|
|
236
244
|
value.dispose();
|
|
237
245
|
});
|
|
238
246
|
this.panels.clear();
|
|
247
|
+
this.splitview.dispose();
|
|
239
248
|
super.dispose();
|
|
240
249
|
}
|
|
241
250
|
}
|
|
@@ -36,12 +36,7 @@ export declare abstract class SplitviewPanel extends BasePanelView<SplitviewPane
|
|
|
36
36
|
maximumSize: number | undefined;
|
|
37
37
|
id: string;
|
|
38
38
|
component: string;
|
|
39
|
-
params?:
|
|
40
|
-
[key: string]: any;
|
|
41
|
-
} | undefined;
|
|
42
|
-
state?: {
|
|
43
|
-
[key: string]: any;
|
|
44
|
-
} | undefined;
|
|
39
|
+
params?: Record<string, any> | undefined;
|
|
45
40
|
};
|
|
46
41
|
private updateConstraints;
|
|
47
42
|
}
|
|
@@ -12,12 +12,14 @@ export class SplitviewPanel extends BasePanelView {
|
|
|
12
12
|
this._snap = false;
|
|
13
13
|
this._onDidChange = new Emitter();
|
|
14
14
|
this.onDidChange = this._onDidChange.event;
|
|
15
|
-
this.addDisposables(this.api.onVisibilityChange((event) => {
|
|
15
|
+
this.addDisposables(this._onDidChange, this.api.onVisibilityChange((event) => {
|
|
16
16
|
const { isVisible } = event;
|
|
17
|
-
const { containerApi } = this
|
|
17
|
+
const { containerApi } = this
|
|
18
|
+
._params;
|
|
18
19
|
containerApi.setVisible(this, isVisible);
|
|
19
20
|
}), this.api.onActiveChange(() => {
|
|
20
|
-
const { containerApi } = this
|
|
21
|
+
const { containerApi } = this
|
|
22
|
+
._params;
|
|
21
23
|
containerApi.setActive(this);
|
|
22
24
|
}), this.api.onDidConstraintsChangeInternal((event) => {
|
|
23
25
|
if (typeof event.minimumSize === 'number' ||
|
package/dist/styles/dockview.css
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
--dv-tabs-and-actions-container-font-size: 13px;
|
|
4
4
|
--dv-tabs-and-actions-container-height: 35px;
|
|
5
5
|
--dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
|
|
6
|
-
--dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"/></svg>');
|
|
7
6
|
--dv-drag-over-background-color: rgba(83, 89, 93, 0.5);
|
|
8
7
|
--dv-drag-over-border-color: white;
|
|
9
8
|
--dv-tabs-container-scrollbar-color: #888;
|
|
@@ -27,7 +26,6 @@
|
|
|
27
26
|
--dv-tabs-and-actions-container-font-size: 13px;
|
|
28
27
|
--dv-tabs-and-actions-container-height: 35px;
|
|
29
28
|
--dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
|
|
30
|
-
--dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"/></svg>');
|
|
31
29
|
--dv-drag-over-background-color: rgba(83, 89, 93, 0.5);
|
|
32
30
|
--dv-drag-over-border-color: white;
|
|
33
31
|
--dv-tabs-container-scrollbar-color: #888;
|
|
@@ -51,7 +49,6 @@
|
|
|
51
49
|
--dv-tabs-and-actions-container-font-size: 13px;
|
|
52
50
|
--dv-tabs-and-actions-container-height: 35px;
|
|
53
51
|
--dv-tab-close-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>');
|
|
54
|
-
--dv-tab-dirty-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"/></svg>');
|
|
55
52
|
--dv-drag-over-background-color: rgba(83, 89, 93, 0.5);
|
|
56
53
|
--dv-drag-over-border-color: white;
|
|
57
54
|
--dv-tabs-container-scrollbar-color: #888;
|
|
@@ -105,6 +102,52 @@
|
|
|
105
102
|
margin-right: "0.5em";
|
|
106
103
|
cursor: pointer;
|
|
107
104
|
}
|
|
105
|
+
.drop-target {
|
|
106
|
+
position: relative;
|
|
107
|
+
}
|
|
108
|
+
.drop-target > .drop-target-dropzone {
|
|
109
|
+
position: absolute;
|
|
110
|
+
left: 0px;
|
|
111
|
+
top: 0px;
|
|
112
|
+
height: 100%;
|
|
113
|
+
width: 100%;
|
|
114
|
+
z-index: 10000;
|
|
115
|
+
}
|
|
116
|
+
.drop-target > .drop-target-dropzone > .drop-target-selection {
|
|
117
|
+
position: relative;
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
height: 100%;
|
|
120
|
+
width: 100%;
|
|
121
|
+
background-color: var(--dv-drag-over-background-color);
|
|
122
|
+
transition-duration: 0.15s;
|
|
123
|
+
transition-timing-function: ease-out;
|
|
124
|
+
will-change: transform;
|
|
125
|
+
pointer-events: none;
|
|
126
|
+
}
|
|
127
|
+
.drop-target > .drop-target-dropzone > .drop-target-selection.left {
|
|
128
|
+
transform: translateX(-25%) scaleX(50%);
|
|
129
|
+
}
|
|
130
|
+
.drop-target > .drop-target-dropzone > .drop-target-selection.right {
|
|
131
|
+
transform: translateX(25%) scaleX(50%);
|
|
132
|
+
}
|
|
133
|
+
.drop-target > .drop-target-dropzone > .drop-target-selection.top {
|
|
134
|
+
transform: translateY(-25%) scaleY(50%);
|
|
135
|
+
}
|
|
136
|
+
.drop-target > .drop-target-dropzone > .drop-target-selection.bottom {
|
|
137
|
+
transform: translateY(25%) scaleY(50%);
|
|
138
|
+
}
|
|
139
|
+
.drop-target > .drop-target-dropzone > .drop-target-selection.small-top {
|
|
140
|
+
border-top: 1px solid var(--dv-drag-over-border-color);
|
|
141
|
+
}
|
|
142
|
+
.drop-target > .drop-target-dropzone > .drop-target-selection.small-bottom {
|
|
143
|
+
border-bottom: 1px solid var(--dv-drag-over-border-color);
|
|
144
|
+
}
|
|
145
|
+
.drop-target > .drop-target-dropzone > .drop-target-selection.small-left {
|
|
146
|
+
border-left: 1px solid var(--dv-drag-over-border-color);
|
|
147
|
+
}
|
|
148
|
+
.drop-target > .drop-target-dropzone > .drop-target-selection.small-right {
|
|
149
|
+
border-right: 1px solid var(--dv-drag-over-border-color);
|
|
150
|
+
}
|
|
108
151
|
.custom-dragging {
|
|
109
152
|
height: 24px;
|
|
110
153
|
line-height: 24px;
|
|
@@ -154,51 +197,6 @@
|
|
|
154
197
|
background-color: var(--dv-activegroup-visiblepanel-tab-background-color);
|
|
155
198
|
color: var(--dv-activegroup-visiblepanel-tab-color);
|
|
156
199
|
}
|
|
157
|
-
.drop-target {
|
|
158
|
-
position: relative;
|
|
159
|
-
}
|
|
160
|
-
.drop-target > .drop-target-dropzone {
|
|
161
|
-
position: absolute;
|
|
162
|
-
left: 0px;
|
|
163
|
-
top: 0px;
|
|
164
|
-
height: 100%;
|
|
165
|
-
width: 100%;
|
|
166
|
-
z-index: 10000;
|
|
167
|
-
}
|
|
168
|
-
.drop-target > .drop-target-dropzone > .drop-target-selection {
|
|
169
|
-
position: relative;
|
|
170
|
-
pointer-events: none;
|
|
171
|
-
box-sizing: border-box;
|
|
172
|
-
height: 100%;
|
|
173
|
-
width: 100%;
|
|
174
|
-
background-color: var(--dv-drag-over-background-color);
|
|
175
|
-
transition-duration: 0.15s;
|
|
176
|
-
transition-timing-function: ease-out;
|
|
177
|
-
}
|
|
178
|
-
.drop-target > .drop-target-dropzone > .drop-target-selection.left, .drop-target > .drop-target-dropzone > .drop-target-selection.right {
|
|
179
|
-
width: 50%;
|
|
180
|
-
}
|
|
181
|
-
.drop-target > .drop-target-dropzone > .drop-target-selection.right {
|
|
182
|
-
transform: translate(100%, 0%);
|
|
183
|
-
}
|
|
184
|
-
.drop-target > .drop-target-dropzone > .drop-target-selection.bottom {
|
|
185
|
-
transform: translate(0%, 100%);
|
|
186
|
-
}
|
|
187
|
-
.drop-target > .drop-target-dropzone > .drop-target-selection.top, .drop-target > .drop-target-dropzone > .drop-target-selection.bottom {
|
|
188
|
-
height: 50%;
|
|
189
|
-
}
|
|
190
|
-
.drop-target > .drop-target-dropzone > .drop-target-selection.small-top {
|
|
191
|
-
border-top: 1px solid var(--dv-drag-over-border-color);
|
|
192
|
-
}
|
|
193
|
-
.drop-target > .drop-target-dropzone > .drop-target-selection.small-bottom {
|
|
194
|
-
border-bottom: 1px solid var(--dv-drag-over-border-color);
|
|
195
|
-
}
|
|
196
|
-
.drop-target > .drop-target-dropzone > .drop-target-selection.small-left {
|
|
197
|
-
border-left: 1px solid var(--dv-drag-over-border-color);
|
|
198
|
-
}
|
|
199
|
-
.drop-target > .drop-target-dropzone > .drop-target-selection.small-right {
|
|
200
|
-
border-right: 1px solid var(--dv-drag-over-border-color);
|
|
201
|
-
}
|
|
202
200
|
.grid-view,
|
|
203
201
|
.branch-node {
|
|
204
202
|
height: 100%;
|
|
@@ -357,6 +355,10 @@
|
|
|
357
355
|
width: 1px;
|
|
358
356
|
height: 100%;
|
|
359
357
|
}
|
|
358
|
+
.dockview-react-part {
|
|
359
|
+
height: 100%;
|
|
360
|
+
width: 100%;
|
|
361
|
+
}
|
|
360
362
|
.split-view-container {
|
|
361
363
|
position: relative;
|
|
362
364
|
overflow: hidden;
|
|
@@ -470,7 +472,7 @@
|
|
|
470
472
|
.tab.active-tab > .default-tab .tab-action {
|
|
471
473
|
visibility: visible;
|
|
472
474
|
}
|
|
473
|
-
.tab.inactive-tab > .default-tab .tab-action
|
|
475
|
+
.tab.inactive-tab > .default-tab .tab-action {
|
|
474
476
|
visibility: hidden;
|
|
475
477
|
}
|
|
476
478
|
.tab.inactive-tab > .default-tab:hover .tab-action {
|
|
@@ -515,11 +517,6 @@
|
|
|
515
517
|
.tab .default-tab .action-container .tab-list .tab-action.disable-close {
|
|
516
518
|
display: none;
|
|
517
519
|
}
|
|
518
|
-
.tab .default-tab .action-container .tab-list .tab-action.dirty:not(:hover) {
|
|
519
|
-
display: block;
|
|
520
|
-
-webkit-mask: var(--dv-tab-dirty-icon) 50% 50%/60% 60% no-repeat;
|
|
521
|
-
mask: var(--dv-tab-dirty-icon) 50% 50%/60% 60% no-repeat;
|
|
522
|
-
}
|
|
523
520
|
.watermark {
|
|
524
521
|
display: flex;
|
|
525
522
|
width: 100%;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dockview",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Zero dependency layout manager supporting tabs, grids and splitviews with ReactJS support",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/cjs/index.d.ts",
|
|
@@ -55,23 +55,23 @@
|
|
|
55
55
|
"author": "https://github.com/mathuo",
|
|
56
56
|
"license": "MIT",
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@rollup/plugin-typescript": "^8.3.
|
|
59
|
-
"@testing-library/react": "^
|
|
60
|
-
"@types/react": "^
|
|
61
|
-
"@types/react-dom": "^
|
|
58
|
+
"@rollup/plugin-typescript": "^8.3.2",
|
|
59
|
+
"@testing-library/react": "^13.1.0",
|
|
60
|
+
"@types/react": "^18.0.5",
|
|
61
|
+
"@types/react-dom": "^18.0.1",
|
|
62
62
|
"cross-env": "^7.0.3",
|
|
63
|
-
"postcss": "^8.4.
|
|
64
|
-
"react": "^
|
|
65
|
-
"react-dom": "^
|
|
63
|
+
"postcss": "^8.4.12",
|
|
64
|
+
"react": "^18.0.0",
|
|
65
|
+
"react-dom": "^18.0.0",
|
|
66
66
|
"rimraf": "^3.0.2",
|
|
67
|
-
"rollup": "^2.
|
|
67
|
+
"rollup": "^2.70.2",
|
|
68
68
|
"rollup-plugin-postcss": "^4.0.2",
|
|
69
69
|
"rollup-plugin-terser": "^7.0.2",
|
|
70
|
-
"typedoc": "^0.22.
|
|
70
|
+
"typedoc": "^0.22.15"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"react": ">=16.8.0",
|
|
74
74
|
"react-dom": ">=16.8.0"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "2dc0c4ab219a5b2188b9d98e032d9b987561bf4d"
|
|
77
77
|
}
|
package/dist/cjs/functions.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function debounce<T extends Function>(cb: T, wait: number): T;
|
package/dist/cjs/functions.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
-
if (!m) return o;
|
|
5
|
-
var i = m.call(o), r, ar = [], e;
|
|
6
|
-
try {
|
|
7
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
-
}
|
|
9
|
-
catch (error) { e = { error: error }; }
|
|
10
|
-
finally {
|
|
11
|
-
try {
|
|
12
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
-
}
|
|
14
|
-
finally { if (e) throw e.error; }
|
|
15
|
-
}
|
|
16
|
-
return ar;
|
|
17
|
-
};
|
|
18
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
-
if (ar || !(i in from)) {
|
|
21
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
-
ar[i] = from[i];
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.debounce = void 0;
|
|
29
|
-
function debounce(cb, wait) {
|
|
30
|
-
var timeout;
|
|
31
|
-
var callable = function () {
|
|
32
|
-
var args = [];
|
|
33
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
34
|
-
args[_i] = arguments[_i];
|
|
35
|
-
}
|
|
36
|
-
clearTimeout(timeout);
|
|
37
|
-
timeout = setTimeout(function () { return cb.apply(void 0, __spreadArray([], __read(args), false)); }, wait);
|
|
38
|
-
};
|
|
39
|
-
return callable;
|
|
40
|
-
}
|
|
41
|
-
exports.debounce = debounce;
|
|
42
|
-
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,QAAQ,CAAqB,EAAK,EAAE,IAAY;IAC5D,IAAI,OAAY,CAAC;IAEjB,IAAM,QAAQ,GAAG;QAAC,cAAY;aAAZ,UAAY,EAAZ,qBAAY,EAAZ,IAAY;YAAZ,yBAAY;;QAC1B,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,GAAG,UAAU,CAAC,cAAM,OAAA,EAAE,wCAAI,IAAI,YAAV,CAAW,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC,CAAC;IACF,OAAgB,QAAS,CAAC;AAC9B,CAAC;AARD,4BAQC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IDisposable } from '../../lifecycle';
|
|
2
|
-
import { IGroupPanel } from '../groupPanel';
|
|
3
|
-
import { IRenderable } from '../types';
|
|
4
|
-
export interface HostedPanelOptions {
|
|
5
|
-
id: string;
|
|
6
|
-
parent?: HTMLElement;
|
|
7
|
-
}
|
|
8
|
-
export declare class HostedPanel implements IRenderable, IDisposable {
|
|
9
|
-
private readonly panel;
|
|
10
|
-
private readonly options;
|
|
11
|
-
private readonly _element;
|
|
12
|
-
get element(): HTMLElement;
|
|
13
|
-
get id(): string;
|
|
14
|
-
constructor(panel: IGroupPanel, options: HostedPanelOptions);
|
|
15
|
-
hide(): void;
|
|
16
|
-
show(): void;
|
|
17
|
-
layout(element: HTMLElement, dimension?: {
|
|
18
|
-
width: number;
|
|
19
|
-
height: number;
|
|
20
|
-
}): void;
|
|
21
|
-
dispose(): void;
|
|
22
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HostedPanel = void 0;
|
|
4
|
-
var HostedPanel = /** @class */ (function () {
|
|
5
|
-
function HostedPanel(panel, options) {
|
|
6
|
-
this.panel = panel;
|
|
7
|
-
this.options = options;
|
|
8
|
-
if (!options.parent) {
|
|
9
|
-
options.parent = document.getElementById('app');
|
|
10
|
-
options.parent.style.position = 'relative';
|
|
11
|
-
}
|
|
12
|
-
this._element = document.createElement('div');
|
|
13
|
-
this._element.style.visibility = 'hidden';
|
|
14
|
-
this._element.style.overflow = 'hidden';
|
|
15
|
-
// this._element.style.pointerEvents = 'none';
|
|
16
|
-
this._element.id = "webivew-".concat(options.id);
|
|
17
|
-
options.parent.appendChild(this._element);
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(HostedPanel.prototype, "element", {
|
|
20
|
-
get: function () {
|
|
21
|
-
return this._element;
|
|
22
|
-
},
|
|
23
|
-
enumerable: false,
|
|
24
|
-
configurable: true
|
|
25
|
-
});
|
|
26
|
-
Object.defineProperty(HostedPanel.prototype, "id", {
|
|
27
|
-
get: function () {
|
|
28
|
-
return this.panel.id;
|
|
29
|
-
},
|
|
30
|
-
enumerable: false,
|
|
31
|
-
configurable: true
|
|
32
|
-
});
|
|
33
|
-
HostedPanel.prototype.hide = function () {
|
|
34
|
-
this._element.style.visibility = 'hidden';
|
|
35
|
-
};
|
|
36
|
-
HostedPanel.prototype.show = function () {
|
|
37
|
-
this._element.style.visibility = 'visible';
|
|
38
|
-
};
|
|
39
|
-
HostedPanel.prototype.layout = function (element, dimension) {
|
|
40
|
-
if (!this.element || !this.element.parentElement) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
var frameRect = element.getBoundingClientRect();
|
|
44
|
-
var containerRect = this.element.parentElement.getBoundingClientRect();
|
|
45
|
-
this.element.style.position = 'absolute';
|
|
46
|
-
this.element.style.top = "".concat(frameRect.top - containerRect.top, "px");
|
|
47
|
-
this.element.style.left = "".concat(frameRect.left - containerRect.left, "px");
|
|
48
|
-
this.element.style.width = "".concat(dimension ? dimension.width : frameRect.width, "px");
|
|
49
|
-
this.element.style.height = "".concat(dimension ? dimension.height : frameRect.height, "px");
|
|
50
|
-
};
|
|
51
|
-
HostedPanel.prototype.dispose = function () {
|
|
52
|
-
this._element.remove();
|
|
53
|
-
};
|
|
54
|
-
return HostedPanel;
|
|
55
|
-
}());
|
|
56
|
-
exports.HostedPanel = HostedPanel;
|
|
57
|
-
//# sourceMappingURL=hostedPanel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hostedPanel.js","sourceRoot":"","sources":["../../../../src/groupview/panel/hostedPanel.ts"],"names":[],"mappings":";;;AASA;IAWI,qBACqB,KAAkB,EAClB,OAA2B;QAD3B,UAAK,GAAL,KAAK,CAAa;QAClB,YAAO,GAAP,OAAO,CAAoB;QAE5C,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACjB,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAgB,CAAC;YAC/D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;SAC9C;QAED,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;QAC1C,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACxC,8CAA8C;QAC9C,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,kBAAW,OAAO,CAAC,EAAE,CAAE,CAAC;QAE3C,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAxBD,sBAAI,gCAAO;aAAX;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;;;OAAA;IAED,sBAAI,2BAAE;aAAN;YACI,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,CAAC;;;OAAA;IAoBD,0BAAI,GAAJ;QACI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC9C,CAAC;IAED,0BAAI,GAAJ;QACI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC;IAC/C,CAAC;IAED,4BAAM,GAAN,UACI,OAAoB,EACpB,SAA6C;QAE7C,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YAC9C,OAAO;SACV;QACD,IAAM,SAAS,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;QAClD,IAAM,aAAa,GACf,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;QACvD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;QACzC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,UAAG,SAAS,CAAC,GAAG,GAAG,aAAa,CAAC,GAAG,OAAI,CAAC;QAClE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,UAAG,SAAS,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI,OAAI,CAAC;QACrE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,UACvB,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,OAC7C,CAAC;QACL,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,UACxB,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,OAC/C,CAAC;IACT,CAAC;IAED,6BAAO,GAAP;QACI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC3B,CAAC;IACL,kBAAC;AAAD,CAAC,AA7DD,IA6DC;AA7DY,kCAAW"}
|
package/dist/cjs/json.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tryParseJSON(text: string, reviver?: (this: any, key: string, value: any) => any): any | undefined;
|
package/dist/cjs/json.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tryParseJSON = void 0;
|
|
4
|
-
function tryParseJSON(text, reviver) {
|
|
5
|
-
try {
|
|
6
|
-
return JSON.parse(text, reviver);
|
|
7
|
-
}
|
|
8
|
-
catch (err) {
|
|
9
|
-
console.warn('failed to parse JSON');
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.tryParseJSON = tryParseJSON;
|
|
14
|
-
//# sourceMappingURL=json.js.map
|
package/dist/cjs/json.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/json.ts"],"names":[],"mappings":";;;AAIA,SAAgB,YAAY,CACxB,IAAY,EACZ,OAAqD;IAErD,IAAI;QACA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAM,CAAC;KACzC;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACrC,OAAO,SAAS,CAAC;KACpB;AACL,CAAC;AAVD,oCAUC"}
|
package/dist/esm/functions.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function debounce<T extends Function>(cb: T, wait: number): T;
|
package/dist/esm/functions.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IDisposable } from '../../lifecycle';
|
|
2
|
-
import { IGroupPanel } from '../groupPanel';
|
|
3
|
-
import { IRenderable } from '../types';
|
|
4
|
-
export interface HostedPanelOptions {
|
|
5
|
-
id: string;
|
|
6
|
-
parent?: HTMLElement;
|
|
7
|
-
}
|
|
8
|
-
export declare class HostedPanel implements IRenderable, IDisposable {
|
|
9
|
-
private readonly panel;
|
|
10
|
-
private readonly options;
|
|
11
|
-
private readonly _element;
|
|
12
|
-
get element(): HTMLElement;
|
|
13
|
-
get id(): string;
|
|
14
|
-
constructor(panel: IGroupPanel, options: HostedPanelOptions);
|
|
15
|
-
hide(): void;
|
|
16
|
-
show(): void;
|
|
17
|
-
layout(element: HTMLElement, dimension?: {
|
|
18
|
-
width: number;
|
|
19
|
-
height: number;
|
|
20
|
-
}): void;
|
|
21
|
-
dispose(): void;
|
|
22
|
-
}
|