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,326 +1,326 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
var __values = (this && this.__values) || function(o) {
|
|
29
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
30
|
-
if (m) return m.call(o);
|
|
31
|
-
if (o && typeof o.length === "number") return {
|
|
32
|
-
next: function () {
|
|
33
|
-
if (o && i >= o.length) o = void 0;
|
|
34
|
-
return { value: o && o[i++], done: !o };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
38
|
-
};
|
|
39
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
40
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
41
|
-
if (!m) return o;
|
|
42
|
-
var i = m.call(o), r, ar = [], e;
|
|
43
|
-
try {
|
|
44
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
45
|
-
}
|
|
46
|
-
catch (error) { e = { error: error }; }
|
|
47
|
-
finally {
|
|
48
|
-
try {
|
|
49
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
50
|
-
}
|
|
51
|
-
finally { if (e) throw e.error; }
|
|
52
|
-
}
|
|
53
|
-
return ar;
|
|
54
|
-
};
|
|
55
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
-
exports.GridviewComponent = void 0;
|
|
57
|
-
var gridview_1 = require("./gridview");
|
|
58
|
-
var droptarget_1 = require("../dnd/droptarget");
|
|
59
|
-
var array_1 = require("../array");
|
|
60
|
-
var lifecycle_1 = require("../lifecycle");
|
|
61
|
-
var baseComponentGridview_1 = require("./baseComponentGridview");
|
|
62
|
-
var componentFactory_1 = require("../panel/componentFactory");
|
|
63
|
-
var events_1 = require("../events");
|
|
64
|
-
var GridviewComponent = /** @class */ (function (_super) {
|
|
65
|
-
__extends(GridviewComponent, _super);
|
|
66
|
-
function GridviewComponent(element, options) {
|
|
67
|
-
var _this = _super.call(this, element, {
|
|
68
|
-
proportionalLayout: options.proportionalLayout,
|
|
69
|
-
orientation: options.orientation,
|
|
70
|
-
styles: options.styles,
|
|
71
|
-
}) || this;
|
|
72
|
-
_this._onDidLayoutfromJSON = new events_1.Emitter();
|
|
73
|
-
_this.onDidLayoutFromJSON = _this._onDidLayoutfromJSON.event;
|
|
74
|
-
_this._options = options;
|
|
75
|
-
if (!_this.options.components) {
|
|
76
|
-
_this.options.components = {};
|
|
77
|
-
}
|
|
78
|
-
if (!_this.options.frameworkComponents) {
|
|
79
|
-
_this.options.frameworkComponents = {};
|
|
80
|
-
}
|
|
81
|
-
return _this;
|
|
82
|
-
}
|
|
83
|
-
Object.defineProperty(GridviewComponent.prototype, "orientation", {
|
|
84
|
-
get: function () {
|
|
85
|
-
return this.gridview.orientation;
|
|
86
|
-
},
|
|
87
|
-
set: function (value) {
|
|
88
|
-
this.gridview.orientation = value;
|
|
89
|
-
},
|
|
90
|
-
enumerable: false,
|
|
91
|
-
configurable: true
|
|
92
|
-
});
|
|
93
|
-
Object.defineProperty(GridviewComponent.prototype, "options", {
|
|
94
|
-
get: function () {
|
|
95
|
-
return this._options;
|
|
96
|
-
},
|
|
97
|
-
enumerable: false,
|
|
98
|
-
configurable: true
|
|
99
|
-
});
|
|
100
|
-
Object.defineProperty(GridviewComponent.prototype, "deserializer", {
|
|
101
|
-
get: function () {
|
|
102
|
-
return this._deserializer;
|
|
103
|
-
},
|
|
104
|
-
set: function (value) {
|
|
105
|
-
this._deserializer = value;
|
|
106
|
-
},
|
|
107
|
-
enumerable: false,
|
|
108
|
-
configurable: true
|
|
109
|
-
});
|
|
110
|
-
GridviewComponent.prototype.updateOptions = function (options) {
|
|
111
|
-
var hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
112
|
-
this.gridview.orientation !== options.orientation;
|
|
113
|
-
this._options = __assign(__assign({}, this.options), options);
|
|
114
|
-
if (hasOrientationChanged) {
|
|
115
|
-
this.gridview.orientation = options.orientation;
|
|
116
|
-
}
|
|
117
|
-
this.layout(this.gridview.width, this.gridview.height, true);
|
|
118
|
-
};
|
|
119
|
-
GridviewComponent.prototype.removePanel = function (panel) {
|
|
120
|
-
this.removeGroup(panel);
|
|
121
|
-
};
|
|
122
|
-
/**
|
|
123
|
-
* Serialize the current state of the layout
|
|
124
|
-
*
|
|
125
|
-
* @returns A JSON respresentation of the layout
|
|
126
|
-
*/
|
|
127
|
-
GridviewComponent.prototype.toJSON = function () {
|
|
128
|
-
var _a;
|
|
129
|
-
var data = this.gridview.serialize();
|
|
130
|
-
return {
|
|
131
|
-
grid: data,
|
|
132
|
-
activePanel: (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.id,
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
GridviewComponent.prototype.setVisible = function (panel, visible) {
|
|
136
|
-
this.gridview.setViewVisible((0, gridview_1.getGridLocation)(panel.element), visible);
|
|
137
|
-
};
|
|
138
|
-
GridviewComponent.prototype.setActive = function (panel) {
|
|
139
|
-
this._groups.forEach(function (value, _key) {
|
|
140
|
-
value.value.setActive(panel === value.value);
|
|
141
|
-
});
|
|
142
|
-
};
|
|
143
|
-
GridviewComponent.prototype.focus = function () {
|
|
144
|
-
var _a;
|
|
145
|
-
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
146
|
-
};
|
|
147
|
-
GridviewComponent.prototype.fromJSON = function (serializedGridview) {
|
|
148
|
-
var _this = this;
|
|
149
|
-
this.clear();
|
|
150
|
-
var grid = serializedGridview.grid, activePanel = serializedGridview.activePanel;
|
|
151
|
-
var queue = [];
|
|
152
|
-
this.gridview.deserialize(grid, {
|
|
153
|
-
fromJSON: function (node) {
|
|
154
|
-
var data = node.data;
|
|
155
|
-
var view = (0, componentFactory_1.createComponent)(data.id, data.component, _this.options.components || {}, _this.options.frameworkComponents || {}, _this.options.frameworkComponentFactory
|
|
156
|
-
? {
|
|
157
|
-
createComponent: _this.options.frameworkComponentFactory
|
|
158
|
-
.createComponent,
|
|
159
|
-
}
|
|
160
|
-
: undefined);
|
|
161
|
-
queue.push(function () {
|
|
162
|
-
return view.init({
|
|
163
|
-
params: data.params,
|
|
164
|
-
minimumWidth: data.minimumWidth,
|
|
165
|
-
maximumWidth: data.maximumWidth,
|
|
166
|
-
minimumHeight: data.minimumHeight,
|
|
167
|
-
maximumHeight: data.maximumHeight,
|
|
168
|
-
priority: data.priority,
|
|
169
|
-
snap: !!data.snap,
|
|
170
|
-
accessor: _this,
|
|
171
|
-
isVisible: node.visible,
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
_this._onDidAddGroup.fire(view);
|
|
175
|
-
_this.registerPanel(view);
|
|
176
|
-
return view;
|
|
177
|
-
},
|
|
178
|
-
});
|
|
179
|
-
this.layout(this.width, this.height, true);
|
|
180
|
-
queue.forEach(function (f) { return f(); });
|
|
181
|
-
if (typeof activePanel === 'string') {
|
|
182
|
-
var panel = this.getPanel(activePanel);
|
|
183
|
-
if (panel) {
|
|
184
|
-
this.doSetGroupActive(panel);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
this._onDidLayoutfromJSON.fire();
|
|
188
|
-
};
|
|
189
|
-
GridviewComponent.prototype.clear = function () {
|
|
190
|
-
var e_1, _a;
|
|
191
|
-
var hasActiveGroup = this.activeGroup;
|
|
192
|
-
var groups = Array.from(this._groups.values()); // reassign since group panels will mutate
|
|
193
|
-
try {
|
|
194
|
-
for (var groups_1 = __values(groups), groups_1_1 = groups_1.next(); !groups_1_1.done; groups_1_1 = groups_1.next()) {
|
|
195
|
-
var group = groups_1_1.value;
|
|
196
|
-
group.disposable.dispose();
|
|
197
|
-
this.doRemoveGroup(group.value, { skipActive: true });
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
201
|
-
finally {
|
|
202
|
-
try {
|
|
203
|
-
if (groups_1_1 && !groups_1_1.done && (_a = groups_1.return)) _a.call(groups_1);
|
|
204
|
-
}
|
|
205
|
-
finally { if (e_1) throw e_1.error; }
|
|
206
|
-
}
|
|
207
|
-
if (hasActiveGroup) {
|
|
208
|
-
this.doSetGroupActive(undefined);
|
|
209
|
-
}
|
|
210
|
-
this.gridview.clear();
|
|
211
|
-
};
|
|
212
|
-
GridviewComponent.prototype.movePanel = function (panel, options) {
|
|
213
|
-
var _a;
|
|
214
|
-
var relativeLocation;
|
|
215
|
-
var removedPanel = this.gridview.remove(panel);
|
|
216
|
-
var referenceGroup = (_a = this._groups.get(options.reference)) === null || _a === void 0 ? void 0 : _a.value;
|
|
217
|
-
if (!referenceGroup) {
|
|
218
|
-
throw new Error("reference group ".concat(options.reference, " does not exist"));
|
|
219
|
-
}
|
|
220
|
-
var target = (0, baseComponentGridview_1.toTarget)(options.direction);
|
|
221
|
-
if (target === droptarget_1.Position.Center) {
|
|
222
|
-
throw new Error("".concat(target, " not supported as an option"));
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
var location_1 = (0, gridview_1.getGridLocation)(referenceGroup.element);
|
|
226
|
-
relativeLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, location_1, target);
|
|
227
|
-
}
|
|
228
|
-
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
229
|
-
};
|
|
230
|
-
GridviewComponent.prototype.addPanel = function (options) {
|
|
231
|
-
var _a, _b;
|
|
232
|
-
var relativeLocation = options.location || [0];
|
|
233
|
-
if ((_a = options.position) === null || _a === void 0 ? void 0 : _a.referencePanel) {
|
|
234
|
-
var referenceGroup = (_b = this._groups.get(options.position.referencePanel)) === null || _b === void 0 ? void 0 : _b.value;
|
|
235
|
-
if (!referenceGroup) {
|
|
236
|
-
throw new Error("reference group ".concat(options.position.referencePanel, " does not exist"));
|
|
237
|
-
}
|
|
238
|
-
var target = (0, baseComponentGridview_1.toTarget)(options.position.direction);
|
|
239
|
-
if (target === droptarget_1.Position.Center) {
|
|
240
|
-
throw new Error("".concat(target, " not supported as an option"));
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
var location_2 = (0, gridview_1.getGridLocation)(referenceGroup.element);
|
|
244
|
-
relativeLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, location_2, target);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
var view = (0, componentFactory_1.createComponent)(options.id, options.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory
|
|
248
|
-
? {
|
|
249
|
-
createComponent: this.options.frameworkComponentFactory
|
|
250
|
-
.createComponent,
|
|
251
|
-
}
|
|
252
|
-
: undefined);
|
|
253
|
-
view.init({
|
|
254
|
-
params: options.params || {},
|
|
255
|
-
minimumWidth: options.minimumWidth,
|
|
256
|
-
maximumWidth: options.maximumWidth,
|
|
257
|
-
minimumHeight: options.minimumHeight,
|
|
258
|
-
maximumHeight: options.maximumHeight,
|
|
259
|
-
priority: options.priority,
|
|
260
|
-
snap: !!options.snap,
|
|
261
|
-
accessor: this,
|
|
262
|
-
isVisible: true,
|
|
263
|
-
});
|
|
264
|
-
this.registerPanel(view);
|
|
265
|
-
this.doAddGroup(view, relativeLocation, options.size);
|
|
266
|
-
return view;
|
|
267
|
-
};
|
|
268
|
-
GridviewComponent.prototype.registerPanel = function (panel) {
|
|
269
|
-
var _this = this;
|
|
270
|
-
var disposable = new lifecycle_1.CompositeDisposable(panel.api.onDidFocusChange(function (event) {
|
|
271
|
-
if (!event.isFocused) {
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
_this._groups.forEach(function (groupItem) {
|
|
275
|
-
var group = groupItem.value;
|
|
276
|
-
if (group !== panel) {
|
|
277
|
-
group.setActive(false);
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
group.setActive(true);
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
}));
|
|
284
|
-
this._groups.set(panel.id, {
|
|
285
|
-
value: panel,
|
|
286
|
-
disposable: disposable,
|
|
287
|
-
});
|
|
288
|
-
};
|
|
289
|
-
GridviewComponent.prototype.moveGroup = function (referenceGroup, groupId, target) {
|
|
290
|
-
var sourceGroup = this.getPanel(groupId);
|
|
291
|
-
if (!sourceGroup) {
|
|
292
|
-
throw new Error('invalid operation');
|
|
293
|
-
}
|
|
294
|
-
var referenceLocation = (0, gridview_1.getGridLocation)(referenceGroup.element);
|
|
295
|
-
var targetLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, referenceLocation, target);
|
|
296
|
-
var _a = __read((0, array_1.tail)(targetLocation), 2), targetParentLocation = _a[0], to = _a[1];
|
|
297
|
-
var sourceLocation = (0, gridview_1.getGridLocation)(sourceGroup.element);
|
|
298
|
-
var _b = __read((0, array_1.tail)(sourceLocation), 2), sourceParentLocation = _b[0], from = _b[1];
|
|
299
|
-
if ((0, array_1.sequenceEquals)(sourceParentLocation, targetParentLocation)) {
|
|
300
|
-
// special case when 'swapping' two views within same grid location
|
|
301
|
-
// if a group has one tab - we are essentially moving the 'group'
|
|
302
|
-
// which is equivalent to swapping two views in this case
|
|
303
|
-
this.gridview.moveView(sourceParentLocation, from, to);
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
// source group will become empty so delete the group
|
|
307
|
-
var targetGroup = this.doRemoveGroup(sourceGroup, {
|
|
308
|
-
skipActive: true,
|
|
309
|
-
skipDispose: true,
|
|
310
|
-
});
|
|
311
|
-
// after deleting the group we need to re-evaulate the ref location
|
|
312
|
-
var updatedReferenceLocation = (0, gridview_1.getGridLocation)(referenceGroup.element);
|
|
313
|
-
var location = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, updatedReferenceLocation, target);
|
|
314
|
-
this.doAddGroup(targetGroup, location);
|
|
315
|
-
};
|
|
316
|
-
GridviewComponent.prototype.removeGroup = function (group) {
|
|
317
|
-
_super.prototype.removeGroup.call(this, group);
|
|
318
|
-
};
|
|
319
|
-
GridviewComponent.prototype.dispose = function () {
|
|
320
|
-
_super.prototype.dispose.call(this);
|
|
321
|
-
this._onDidLayoutfromJSON.dispose();
|
|
322
|
-
};
|
|
323
|
-
return GridviewComponent;
|
|
324
|
-
}(baseComponentGridview_1.BaseGrid));
|
|
325
|
-
exports.GridviewComponent = GridviewComponent;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __values = (this && this.__values) || function(o) {
|
|
29
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
30
|
+
if (m) return m.call(o);
|
|
31
|
+
if (o && typeof o.length === "number") return {
|
|
32
|
+
next: function () {
|
|
33
|
+
if (o && i >= o.length) o = void 0;
|
|
34
|
+
return { value: o && o[i++], done: !o };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
38
|
+
};
|
|
39
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
40
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
41
|
+
if (!m) return o;
|
|
42
|
+
var i = m.call(o), r, ar = [], e;
|
|
43
|
+
try {
|
|
44
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
45
|
+
}
|
|
46
|
+
catch (error) { e = { error: error }; }
|
|
47
|
+
finally {
|
|
48
|
+
try {
|
|
49
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
50
|
+
}
|
|
51
|
+
finally { if (e) throw e.error; }
|
|
52
|
+
}
|
|
53
|
+
return ar;
|
|
54
|
+
};
|
|
55
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
+
exports.GridviewComponent = void 0;
|
|
57
|
+
var gridview_1 = require("./gridview");
|
|
58
|
+
var droptarget_1 = require("../dnd/droptarget");
|
|
59
|
+
var array_1 = require("../array");
|
|
60
|
+
var lifecycle_1 = require("../lifecycle");
|
|
61
|
+
var baseComponentGridview_1 = require("./baseComponentGridview");
|
|
62
|
+
var componentFactory_1 = require("../panel/componentFactory");
|
|
63
|
+
var events_1 = require("../events");
|
|
64
|
+
var GridviewComponent = /** @class */ (function (_super) {
|
|
65
|
+
__extends(GridviewComponent, _super);
|
|
66
|
+
function GridviewComponent(element, options) {
|
|
67
|
+
var _this = _super.call(this, element, {
|
|
68
|
+
proportionalLayout: options.proportionalLayout,
|
|
69
|
+
orientation: options.orientation,
|
|
70
|
+
styles: options.styles,
|
|
71
|
+
}) || this;
|
|
72
|
+
_this._onDidLayoutfromJSON = new events_1.Emitter();
|
|
73
|
+
_this.onDidLayoutFromJSON = _this._onDidLayoutfromJSON.event;
|
|
74
|
+
_this._options = options;
|
|
75
|
+
if (!_this.options.components) {
|
|
76
|
+
_this.options.components = {};
|
|
77
|
+
}
|
|
78
|
+
if (!_this.options.frameworkComponents) {
|
|
79
|
+
_this.options.frameworkComponents = {};
|
|
80
|
+
}
|
|
81
|
+
return _this;
|
|
82
|
+
}
|
|
83
|
+
Object.defineProperty(GridviewComponent.prototype, "orientation", {
|
|
84
|
+
get: function () {
|
|
85
|
+
return this.gridview.orientation;
|
|
86
|
+
},
|
|
87
|
+
set: function (value) {
|
|
88
|
+
this.gridview.orientation = value;
|
|
89
|
+
},
|
|
90
|
+
enumerable: false,
|
|
91
|
+
configurable: true
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(GridviewComponent.prototype, "options", {
|
|
94
|
+
get: function () {
|
|
95
|
+
return this._options;
|
|
96
|
+
},
|
|
97
|
+
enumerable: false,
|
|
98
|
+
configurable: true
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(GridviewComponent.prototype, "deserializer", {
|
|
101
|
+
get: function () {
|
|
102
|
+
return this._deserializer;
|
|
103
|
+
},
|
|
104
|
+
set: function (value) {
|
|
105
|
+
this._deserializer = value;
|
|
106
|
+
},
|
|
107
|
+
enumerable: false,
|
|
108
|
+
configurable: true
|
|
109
|
+
});
|
|
110
|
+
GridviewComponent.prototype.updateOptions = function (options) {
|
|
111
|
+
var hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
112
|
+
this.gridview.orientation !== options.orientation;
|
|
113
|
+
this._options = __assign(__assign({}, this.options), options);
|
|
114
|
+
if (hasOrientationChanged) {
|
|
115
|
+
this.gridview.orientation = options.orientation;
|
|
116
|
+
}
|
|
117
|
+
this.layout(this.gridview.width, this.gridview.height, true);
|
|
118
|
+
};
|
|
119
|
+
GridviewComponent.prototype.removePanel = function (panel) {
|
|
120
|
+
this.removeGroup(panel);
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Serialize the current state of the layout
|
|
124
|
+
*
|
|
125
|
+
* @returns A JSON respresentation of the layout
|
|
126
|
+
*/
|
|
127
|
+
GridviewComponent.prototype.toJSON = function () {
|
|
128
|
+
var _a;
|
|
129
|
+
var data = this.gridview.serialize();
|
|
130
|
+
return {
|
|
131
|
+
grid: data,
|
|
132
|
+
activePanel: (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.id,
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
GridviewComponent.prototype.setVisible = function (panel, visible) {
|
|
136
|
+
this.gridview.setViewVisible((0, gridview_1.getGridLocation)(panel.element), visible);
|
|
137
|
+
};
|
|
138
|
+
GridviewComponent.prototype.setActive = function (panel) {
|
|
139
|
+
this._groups.forEach(function (value, _key) {
|
|
140
|
+
value.value.setActive(panel === value.value);
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
GridviewComponent.prototype.focus = function () {
|
|
144
|
+
var _a;
|
|
145
|
+
(_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
|
|
146
|
+
};
|
|
147
|
+
GridviewComponent.prototype.fromJSON = function (serializedGridview) {
|
|
148
|
+
var _this = this;
|
|
149
|
+
this.clear();
|
|
150
|
+
var grid = serializedGridview.grid, activePanel = serializedGridview.activePanel;
|
|
151
|
+
var queue = [];
|
|
152
|
+
this.gridview.deserialize(grid, {
|
|
153
|
+
fromJSON: function (node) {
|
|
154
|
+
var data = node.data;
|
|
155
|
+
var view = (0, componentFactory_1.createComponent)(data.id, data.component, _this.options.components || {}, _this.options.frameworkComponents || {}, _this.options.frameworkComponentFactory
|
|
156
|
+
? {
|
|
157
|
+
createComponent: _this.options.frameworkComponentFactory
|
|
158
|
+
.createComponent,
|
|
159
|
+
}
|
|
160
|
+
: undefined);
|
|
161
|
+
queue.push(function () {
|
|
162
|
+
return view.init({
|
|
163
|
+
params: data.params,
|
|
164
|
+
minimumWidth: data.minimumWidth,
|
|
165
|
+
maximumWidth: data.maximumWidth,
|
|
166
|
+
minimumHeight: data.minimumHeight,
|
|
167
|
+
maximumHeight: data.maximumHeight,
|
|
168
|
+
priority: data.priority,
|
|
169
|
+
snap: !!data.snap,
|
|
170
|
+
accessor: _this,
|
|
171
|
+
isVisible: node.visible,
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
_this._onDidAddGroup.fire(view);
|
|
175
|
+
_this.registerPanel(view);
|
|
176
|
+
return view;
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
this.layout(this.width, this.height, true);
|
|
180
|
+
queue.forEach(function (f) { return f(); });
|
|
181
|
+
if (typeof activePanel === 'string') {
|
|
182
|
+
var panel = this.getPanel(activePanel);
|
|
183
|
+
if (panel) {
|
|
184
|
+
this.doSetGroupActive(panel);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
this._onDidLayoutfromJSON.fire();
|
|
188
|
+
};
|
|
189
|
+
GridviewComponent.prototype.clear = function () {
|
|
190
|
+
var e_1, _a;
|
|
191
|
+
var hasActiveGroup = this.activeGroup;
|
|
192
|
+
var groups = Array.from(this._groups.values()); // reassign since group panels will mutate
|
|
193
|
+
try {
|
|
194
|
+
for (var groups_1 = __values(groups), groups_1_1 = groups_1.next(); !groups_1_1.done; groups_1_1 = groups_1.next()) {
|
|
195
|
+
var group = groups_1_1.value;
|
|
196
|
+
group.disposable.dispose();
|
|
197
|
+
this.doRemoveGroup(group.value, { skipActive: true });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
201
|
+
finally {
|
|
202
|
+
try {
|
|
203
|
+
if (groups_1_1 && !groups_1_1.done && (_a = groups_1.return)) _a.call(groups_1);
|
|
204
|
+
}
|
|
205
|
+
finally { if (e_1) throw e_1.error; }
|
|
206
|
+
}
|
|
207
|
+
if (hasActiveGroup) {
|
|
208
|
+
this.doSetGroupActive(undefined);
|
|
209
|
+
}
|
|
210
|
+
this.gridview.clear();
|
|
211
|
+
};
|
|
212
|
+
GridviewComponent.prototype.movePanel = function (panel, options) {
|
|
213
|
+
var _a;
|
|
214
|
+
var relativeLocation;
|
|
215
|
+
var removedPanel = this.gridview.remove(panel);
|
|
216
|
+
var referenceGroup = (_a = this._groups.get(options.reference)) === null || _a === void 0 ? void 0 : _a.value;
|
|
217
|
+
if (!referenceGroup) {
|
|
218
|
+
throw new Error("reference group ".concat(options.reference, " does not exist"));
|
|
219
|
+
}
|
|
220
|
+
var target = (0, baseComponentGridview_1.toTarget)(options.direction);
|
|
221
|
+
if (target === droptarget_1.Position.Center) {
|
|
222
|
+
throw new Error("".concat(target, " not supported as an option"));
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
var location_1 = (0, gridview_1.getGridLocation)(referenceGroup.element);
|
|
226
|
+
relativeLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, location_1, target);
|
|
227
|
+
}
|
|
228
|
+
this.doAddGroup(removedPanel, relativeLocation, options.size);
|
|
229
|
+
};
|
|
230
|
+
GridviewComponent.prototype.addPanel = function (options) {
|
|
231
|
+
var _a, _b;
|
|
232
|
+
var relativeLocation = options.location || [0];
|
|
233
|
+
if ((_a = options.position) === null || _a === void 0 ? void 0 : _a.referencePanel) {
|
|
234
|
+
var referenceGroup = (_b = this._groups.get(options.position.referencePanel)) === null || _b === void 0 ? void 0 : _b.value;
|
|
235
|
+
if (!referenceGroup) {
|
|
236
|
+
throw new Error("reference group ".concat(options.position.referencePanel, " does not exist"));
|
|
237
|
+
}
|
|
238
|
+
var target = (0, baseComponentGridview_1.toTarget)(options.position.direction);
|
|
239
|
+
if (target === droptarget_1.Position.Center) {
|
|
240
|
+
throw new Error("".concat(target, " not supported as an option"));
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
var location_2 = (0, gridview_1.getGridLocation)(referenceGroup.element);
|
|
244
|
+
relativeLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, location_2, target);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
var view = (0, componentFactory_1.createComponent)(options.id, options.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory
|
|
248
|
+
? {
|
|
249
|
+
createComponent: this.options.frameworkComponentFactory
|
|
250
|
+
.createComponent,
|
|
251
|
+
}
|
|
252
|
+
: undefined);
|
|
253
|
+
view.init({
|
|
254
|
+
params: options.params || {},
|
|
255
|
+
minimumWidth: options.minimumWidth,
|
|
256
|
+
maximumWidth: options.maximumWidth,
|
|
257
|
+
minimumHeight: options.minimumHeight,
|
|
258
|
+
maximumHeight: options.maximumHeight,
|
|
259
|
+
priority: options.priority,
|
|
260
|
+
snap: !!options.snap,
|
|
261
|
+
accessor: this,
|
|
262
|
+
isVisible: true,
|
|
263
|
+
});
|
|
264
|
+
this.registerPanel(view);
|
|
265
|
+
this.doAddGroup(view, relativeLocation, options.size);
|
|
266
|
+
return view;
|
|
267
|
+
};
|
|
268
|
+
GridviewComponent.prototype.registerPanel = function (panel) {
|
|
269
|
+
var _this = this;
|
|
270
|
+
var disposable = new lifecycle_1.CompositeDisposable(panel.api.onDidFocusChange(function (event) {
|
|
271
|
+
if (!event.isFocused) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
_this._groups.forEach(function (groupItem) {
|
|
275
|
+
var group = groupItem.value;
|
|
276
|
+
if (group !== panel) {
|
|
277
|
+
group.setActive(false);
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
group.setActive(true);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}));
|
|
284
|
+
this._groups.set(panel.id, {
|
|
285
|
+
value: panel,
|
|
286
|
+
disposable: disposable,
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
GridviewComponent.prototype.moveGroup = function (referenceGroup, groupId, target) {
|
|
290
|
+
var sourceGroup = this.getPanel(groupId);
|
|
291
|
+
if (!sourceGroup) {
|
|
292
|
+
throw new Error('invalid operation');
|
|
293
|
+
}
|
|
294
|
+
var referenceLocation = (0, gridview_1.getGridLocation)(referenceGroup.element);
|
|
295
|
+
var targetLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, referenceLocation, target);
|
|
296
|
+
var _a = __read((0, array_1.tail)(targetLocation), 2), targetParentLocation = _a[0], to = _a[1];
|
|
297
|
+
var sourceLocation = (0, gridview_1.getGridLocation)(sourceGroup.element);
|
|
298
|
+
var _b = __read((0, array_1.tail)(sourceLocation), 2), sourceParentLocation = _b[0], from = _b[1];
|
|
299
|
+
if ((0, array_1.sequenceEquals)(sourceParentLocation, targetParentLocation)) {
|
|
300
|
+
// special case when 'swapping' two views within same grid location
|
|
301
|
+
// if a group has one tab - we are essentially moving the 'group'
|
|
302
|
+
// which is equivalent to swapping two views in this case
|
|
303
|
+
this.gridview.moveView(sourceParentLocation, from, to);
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
// source group will become empty so delete the group
|
|
307
|
+
var targetGroup = this.doRemoveGroup(sourceGroup, {
|
|
308
|
+
skipActive: true,
|
|
309
|
+
skipDispose: true,
|
|
310
|
+
});
|
|
311
|
+
// after deleting the group we need to re-evaulate the ref location
|
|
312
|
+
var updatedReferenceLocation = (0, gridview_1.getGridLocation)(referenceGroup.element);
|
|
313
|
+
var location = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, updatedReferenceLocation, target);
|
|
314
|
+
this.doAddGroup(targetGroup, location);
|
|
315
|
+
};
|
|
316
|
+
GridviewComponent.prototype.removeGroup = function (group) {
|
|
317
|
+
_super.prototype.removeGroup.call(this, group);
|
|
318
|
+
};
|
|
319
|
+
GridviewComponent.prototype.dispose = function () {
|
|
320
|
+
_super.prototype.dispose.call(this);
|
|
321
|
+
this._onDidLayoutfromJSON.dispose();
|
|
322
|
+
};
|
|
323
|
+
return GridviewComponent;
|
|
324
|
+
}(baseComponentGridview_1.BaseGrid));
|
|
325
|
+
exports.GridviewComponent = GridviewComponent;
|
|
326
326
|
//# sourceMappingURL=gridviewComponent.js.map
|