dockview 0.0.28 → 1.0.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 +60 -0
- 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 +135 -131
- package/dist/cjs/api/component.api.js +486 -444
- package/dist/cjs/api/component.api.js.map +1 -1
- package/dist/cjs/api/gridviewPanelApi.d.ts +36 -36
- package/dist/cjs/api/gridviewPanelApi.js +46 -46
- package/dist/cjs/api/groupPanelApi.d.ts +44 -44
- package/dist/cjs/api/groupPanelApi.js +94 -94
- package/dist/cjs/api/groupPanelApi.js.map +1 -1
- package/dist/cjs/api/panelApi.d.ts +107 -107
- package/dist/cjs/api/panelApi.js +140 -140
- package/dist/cjs/api/paneviewPanelApi.d.ts +26 -26
- package/dist/cjs/api/paneviewPanelApi.js +56 -56
- package/dist/cjs/api/splitviewPanelApi.d.ts +33 -33
- package/dist/cjs/api/splitviewPanelApi.js +51 -51
- 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 +56 -56
- package/dist/cjs/dnd/dataTransfer.js +144 -144
- package/dist/cjs/dnd/dataTransfer.js.map +1 -1
- package/dist/cjs/dnd/dnd.d.ts +40 -40
- package/dist/cjs/dnd/dnd.js +142 -142
- package/dist/cjs/dnd/droptarget.d.ts +33 -37
- package/dist/cjs/dnd/droptarget.js +177 -177
- package/dist/cjs/dnd/droptarget.js.map +1 -1
- package/dist/cjs/dockview/components/tab/defaultTab.d.ts +44 -44
- package/dist/cjs/dockview/components/tab/defaultTab.js +186 -186
- package/dist/cjs/dockview/components/watermark/watermark.d.ts +20 -20
- package/dist/cjs/dockview/components/watermark/watermark.js +99 -99
- package/dist/cjs/dockview/defaultGroupPanelView.d.ts +34 -34
- package/dist/cjs/dockview/defaultGroupPanelView.js +85 -83
- package/dist/cjs/dockview/defaultGroupPanelView.js.map +1 -1
- package/dist/cjs/dockview/deserializer.d.ts +14 -14
- package/dist/cjs/dockview/deserializer.js +47 -47
- package/dist/cjs/dockview/dockviewComponent.d.ts +121 -121
- package/dist/cjs/dockview/dockviewComponent.js +692 -692
- package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
- package/dist/cjs/dockview/dockviewGroupPanel.d.ts +35 -35
- package/dist/cjs/dockview/dockviewGroupPanel.js +195 -195
- package/dist/cjs/dockview/options.d.ts +79 -79
- 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 -23
- package/dist/cjs/events.js +108 -87
- package/dist/cjs/events.js.map +1 -1
- package/dist/cjs/functions.d.ts +1 -1
- package/dist/cjs/functions.js +41 -41
- package/dist/cjs/gridview/baseComponentGridview.d.ts +98 -98
- package/dist/cjs/gridview/baseComponentGridview.js +285 -292
- package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
- package/dist/cjs/gridview/basePanelView.d.ts +46 -46
- package/dist/cjs/gridview/basePanelView.js +115 -115
- package/dist/cjs/gridview/branchNode.d.ts +46 -46
- package/dist/cjs/gridview/branchNode.js +342 -342
- package/dist/cjs/gridview/gridview.d.ts +123 -123
- package/dist/cjs/gridview/gridview.js +476 -477
- package/dist/cjs/gridview/gridview.js.map +1 -1
- package/dist/cjs/gridview/gridviewComponent.d.ts +88 -88
- package/dist/cjs/gridview/gridviewComponent.js +303 -303
- package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
- package/dist/cjs/gridview/gridviewPanel.d.ts +62 -62
- package/dist/cjs/gridview/gridviewPanel.js +205 -205
- package/dist/cjs/gridview/leafNode.d.ts +31 -31
- package/dist/cjs/gridview/leafNode.js +164 -164
- 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 +41 -41
- package/dist/cjs/groupview/groupPanel.js +2 -2
- package/dist/cjs/groupview/groupview.d.ts +154 -154
- package/dist/cjs/groupview/groupview.js +633 -633
- package/dist/cjs/groupview/groupview.js.map +1 -1
- package/dist/cjs/groupview/groupviewPanel.d.ts +18 -18
- package/dist/cjs/groupview/groupviewPanel.js +83 -83
- package/dist/cjs/groupview/panel/content.d.ts +30 -30
- package/dist/cjs/groupview/panel/content.js +99 -99
- package/dist/cjs/groupview/panel/hostedPanel.d.ts +22 -22
- package/dist/cjs/groupview/panel/hostedPanel.js +56 -56
- package/dist/cjs/groupview/panel/hostedPanel.js.map +1 -1
- package/dist/cjs/groupview/tab.d.ts +44 -44
- package/dist/cjs/groupview/tab.js +182 -182
- package/dist/cjs/groupview/titlebar/tabsContainer.d.ts +66 -66
- package/dist/cjs/groupview/titlebar/tabsContainer.js +260 -260
- package/dist/cjs/groupview/titlebar/tabsContainer.js.map +1 -1
- package/dist/cjs/groupview/types.d.ts +59 -59
- 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/hostedContainer.js.map +1 -1
- package/dist/cjs/index.d.ts +28 -26
- package/dist/cjs/index.js +37 -35
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/json.d.ts +1 -1
- package/dist/cjs/json.js +13 -13
- package/dist/cjs/lifecycle.d.ts +22 -22
- package/dist/cjs/lifecycle.js +87 -87
- package/dist/cjs/math.d.ts +4 -4
- package/dist/cjs/math.js +15 -15
- package/dist/cjs/math.js.map +1 -1
- package/dist/cjs/panel/componentFactory.d.ts +8 -8
- package/dist/cjs/panel/componentFactory.js +30 -30
- package/dist/cjs/panel/componentFactory.js.map +1 -1
- package/dist/cjs/panel/types.d.ts +34 -34
- package/dist/cjs/panel/types.js +2 -2
- package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +18 -18
- package/dist/cjs/paneview/defaultPaneviewHeader.js +64 -64
- package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +17 -17
- package/dist/cjs/paneview/draggablePaneviewPanel.js +111 -111
- package/dist/cjs/paneview/options.d.ts +25 -25
- package/dist/cjs/paneview/options.js +2 -2
- package/dist/cjs/paneview/paneview.d.ts +38 -38
- package/dist/cjs/paneview/paneview.js +195 -198
- package/dist/cjs/paneview/paneview.js.map +1 -1
- package/dist/cjs/paneview/paneviewComponent.d.ts +115 -113
- package/dist/cjs/paneview/paneviewComponent.js +338 -338
- package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
- package/dist/cjs/paneview/paneviewPanel.d.ts +85 -85
- package/dist/cjs/paneview/paneviewPanel.js +262 -262
- package/dist/cjs/paneview/paneviewPanel.js.map +1 -1
- package/dist/cjs/react/deserializer.d.ts +8 -8
- package/dist/cjs/react/deserializer.js +39 -39
- package/dist/cjs/react/dockview/components.d.ts +11 -11
- package/dist/cjs/react/dockview/components.js +76 -76
- package/dist/cjs/react/dockview/dockview.d.ts +34 -34
- package/dist/cjs/react/dockview/dockview.js +151 -135
- package/dist/cjs/react/dockview/dockview.js.map +1 -1
- package/dist/cjs/react/dockview/reactContentPart.d.ts +47 -47
- package/dist/cjs/react/dockview/reactContentPart.js +88 -88
- package/dist/cjs/react/dockview/reactHeaderPart.d.ts +24 -24
- package/dist/cjs/react/dockview/reactHeaderPart.js +50 -50
- package/dist/cjs/react/dockview/reactWatermarkPart.d.ts +30 -30
- package/dist/cjs/react/dockview/reactWatermarkPart.js +66 -66
- package/dist/cjs/react/dockview/v2/reactContentRenderer.d.ts +30 -30
- package/dist/cjs/react/dockview/v2/reactContentRenderer.js +90 -90
- 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 +104 -96
- package/dist/cjs/react/gridview/gridview.js.map +1 -1
- package/dist/cjs/react/gridview/view.d.ts +10 -10
- package/dist/cjs/react/gridview/view.js +40 -40
- package/dist/cjs/react/index.d.ts +9 -9
- package/dist/cjs/react/index.js +21 -21
- package/dist/cjs/react/paneview/paneview.d.ts +28 -28
- package/dist/cjs/react/paneview/paneview.js +142 -138
- package/dist/cjs/react/paneview/paneview.js.map +1 -1
- 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 +35 -35
- package/dist/cjs/react/react.js +181 -181
- package/dist/cjs/react/react.js.map +1 -1
- package/dist/cjs/react/splitview/splitview.d.ts +24 -24
- package/dist/cjs/react/splitview/splitview.js +101 -93
- package/dist/cjs/react/splitview/splitview.js.map +1 -1
- package/dist/cjs/react/splitview/view.d.ts +10 -10
- package/dist/cjs/react/splitview/view.js +40 -40
- 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 +124 -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 +100 -100
- package/dist/cjs/splitview/splitviewComponent.js +327 -327
- package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
- package/dist/cjs/splitview/splitviewPanel.d.ts +47 -47
- package/dist/cjs/splitview/splitviewPanel.js +178 -178
- package/dist/cjs/types.d.ts +7 -7
- package/dist/cjs/types.js +2 -2
- package/dist/dockview.amd.js +6759 -6712
- package/dist/dockview.amd.min.js +3 -3
- package/dist/dockview.amd.min.noStyle.js +3 -3
- package/dist/dockview.amd.noStyle.js +6752 -6705
- package/dist/dockview.cjs.js +6755 -6708
- package/dist/dockview.esm.js +6750 -6707
- package/dist/dockview.esm.min.js +3 -3
- package/dist/dockview.js +6759 -6712
- package/dist/dockview.min.js +3 -3
- package/dist/dockview.min.noStyle.js +3 -3
- package/dist/dockview.noStyle.js +6752 -6705
- 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 +135 -131
- package/dist/esm/api/component.api.js +305 -287
- package/dist/esm/api/gridviewPanelApi.d.ts +36 -36
- package/dist/esm/api/gridviewPanelApi.js +24 -24
- package/dist/esm/api/groupPanelApi.d.ts +44 -44
- package/dist/esm/api/groupPanelApi.js +52 -52
- package/dist/esm/api/panelApi.d.ts +107 -107
- package/dist/esm/api/panelApi.js +98 -98
- package/dist/esm/api/paneviewPanelApi.d.ts +26 -26
- package/dist/esm/api/paneviewPanelApi.js +26 -26
- package/dist/esm/api/splitviewPanelApi.d.ts +33 -33
- package/dist/esm/api/splitviewPanelApi.js +29 -29
- 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 +56 -56
- package/dist/esm/dnd/dataTransfer.js +109 -109
- package/dist/esm/dnd/dnd.d.ts +40 -40
- package/dist/esm/dnd/dnd.js +109 -109
- package/dist/esm/dnd/droptarget.d.ts +33 -37
- package/dist/esm/dnd/droptarget.js +143 -143
- package/dist/esm/dockview/components/tab/defaultTab.d.ts +44 -44
- package/dist/esm/dockview/components/tab/defaultTab.js +130 -130
- package/dist/esm/dockview/components/watermark/watermark.d.ts +20 -20
- package/dist/esm/dockview/components/watermark/watermark.js +68 -68
- package/dist/esm/dockview/defaultGroupPanelView.d.ts +34 -34
- package/dist/esm/dockview/defaultGroupPanelView.js +57 -55
- package/dist/esm/dockview/deserializer.d.ts +14 -14
- package/dist/esm/dockview/deserializer.js +20 -20
- package/dist/esm/dockview/dockviewComponent.d.ts +121 -121
- package/dist/esm/dockview/dockviewComponent.js +533 -533
- package/dist/esm/dockview/dockviewGroupPanel.d.ts +35 -35
- package/dist/esm/dockview/dockviewGroupPanel.js +145 -145
- package/dist/esm/dockview/options.d.ts +79 -79
- 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 -23
- package/dist/esm/events.js +89 -71
- package/dist/esm/functions.d.ts +1 -1
- package/dist/esm/functions.js +8 -8
- package/dist/esm/gridview/baseComponentGridview.d.ts +98 -98
- package/dist/esm/gridview/baseComponentGridview.js +217 -224
- package/dist/esm/gridview/basePanelView.d.ts +46 -46
- package/dist/esm/gridview/basePanelView.js +70 -70
- package/dist/esm/gridview/branchNode.d.ts +46 -46
- package/dist/esm/gridview/branchNode.js +218 -218
- package/dist/esm/gridview/gridview.d.ts +123 -123
- package/dist/esm/gridview/gridview.js +395 -396
- package/dist/esm/gridview/gridviewComponent.d.ts +88 -88
- package/dist/esm/gridview/gridviewComponent.js +238 -238
- package/dist/esm/gridview/gridviewPanel.d.ts +62 -62
- package/dist/esm/gridview/gridviewPanel.js +141 -141
- package/dist/esm/gridview/leafNode.d.ts +31 -31
- package/dist/esm/gridview/leafNode.js +97 -97
- 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 +41 -41
- package/dist/esm/groupview/groupPanel.js +1 -1
- package/dist/esm/groupview/groupview.d.ts +154 -154
- package/dist/esm/groupview/groupview.js +448 -448
- package/dist/esm/groupview/groupviewPanel.d.ts +18 -18
- package/dist/esm/groupview/groupviewPanel.js +41 -41
- package/dist/esm/groupview/panel/content.d.ts +30 -30
- package/dist/esm/groupview/panel/content.js +72 -72
- package/dist/esm/groupview/panel/hostedPanel.d.ts +22 -22
- package/dist/esm/groupview/panel/hostedPanel.js +43 -43
- package/dist/esm/groupview/tab.d.ts +44 -44
- package/dist/esm/groupview/tab.js +101 -101
- package/dist/esm/groupview/titlebar/tabsContainer.d.ts +66 -66
- package/dist/esm/groupview/titlebar/tabsContainer.js +185 -185
- package/dist/esm/groupview/types.d.ts +59 -59
- 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 +28 -26
- package/dist/esm/index.js +23 -21
- package/dist/esm/json.d.ts +1 -1
- package/dist/esm/json.js +9 -9
- package/dist/esm/lifecycle.d.ts +22 -22
- package/dist/esm/lifecycle.js +38 -38
- 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 +34 -34
- package/dist/esm/panel/types.js +1 -1
- package/dist/esm/paneview/defaultPaneviewHeader.d.ts +18 -18
- package/dist/esm/paneview/defaultPaneviewHeader.js +37 -37
- package/dist/esm/paneview/draggablePaneviewPanel.d.ts +17 -17
- package/dist/esm/paneview/draggablePaneviewPanel.js +72 -72
- package/dist/esm/paneview/options.d.ts +25 -25
- package/dist/esm/paneview/options.js +1 -1
- package/dist/esm/paneview/paneview.d.ts +38 -38
- package/dist/esm/paneview/paneview.js +141 -144
- package/dist/esm/paneview/paneviewComponent.d.ts +115 -113
- package/dist/esm/paneview/paneviewComponent.js +247 -247
- package/dist/esm/paneview/paneviewPanel.d.ts +85 -85
- package/dist/esm/paneview/paneviewPanel.js +183 -183
- package/dist/esm/react/deserializer.d.ts +8 -8
- package/dist/esm/react/deserializer.js +34 -34
- package/dist/esm/react/dockview/components.d.ts +11 -11
- package/dist/esm/react/dockview/components.js +54 -54
- package/dist/esm/react/dockview/dockview.d.ts +34 -34
- package/dist/esm/react/dockview/dockview.js +113 -97
- package/dist/esm/react/dockview/reactContentPart.d.ts +47 -47
- package/dist/esm/react/dockview/reactContentPart.js +75 -75
- package/dist/esm/react/dockview/reactHeaderPart.d.ts +24 -24
- package/dist/esm/react/dockview/reactHeaderPart.js +41 -41
- package/dist/esm/react/dockview/reactWatermarkPart.d.ts +30 -30
- package/dist/esm/react/dockview/reactWatermarkPart.js +56 -56
- package/dist/esm/react/dockview/v2/reactContentRenderer.d.ts +30 -30
- package/dist/esm/react/dockview/v2/reactContentRenderer.js +72 -72
- 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 +66 -58
- package/dist/esm/react/gridview/view.d.ts +10 -10
- package/dist/esm/react/gridview/view.js +18 -18
- package/dist/esm/react/index.d.ts +9 -9
- package/dist/esm/react/index.js +9 -9
- package/dist/esm/react/paneview/paneview.d.ts +28 -28
- package/dist/esm/react/paneview/paneview.js +91 -87
- 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 +35 -35
- package/dist/esm/react/react.js +116 -116
- package/dist/esm/react/splitview/splitview.d.ts +24 -24
- package/dist/esm/react/splitview/splitview.js +63 -55
- package/dist/esm/react/splitview/view.d.ts +10 -10
- package/dist/esm/react/splitview/view.js +18 -18
- 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 +124 -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 +100 -100
- package/dist/esm/splitview/splitviewComponent.js +241 -241
- package/dist/esm/splitview/splitviewPanel.d.ts +47 -47
- package/dist/esm/splitview/splitviewPanel.js +107 -107
- package/dist/esm/types.d.ts +7 -7
- package/dist/esm/types.js +1 -1
- package/dist/styles/dockview.css +45 -45
- package/package.json +75 -75
- package/dist/cjs/footnote.d.ts +0 -1
- package/dist/cjs/footnote.js +0 -20
- package/dist/cjs/footnote.js.map +0 -1
- package/dist/esm/footnote.d.ts +0 -1
- package/dist/esm/footnote.js +0 -19
|
@@ -1,328 +1,328 @@
|
|
|
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 __read = (this && this.__read) || function (o, n) {
|
|
29
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
30
|
-
if (!m) return o;
|
|
31
|
-
var i = m.call(o), r, ar = [], e;
|
|
32
|
-
try {
|
|
33
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
34
|
-
}
|
|
35
|
-
catch (error) { e = { error: error }; }
|
|
36
|
-
finally {
|
|
37
|
-
try {
|
|
38
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
39
|
-
}
|
|
40
|
-
finally { if (e) throw e.error; }
|
|
41
|
-
}
|
|
42
|
-
return ar;
|
|
43
|
-
};
|
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.SplitviewComponent = void 0;
|
|
46
|
-
var lifecycle_1 = require("../lifecycle");
|
|
47
|
-
var splitview_1 = require("./core/splitview");
|
|
48
|
-
var events_1 = require("../events");
|
|
49
|
-
var component_api_1 = require("../api/component.api");
|
|
50
|
-
var componentFactory_1 = require("../panel/componentFactory");
|
|
51
|
-
/**
|
|
52
|
-
* A high-level implementation of splitview that works using 'panels'
|
|
53
|
-
*/
|
|
54
|
-
var SplitviewComponent = /** @class */ (function (_super) {
|
|
55
|
-
__extends(SplitviewComponent, _super);
|
|
56
|
-
function SplitviewComponent(element, options) {
|
|
57
|
-
var _this = _super.call(this) || this;
|
|
58
|
-
_this.element = element;
|
|
59
|
-
_this._disposable = new lifecycle_1.MutableDisposable();
|
|
60
|
-
_this.panels = new Map();
|
|
61
|
-
_this._onDidLayoutChange = new events_1.Emitter();
|
|
62
|
-
_this.onDidLayoutChange = _this._onDidLayoutChange.event;
|
|
63
|
-
_this._options = options;
|
|
64
|
-
if (!options.components) {
|
|
65
|
-
options.components = {};
|
|
66
|
-
}
|
|
67
|
-
if (!options.frameworkComponents) {
|
|
68
|
-
options.frameworkComponents = {};
|
|
69
|
-
}
|
|
70
|
-
_this.splitview = new splitview_1.Splitview(_this.element, options);
|
|
71
|
-
_this.addDisposables(_this._disposable);
|
|
72
|
-
return _this;
|
|
73
|
-
}
|
|
74
|
-
Object.defineProperty(SplitviewComponent.prototype, "options", {
|
|
75
|
-
get: function () {
|
|
76
|
-
return this._options;
|
|
77
|
-
},
|
|
78
|
-
enumerable: false,
|
|
79
|
-
configurable: true
|
|
80
|
-
});
|
|
81
|
-
Object.defineProperty(SplitviewComponent.prototype, "orientation", {
|
|
82
|
-
get: function () {
|
|
83
|
-
return this.splitview.orientation;
|
|
84
|
-
},
|
|
85
|
-
enumerable: false,
|
|
86
|
-
configurable: true
|
|
87
|
-
});
|
|
88
|
-
Object.defineProperty(SplitviewComponent.prototype, "splitview", {
|
|
89
|
-
get: function () {
|
|
90
|
-
return this._splitview;
|
|
91
|
-
},
|
|
92
|
-
set: function (value) {
|
|
93
|
-
var _this = this;
|
|
94
|
-
this._splitview = value;
|
|
95
|
-
this._disposable.value = new lifecycle_1.CompositeDisposable(this._splitview.onDidSashEnd(function () {
|
|
96
|
-
_this._onDidLayoutChange.fire(undefined);
|
|
97
|
-
}));
|
|
98
|
-
},
|
|
99
|
-
enumerable: false,
|
|
100
|
-
configurable: true
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(SplitviewComponent.prototype, "minimumSize", {
|
|
103
|
-
get: function () {
|
|
104
|
-
return this.splitview.minimumSize;
|
|
105
|
-
},
|
|
106
|
-
enumerable: false,
|
|
107
|
-
configurable: true
|
|
108
|
-
});
|
|
109
|
-
Object.defineProperty(SplitviewComponent.prototype, "maximumSize", {
|
|
110
|
-
get: function () {
|
|
111
|
-
return this.splitview.maximumSize;
|
|
112
|
-
},
|
|
113
|
-
enumerable: false,
|
|
114
|
-
configurable: true
|
|
115
|
-
});
|
|
116
|
-
Object.defineProperty(SplitviewComponent.prototype, "height", {
|
|
117
|
-
get: function () {
|
|
118
|
-
return this.splitview.orientation === splitview_1.Orientation.HORIZONTAL
|
|
119
|
-
? this.splitview.orthogonalSize
|
|
120
|
-
: this.splitview.size;
|
|
121
|
-
},
|
|
122
|
-
enumerable: false,
|
|
123
|
-
configurable: true
|
|
124
|
-
});
|
|
125
|
-
Object.defineProperty(SplitviewComponent.prototype, "width", {
|
|
126
|
-
get: function () {
|
|
127
|
-
return this.splitview.orientation === splitview_1.Orientation.HORIZONTAL
|
|
128
|
-
? this.splitview.size
|
|
129
|
-
: this.splitview.orthogonalSize;
|
|
130
|
-
},
|
|
131
|
-
enumerable: false,
|
|
132
|
-
configurable: true
|
|
133
|
-
});
|
|
134
|
-
Object.defineProperty(SplitviewComponent.prototype, "length", {
|
|
135
|
-
get: function () {
|
|
136
|
-
return this.panels.size;
|
|
137
|
-
},
|
|
138
|
-
enumerable: false,
|
|
139
|
-
configurable: true
|
|
140
|
-
});
|
|
141
|
-
SplitviewComponent.prototype.updateOptions = function (options) {
|
|
142
|
-
var hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
143
|
-
this.options.orientation !== options.orientation;
|
|
144
|
-
this._options = __assign(__assign({}, this.options), options);
|
|
145
|
-
if (hasOrientationChanged) {
|
|
146
|
-
this.splitview.orientation = options.orientation;
|
|
147
|
-
}
|
|
148
|
-
this.splitview.layout(this.splitview.size, this.splitview.orthogonalSize);
|
|
149
|
-
};
|
|
150
|
-
SplitviewComponent.prototype.focus = function () {
|
|
151
|
-
var _a;
|
|
152
|
-
(_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus();
|
|
153
|
-
};
|
|
154
|
-
SplitviewComponent.prototype.movePanel = function (from, to) {
|
|
155
|
-
this.splitview.moveView(from, to);
|
|
156
|
-
};
|
|
157
|
-
SplitviewComponent.prototype.setVisible = function (panel, visible) {
|
|
158
|
-
var index = this.getPanels().indexOf(panel);
|
|
159
|
-
this.splitview.setViewVisible(index, visible);
|
|
160
|
-
};
|
|
161
|
-
SplitviewComponent.prototype.setActive = function (view, skipFocus) {
|
|
162
|
-
this._activePanel = view;
|
|
163
|
-
this.getPanels()
|
|
164
|
-
.filter(function (v) { return v !== view; })
|
|
165
|
-
.forEach(function (v) {
|
|
166
|
-
v.api._onDidActiveChange.fire({ isActive: false });
|
|
167
|
-
if (!skipFocus) {
|
|
168
|
-
v.focus();
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
view.api._onDidActiveChange.fire({ isActive: true });
|
|
172
|
-
if (!skipFocus) {
|
|
173
|
-
view.focus();
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
SplitviewComponent.prototype.getPanels = function () {
|
|
177
|
-
return this.splitview.getViews();
|
|
178
|
-
};
|
|
179
|
-
SplitviewComponent.prototype.removePanel = function (panel, sizing) {
|
|
180
|
-
var disposable = this.panels.get(panel.id);
|
|
181
|
-
disposable === null || disposable === void 0 ? void 0 : disposable.dispose();
|
|
182
|
-
this.panels.delete(panel.id);
|
|
183
|
-
var index = this.getPanels().findIndex(function (_) { return _ === panel; });
|
|
184
|
-
this.splitview.removeView(index, sizing);
|
|
185
|
-
var panels = this.getPanels();
|
|
186
|
-
if (panels.length > 0) {
|
|
187
|
-
this.setActive(panels[panels.length - 1]);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
SplitviewComponent.prototype.getPanel = function (id) {
|
|
191
|
-
return this.getPanels().find(function (view) { return view.id === id; });
|
|
192
|
-
};
|
|
193
|
-
SplitviewComponent.prototype.addPanel = function (options) {
|
|
194
|
-
if (this.panels.has(options.id)) {
|
|
195
|
-
throw new Error("panel "
|
|
196
|
-
}
|
|
197
|
-
var view = (0, componentFactory_1.createComponent)(options.id, options.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkWrapper
|
|
198
|
-
? {
|
|
199
|
-
createComponent: this.options.frameworkWrapper.createComponent,
|
|
200
|
-
}
|
|
201
|
-
: undefined);
|
|
202
|
-
view.orientation = this.splitview.orientation;
|
|
203
|
-
view.init({
|
|
204
|
-
params: options.params || {},
|
|
205
|
-
minimumSize: options.minimumSize,
|
|
206
|
-
maximumSize: options.maximumSize,
|
|
207
|
-
snap: options.snap,
|
|
208
|
-
priority: options.priority,
|
|
209
|
-
containerApi: new component_api_1.SplitviewApi(this),
|
|
210
|
-
});
|
|
211
|
-
var size = typeof options.size === 'number' ? options.size : splitview_1.Sizing.Distribute;
|
|
212
|
-
var index = typeof options.index === 'number' ? options.index : undefined;
|
|
213
|
-
this.splitview.addView(view, size, index);
|
|
214
|
-
this.doAddView(view);
|
|
215
|
-
this.setActive(view);
|
|
216
|
-
};
|
|
217
|
-
/**
|
|
218
|
-
* Resize the layout to fit the parent container
|
|
219
|
-
*/
|
|
220
|
-
SplitviewComponent.prototype.resizeToFit = function () {
|
|
221
|
-
if (!this.element.parentElement) {
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
var _a = this.element.parentElement.getBoundingClientRect(), width = _a.width, height = _a.height;
|
|
225
|
-
this.layout(width, height);
|
|
226
|
-
};
|
|
227
|
-
SplitviewComponent.prototype.layout = function (width, height) {
|
|
228
|
-
var _a = __read(this.splitview.orientation === splitview_1.Orientation.HORIZONTAL
|
|
229
|
-
? [width, height]
|
|
230
|
-
: [height, width], 2), size = _a[0], orthogonalSize = _a[1];
|
|
231
|
-
this.splitview.layout(size, orthogonalSize);
|
|
232
|
-
};
|
|
233
|
-
SplitviewComponent.prototype.doAddView = function (view) {
|
|
234
|
-
var _this = this;
|
|
235
|
-
var disposable = view.api.onDidFocusChange(function (event) {
|
|
236
|
-
if (!event.isFocused) {
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
_this.setActive(view, true);
|
|
240
|
-
});
|
|
241
|
-
this.panels.set(view.id, disposable);
|
|
242
|
-
};
|
|
243
|
-
SplitviewComponent.prototype.toJSON = function () {
|
|
244
|
-
var _this = this;
|
|
245
|
-
var _a;
|
|
246
|
-
var views = this.splitview
|
|
247
|
-
.getViews()
|
|
248
|
-
.map(function (view, i) {
|
|
249
|
-
var size = _this.splitview.getViewSize(i);
|
|
250
|
-
return {
|
|
251
|
-
size: size,
|
|
252
|
-
data: view.toJSON(),
|
|
253
|
-
snap: !!view.snap,
|
|
254
|
-
priority: view.priority,
|
|
255
|
-
};
|
|
256
|
-
});
|
|
257
|
-
return {
|
|
258
|
-
views: views,
|
|
259
|
-
activeView: (_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.id,
|
|
260
|
-
size: this.splitview.size,
|
|
261
|
-
orientation: this.splitview.orientation,
|
|
262
|
-
};
|
|
263
|
-
};
|
|
264
|
-
SplitviewComponent.prototype.fromJSON = function (serializedSplitview, deferComponentLayout) {
|
|
265
|
-
var _this = this;
|
|
266
|
-
if (deferComponentLayout === void 0) { deferComponentLayout = false; }
|
|
267
|
-
var views = serializedSplitview.views, orientation = serializedSplitview.orientation, size = serializedSplitview.size, activeView = serializedSplitview.activeView;
|
|
268
|
-
this.splitview.dispose();
|
|
269
|
-
var queue = [];
|
|
270
|
-
this.splitview = new splitview_1.Splitview(this.element, {
|
|
271
|
-
orientation: orientation,
|
|
272
|
-
proportionalLayout: this.options.proportionalLayout,
|
|
273
|
-
descriptor: {
|
|
274
|
-
size: size,
|
|
275
|
-
views: views.map(function (view) {
|
|
276
|
-
var data = view.data;
|
|
277
|
-
if (_this.panels.has(data.id)) {
|
|
278
|
-
throw new Error("panel "
|
|
279
|
-
}
|
|
280
|
-
var panel = (0, componentFactory_1.createComponent)(data.id, data.component, _this.options.components || {}, _this.options.frameworkComponents || {}, _this.options.frameworkWrapper
|
|
281
|
-
? {
|
|
282
|
-
createComponent: _this.options.frameworkWrapper
|
|
283
|
-
.createComponent,
|
|
284
|
-
}
|
|
285
|
-
: undefined);
|
|
286
|
-
queue.push(function () {
|
|
287
|
-
panel.init({
|
|
288
|
-
params: data.params || {},
|
|
289
|
-
minimumSize: data.minimumSize,
|
|
290
|
-
maximumSize: data.maximumSize,
|
|
291
|
-
snap: view.snap,
|
|
292
|
-
priority: view.priority,
|
|
293
|
-
containerApi: new component_api_1.SplitviewApi(_this),
|
|
294
|
-
});
|
|
295
|
-
});
|
|
296
|
-
panel.orientation = orientation;
|
|
297
|
-
_this.doAddView(panel);
|
|
298
|
-
return { size: view.size, view: panel };
|
|
299
|
-
}),
|
|
300
|
-
},
|
|
301
|
-
});
|
|
302
|
-
this.layout(this.width, this.height);
|
|
303
|
-
if (deferComponentLayout) {
|
|
304
|
-
setTimeout(function () {
|
|
305
|
-
queue.forEach(function (f) { return f(); });
|
|
306
|
-
}, 0);
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
queue.forEach(function (f) { return f(); });
|
|
310
|
-
}
|
|
311
|
-
if (typeof activeView === 'string') {
|
|
312
|
-
var panel = this.getPanel(activeView);
|
|
313
|
-
if (panel) {
|
|
314
|
-
this.setActive(panel);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
SplitviewComponent.prototype.dispose = function () {
|
|
319
|
-
Array.from(this.panels.values()).forEach(function (value) {
|
|
320
|
-
value.dispose();
|
|
321
|
-
});
|
|
322
|
-
this.panels.clear();
|
|
323
|
-
_super.prototype.dispose.call(this);
|
|
324
|
-
};
|
|
325
|
-
return SplitviewComponent;
|
|
326
|
-
}(lifecycle_1.CompositeDisposable));
|
|
327
|
-
exports.SplitviewComponent = SplitviewComponent;
|
|
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 __read = (this && this.__read) || function (o, n) {
|
|
29
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
30
|
+
if (!m) return o;
|
|
31
|
+
var i = m.call(o), r, ar = [], e;
|
|
32
|
+
try {
|
|
33
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
34
|
+
}
|
|
35
|
+
catch (error) { e = { error: error }; }
|
|
36
|
+
finally {
|
|
37
|
+
try {
|
|
38
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
39
|
+
}
|
|
40
|
+
finally { if (e) throw e.error; }
|
|
41
|
+
}
|
|
42
|
+
return ar;
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.SplitviewComponent = void 0;
|
|
46
|
+
var lifecycle_1 = require("../lifecycle");
|
|
47
|
+
var splitview_1 = require("./core/splitview");
|
|
48
|
+
var events_1 = require("../events");
|
|
49
|
+
var component_api_1 = require("../api/component.api");
|
|
50
|
+
var componentFactory_1 = require("../panel/componentFactory");
|
|
51
|
+
/**
|
|
52
|
+
* A high-level implementation of splitview that works using 'panels'
|
|
53
|
+
*/
|
|
54
|
+
var SplitviewComponent = /** @class */ (function (_super) {
|
|
55
|
+
__extends(SplitviewComponent, _super);
|
|
56
|
+
function SplitviewComponent(element, options) {
|
|
57
|
+
var _this = _super.call(this) || this;
|
|
58
|
+
_this.element = element;
|
|
59
|
+
_this._disposable = new lifecycle_1.MutableDisposable();
|
|
60
|
+
_this.panels = new Map();
|
|
61
|
+
_this._onDidLayoutChange = new events_1.Emitter();
|
|
62
|
+
_this.onDidLayoutChange = _this._onDidLayoutChange.event;
|
|
63
|
+
_this._options = options;
|
|
64
|
+
if (!options.components) {
|
|
65
|
+
options.components = {};
|
|
66
|
+
}
|
|
67
|
+
if (!options.frameworkComponents) {
|
|
68
|
+
options.frameworkComponents = {};
|
|
69
|
+
}
|
|
70
|
+
_this.splitview = new splitview_1.Splitview(_this.element, options);
|
|
71
|
+
_this.addDisposables(_this._disposable);
|
|
72
|
+
return _this;
|
|
73
|
+
}
|
|
74
|
+
Object.defineProperty(SplitviewComponent.prototype, "options", {
|
|
75
|
+
get: function () {
|
|
76
|
+
return this._options;
|
|
77
|
+
},
|
|
78
|
+
enumerable: false,
|
|
79
|
+
configurable: true
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(SplitviewComponent.prototype, "orientation", {
|
|
82
|
+
get: function () {
|
|
83
|
+
return this.splitview.orientation;
|
|
84
|
+
},
|
|
85
|
+
enumerable: false,
|
|
86
|
+
configurable: true
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(SplitviewComponent.prototype, "splitview", {
|
|
89
|
+
get: function () {
|
|
90
|
+
return this._splitview;
|
|
91
|
+
},
|
|
92
|
+
set: function (value) {
|
|
93
|
+
var _this = this;
|
|
94
|
+
this._splitview = value;
|
|
95
|
+
this._disposable.value = new lifecycle_1.CompositeDisposable(this._splitview.onDidSashEnd(function () {
|
|
96
|
+
_this._onDidLayoutChange.fire(undefined);
|
|
97
|
+
}));
|
|
98
|
+
},
|
|
99
|
+
enumerable: false,
|
|
100
|
+
configurable: true
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(SplitviewComponent.prototype, "minimumSize", {
|
|
103
|
+
get: function () {
|
|
104
|
+
return this.splitview.minimumSize;
|
|
105
|
+
},
|
|
106
|
+
enumerable: false,
|
|
107
|
+
configurable: true
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(SplitviewComponent.prototype, "maximumSize", {
|
|
110
|
+
get: function () {
|
|
111
|
+
return this.splitview.maximumSize;
|
|
112
|
+
},
|
|
113
|
+
enumerable: false,
|
|
114
|
+
configurable: true
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(SplitviewComponent.prototype, "height", {
|
|
117
|
+
get: function () {
|
|
118
|
+
return this.splitview.orientation === splitview_1.Orientation.HORIZONTAL
|
|
119
|
+
? this.splitview.orthogonalSize
|
|
120
|
+
: this.splitview.size;
|
|
121
|
+
},
|
|
122
|
+
enumerable: false,
|
|
123
|
+
configurable: true
|
|
124
|
+
});
|
|
125
|
+
Object.defineProperty(SplitviewComponent.prototype, "width", {
|
|
126
|
+
get: function () {
|
|
127
|
+
return this.splitview.orientation === splitview_1.Orientation.HORIZONTAL
|
|
128
|
+
? this.splitview.size
|
|
129
|
+
: this.splitview.orthogonalSize;
|
|
130
|
+
},
|
|
131
|
+
enumerable: false,
|
|
132
|
+
configurable: true
|
|
133
|
+
});
|
|
134
|
+
Object.defineProperty(SplitviewComponent.prototype, "length", {
|
|
135
|
+
get: function () {
|
|
136
|
+
return this.panels.size;
|
|
137
|
+
},
|
|
138
|
+
enumerable: false,
|
|
139
|
+
configurable: true
|
|
140
|
+
});
|
|
141
|
+
SplitviewComponent.prototype.updateOptions = function (options) {
|
|
142
|
+
var hasOrientationChanged = typeof options.orientation === 'string' &&
|
|
143
|
+
this.options.orientation !== options.orientation;
|
|
144
|
+
this._options = __assign(__assign({}, this.options), options);
|
|
145
|
+
if (hasOrientationChanged) {
|
|
146
|
+
this.splitview.orientation = options.orientation;
|
|
147
|
+
}
|
|
148
|
+
this.splitview.layout(this.splitview.size, this.splitview.orthogonalSize);
|
|
149
|
+
};
|
|
150
|
+
SplitviewComponent.prototype.focus = function () {
|
|
151
|
+
var _a;
|
|
152
|
+
(_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.focus();
|
|
153
|
+
};
|
|
154
|
+
SplitviewComponent.prototype.movePanel = function (from, to) {
|
|
155
|
+
this.splitview.moveView(from, to);
|
|
156
|
+
};
|
|
157
|
+
SplitviewComponent.prototype.setVisible = function (panel, visible) {
|
|
158
|
+
var index = this.getPanels().indexOf(panel);
|
|
159
|
+
this.splitview.setViewVisible(index, visible);
|
|
160
|
+
};
|
|
161
|
+
SplitviewComponent.prototype.setActive = function (view, skipFocus) {
|
|
162
|
+
this._activePanel = view;
|
|
163
|
+
this.getPanels()
|
|
164
|
+
.filter(function (v) { return v !== view; })
|
|
165
|
+
.forEach(function (v) {
|
|
166
|
+
v.api._onDidActiveChange.fire({ isActive: false });
|
|
167
|
+
if (!skipFocus) {
|
|
168
|
+
v.focus();
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
view.api._onDidActiveChange.fire({ isActive: true });
|
|
172
|
+
if (!skipFocus) {
|
|
173
|
+
view.focus();
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
SplitviewComponent.prototype.getPanels = function () {
|
|
177
|
+
return this.splitview.getViews();
|
|
178
|
+
};
|
|
179
|
+
SplitviewComponent.prototype.removePanel = function (panel, sizing) {
|
|
180
|
+
var disposable = this.panels.get(panel.id);
|
|
181
|
+
disposable === null || disposable === void 0 ? void 0 : disposable.dispose();
|
|
182
|
+
this.panels.delete(panel.id);
|
|
183
|
+
var index = this.getPanels().findIndex(function (_) { return _ === panel; });
|
|
184
|
+
this.splitview.removeView(index, sizing);
|
|
185
|
+
var panels = this.getPanels();
|
|
186
|
+
if (panels.length > 0) {
|
|
187
|
+
this.setActive(panels[panels.length - 1]);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
SplitviewComponent.prototype.getPanel = function (id) {
|
|
191
|
+
return this.getPanels().find(function (view) { return view.id === id; });
|
|
192
|
+
};
|
|
193
|
+
SplitviewComponent.prototype.addPanel = function (options) {
|
|
194
|
+
if (this.panels.has(options.id)) {
|
|
195
|
+
throw new Error("panel ".concat(options.id, " already exists"));
|
|
196
|
+
}
|
|
197
|
+
var view = (0, componentFactory_1.createComponent)(options.id, options.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkWrapper
|
|
198
|
+
? {
|
|
199
|
+
createComponent: this.options.frameworkWrapper.createComponent,
|
|
200
|
+
}
|
|
201
|
+
: undefined);
|
|
202
|
+
view.orientation = this.splitview.orientation;
|
|
203
|
+
view.init({
|
|
204
|
+
params: options.params || {},
|
|
205
|
+
minimumSize: options.minimumSize,
|
|
206
|
+
maximumSize: options.maximumSize,
|
|
207
|
+
snap: options.snap,
|
|
208
|
+
priority: options.priority,
|
|
209
|
+
containerApi: new component_api_1.SplitviewApi(this),
|
|
210
|
+
});
|
|
211
|
+
var size = typeof options.size === 'number' ? options.size : splitview_1.Sizing.Distribute;
|
|
212
|
+
var index = typeof options.index === 'number' ? options.index : undefined;
|
|
213
|
+
this.splitview.addView(view, size, index);
|
|
214
|
+
this.doAddView(view);
|
|
215
|
+
this.setActive(view);
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* Resize the layout to fit the parent container
|
|
219
|
+
*/
|
|
220
|
+
SplitviewComponent.prototype.resizeToFit = function () {
|
|
221
|
+
if (!this.element.parentElement) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
var _a = this.element.parentElement.getBoundingClientRect(), width = _a.width, height = _a.height;
|
|
225
|
+
this.layout(width, height);
|
|
226
|
+
};
|
|
227
|
+
SplitviewComponent.prototype.layout = function (width, height) {
|
|
228
|
+
var _a = __read(this.splitview.orientation === splitview_1.Orientation.HORIZONTAL
|
|
229
|
+
? [width, height]
|
|
230
|
+
: [height, width], 2), size = _a[0], orthogonalSize = _a[1];
|
|
231
|
+
this.splitview.layout(size, orthogonalSize);
|
|
232
|
+
};
|
|
233
|
+
SplitviewComponent.prototype.doAddView = function (view) {
|
|
234
|
+
var _this = this;
|
|
235
|
+
var disposable = view.api.onDidFocusChange(function (event) {
|
|
236
|
+
if (!event.isFocused) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
_this.setActive(view, true);
|
|
240
|
+
});
|
|
241
|
+
this.panels.set(view.id, disposable);
|
|
242
|
+
};
|
|
243
|
+
SplitviewComponent.prototype.toJSON = function () {
|
|
244
|
+
var _this = this;
|
|
245
|
+
var _a;
|
|
246
|
+
var views = this.splitview
|
|
247
|
+
.getViews()
|
|
248
|
+
.map(function (view, i) {
|
|
249
|
+
var size = _this.splitview.getViewSize(i);
|
|
250
|
+
return {
|
|
251
|
+
size: size,
|
|
252
|
+
data: view.toJSON(),
|
|
253
|
+
snap: !!view.snap,
|
|
254
|
+
priority: view.priority,
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
return {
|
|
258
|
+
views: views,
|
|
259
|
+
activeView: (_a = this._activePanel) === null || _a === void 0 ? void 0 : _a.id,
|
|
260
|
+
size: this.splitview.size,
|
|
261
|
+
orientation: this.splitview.orientation,
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
SplitviewComponent.prototype.fromJSON = function (serializedSplitview, deferComponentLayout) {
|
|
265
|
+
var _this = this;
|
|
266
|
+
if (deferComponentLayout === void 0) { deferComponentLayout = false; }
|
|
267
|
+
var views = serializedSplitview.views, orientation = serializedSplitview.orientation, size = serializedSplitview.size, activeView = serializedSplitview.activeView;
|
|
268
|
+
this.splitview.dispose();
|
|
269
|
+
var queue = [];
|
|
270
|
+
this.splitview = new splitview_1.Splitview(this.element, {
|
|
271
|
+
orientation: orientation,
|
|
272
|
+
proportionalLayout: this.options.proportionalLayout,
|
|
273
|
+
descriptor: {
|
|
274
|
+
size: size,
|
|
275
|
+
views: views.map(function (view) {
|
|
276
|
+
var data = view.data;
|
|
277
|
+
if (_this.panels.has(data.id)) {
|
|
278
|
+
throw new Error("panel ".concat(data.id, " already exists"));
|
|
279
|
+
}
|
|
280
|
+
var panel = (0, componentFactory_1.createComponent)(data.id, data.component, _this.options.components || {}, _this.options.frameworkComponents || {}, _this.options.frameworkWrapper
|
|
281
|
+
? {
|
|
282
|
+
createComponent: _this.options.frameworkWrapper
|
|
283
|
+
.createComponent,
|
|
284
|
+
}
|
|
285
|
+
: undefined);
|
|
286
|
+
queue.push(function () {
|
|
287
|
+
panel.init({
|
|
288
|
+
params: data.params || {},
|
|
289
|
+
minimumSize: data.minimumSize,
|
|
290
|
+
maximumSize: data.maximumSize,
|
|
291
|
+
snap: view.snap,
|
|
292
|
+
priority: view.priority,
|
|
293
|
+
containerApi: new component_api_1.SplitviewApi(_this),
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
panel.orientation = orientation;
|
|
297
|
+
_this.doAddView(panel);
|
|
298
|
+
return { size: view.size, view: panel };
|
|
299
|
+
}),
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
this.layout(this.width, this.height);
|
|
303
|
+
if (deferComponentLayout) {
|
|
304
|
+
setTimeout(function () {
|
|
305
|
+
queue.forEach(function (f) { return f(); });
|
|
306
|
+
}, 0);
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
queue.forEach(function (f) { return f(); });
|
|
310
|
+
}
|
|
311
|
+
if (typeof activeView === 'string') {
|
|
312
|
+
var panel = this.getPanel(activeView);
|
|
313
|
+
if (panel) {
|
|
314
|
+
this.setActive(panel);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
SplitviewComponent.prototype.dispose = function () {
|
|
319
|
+
Array.from(this.panels.values()).forEach(function (value) {
|
|
320
|
+
value.dispose();
|
|
321
|
+
});
|
|
322
|
+
this.panels.clear();
|
|
323
|
+
_super.prototype.dispose.call(this);
|
|
324
|
+
};
|
|
325
|
+
return SplitviewComponent;
|
|
326
|
+
}(lifecycle_1.CompositeDisposable));
|
|
327
|
+
exports.SplitviewComponent = SplitviewComponent;
|
|
328
328
|
//# sourceMappingURL=splitviewComponent.js.map
|