dockview 1.5.0 → 1.5.2
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/LICENSE +21 -21
- package/README.md +52 -52
- package/dist/cjs/actionbar/actionsContainer.d.ts +7 -7
- package/dist/cjs/actionbar/actionsContainer.js +26 -26
- package/dist/cjs/api/component.api.d.ts +144 -144
- package/dist/cjs/api/component.api.js +571 -571
- package/dist/cjs/api/gridviewPanelApi.d.ts +36 -36
- package/dist/cjs/api/gridviewPanelApi.js +47 -47
- package/dist/cjs/api/groupPanelApi.d.ts +34 -41
- package/dist/cjs/api/groupPanelApi.js +85 -96
- package/dist/cjs/api/groupPanelApi.js.map +1 -1
- package/dist/cjs/api/panelApi.d.ts +81 -81
- package/dist/cjs/api/panelApi.js +121 -121
- package/dist/cjs/api/paneviewPanelApi.d.ts +26 -26
- package/dist/cjs/api/paneviewPanelApi.js +57 -57
- package/dist/cjs/api/splitviewPanelApi.d.ts +32 -32
- package/dist/cjs/api/splitviewPanelApi.js +47 -47
- package/dist/cjs/array.d.ts +13 -13
- package/dist/cjs/array.js +77 -77
- package/dist/cjs/dnd/abstractDragHandler.d.ts +11 -11
- package/dist/cjs/dnd/abstractDragHandler.js +115 -115
- package/dist/cjs/dnd/dataTransfer.d.ts +31 -31
- package/dist/cjs/dnd/dataTransfer.js +100 -100
- package/dist/cjs/dnd/dnd.d.ts +27 -27
- package/dist/cjs/dnd/dnd.js +64 -64
- package/dist/cjs/dnd/droptarget.d.ts +37 -37
- package/dist/cjs/dnd/droptarget.js +201 -201
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +27 -27
- package/dist/cjs/dockview/components/tab/defaultTab.js +121 -126
- package/dist/cjs/dockview/components/tab/defaultTab.js.map +1 -1
- package/dist/cjs/dockview/components/watermark/watermark.d.ts +20 -20
- package/dist/cjs/dockview/components/watermark/watermark.js +101 -101
- package/dist/cjs/dockview/defaultGroupPanelView.d.ts +29 -29
- package/dist/cjs/dockview/defaultGroupPanelView.js +68 -68
- package/dist/cjs/dockview/deserializer.d.ts +5 -5
- package/dist/cjs/dockview/deserializer.js +2 -2
- package/dist/cjs/dockview/dockviewComponent.d.ts +125 -130
- package/dist/cjs/dockview/dockviewComponent.js +614 -629
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +31 -33
- package/dist/cjs/dockview/dockviewGroupPanel.js +156 -175
- package/dist/cjs/dockview/dockviewGroupPanel.js.map +1 -1
- package/dist/cjs/dockview/options.d.ts +88 -89
- package/dist/cjs/dockview/options.js +2 -2
- package/dist/cjs/dom.d.ts +14 -14
- package/dist/cjs/dom.js +182 -182
- package/dist/cjs/events.d.ts +30 -30
- package/dist/cjs/events.js +129 -129
- package/dist/cjs/gridview/baseComponentGridview.d.ts +87 -87
- package/dist/cjs/gridview/baseComponentGridview.js +279 -279
- package/dist/cjs/gridview/basePanelView.d.ts +43 -43
- package/dist/cjs/gridview/basePanelView.js +123 -123
- package/dist/cjs/gridview/branchNode.d.ts +49 -46
- package/dist/cjs/gridview/branchNode.js +342 -342
- package/dist/cjs/gridview/branchNode.js.map +1 -1
- package/dist/cjs/gridview/gridview.d.ts +126 -123
- package/dist/cjs/gridview/gridview.js +479 -479
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +85 -85
- package/dist/cjs/gridview/gridviewComponent.js +325 -325
- package/dist/cjs/gridview/gridviewPanel.d.ts +60 -60
- package/dist/cjs/gridview/gridviewPanel.js +202 -202
- package/dist/cjs/gridview/leafNode.d.ts +34 -31
- package/dist/cjs/gridview/leafNode.js +170 -165
- package/dist/cjs/gridview/leafNode.js.map +1 -1
- package/dist/cjs/gridview/options.d.ts +18 -18
- package/dist/cjs/gridview/options.js +2 -2
- package/dist/cjs/gridview/types.d.ts +3 -3
- package/dist/cjs/gridview/types.js +2 -2
- package/dist/cjs/groupview/dnd.d.ts +5 -5
- package/dist/cjs/groupview/dnd.js +9 -9
- package/dist/cjs/groupview/groupPanel.d.ts +32 -35
- package/dist/cjs/groupview/groupPanel.js +2 -2
- package/dist/cjs/groupview/groupview.d.ts +177 -177
- package/dist/cjs/groupview/groupview.js +589 -589
- package/dist/cjs/groupview/groupviewPanel.d.ts +35 -35
- package/dist/cjs/groupview/groupviewPanel.js +128 -128
- package/dist/cjs/groupview/panel/content.d.ts +30 -30
- package/dist/cjs/groupview/panel/content.js +100 -100
- package/dist/cjs/groupview/tab.d.ts +41 -42
- package/dist/cjs/groupview/tab.js +120 -126
- package/dist/cjs/groupview/tab.js.map +1 -1
- package/dist/cjs/groupview/titlebar/tabsContainer.d.ts +68 -68
- package/dist/cjs/groupview/titlebar/tabsContainer.js +258 -270
- package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
- package/dist/cjs/groupview/types.d.ts +52 -53
- package/dist/cjs/groupview/types.js +2 -2
- package/dist/cjs/hostedContainer.d.ts +23 -23
- package/dist/cjs/hostedContainer.js +73 -73
- package/dist/cjs/index.d.ts +30 -30
- package/dist/cjs/index.js +46 -46
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lifecycle.d.ts +22 -22
- package/dist/cjs/lifecycle.js +88 -88
- package/dist/cjs/math.d.ts +4 -4
- package/dist/cjs/math.js +15 -15
- package/dist/cjs/panel/componentFactory.d.ts +8 -8
- package/dist/cjs/panel/componentFactory.js +30 -30
- package/dist/cjs/panel/types.d.ts +33 -33
- package/dist/cjs/panel/types.js +2 -2
- package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +21 -21
- package/dist/cjs/paneview/defaultPaneviewHeader.js +90 -90
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +19 -19
- package/dist/cjs/paneview/draggablePaneviewPanel.js +129 -129
- package/dist/cjs/paneview/options.d.ts +27 -27
- package/dist/cjs/paneview/options.js +2 -2
- package/dist/cjs/paneview/paneview.d.ts +40 -40
- package/dist/cjs/paneview/paneview.js +201 -201
- package/dist/cjs/paneview/paneviewComponent.d.ts +129 -129
- package/dist/cjs/paneview/paneviewComponent.js +394 -394
- package/dist/cjs/paneview/paneviewPanel.d.ts +92 -89
- package/dist/cjs/paneview/paneviewPanel.js +274 -274
- package/dist/cjs/paneview/paneviewPanel.js.map +1 -1
- package/dist/cjs/react/deserializer.d.ts +9 -9
- package/dist/cjs/react/deserializer.js +43 -45
- package/dist/cjs/react/deserializer.js.map +1 -1
- package/dist/cjs/react/dockview/defaultTab.d.ts +4 -4
- package/dist/cjs/react/dockview/defaultTab.js +72 -72
- package/dist/cjs/react/dockview/defaultTab.js.map +1 -1
- package/dist/cjs/react/dockview/dockview.d.ts +34 -35
- package/dist/cjs/react/dockview/dockview.js +212 -227
- package/dist/cjs/react/dockview/dockview.js.map +1 -1
- package/dist/cjs/react/dockview/groupControlsRenderer.d.ts +43 -43
- package/dist/cjs/react/dockview/groupControlsRenderer.js +86 -86
- package/dist/cjs/react/dockview/reactContentPart.d.ts +30 -30
- package/dist/cjs/react/dockview/reactContentPart.js +58 -58
- package/dist/cjs/react/dockview/reactHeaderPart.d.ts +26 -26
- package/dist/cjs/react/dockview/reactHeaderPart.js +55 -55
- package/dist/cjs/react/dockview/reactWatermarkPart.d.ts +29 -29
- package/dist/cjs/react/dockview/reactWatermarkPart.js +65 -65
- package/dist/cjs/react/dockview/v2/reactContentRenderer.d.ts +29 -29
- package/dist/cjs/react/dockview/v2/reactContentRenderer.js +87 -87
- package/dist/cjs/react/dockview/v2/reactGroupPanelView.d.ts +7 -7
- package/dist/cjs/react/dockview/v2/reactGroupPanelView.js +34 -34
- package/dist/cjs/react/dockview/v2/webviewContentRenderer.d.ts +18 -18
- package/dist/cjs/react/dockview/v2/webviewContentRenderer.js +45 -45
- package/dist/cjs/react/gridview/gridview.d.ts +24 -24
- package/dist/cjs/react/gridview/gridview.js +112 -112
- package/dist/cjs/react/gridview/view.d.ts +11 -11
- package/dist/cjs/react/gridview/view.js +40 -40
- package/dist/cjs/react/index.d.ts +9 -9
- package/dist/cjs/react/index.js +23 -23
- package/dist/cjs/react/paneview/paneview.d.ts +30 -30
- package/dist/cjs/react/paneview/paneview.js +155 -155
- package/dist/cjs/react/paneview/view.d.ts +20 -20
- package/dist/cjs/react/paneview/view.js +44 -44
- package/dist/cjs/react/react.d.ts +36 -36
- package/dist/cjs/react/react.js +194 -194
- package/dist/cjs/react/splitview/splitview.d.ts +24 -24
- package/dist/cjs/react/splitview/splitview.js +108 -108
- package/dist/cjs/react/splitview/view.d.ts +10 -10
- package/dist/cjs/react/splitview/view.js +40 -40
- package/dist/cjs/react/svg.d.ts +3 -3
- package/dist/cjs/react/svg.js +35 -35
- package/dist/cjs/react/types.d.ts +7 -7
- package/dist/cjs/react/types.js +2 -2
- package/dist/cjs/splitview/core/options.d.ts +26 -26
- package/dist/cjs/splitview/core/options.js +2 -2
- package/dist/cjs/splitview/core/splitview.d.ts +127 -124
- package/dist/cjs/splitview/core/splitview.js +908 -908
- package/dist/cjs/splitview/core/splitview.js.map +1 -1
- package/dist/cjs/splitview/core/viewItem.d.ts +25 -25
- package/dist/cjs/splitview/core/viewItem.js +124 -124
- package/dist/cjs/splitview/splitviewComponent.d.ts +101 -101
- package/dist/cjs/splitview/splitviewComponent.js +373 -373
- package/dist/cjs/splitview/splitviewPanel.d.ts +45 -42
- package/dist/cjs/splitview/splitviewPanel.js +178 -178
- package/dist/cjs/splitview/splitviewPanel.js.map +1 -1
- package/dist/cjs/svg.d.ts +3 -3
- package/dist/cjs/svg.js +43 -43
- package/dist/cjs/types.d.ts +7 -7
- package/dist/cjs/types.js +2 -2
- package/dist/dockview.amd.js +6737 -6797
- package/dist/dockview.amd.min.js +2 -2
- package/dist/dockview.amd.min.noStyle.js +2 -2
- package/dist/dockview.amd.noStyle.js +6743 -6803
- package/dist/dockview.cjs.js +6737 -6797
- package/dist/dockview.esm.js +6731 -6791
- package/dist/dockview.esm.min.js +2 -2
- package/dist/dockview.js +6737 -6797
- package/dist/dockview.min.js +2 -2
- package/dist/dockview.min.noStyle.js +2 -2
- package/dist/dockview.noStyle.js +6743 -6803
- package/dist/esm/actionbar/actionsContainer.d.ts +7 -7
- package/dist/esm/actionbar/actionsContainer.js +17 -17
- package/dist/esm/api/component.api.d.ts +144 -144
- package/dist/esm/api/component.api.js +326 -326
- package/dist/esm/api/gridviewPanelApi.d.ts +36 -36
- package/dist/esm/api/gridviewPanelApi.js +25 -25
- package/dist/esm/api/groupPanelApi.d.ts +34 -41
- package/dist/esm/api/groupPanelApi.js +50 -57
- package/dist/esm/api/panelApi.d.ts +81 -81
- package/dist/esm/api/panelApi.js +79 -79
- package/dist/esm/api/paneviewPanelApi.d.ts +26 -26
- package/dist/esm/api/paneviewPanelApi.js +27 -27
- package/dist/esm/api/splitviewPanelApi.d.ts +32 -32
- package/dist/esm/api/splitviewPanelApi.js +25 -25
- package/dist/esm/array.d.ts +13 -13
- package/dist/esm/array.js +67 -67
- package/dist/esm/dnd/abstractDragHandler.d.ts +11 -11
- package/dist/esm/dnd/abstractDragHandler.js +37 -37
- package/dist/esm/dnd/dataTransfer.d.ts +31 -31
- package/dist/esm/dnd/dataTransfer.js +69 -69
- package/dist/esm/dnd/dnd.d.ts +27 -27
- package/dist/esm/dnd/dnd.js +41 -41
- package/dist/esm/dnd/droptarget.d.ts +37 -37
- package/dist/esm/dnd/droptarget.js +167 -167
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +27 -27
- package/dist/esm/dockview/components/tab/defaultTab.js +79 -84
- package/dist/esm/dockview/components/watermark/watermark.d.ts +20 -20
- package/dist/esm/dockview/components/watermark/watermark.js +70 -70
- package/dist/esm/dockview/defaultGroupPanelView.d.ts +29 -29
- package/dist/esm/dockview/defaultGroupPanelView.js +44 -44
- package/dist/esm/dockview/deserializer.d.ts +5 -5
- package/dist/esm/dockview/deserializer.js +1 -1
- package/dist/esm/dockview/dockviewComponent.d.ts +125 -130
- package/dist/esm/dockview/dockviewComponent.js +468 -483
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +31 -33
- package/dist/esm/dockview/dockviewGroupPanel.js +107 -122
- package/dist/esm/dockview/options.d.ts +88 -89
- package/dist/esm/dockview/options.js +1 -1
- package/dist/esm/dom.d.ts +14 -14
- package/dist/esm/dom.js +113 -113
- package/dist/esm/events.d.ts +30 -30
- package/dist/esm/events.js +88 -88
- package/dist/esm/gridview/baseComponentGridview.d.ts +87 -87
- package/dist/esm/gridview/baseComponentGridview.js +189 -189
- package/dist/esm/gridview/basePanelView.d.ts +43 -43
- package/dist/esm/gridview/basePanelView.js +74 -74
- package/dist/esm/gridview/branchNode.d.ts +49 -46
- package/dist/esm/gridview/branchNode.js +218 -218
- package/dist/esm/gridview/gridview.d.ts +126 -123
- package/dist/esm/gridview/gridview.js +397 -397
- package/dist/esm/gridview/gridviewComponent.d.ts +85 -85
- package/dist/esm/gridview/gridviewComponent.js +238 -238
- package/dist/esm/gridview/gridviewPanel.d.ts +60 -60
- package/dist/esm/gridview/gridviewPanel.js +138 -138
- package/dist/esm/gridview/leafNode.d.ts +34 -31
- package/dist/esm/gridview/leafNode.js +103 -98
- package/dist/esm/gridview/options.d.ts +18 -18
- package/dist/esm/gridview/options.js +1 -1
- package/dist/esm/gridview/types.d.ts +3 -3
- package/dist/esm/gridview/types.js +1 -1
- package/dist/esm/groupview/dnd.d.ts +5 -5
- package/dist/esm/groupview/dnd.js +6 -6
- package/dist/esm/groupview/groupPanel.d.ts +32 -35
- package/dist/esm/groupview/groupPanel.js +1 -1
- package/dist/esm/groupview/groupview.d.ts +177 -177
- package/dist/esm/groupview/groupview.js +444 -444
- package/dist/esm/groupview/groupviewPanel.d.ts +35 -35
- package/dist/esm/groupview/groupviewPanel.js +61 -61
- package/dist/esm/groupview/panel/content.d.ts +30 -30
- package/dist/esm/groupview/panel/content.js +73 -73
- package/dist/esm/groupview/tab.d.ts +41 -42
- package/dist/esm/groupview/tab.js +90 -96
- package/dist/esm/groupview/titlebar/tabsContainer.d.ts +68 -68
- package/dist/esm/groupview/titlebar/tabsContainer.js +190 -191
- package/dist/esm/groupview/types.d.ts +52 -53
- package/dist/esm/groupview/types.js +1 -1
- package/dist/esm/hostedContainer.d.ts +23 -23
- package/dist/esm/hostedContainer.js +63 -63
- package/dist/esm/index.d.ts +30 -30
- package/dist/esm/index.js +23 -23
- package/dist/esm/lifecycle.d.ts +22 -22
- package/dist/esm/lifecycle.js +39 -39
- package/dist/esm/math.d.ts +4 -4
- package/dist/esm/math.js +10 -10
- package/dist/esm/panel/componentFactory.d.ts +8 -8
- package/dist/esm/panel/componentFactory.js +24 -24
- package/dist/esm/panel/types.d.ts +33 -33
- package/dist/esm/panel/types.js +1 -1
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts +21 -21
- package/dist/esm/paneview/defaultPaneviewHeader.js +63 -63
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +19 -19
- package/dist/esm/paneview/draggablePaneviewPanel.js +90 -90
- package/dist/esm/paneview/options.d.ts +27 -27
- package/dist/esm/paneview/options.js +1 -1
- package/dist/esm/paneview/paneview.d.ts +40 -40
- package/dist/esm/paneview/paneview.js +145 -145
- package/dist/esm/paneview/paneviewComponent.d.ts +129 -129
- package/dist/esm/paneview/paneviewComponent.js +270 -270
- package/dist/esm/paneview/paneviewPanel.d.ts +92 -89
- package/dist/esm/paneview/paneviewPanel.js +191 -191
- package/dist/esm/react/deserializer.d.ts +9 -9
- package/dist/esm/react/deserializer.js +38 -40
- package/dist/esm/react/dockview/defaultTab.d.ts +4 -4
- package/dist/esm/react/dockview/defaultTab.js +34 -34
- package/dist/esm/react/dockview/dockview.d.ts +34 -35
- package/dist/esm/react/dockview/dockview.js +157 -172
- package/dist/esm/react/dockview/groupControlsRenderer.d.ts +43 -43
- package/dist/esm/react/dockview/groupControlsRenderer.js +68 -68
- package/dist/esm/react/dockview/reactContentPart.d.ts +30 -30
- package/dist/esm/react/dockview/reactContentPart.js +49 -49
- package/dist/esm/react/dockview/reactHeaderPart.d.ts +26 -26
- package/dist/esm/react/dockview/reactHeaderPart.js +46 -46
- package/dist/esm/react/dockview/reactWatermarkPart.d.ts +29 -29
- package/dist/esm/react/dockview/reactWatermarkPart.js +55 -55
- package/dist/esm/react/dockview/v2/reactContentRenderer.d.ts +29 -29
- package/dist/esm/react/dockview/v2/reactContentRenderer.js +69 -69
- package/dist/esm/react/dockview/v2/reactGroupPanelView.d.ts +7 -7
- package/dist/esm/react/dockview/v2/reactGroupPanelView.js +12 -12
- package/dist/esm/react/dockview/v2/webviewContentRenderer.d.ts +18 -18
- package/dist/esm/react/dockview/v2/webviewContentRenderer.js +36 -36
- package/dist/esm/react/gridview/gridview.d.ts +24 -24
- package/dist/esm/react/gridview/gridview.js +70 -70
- package/dist/esm/react/gridview/view.d.ts +11 -11
- package/dist/esm/react/gridview/view.js +18 -18
- package/dist/esm/react/index.d.ts +9 -9
- package/dist/esm/react/index.js +7 -7
- package/dist/esm/react/paneview/paneview.d.ts +30 -30
- package/dist/esm/react/paneview/paneview.js +100 -100
- package/dist/esm/react/paneview/view.d.ts +20 -20
- package/dist/esm/react/paneview/view.js +35 -35
- package/dist/esm/react/react.d.ts +36 -36
- package/dist/esm/react/react.js +125 -125
- package/dist/esm/react/splitview/splitview.d.ts +24 -24
- package/dist/esm/react/splitview/splitview.js +66 -66
- package/dist/esm/react/splitview/view.d.ts +10 -10
- package/dist/esm/react/splitview/view.js +18 -18
- package/dist/esm/react/svg.d.ts +3 -3
- package/dist/esm/react/svg.js +7 -7
- package/dist/esm/react/types.d.ts +7 -7
- package/dist/esm/react/types.js +1 -1
- package/dist/esm/splitview/core/options.d.ts +26 -26
- package/dist/esm/splitview/core/options.js +1 -1
- package/dist/esm/splitview/core/splitview.d.ts +127 -124
- package/dist/esm/splitview/core/splitview.js +689 -689
- package/dist/esm/splitview/core/viewItem.d.ts +25 -25
- package/dist/esm/splitview/core/viewItem.js +79 -79
- package/dist/esm/splitview/splitviewComponent.d.ts +101 -101
- package/dist/esm/splitview/splitviewComponent.js +249 -249
- package/dist/esm/splitview/splitviewPanel.d.ts +45 -42
- package/dist/esm/splitview/splitviewPanel.js +107 -107
- package/dist/esm/svg.d.ts +3 -3
- package/dist/esm/svg.js +31 -31
- package/dist/esm/types.d.ts +7 -7
- package/dist/esm/types.js +1 -1
- package/dist/styles/dockview.css +0 -3
- package/package.json +2 -2
|
@@ -1,343 +1,343 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Accreditation: This file is largly based upon the MIT licenced VSCode sourcecode found at:
|
|
4
|
-
* https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __extends = (this && this.__extends) || (function () {
|
|
7
|
-
var extendStatics = function (d, b) {
|
|
8
|
-
extendStatics = Object.setPrototypeOf ||
|
|
9
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
10
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
11
|
-
return extendStatics(d, b);
|
|
12
|
-
};
|
|
13
|
-
return function (d, b) {
|
|
14
|
-
if (typeof b !== "function" && b !== null)
|
|
15
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
16
|
-
extendStatics(d, b);
|
|
17
|
-
function __() { this.constructor = d; }
|
|
18
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
19
|
-
};
|
|
20
|
-
})();
|
|
21
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
22
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
23
|
-
if (!m) return o;
|
|
24
|
-
var i = m.call(o), r, ar = [], e;
|
|
25
|
-
try {
|
|
26
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
27
|
-
}
|
|
28
|
-
catch (error) { e = { error: error }; }
|
|
29
|
-
finally {
|
|
30
|
-
try {
|
|
31
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
32
|
-
}
|
|
33
|
-
finally { if (e) throw e.error; }
|
|
34
|
-
}
|
|
35
|
-
return ar;
|
|
36
|
-
};
|
|
37
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
38
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
39
|
-
if (ar || !(i in from)) {
|
|
40
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
41
|
-
ar[i] = from[i];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
|
-
};
|
|
46
|
-
var __values = (this && this.__values) || function(o) {
|
|
47
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
48
|
-
if (m) return m.call(o);
|
|
49
|
-
if (o && typeof o.length === "number") return {
|
|
50
|
-
next: function () {
|
|
51
|
-
if (o && i >= o.length) o = void 0;
|
|
52
|
-
return { value: o && o[i++], done: !o };
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
56
|
-
};
|
|
57
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
-
exports.BranchNode = void 0;
|
|
59
|
-
var splitview_1 = require("../splitview/core/splitview");
|
|
60
|
-
var events_1 = require("../events");
|
|
61
|
-
var leafNode_1 = require("./leafNode");
|
|
62
|
-
var lifecycle_1 = require("../lifecycle");
|
|
63
|
-
var BranchNode = /** @class */ (function (_super) {
|
|
64
|
-
__extends(BranchNode, _super);
|
|
65
|
-
function BranchNode(orientation, proportionalLayout, styles, size, orthogonalSize, childDescriptors) {
|
|
66
|
-
var _this = _super.call(this) || this;
|
|
67
|
-
_this.orientation = orientation;
|
|
68
|
-
_this.proportionalLayout = proportionalLayout;
|
|
69
|
-
_this.styles = styles;
|
|
70
|
-
_this.children = [];
|
|
71
|
-
_this._onDidChange = new events_1.Emitter();
|
|
72
|
-
_this.onDidChange = _this._onDidChange.event;
|
|
73
|
-
_this._childrenDisposable = lifecycle_1.Disposable.NONE;
|
|
74
|
-
_this._orthogonalSize = orthogonalSize;
|
|
75
|
-
_this._size = size;
|
|
76
|
-
_this.element = document.createElement('div');
|
|
77
|
-
_this.element.className = 'branch-node';
|
|
78
|
-
if (!childDescriptors) {
|
|
79
|
-
_this.splitview = new splitview_1.Splitview(_this.element, {
|
|
80
|
-
orientation: _this.orientation,
|
|
81
|
-
proportionalLayout: proportionalLayout,
|
|
82
|
-
styles: styles,
|
|
83
|
-
});
|
|
84
|
-
_this.splitview.layout(_this.size, _this.orthogonalSize);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
var descriptor = {
|
|
88
|
-
views: childDescriptors.map(function (childDescriptor) {
|
|
89
|
-
return {
|
|
90
|
-
view: childDescriptor.node,
|
|
91
|
-
size: childDescriptor.node.size,
|
|
92
|
-
visible: childDescriptor.node instanceof leafNode_1.LeafNode &&
|
|
93
|
-
childDescriptor.visible !== undefined
|
|
94
|
-
? childDescriptor.visible
|
|
95
|
-
: true,
|
|
96
|
-
};
|
|
97
|
-
}),
|
|
98
|
-
size: _this.size,
|
|
99
|
-
};
|
|
100
|
-
_this.children = childDescriptors.map(function (c) { return c.node; });
|
|
101
|
-
_this.splitview = new splitview_1.Splitview(_this.element, {
|
|
102
|
-
orientation: _this.orientation,
|
|
103
|
-
descriptor: descriptor,
|
|
104
|
-
proportionalLayout: proportionalLayout,
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
_this.addDisposables(_this._onDidChange, _this.splitview.onDidSashEnd(function () {
|
|
108
|
-
_this._onDidChange.fire(
|
|
109
|
-
}));
|
|
110
|
-
_this.setupChildrenEvents();
|
|
111
|
-
return _this;
|
|
112
|
-
}
|
|
113
|
-
Object.defineProperty(BranchNode.prototype, "width", {
|
|
114
|
-
get: function () {
|
|
115
|
-
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
116
|
-
? this.size
|
|
117
|
-
: this.orthogonalSize;
|
|
118
|
-
},
|
|
119
|
-
enumerable: false,
|
|
120
|
-
configurable: true
|
|
121
|
-
});
|
|
122
|
-
Object.defineProperty(BranchNode.prototype, "height", {
|
|
123
|
-
get: function () {
|
|
124
|
-
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
125
|
-
? this.orthogonalSize
|
|
126
|
-
: this.size;
|
|
127
|
-
},
|
|
128
|
-
enumerable: false,
|
|
129
|
-
configurable: true
|
|
130
|
-
});
|
|
131
|
-
Object.defineProperty(BranchNode.prototype, "minimumSize", {
|
|
132
|
-
get: function () {
|
|
133
|
-
return this.children.length === 0
|
|
134
|
-
? 0
|
|
135
|
-
: Math.max.apply(Math, __spreadArray([], __read(this.children.map(function (c) { return c.minimumOrthogonalSize; })), false));
|
|
136
|
-
},
|
|
137
|
-
enumerable: false,
|
|
138
|
-
configurable: true
|
|
139
|
-
});
|
|
140
|
-
Object.defineProperty(BranchNode.prototype, "maximumSize", {
|
|
141
|
-
get: function () {
|
|
142
|
-
return Math.min.apply(Math, __spreadArray([], __read(this.children.map(function (c) { return c.maximumOrthogonalSize; })), false));
|
|
143
|
-
},
|
|
144
|
-
enumerable: false,
|
|
145
|
-
configurable: true
|
|
146
|
-
});
|
|
147
|
-
Object.defineProperty(BranchNode.prototype, "minimumOrthogonalSize", {
|
|
148
|
-
get: function () {
|
|
149
|
-
return this.splitview.minimumSize;
|
|
150
|
-
},
|
|
151
|
-
enumerable: false,
|
|
152
|
-
configurable: true
|
|
153
|
-
});
|
|
154
|
-
Object.defineProperty(BranchNode.prototype, "maximumOrthogonalSize", {
|
|
155
|
-
get: function () {
|
|
156
|
-
return this.splitview.maximumSize;
|
|
157
|
-
},
|
|
158
|
-
enumerable: false,
|
|
159
|
-
configurable: true
|
|
160
|
-
});
|
|
161
|
-
Object.defineProperty(BranchNode.prototype, "orthogonalSize", {
|
|
162
|
-
get: function () {
|
|
163
|
-
return this._orthogonalSize;
|
|
164
|
-
},
|
|
165
|
-
enumerable: false,
|
|
166
|
-
configurable: true
|
|
167
|
-
});
|
|
168
|
-
Object.defineProperty(BranchNode.prototype, "size", {
|
|
169
|
-
get: function () {
|
|
170
|
-
return this._size;
|
|
171
|
-
},
|
|
172
|
-
enumerable: false,
|
|
173
|
-
configurable: true
|
|
174
|
-
});
|
|
175
|
-
Object.defineProperty(BranchNode.prototype, "minimumWidth", {
|
|
176
|
-
get: function () {
|
|
177
|
-
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
178
|
-
? this.minimumOrthogonalSize
|
|
179
|
-
: this.minimumSize;
|
|
180
|
-
},
|
|
181
|
-
enumerable: false,
|
|
182
|
-
configurable: true
|
|
183
|
-
});
|
|
184
|
-
Object.defineProperty(BranchNode.prototype, "minimumHeight", {
|
|
185
|
-
get: function () {
|
|
186
|
-
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
187
|
-
? this.minimumSize
|
|
188
|
-
: this.minimumOrthogonalSize;
|
|
189
|
-
},
|
|
190
|
-
enumerable: false,
|
|
191
|
-
configurable: true
|
|
192
|
-
});
|
|
193
|
-
Object.defineProperty(BranchNode.prototype, "maximumWidth", {
|
|
194
|
-
get: function () {
|
|
195
|
-
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
196
|
-
? this.maximumOrthogonalSize
|
|
197
|
-
: this.maximumSize;
|
|
198
|
-
},
|
|
199
|
-
enumerable: false,
|
|
200
|
-
configurable: true
|
|
201
|
-
});
|
|
202
|
-
Object.defineProperty(BranchNode.prototype, "maximumHeight", {
|
|
203
|
-
get: function () {
|
|
204
|
-
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
205
|
-
? this.maximumSize
|
|
206
|
-
: this.maximumOrthogonalSize;
|
|
207
|
-
},
|
|
208
|
-
enumerable: false,
|
|
209
|
-
configurable: true
|
|
210
|
-
});
|
|
211
|
-
Object.defineProperty(BranchNode.prototype, "priority", {
|
|
212
|
-
get: function () {
|
|
213
|
-
if (this.children.length === 0) {
|
|
214
|
-
return splitview_1.LayoutPriority.Normal;
|
|
215
|
-
}
|
|
216
|
-
var priorities = this.children.map(function (c) {
|
|
217
|
-
return typeof c.priority === 'undefined'
|
|
218
|
-
? splitview_1.LayoutPriority.Normal
|
|
219
|
-
: c.priority;
|
|
220
|
-
});
|
|
221
|
-
if (priorities.some(function (p) { return p === splitview_1.LayoutPriority.High; })) {
|
|
222
|
-
return splitview_1.LayoutPriority.High;
|
|
223
|
-
}
|
|
224
|
-
else if (priorities.some(function (p) { return p === splitview_1.LayoutPriority.Low; })) {
|
|
225
|
-
return splitview_1.LayoutPriority.Low;
|
|
226
|
-
}
|
|
227
|
-
return splitview_1.LayoutPriority.Normal;
|
|
228
|
-
},
|
|
229
|
-
enumerable: false,
|
|
230
|
-
configurable: true
|
|
231
|
-
});
|
|
232
|
-
BranchNode.prototype.setVisible = function (visible) {
|
|
233
|
-
var e_1, _a;
|
|
234
|
-
try {
|
|
235
|
-
for (var _b = __values(this.children), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
236
|
-
var child = _c.value;
|
|
237
|
-
child.setVisible(visible);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
241
|
-
finally {
|
|
242
|
-
try {
|
|
243
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
244
|
-
}
|
|
245
|
-
finally { if (e_1) throw e_1.error; }
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
BranchNode.prototype.isChildVisible = function (index) {
|
|
249
|
-
if (index < 0 || index >= this.children.length) {
|
|
250
|
-
throw new Error('Invalid index');
|
|
251
|
-
}
|
|
252
|
-
return this.splitview.isViewVisible(index);
|
|
253
|
-
};
|
|
254
|
-
BranchNode.prototype.setChildVisible = function (index, visible) {
|
|
255
|
-
if (index < 0 || index >= this.children.length) {
|
|
256
|
-
throw new Error('Invalid index');
|
|
257
|
-
}
|
|
258
|
-
if (this.splitview.isViewVisible(index) === visible) {
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
this.splitview.setViewVisible(index, visible);
|
|
262
|
-
};
|
|
263
|
-
BranchNode.prototype.moveChild = function (from, to) {
|
|
264
|
-
if (from === to) {
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
if (from < 0 || from >= this.children.length) {
|
|
268
|
-
throw new Error('Invalid from index');
|
|
269
|
-
}
|
|
270
|
-
if (from < to) {
|
|
271
|
-
to--;
|
|
272
|
-
}
|
|
273
|
-
this.splitview.moveView(from, to);
|
|
274
|
-
var child = this._removeChild(from);
|
|
275
|
-
this._addChild(child, to);
|
|
276
|
-
};
|
|
277
|
-
BranchNode.prototype.getChildSize = function (index) {
|
|
278
|
-
if (index < 0 || index >= this.children.length) {
|
|
279
|
-
throw new Error('Invalid index');
|
|
280
|
-
}
|
|
281
|
-
return this.splitview.getViewSize(index);
|
|
282
|
-
};
|
|
283
|
-
BranchNode.prototype.resizeChild = function (index, size) {
|
|
284
|
-
if (index < 0 || index >= this.children.length) {
|
|
285
|
-
throw new Error('Invalid index');
|
|
286
|
-
}
|
|
287
|
-
this.splitview.resizeView(index, size);
|
|
288
|
-
};
|
|
289
|
-
BranchNode.prototype.layout = function (size, orthogonalSize) {
|
|
290
|
-
this._size = orthogonalSize;
|
|
291
|
-
this._orthogonalSize = size;
|
|
292
|
-
this.splitview.layout(this.size, this.orthogonalSize);
|
|
293
|
-
};
|
|
294
|
-
BranchNode.prototype.addChild = function (node, size, index, skipLayout) {
|
|
295
|
-
if (index < 0 || index > this.children.length) {
|
|
296
|
-
throw new Error('Invalid index');
|
|
297
|
-
}
|
|
298
|
-
this.splitview.addView(node, size, index, skipLayout);
|
|
299
|
-
this._addChild(node, index);
|
|
300
|
-
};
|
|
301
|
-
BranchNode.prototype.getChildCachedVisibleSize = function (index) {
|
|
302
|
-
if (index < 0 || index >= this.children.length) {
|
|
303
|
-
throw new Error('Invalid index');
|
|
304
|
-
}
|
|
305
|
-
return this.splitview.getViewCachedVisibleSize(index);
|
|
306
|
-
};
|
|
307
|
-
BranchNode.prototype.removeChild = function (index, sizing) {
|
|
308
|
-
if (index < 0 || index >= this.children.length) {
|
|
309
|
-
throw new Error('Invalid index');
|
|
310
|
-
}
|
|
311
|
-
this.splitview.removeView(index, sizing);
|
|
312
|
-
this._removeChild(index);
|
|
313
|
-
};
|
|
314
|
-
BranchNode.prototype._addChild = function (node, index) {
|
|
315
|
-
this.children.splice(index, 0, node);
|
|
316
|
-
this.setupChildrenEvents();
|
|
317
|
-
};
|
|
318
|
-
BranchNode.prototype._removeChild = function (index) {
|
|
319
|
-
var _a = __read(this.children.splice(index, 1), 1), child = _a[0];
|
|
320
|
-
this.setupChildrenEvents();
|
|
321
|
-
return child;
|
|
322
|
-
};
|
|
323
|
-
BranchNode.prototype.setupChildrenEvents = function () {
|
|
324
|
-
var _this = this;
|
|
325
|
-
this._childrenDisposable.dispose();
|
|
326
|
-
this._childrenDisposable = events_1.Event.any.apply(events_1.Event, __spreadArray([], __read(this.children.map(function (c) { return c.onDidChange; })), false))(function () {
|
|
327
|
-
/**
|
|
328
|
-
* indicate a change has occured to allows any re-rendering but don't bubble
|
|
329
|
-
* event because that was specific to this branch
|
|
330
|
-
*/
|
|
331
|
-
_this._onDidChange.fire(
|
|
332
|
-
});
|
|
333
|
-
};
|
|
334
|
-
BranchNode.prototype.dispose = function () {
|
|
335
|
-
_super.prototype.dispose.call(this);
|
|
336
|
-
this._childrenDisposable.dispose();
|
|
337
|
-
this.children.forEach(function (child) { return child.dispose(); });
|
|
338
|
-
this.splitview.dispose();
|
|
339
|
-
};
|
|
340
|
-
return BranchNode;
|
|
341
|
-
}(lifecycle_1.CompositeDisposable));
|
|
342
|
-
exports.BranchNode = BranchNode;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Accreditation: This file is largly based upon the MIT licenced VSCode sourcecode found at:
|
|
4
|
+
* https://github.com/microsoft/vscode/tree/main/src/vs/base/browser/ui/grid
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
var __extends = (this && this.__extends) || (function () {
|
|
7
|
+
var extendStatics = function (d, b) {
|
|
8
|
+
extendStatics = Object.setPrototypeOf ||
|
|
9
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
10
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
11
|
+
return extendStatics(d, b);
|
|
12
|
+
};
|
|
13
|
+
return function (d, b) {
|
|
14
|
+
if (typeof b !== "function" && b !== null)
|
|
15
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
16
|
+
extendStatics(d, b);
|
|
17
|
+
function __() { this.constructor = d; }
|
|
18
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
19
|
+
};
|
|
20
|
+
})();
|
|
21
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
22
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
23
|
+
if (!m) return o;
|
|
24
|
+
var i = m.call(o), r, ar = [], e;
|
|
25
|
+
try {
|
|
26
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
27
|
+
}
|
|
28
|
+
catch (error) { e = { error: error }; }
|
|
29
|
+
finally {
|
|
30
|
+
try {
|
|
31
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
32
|
+
}
|
|
33
|
+
finally { if (e) throw e.error; }
|
|
34
|
+
}
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
38
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
39
|
+
if (ar || !(i in from)) {
|
|
40
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
41
|
+
ar[i] = from[i];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
|
+
};
|
|
46
|
+
var __values = (this && this.__values) || function(o) {
|
|
47
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
48
|
+
if (m) return m.call(o);
|
|
49
|
+
if (o && typeof o.length === "number") return {
|
|
50
|
+
next: function () {
|
|
51
|
+
if (o && i >= o.length) o = void 0;
|
|
52
|
+
return { value: o && o[i++], done: !o };
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
56
|
+
};
|
|
57
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
58
|
+
exports.BranchNode = void 0;
|
|
59
|
+
var splitview_1 = require("../splitview/core/splitview");
|
|
60
|
+
var events_1 = require("../events");
|
|
61
|
+
var leafNode_1 = require("./leafNode");
|
|
62
|
+
var lifecycle_1 = require("../lifecycle");
|
|
63
|
+
var BranchNode = /** @class */ (function (_super) {
|
|
64
|
+
__extends(BranchNode, _super);
|
|
65
|
+
function BranchNode(orientation, proportionalLayout, styles, size, orthogonalSize, childDescriptors) {
|
|
66
|
+
var _this = _super.call(this) || this;
|
|
67
|
+
_this.orientation = orientation;
|
|
68
|
+
_this.proportionalLayout = proportionalLayout;
|
|
69
|
+
_this.styles = styles;
|
|
70
|
+
_this.children = [];
|
|
71
|
+
_this._onDidChange = new events_1.Emitter();
|
|
72
|
+
_this.onDidChange = _this._onDidChange.event;
|
|
73
|
+
_this._childrenDisposable = lifecycle_1.Disposable.NONE;
|
|
74
|
+
_this._orthogonalSize = orthogonalSize;
|
|
75
|
+
_this._size = size;
|
|
76
|
+
_this.element = document.createElement('div');
|
|
77
|
+
_this.element.className = 'branch-node';
|
|
78
|
+
if (!childDescriptors) {
|
|
79
|
+
_this.splitview = new splitview_1.Splitview(_this.element, {
|
|
80
|
+
orientation: _this.orientation,
|
|
81
|
+
proportionalLayout: proportionalLayout,
|
|
82
|
+
styles: styles,
|
|
83
|
+
});
|
|
84
|
+
_this.splitview.layout(_this.size, _this.orthogonalSize);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
var descriptor = {
|
|
88
|
+
views: childDescriptors.map(function (childDescriptor) {
|
|
89
|
+
return {
|
|
90
|
+
view: childDescriptor.node,
|
|
91
|
+
size: childDescriptor.node.size,
|
|
92
|
+
visible: childDescriptor.node instanceof leafNode_1.LeafNode &&
|
|
93
|
+
childDescriptor.visible !== undefined
|
|
94
|
+
? childDescriptor.visible
|
|
95
|
+
: true,
|
|
96
|
+
};
|
|
97
|
+
}),
|
|
98
|
+
size: _this.size,
|
|
99
|
+
};
|
|
100
|
+
_this.children = childDescriptors.map(function (c) { return c.node; });
|
|
101
|
+
_this.splitview = new splitview_1.Splitview(_this.element, {
|
|
102
|
+
orientation: _this.orientation,
|
|
103
|
+
descriptor: descriptor,
|
|
104
|
+
proportionalLayout: proportionalLayout,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
_this.addDisposables(_this._onDidChange, _this.splitview.onDidSashEnd(function () {
|
|
108
|
+
_this._onDidChange.fire({});
|
|
109
|
+
}));
|
|
110
|
+
_this.setupChildrenEvents();
|
|
111
|
+
return _this;
|
|
112
|
+
}
|
|
113
|
+
Object.defineProperty(BranchNode.prototype, "width", {
|
|
114
|
+
get: function () {
|
|
115
|
+
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
116
|
+
? this.size
|
|
117
|
+
: this.orthogonalSize;
|
|
118
|
+
},
|
|
119
|
+
enumerable: false,
|
|
120
|
+
configurable: true
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(BranchNode.prototype, "height", {
|
|
123
|
+
get: function () {
|
|
124
|
+
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
125
|
+
? this.orthogonalSize
|
|
126
|
+
: this.size;
|
|
127
|
+
},
|
|
128
|
+
enumerable: false,
|
|
129
|
+
configurable: true
|
|
130
|
+
});
|
|
131
|
+
Object.defineProperty(BranchNode.prototype, "minimumSize", {
|
|
132
|
+
get: function () {
|
|
133
|
+
return this.children.length === 0
|
|
134
|
+
? 0
|
|
135
|
+
: Math.max.apply(Math, __spreadArray([], __read(this.children.map(function (c) { return c.minimumOrthogonalSize; })), false));
|
|
136
|
+
},
|
|
137
|
+
enumerable: false,
|
|
138
|
+
configurable: true
|
|
139
|
+
});
|
|
140
|
+
Object.defineProperty(BranchNode.prototype, "maximumSize", {
|
|
141
|
+
get: function () {
|
|
142
|
+
return Math.min.apply(Math, __spreadArray([], __read(this.children.map(function (c) { return c.maximumOrthogonalSize; })), false));
|
|
143
|
+
},
|
|
144
|
+
enumerable: false,
|
|
145
|
+
configurable: true
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(BranchNode.prototype, "minimumOrthogonalSize", {
|
|
148
|
+
get: function () {
|
|
149
|
+
return this.splitview.minimumSize;
|
|
150
|
+
},
|
|
151
|
+
enumerable: false,
|
|
152
|
+
configurable: true
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(BranchNode.prototype, "maximumOrthogonalSize", {
|
|
155
|
+
get: function () {
|
|
156
|
+
return this.splitview.maximumSize;
|
|
157
|
+
},
|
|
158
|
+
enumerable: false,
|
|
159
|
+
configurable: true
|
|
160
|
+
});
|
|
161
|
+
Object.defineProperty(BranchNode.prototype, "orthogonalSize", {
|
|
162
|
+
get: function () {
|
|
163
|
+
return this._orthogonalSize;
|
|
164
|
+
},
|
|
165
|
+
enumerable: false,
|
|
166
|
+
configurable: true
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(BranchNode.prototype, "size", {
|
|
169
|
+
get: function () {
|
|
170
|
+
return this._size;
|
|
171
|
+
},
|
|
172
|
+
enumerable: false,
|
|
173
|
+
configurable: true
|
|
174
|
+
});
|
|
175
|
+
Object.defineProperty(BranchNode.prototype, "minimumWidth", {
|
|
176
|
+
get: function () {
|
|
177
|
+
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
178
|
+
? this.minimumOrthogonalSize
|
|
179
|
+
: this.minimumSize;
|
|
180
|
+
},
|
|
181
|
+
enumerable: false,
|
|
182
|
+
configurable: true
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(BranchNode.prototype, "minimumHeight", {
|
|
185
|
+
get: function () {
|
|
186
|
+
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
187
|
+
? this.minimumSize
|
|
188
|
+
: this.minimumOrthogonalSize;
|
|
189
|
+
},
|
|
190
|
+
enumerable: false,
|
|
191
|
+
configurable: true
|
|
192
|
+
});
|
|
193
|
+
Object.defineProperty(BranchNode.prototype, "maximumWidth", {
|
|
194
|
+
get: function () {
|
|
195
|
+
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
196
|
+
? this.maximumOrthogonalSize
|
|
197
|
+
: this.maximumSize;
|
|
198
|
+
},
|
|
199
|
+
enumerable: false,
|
|
200
|
+
configurable: true
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(BranchNode.prototype, "maximumHeight", {
|
|
203
|
+
get: function () {
|
|
204
|
+
return this.orientation === splitview_1.Orientation.HORIZONTAL
|
|
205
|
+
? this.maximumSize
|
|
206
|
+
: this.maximumOrthogonalSize;
|
|
207
|
+
},
|
|
208
|
+
enumerable: false,
|
|
209
|
+
configurable: true
|
|
210
|
+
});
|
|
211
|
+
Object.defineProperty(BranchNode.prototype, "priority", {
|
|
212
|
+
get: function () {
|
|
213
|
+
if (this.children.length === 0) {
|
|
214
|
+
return splitview_1.LayoutPriority.Normal;
|
|
215
|
+
}
|
|
216
|
+
var priorities = this.children.map(function (c) {
|
|
217
|
+
return typeof c.priority === 'undefined'
|
|
218
|
+
? splitview_1.LayoutPriority.Normal
|
|
219
|
+
: c.priority;
|
|
220
|
+
});
|
|
221
|
+
if (priorities.some(function (p) { return p === splitview_1.LayoutPriority.High; })) {
|
|
222
|
+
return splitview_1.LayoutPriority.High;
|
|
223
|
+
}
|
|
224
|
+
else if (priorities.some(function (p) { return p === splitview_1.LayoutPriority.Low; })) {
|
|
225
|
+
return splitview_1.LayoutPriority.Low;
|
|
226
|
+
}
|
|
227
|
+
return splitview_1.LayoutPriority.Normal;
|
|
228
|
+
},
|
|
229
|
+
enumerable: false,
|
|
230
|
+
configurable: true
|
|
231
|
+
});
|
|
232
|
+
BranchNode.prototype.setVisible = function (visible) {
|
|
233
|
+
var e_1, _a;
|
|
234
|
+
try {
|
|
235
|
+
for (var _b = __values(this.children), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
236
|
+
var child = _c.value;
|
|
237
|
+
child.setVisible(visible);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
241
|
+
finally {
|
|
242
|
+
try {
|
|
243
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
244
|
+
}
|
|
245
|
+
finally { if (e_1) throw e_1.error; }
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
BranchNode.prototype.isChildVisible = function (index) {
|
|
249
|
+
if (index < 0 || index >= this.children.length) {
|
|
250
|
+
throw new Error('Invalid index');
|
|
251
|
+
}
|
|
252
|
+
return this.splitview.isViewVisible(index);
|
|
253
|
+
};
|
|
254
|
+
BranchNode.prototype.setChildVisible = function (index, visible) {
|
|
255
|
+
if (index < 0 || index >= this.children.length) {
|
|
256
|
+
throw new Error('Invalid index');
|
|
257
|
+
}
|
|
258
|
+
if (this.splitview.isViewVisible(index) === visible) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
this.splitview.setViewVisible(index, visible);
|
|
262
|
+
};
|
|
263
|
+
BranchNode.prototype.moveChild = function (from, to) {
|
|
264
|
+
if (from === to) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
if (from < 0 || from >= this.children.length) {
|
|
268
|
+
throw new Error('Invalid from index');
|
|
269
|
+
}
|
|
270
|
+
if (from < to) {
|
|
271
|
+
to--;
|
|
272
|
+
}
|
|
273
|
+
this.splitview.moveView(from, to);
|
|
274
|
+
var child = this._removeChild(from);
|
|
275
|
+
this._addChild(child, to);
|
|
276
|
+
};
|
|
277
|
+
BranchNode.prototype.getChildSize = function (index) {
|
|
278
|
+
if (index < 0 || index >= this.children.length) {
|
|
279
|
+
throw new Error('Invalid index');
|
|
280
|
+
}
|
|
281
|
+
return this.splitview.getViewSize(index);
|
|
282
|
+
};
|
|
283
|
+
BranchNode.prototype.resizeChild = function (index, size) {
|
|
284
|
+
if (index < 0 || index >= this.children.length) {
|
|
285
|
+
throw new Error('Invalid index');
|
|
286
|
+
}
|
|
287
|
+
this.splitview.resizeView(index, size);
|
|
288
|
+
};
|
|
289
|
+
BranchNode.prototype.layout = function (size, orthogonalSize) {
|
|
290
|
+
this._size = orthogonalSize;
|
|
291
|
+
this._orthogonalSize = size;
|
|
292
|
+
this.splitview.layout(this.size, this.orthogonalSize);
|
|
293
|
+
};
|
|
294
|
+
BranchNode.prototype.addChild = function (node, size, index, skipLayout) {
|
|
295
|
+
if (index < 0 || index > this.children.length) {
|
|
296
|
+
throw new Error('Invalid index');
|
|
297
|
+
}
|
|
298
|
+
this.splitview.addView(node, size, index, skipLayout);
|
|
299
|
+
this._addChild(node, index);
|
|
300
|
+
};
|
|
301
|
+
BranchNode.prototype.getChildCachedVisibleSize = function (index) {
|
|
302
|
+
if (index < 0 || index >= this.children.length) {
|
|
303
|
+
throw new Error('Invalid index');
|
|
304
|
+
}
|
|
305
|
+
return this.splitview.getViewCachedVisibleSize(index);
|
|
306
|
+
};
|
|
307
|
+
BranchNode.prototype.removeChild = function (index, sizing) {
|
|
308
|
+
if (index < 0 || index >= this.children.length) {
|
|
309
|
+
throw new Error('Invalid index');
|
|
310
|
+
}
|
|
311
|
+
this.splitview.removeView(index, sizing);
|
|
312
|
+
this._removeChild(index);
|
|
313
|
+
};
|
|
314
|
+
BranchNode.prototype._addChild = function (node, index) {
|
|
315
|
+
this.children.splice(index, 0, node);
|
|
316
|
+
this.setupChildrenEvents();
|
|
317
|
+
};
|
|
318
|
+
BranchNode.prototype._removeChild = function (index) {
|
|
319
|
+
var _a = __read(this.children.splice(index, 1), 1), child = _a[0];
|
|
320
|
+
this.setupChildrenEvents();
|
|
321
|
+
return child;
|
|
322
|
+
};
|
|
323
|
+
BranchNode.prototype.setupChildrenEvents = function () {
|
|
324
|
+
var _this = this;
|
|
325
|
+
this._childrenDisposable.dispose();
|
|
326
|
+
this._childrenDisposable = events_1.Event.any.apply(events_1.Event, __spreadArray([], __read(this.children.map(function (c) { return c.onDidChange; })), false))(function (e) {
|
|
327
|
+
/**
|
|
328
|
+
* indicate a change has occured to allows any re-rendering but don't bubble
|
|
329
|
+
* event because that was specific to this branch
|
|
330
|
+
*/
|
|
331
|
+
_this._onDidChange.fire({ size: e.orthogonalSize });
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
BranchNode.prototype.dispose = function () {
|
|
335
|
+
_super.prototype.dispose.call(this);
|
|
336
|
+
this._childrenDisposable.dispose();
|
|
337
|
+
this.children.forEach(function (child) { return child.dispose(); });
|
|
338
|
+
this.splitview.dispose();
|
|
339
|
+
};
|
|
340
|
+
return BranchNode;
|
|
341
|
+
}(lifecycle_1.CompositeDisposable));
|
|
342
|
+
exports.BranchNode = BranchNode;
|
|
343
343
|
//# sourceMappingURL=branchNode.js.map
|