dockview 0.0.28 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +131 -131
- package/dist/cjs/api/component.api.js +444 -444
- 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 +37 -37
- package/dist/cjs/dnd/droptarget.js +177 -177
- 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 +83 -83
- 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 +23 -23
- package/dist/cjs/events.js +87 -87
- package/dist/cjs/footnote.d.ts +1 -1
- package/dist/cjs/footnote.js +19 -19
- package/dist/cjs/footnote.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 +292 -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 +477 -477
- 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/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 +29 -26
- package/dist/cjs/index.js +38 -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 +198 -198
- package/dist/cjs/paneview/paneviewComponent.d.ts +113 -113
- package/dist/cjs/paneview/paneviewComponent.js +338 -338
- 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 +135 -135
- 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 +96 -96
- 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 +138 -138
- 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 +93 -93
- 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 +6714 -6711
- package/dist/dockview.amd.min.js +3 -3
- package/dist/dockview.amd.min.noStyle.js +3 -3
- package/dist/dockview.amd.noStyle.js +6706 -6703
- package/dist/dockview.cjs.js +6708 -6705
- package/dist/dockview.esm.js +6706 -6706
- package/dist/dockview.esm.min.js +3 -3
- package/dist/dockview.js +6714 -6711
- package/dist/dockview.min.js +3 -3
- package/dist/dockview.min.noStyle.js +3 -3
- package/dist/dockview.noStyle.js +6706 -6703
- 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 +131 -131
- package/dist/esm/api/component.api.js +287 -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 +37 -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 +55 -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 +23 -23
- package/dist/esm/events.js +71 -71
- package/dist/esm/footnote.d.ts +1 -1
- package/dist/esm/footnote.js +19 -19
- 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 +224 -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 +396 -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 +29 -26
- package/dist/esm/index.js +24 -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 +144 -144
- package/dist/esm/paneview/paneviewComponent.d.ts +113 -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 +97 -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 +58 -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 +87 -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 +55 -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/package.json +75 -75
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReactPanelDeserialzier = void 0;
|
|
4
|
-
var dockviewGroupPanel_1 = require("../dockview/dockviewGroupPanel");
|
|
5
|
-
var componentFactory_1 = require("../panel/componentFactory");
|
|
6
|
-
var component_api_1 = require("../api/component.api");
|
|
7
|
-
var defaultTab_1 = require("../dockview/components/tab/defaultTab");
|
|
8
|
-
var defaultGroupPanelView_1 = require("../dockview/defaultGroupPanelView");
|
|
9
|
-
var ReactPanelDeserialzier = /** @class */ (function () {
|
|
10
|
-
function ReactPanelDeserialzier(layout) {
|
|
11
|
-
this.layout = layout;
|
|
12
|
-
}
|
|
13
|
-
ReactPanelDeserialzier.prototype.fromJSON = function (panelData) {
|
|
14
|
-
var _a, _b, _c;
|
|
15
|
-
var panelId = panelData.id;
|
|
16
|
-
var params = panelData.params;
|
|
17
|
-
var title = panelData.title;
|
|
18
|
-
var state = panelData.state;
|
|
19
|
-
var suppressClosable = panelData.suppressClosable;
|
|
20
|
-
var viewData = panelData.view;
|
|
21
|
-
var view = new defaultGroupPanelView_1.DefaultGroupPanelView({
|
|
22
|
-
content: (0, componentFactory_1.createComponent)(viewData.content.id, viewData.content.id, this.layout.options.components, this.layout.options.frameworkComponents, (_a = this.layout.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.content),
|
|
23
|
-
tab: ((_b = viewData.tab) === null || _b === void 0 ? void 0 : _b.id)
|
|
24
|
-
? (0, componentFactory_1.createComponent)(viewData.tab.id, viewData.tab.id, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab)
|
|
25
|
-
: new defaultTab_1.DefaultTab(),
|
|
26
|
-
});
|
|
27
|
-
var panel = new dockviewGroupPanel_1.DockviewGroupPanel(panelId, new component_api_1.DockviewApi(this.layout));
|
|
28
|
-
panel.init({
|
|
29
|
-
view: view,
|
|
30
|
-
title: title,
|
|
31
|
-
suppressClosable: suppressClosable,
|
|
32
|
-
params: params || {},
|
|
33
|
-
state: state || {},
|
|
34
|
-
});
|
|
35
|
-
return panel;
|
|
36
|
-
};
|
|
37
|
-
return ReactPanelDeserialzier;
|
|
38
|
-
}());
|
|
39
|
-
exports.ReactPanelDeserialzier = ReactPanelDeserialzier;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReactPanelDeserialzier = void 0;
|
|
4
|
+
var dockviewGroupPanel_1 = require("../dockview/dockviewGroupPanel");
|
|
5
|
+
var componentFactory_1 = require("../panel/componentFactory");
|
|
6
|
+
var component_api_1 = require("../api/component.api");
|
|
7
|
+
var defaultTab_1 = require("../dockview/components/tab/defaultTab");
|
|
8
|
+
var defaultGroupPanelView_1 = require("../dockview/defaultGroupPanelView");
|
|
9
|
+
var ReactPanelDeserialzier = /** @class */ (function () {
|
|
10
|
+
function ReactPanelDeserialzier(layout) {
|
|
11
|
+
this.layout = layout;
|
|
12
|
+
}
|
|
13
|
+
ReactPanelDeserialzier.prototype.fromJSON = function (panelData) {
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
var panelId = panelData.id;
|
|
16
|
+
var params = panelData.params;
|
|
17
|
+
var title = panelData.title;
|
|
18
|
+
var state = panelData.state;
|
|
19
|
+
var suppressClosable = panelData.suppressClosable;
|
|
20
|
+
var viewData = panelData.view;
|
|
21
|
+
var view = new defaultGroupPanelView_1.DefaultGroupPanelView({
|
|
22
|
+
content: (0, componentFactory_1.createComponent)(viewData.content.id, viewData.content.id, this.layout.options.components, this.layout.options.frameworkComponents, (_a = this.layout.options.frameworkComponentFactory) === null || _a === void 0 ? void 0 : _a.content),
|
|
23
|
+
tab: ((_b = viewData.tab) === null || _b === void 0 ? void 0 : _b.id)
|
|
24
|
+
? (0, componentFactory_1.createComponent)(viewData.tab.id, viewData.tab.id, this.layout.options.tabComponents, this.layout.options.frameworkTabComponents, (_c = this.layout.options.frameworkComponentFactory) === null || _c === void 0 ? void 0 : _c.tab)
|
|
25
|
+
: new defaultTab_1.DefaultTab(),
|
|
26
|
+
});
|
|
27
|
+
var panel = new dockviewGroupPanel_1.DockviewGroupPanel(panelId, new component_api_1.DockviewApi(this.layout));
|
|
28
|
+
panel.init({
|
|
29
|
+
view: view,
|
|
30
|
+
title: title,
|
|
31
|
+
suppressClosable: suppressClosable,
|
|
32
|
+
params: params || {},
|
|
33
|
+
state: state || {},
|
|
34
|
+
});
|
|
35
|
+
return panel;
|
|
36
|
+
};
|
|
37
|
+
return ReactPanelDeserialzier;
|
|
38
|
+
}());
|
|
39
|
+
exports.ReactPanelDeserialzier = ReactPanelDeserialzier;
|
|
40
40
|
//# sourceMappingURL=deserializer.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface WithChildren {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export declare const DockviewComponents: {
|
|
6
|
-
Tab: React.FunctionComponent<WithChildren>;
|
|
7
|
-
Content: React.FunctionComponent<WithChildren>;
|
|
8
|
-
Actions: React.FunctionComponent<WithChildren>;
|
|
9
|
-
Panel: React.FunctionComponent<WithChildren>;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface WithChildren {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare const DockviewComponents: {
|
|
6
|
+
Tab: React.FunctionComponent<WithChildren>;
|
|
7
|
+
Content: React.FunctionComponent<WithChildren>;
|
|
8
|
+
Actions: React.FunctionComponent<WithChildren>;
|
|
9
|
+
Panel: React.FunctionComponent<WithChildren>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.DockviewComponents = void 0;
|
|
23
|
-
var React = __importStar(require("react"));
|
|
24
|
-
var ReactDOM = __importStar(require("react-dom"));
|
|
25
|
-
var react_1 = require("../react");
|
|
26
|
-
var Tab = function (props) {
|
|
27
|
-
return React.createElement(React.Fragment, null, props.children);
|
|
28
|
-
};
|
|
29
|
-
var Content = function (props) {
|
|
30
|
-
return React.createElement(React.Fragment, null, props.children);
|
|
31
|
-
};
|
|
32
|
-
var Actions = function (props) {
|
|
33
|
-
return React.createElement(React.Fragment, null, props.children);
|
|
34
|
-
};
|
|
35
|
-
function isValidComponent(element) {
|
|
36
|
-
return [Content, Actions, Tab].find(function (comp) { return element.type === comp; });
|
|
37
|
-
}
|
|
38
|
-
var Panel = function (props) {
|
|
39
|
-
var context = React.useContext(react_1.ReactPartContext);
|
|
40
|
-
var sections = React.useMemo(function () {
|
|
41
|
-
var _a;
|
|
42
|
-
var childs = ((_a = React.Children.map(props.children, function (_) { return _; })) === null || _a === void 0 ? void 0 : _a.filter(react_1.isReactElement)) || [];
|
|
43
|
-
var isInvalid = !!childs.find(function (_) { return !isValidComponent(_); });
|
|
44
|
-
if (isInvalid) {
|
|
45
|
-
throw new Error('Children of DockviewComponents.Panel must be one of the following: DockviewComponents.Content, DockviewComponents.Actions, DockviewComponents.Tab');
|
|
46
|
-
}
|
|
47
|
-
var body = childs.find(function (_) { return _.type === Content; });
|
|
48
|
-
var actions = childs.find(function (_) { return _.type === Actions; });
|
|
49
|
-
var tab = childs.find(function (_) { return _.type === Tab; });
|
|
50
|
-
return { body: body, actions: actions, tab: tab };
|
|
51
|
-
}, [props.children]);
|
|
52
|
-
React.useEffect(function () {
|
|
53
|
-
/**
|
|
54
|
-
* hide or show the default tab behavior based on whether we want to override
|
|
55
|
-
* with our own React tab.
|
|
56
|
-
*/
|
|
57
|
-
if (sections.tab) {
|
|
58
|
-
context.tabPortalElement.hide();
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
context.tabPortalElement.show();
|
|
62
|
-
}
|
|
63
|
-
}, [sections.tab]);
|
|
64
|
-
return (React.createElement(React.Fragment, null,
|
|
65
|
-
sections.actions &&
|
|
66
|
-
ReactDOM.createPortal(sections.actions, context.actionsPortalElement),
|
|
67
|
-
sections.tab &&
|
|
68
|
-
ReactDOM.createPortal(sections.tab, context.tabPortalElement.element),
|
|
69
|
-
sections.body || props.children));
|
|
70
|
-
};
|
|
71
|
-
exports.DockviewComponents = {
|
|
72
|
-
Tab: Tab,
|
|
73
|
-
Content: Content,
|
|
74
|
-
Actions: Actions,
|
|
75
|
-
Panel: Panel,
|
|
76
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.DockviewComponents = void 0;
|
|
23
|
+
var React = __importStar(require("react"));
|
|
24
|
+
var ReactDOM = __importStar(require("react-dom"));
|
|
25
|
+
var react_1 = require("../react");
|
|
26
|
+
var Tab = function (props) {
|
|
27
|
+
return React.createElement(React.Fragment, null, props.children);
|
|
28
|
+
};
|
|
29
|
+
var Content = function (props) {
|
|
30
|
+
return React.createElement(React.Fragment, null, props.children);
|
|
31
|
+
};
|
|
32
|
+
var Actions = function (props) {
|
|
33
|
+
return React.createElement(React.Fragment, null, props.children);
|
|
34
|
+
};
|
|
35
|
+
function isValidComponent(element) {
|
|
36
|
+
return [Content, Actions, Tab].find(function (comp) { return element.type === comp; });
|
|
37
|
+
}
|
|
38
|
+
var Panel = function (props) {
|
|
39
|
+
var context = React.useContext(react_1.ReactPartContext);
|
|
40
|
+
var sections = React.useMemo(function () {
|
|
41
|
+
var _a;
|
|
42
|
+
var childs = ((_a = React.Children.map(props.children, function (_) { return _; })) === null || _a === void 0 ? void 0 : _a.filter(react_1.isReactElement)) || [];
|
|
43
|
+
var isInvalid = !!childs.find(function (_) { return !isValidComponent(_); });
|
|
44
|
+
if (isInvalid) {
|
|
45
|
+
throw new Error('Children of DockviewComponents.Panel must be one of the following: DockviewComponents.Content, DockviewComponents.Actions, DockviewComponents.Tab');
|
|
46
|
+
}
|
|
47
|
+
var body = childs.find(function (_) { return _.type === Content; });
|
|
48
|
+
var actions = childs.find(function (_) { return _.type === Actions; });
|
|
49
|
+
var tab = childs.find(function (_) { return _.type === Tab; });
|
|
50
|
+
return { body: body, actions: actions, tab: tab };
|
|
51
|
+
}, [props.children]);
|
|
52
|
+
React.useEffect(function () {
|
|
53
|
+
/**
|
|
54
|
+
* hide or show the default tab behavior based on whether we want to override
|
|
55
|
+
* with our own React tab.
|
|
56
|
+
*/
|
|
57
|
+
if (sections.tab) {
|
|
58
|
+
context.tabPortalElement.hide();
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
context.tabPortalElement.show();
|
|
62
|
+
}
|
|
63
|
+
}, [sections.tab]);
|
|
64
|
+
return (React.createElement(React.Fragment, null,
|
|
65
|
+
sections.actions &&
|
|
66
|
+
ReactDOM.createPortal(sections.actions, context.actionsPortalElement),
|
|
67
|
+
sections.tab &&
|
|
68
|
+
ReactDOM.createPortal(sections.tab, context.tabPortalElement.element),
|
|
69
|
+
sections.body || props.children));
|
|
70
|
+
};
|
|
71
|
+
exports.DockviewComponents = {
|
|
72
|
+
Tab: Tab,
|
|
73
|
+
Content: Content,
|
|
74
|
+
Actions: Actions,
|
|
75
|
+
Panel: Panel,
|
|
76
|
+
};
|
|
77
77
|
//# sourceMappingURL=components.js.map
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { TabContextMenuEvent } from '../../dockview/options';
|
|
3
|
-
import { DockviewPanelApi } from '../../api/groupPanelApi';
|
|
4
|
-
import { DockviewApi } from '../../api/component.api';
|
|
5
|
-
import { PanelCollection, PanelParameters } from '../types';
|
|
6
|
-
export interface IGroupPanelBaseProps<T extends {} = Record<string, any>> extends PanelParameters<T> {
|
|
7
|
-
api: DockviewPanelApi;
|
|
8
|
-
containerApi: DockviewApi;
|
|
9
|
-
}
|
|
10
|
-
export interface IDockviewPanelProps<T extends {
|
|
11
|
-
[index: string]: any;
|
|
12
|
-
} = any> extends IGroupPanelBaseProps<T> {
|
|
13
|
-
}
|
|
14
|
-
export interface DockviewReadyEvent {
|
|
15
|
-
api: DockviewApi;
|
|
16
|
-
}
|
|
17
|
-
export interface IWatermarkPanelProps<T extends {} = Record<string, any>> extends PanelParameters<T> {
|
|
18
|
-
containerApi: DockviewApi;
|
|
19
|
-
close(): void;
|
|
20
|
-
}
|
|
21
|
-
export interface IDockviewReactProps {
|
|
22
|
-
components?: PanelCollection<IDockviewPanelProps>;
|
|
23
|
-
tabComponents?: PanelCollection<IGroupPanelBaseProps>;
|
|
24
|
-
watermarkComponent?: React.FunctionComponent<IWatermarkPanelProps>;
|
|
25
|
-
onReady?: (event: DockviewReadyEvent) => void;
|
|
26
|
-
debug?: boolean;
|
|
27
|
-
tabHeight?: number;
|
|
28
|
-
enableExternalDragEvents?: boolean;
|
|
29
|
-
onTabContextMenu?: (event: TabContextMenuEvent) => void;
|
|
30
|
-
hideBorders?: boolean;
|
|
31
|
-
className?: string;
|
|
32
|
-
disableAutoResizing?: boolean;
|
|
33
|
-
}
|
|
34
|
-
export declare const DockviewReact: React.ForwardRefExoticComponent<IDockviewReactProps & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TabContextMenuEvent } from '../../dockview/options';
|
|
3
|
+
import { DockviewPanelApi } from '../../api/groupPanelApi';
|
|
4
|
+
import { DockviewApi } from '../../api/component.api';
|
|
5
|
+
import { PanelCollection, PanelParameters } from '../types';
|
|
6
|
+
export interface IGroupPanelBaseProps<T extends {} = Record<string, any>> extends PanelParameters<T> {
|
|
7
|
+
api: DockviewPanelApi;
|
|
8
|
+
containerApi: DockviewApi;
|
|
9
|
+
}
|
|
10
|
+
export interface IDockviewPanelProps<T extends {
|
|
11
|
+
[index: string]: any;
|
|
12
|
+
} = any> extends IGroupPanelBaseProps<T> {
|
|
13
|
+
}
|
|
14
|
+
export interface DockviewReadyEvent {
|
|
15
|
+
api: DockviewApi;
|
|
16
|
+
}
|
|
17
|
+
export interface IWatermarkPanelProps<T extends {} = Record<string, any>> extends PanelParameters<T> {
|
|
18
|
+
containerApi: DockviewApi;
|
|
19
|
+
close(): void;
|
|
20
|
+
}
|
|
21
|
+
export interface IDockviewReactProps {
|
|
22
|
+
components?: PanelCollection<IDockviewPanelProps>;
|
|
23
|
+
tabComponents?: PanelCollection<IGroupPanelBaseProps>;
|
|
24
|
+
watermarkComponent?: React.FunctionComponent<IWatermarkPanelProps>;
|
|
25
|
+
onReady?: (event: DockviewReadyEvent) => void;
|
|
26
|
+
debug?: boolean;
|
|
27
|
+
tabHeight?: number;
|
|
28
|
+
enableExternalDragEvents?: boolean;
|
|
29
|
+
onTabContextMenu?: (event: TabContextMenuEvent) => void;
|
|
30
|
+
hideBorders?: boolean;
|
|
31
|
+
className?: string;
|
|
32
|
+
disableAutoResizing?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare const DockviewReact: React.ForwardRefExoticComponent<IDockviewReactProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
22
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
23
|
-
if (!m) return o;
|
|
24
|
-
var i = m.call(o), r, ar = [], e;
|
|
25
|
-
try {
|
|
26
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
27
|
-
}
|
|
28
|
-
catch (error) { e = { error: error }; }
|
|
29
|
-
finally {
|
|
30
|
-
try {
|
|
31
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
32
|
-
}
|
|
33
|
-
finally { if (e) throw e.error; }
|
|
34
|
-
}
|
|
35
|
-
return ar;
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.DockviewReact = void 0;
|
|
39
|
-
var React = __importStar(require("react"));
|
|
40
|
-
var dockviewComponent_1 = require("../../dockview/dockviewComponent");
|
|
41
|
-
var reactContentPart_1 = require("./reactContentPart");
|
|
42
|
-
var reactHeaderPart_1 = require("./reactHeaderPart");
|
|
43
|
-
var deserializer_1 = require("../deserializer");
|
|
44
|
-
var react_1 = require("../react");
|
|
45
|
-
var component_api_1 = require("../../api/component.api");
|
|
46
|
-
var reactWatermarkPart_1 = require("./reactWatermarkPart");
|
|
47
|
-
var dom_1 = require("../../dom");
|
|
48
|
-
exports.DockviewReact = React.forwardRef(function (props, ref) {
|
|
49
|
-
var domRef = React.useRef(null);
|
|
50
|
-
var dockviewRef = React.useRef();
|
|
51
|
-
var _a = __read((0, react_1.usePortalsLifecycle)(), 2), portals = _a[0], addPortal = _a[1];
|
|
52
|
-
React.useImperativeHandle(ref, function () { return domRef.current; }, []);
|
|
53
|
-
React.useEffect(function () {
|
|
54
|
-
if (props.disableAutoResizing) {
|
|
55
|
-
return function () {
|
|
56
|
-
//
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
var watcher = (0, dom_1.watchElementResize)(domRef.current, function (entry) {
|
|
60
|
-
var _a;
|
|
61
|
-
var _b = entry.contentRect, width = _b.width, height = _b.height;
|
|
62
|
-
(_a = dockviewRef.current) === null || _a === void 0 ? void 0 : _a.layout(width, height);
|
|
63
|
-
});
|
|
64
|
-
return function () {
|
|
65
|
-
watcher.dispose();
|
|
66
|
-
};
|
|
67
|
-
}, [props.disableAutoResizing]);
|
|
68
|
-
React.useEffect(function () {
|
|
69
|
-
var _a;
|
|
70
|
-
var factory = {
|
|
71
|
-
content: {
|
|
72
|
-
createComponent: function (id, componentId, component) {
|
|
73
|
-
return new reactContentPart_1.ReactPanelContentPart(componentId, component, {
|
|
74
|
-
addPortal: addPortal,
|
|
75
|
-
});
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
tab: {
|
|
79
|
-
createComponent: function (id, componentId, component) {
|
|
80
|
-
return new reactHeaderPart_1.ReactPanelHeaderPart(componentId, component, {
|
|
81
|
-
addPortal: addPortal,
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
watermark: {
|
|
86
|
-
createComponent: function (id, componentId, component) {
|
|
87
|
-
return new reactWatermarkPart_1.ReactWatermarkPart(componentId, component, {
|
|
88
|
-
addPortal: addPortal,
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
var element = document.createElement('div');
|
|
94
|
-
var dockview = new dockviewComponent_1.DockviewComponent(element, {
|
|
95
|
-
frameworkComponentFactory: factory,
|
|
96
|
-
frameworkComponents: props.components,
|
|
97
|
-
frameworkTabComponents: props.tabComponents,
|
|
98
|
-
tabHeight: props.tabHeight,
|
|
99
|
-
debug: props.debug,
|
|
100
|
-
enableExternalDragEvents: props.enableExternalDragEvents,
|
|
101
|
-
watermarkFrameworkComponent: props.watermarkComponent,
|
|
102
|
-
styles: props.hideBorders
|
|
103
|
-
? { separatorBorder: 'transparent' }
|
|
104
|
-
: undefined,
|
|
105
|
-
});
|
|
106
|
-
(_a = domRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(dockview.element);
|
|
107
|
-
dockview.deserializer = new deserializer_1.ReactPanelDeserialzier(dockview);
|
|
108
|
-
var _b = domRef.current, clientWidth = _b.clientWidth, clientHeight = _b.clientHeight;
|
|
109
|
-
dockview.layout(clientWidth, clientHeight);
|
|
110
|
-
if (props.onReady) {
|
|
111
|
-
props.onReady({ api: new component_api_1.DockviewApi(dockview) });
|
|
112
|
-
}
|
|
113
|
-
dockviewRef.current = dockview;
|
|
114
|
-
return function () {
|
|
115
|
-
dockview.dispose();
|
|
116
|
-
};
|
|
117
|
-
}, []);
|
|
118
|
-
React.useEffect(function () {
|
|
119
|
-
if (!props.onTabContextMenu || !dockviewRef.current) {
|
|
120
|
-
return function () {
|
|
121
|
-
//noop
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
var disposable = dockviewRef.current.onTabContextMenu(function (event) {
|
|
125
|
-
if (props.onTabContextMenu) {
|
|
126
|
-
props.onTabContextMenu(event);
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
return function () {
|
|
130
|
-
disposable.dispose();
|
|
131
|
-
};
|
|
132
|
-
}, [props.onTabContextMenu]);
|
|
133
|
-
return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
134
|
-
});
|
|
135
|
-
exports.DockviewReact.displayName = 'DockviewComponent';
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
22
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
23
|
+
if (!m) return o;
|
|
24
|
+
var i = m.call(o), r, ar = [], e;
|
|
25
|
+
try {
|
|
26
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
27
|
+
}
|
|
28
|
+
catch (error) { e = { error: error }; }
|
|
29
|
+
finally {
|
|
30
|
+
try {
|
|
31
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
32
|
+
}
|
|
33
|
+
finally { if (e) throw e.error; }
|
|
34
|
+
}
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.DockviewReact = void 0;
|
|
39
|
+
var React = __importStar(require("react"));
|
|
40
|
+
var dockviewComponent_1 = require("../../dockview/dockviewComponent");
|
|
41
|
+
var reactContentPart_1 = require("./reactContentPart");
|
|
42
|
+
var reactHeaderPart_1 = require("./reactHeaderPart");
|
|
43
|
+
var deserializer_1 = require("../deserializer");
|
|
44
|
+
var react_1 = require("../react");
|
|
45
|
+
var component_api_1 = require("../../api/component.api");
|
|
46
|
+
var reactWatermarkPart_1 = require("./reactWatermarkPart");
|
|
47
|
+
var dom_1 = require("../../dom");
|
|
48
|
+
exports.DockviewReact = React.forwardRef(function (props, ref) {
|
|
49
|
+
var domRef = React.useRef(null);
|
|
50
|
+
var dockviewRef = React.useRef();
|
|
51
|
+
var _a = __read((0, react_1.usePortalsLifecycle)(), 2), portals = _a[0], addPortal = _a[1];
|
|
52
|
+
React.useImperativeHandle(ref, function () { return domRef.current; }, []);
|
|
53
|
+
React.useEffect(function () {
|
|
54
|
+
if (props.disableAutoResizing) {
|
|
55
|
+
return function () {
|
|
56
|
+
//
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
var watcher = (0, dom_1.watchElementResize)(domRef.current, function (entry) {
|
|
60
|
+
var _a;
|
|
61
|
+
var _b = entry.contentRect, width = _b.width, height = _b.height;
|
|
62
|
+
(_a = dockviewRef.current) === null || _a === void 0 ? void 0 : _a.layout(width, height);
|
|
63
|
+
});
|
|
64
|
+
return function () {
|
|
65
|
+
watcher.dispose();
|
|
66
|
+
};
|
|
67
|
+
}, [props.disableAutoResizing]);
|
|
68
|
+
React.useEffect(function () {
|
|
69
|
+
var _a;
|
|
70
|
+
var factory = {
|
|
71
|
+
content: {
|
|
72
|
+
createComponent: function (id, componentId, component) {
|
|
73
|
+
return new reactContentPart_1.ReactPanelContentPart(componentId, component, {
|
|
74
|
+
addPortal: addPortal,
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
tab: {
|
|
79
|
+
createComponent: function (id, componentId, component) {
|
|
80
|
+
return new reactHeaderPart_1.ReactPanelHeaderPart(componentId, component, {
|
|
81
|
+
addPortal: addPortal,
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
watermark: {
|
|
86
|
+
createComponent: function (id, componentId, component) {
|
|
87
|
+
return new reactWatermarkPart_1.ReactWatermarkPart(componentId, component, {
|
|
88
|
+
addPortal: addPortal,
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
var element = document.createElement('div');
|
|
94
|
+
var dockview = new dockviewComponent_1.DockviewComponent(element, {
|
|
95
|
+
frameworkComponentFactory: factory,
|
|
96
|
+
frameworkComponents: props.components,
|
|
97
|
+
frameworkTabComponents: props.tabComponents,
|
|
98
|
+
tabHeight: props.tabHeight,
|
|
99
|
+
debug: props.debug,
|
|
100
|
+
enableExternalDragEvents: props.enableExternalDragEvents,
|
|
101
|
+
watermarkFrameworkComponent: props.watermarkComponent,
|
|
102
|
+
styles: props.hideBorders
|
|
103
|
+
? { separatorBorder: 'transparent' }
|
|
104
|
+
: undefined,
|
|
105
|
+
});
|
|
106
|
+
(_a = domRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(dockview.element);
|
|
107
|
+
dockview.deserializer = new deserializer_1.ReactPanelDeserialzier(dockview);
|
|
108
|
+
var _b = domRef.current, clientWidth = _b.clientWidth, clientHeight = _b.clientHeight;
|
|
109
|
+
dockview.layout(clientWidth, clientHeight);
|
|
110
|
+
if (props.onReady) {
|
|
111
|
+
props.onReady({ api: new component_api_1.DockviewApi(dockview) });
|
|
112
|
+
}
|
|
113
|
+
dockviewRef.current = dockview;
|
|
114
|
+
return function () {
|
|
115
|
+
dockview.dispose();
|
|
116
|
+
};
|
|
117
|
+
}, []);
|
|
118
|
+
React.useEffect(function () {
|
|
119
|
+
if (!props.onTabContextMenu || !dockviewRef.current) {
|
|
120
|
+
return function () {
|
|
121
|
+
//noop
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
var disposable = dockviewRef.current.onTabContextMenu(function (event) {
|
|
125
|
+
if (props.onTabContextMenu) {
|
|
126
|
+
props.onTabContextMenu(event);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
return function () {
|
|
130
|
+
disposable.dispose();
|
|
131
|
+
};
|
|
132
|
+
}, [props.onTabContextMenu]);
|
|
133
|
+
return (React.createElement("div", { className: props.className, style: { height: '100%', width: '100%' }, ref: domRef }, portals));
|
|
134
|
+
});
|
|
135
|
+
exports.DockviewReact.displayName = 'DockviewComponent';
|
|
136
136
|
//# sourceMappingURL=dockview.js.map
|