dockview-core 1.8.4 → 1.8.5

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.
Files changed (334) hide show
  1. package/README.md +51 -51
  2. package/dist/cjs/api/component.api.d.ts +455 -152
  3. package/dist/cjs/api/component.api.d.ts.map +1 -1
  4. package/dist/cjs/api/component.api.js +895 -592
  5. package/dist/cjs/api/component.api.js.map +1 -1
  6. package/dist/cjs/api/dockviewGroupPanelApi.d.ts +29 -29
  7. package/dist/cjs/api/dockviewGroupPanelApi.js +53 -53
  8. package/dist/cjs/api/dockviewPanelApi.d.ts +47 -47
  9. package/dist/cjs/api/dockviewPanelApi.js +88 -88
  10. package/dist/cjs/api/gridviewPanelApi.d.ts +37 -37
  11. package/dist/cjs/api/gridviewPanelApi.js +47 -47
  12. package/dist/cjs/api/panelApi.d.ts +88 -88
  13. package/dist/cjs/api/panelApi.js +135 -135
  14. package/dist/cjs/api/paneviewPanelApi.d.ts +26 -26
  15. package/dist/cjs/api/paneviewPanelApi.js +57 -57
  16. package/dist/cjs/api/splitviewPanelApi.d.ts +32 -32
  17. package/dist/cjs/api/splitviewPanelApi.js +47 -47
  18. package/dist/cjs/array.d.ts +13 -13
  19. package/dist/cjs/array.js +67 -67
  20. package/dist/cjs/dnd/abstractDragHandler.d.ts +12 -12
  21. package/dist/cjs/dnd/abstractDragHandler.js +141 -141
  22. package/dist/cjs/dnd/dataTransfer.d.ts +30 -31
  23. package/dist/cjs/dnd/dataTransfer.d.ts.map +1 -1
  24. package/dist/cjs/dnd/dataTransfer.js +99 -100
  25. package/dist/cjs/dnd/dataTransfer.js.map +1 -1
  26. package/dist/cjs/dnd/dnd.d.ts +27 -27
  27. package/dist/cjs/dnd/dnd.js +59 -59
  28. package/dist/cjs/dnd/droptarget.d.ts +53 -53
  29. package/dist/cjs/dnd/droptarget.js +304 -304
  30. package/dist/cjs/dnd/droptarget.js.map +1 -1
  31. package/dist/cjs/dnd/ghost.d.ts +1 -1
  32. package/dist/cjs/dnd/ghost.js +15 -15
  33. package/dist/cjs/dnd/groupDragHandler.d.ts +12 -12
  34. package/dist/cjs/dnd/groupDragHandler.js +77 -77
  35. package/dist/cjs/dnd/overlay.d.ts +43 -43
  36. package/dist/cjs/dnd/overlay.d.ts.map +1 -1
  37. package/dist/cjs/dnd/overlay.js +412 -412
  38. package/dist/cjs/dnd/overlay.js.map +1 -1
  39. package/dist/cjs/dockview/components/panel/content.d.ts +30 -30
  40. package/dist/cjs/dockview/components/panel/content.js +100 -100
  41. package/dist/cjs/dockview/components/tab/defaultTab.d.ts +21 -21
  42. package/dist/cjs/dockview/components/tab/defaultTab.js +105 -105
  43. package/dist/cjs/dockview/components/tab/tab.d.ts +34 -34
  44. package/dist/cjs/dockview/components/tab/tab.js +120 -120
  45. package/dist/cjs/dockview/components/titlebar/tabsContainer.d.ts +81 -81
  46. package/dist/cjs/dockview/components/titlebar/tabsContainer.js +325 -325
  47. package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts +17 -17
  48. package/dist/cjs/dockview/components/titlebar/voidContainer.js +77 -77
  49. package/dist/cjs/dockview/components/watermark/watermark.d.ts +18 -18
  50. package/dist/cjs/dockview/components/watermark/watermark.js +87 -87
  51. package/dist/cjs/dockview/deserializer.d.ts +12 -12
  52. package/dist/cjs/dockview/deserializer.js +33 -33
  53. package/dist/cjs/dockview/deserializer.js.map +1 -1
  54. package/dist/cjs/dockview/dockviewComponent.d.ts +159 -159
  55. package/dist/cjs/dockview/dockviewComponent.d.ts.map +1 -1
  56. package/dist/cjs/dockview/dockviewComponent.js +1170 -1156
  57. package/dist/cjs/dockview/dockviewComponent.js.map +1 -1
  58. package/dist/cjs/dockview/dockviewFloatingGroupPanel.d.ts +23 -23
  59. package/dist/cjs/dockview/dockviewFloatingGroupPanel.js +34 -34
  60. package/dist/cjs/dockview/dockviewGroupPanel.d.ts +30 -30
  61. package/dist/cjs/dockview/dockviewGroupPanel.js +97 -97
  62. package/dist/cjs/dockview/dockviewGroupPanelModel.d.ts +185 -185
  63. package/dist/cjs/dockview/dockviewGroupPanelModel.js +632 -631
  64. package/dist/cjs/dockview/dockviewGroupPanelModel.js.map +1 -1
  65. package/dist/cjs/dockview/dockviewPanel.d.ts +41 -41
  66. package/dist/cjs/dockview/dockviewPanel.js +172 -171
  67. package/dist/cjs/dockview/dockviewPanel.js.map +1 -1
  68. package/dist/cjs/dockview/dockviewPanelModel.d.ts +35 -35
  69. package/dist/cjs/dockview/dockviewPanelModel.js +98 -98
  70. package/dist/cjs/dockview/dockviewPanelModel.js.map +1 -1
  71. package/dist/cjs/dockview/options.d.ts +133 -136
  72. package/dist/cjs/dockview/options.d.ts.map +1 -1
  73. package/dist/cjs/dockview/options.js +31 -31
  74. package/dist/cjs/dockview/types.d.ts +63 -63
  75. package/dist/cjs/dockview/types.js +10 -10
  76. package/dist/cjs/dockview/types.js.map +1 -1
  77. package/dist/cjs/dom.d.ts +16 -16
  78. package/dist/cjs/dom.js +197 -197
  79. package/dist/cjs/events.d.ts +47 -47
  80. package/dist/cjs/events.js +216 -216
  81. package/dist/cjs/events.js.map +1 -1
  82. package/dist/cjs/gridview/baseComponentGridview.d.ts +88 -87
  83. package/dist/cjs/gridview/baseComponentGridview.d.ts.map +1 -1
  84. package/dist/cjs/gridview/baseComponentGridview.js +270 -270
  85. package/dist/cjs/gridview/baseComponentGridview.js.map +1 -1
  86. package/dist/cjs/gridview/basePanelView.d.ts +40 -40
  87. package/dist/cjs/gridview/basePanelView.js +156 -156
  88. package/dist/cjs/gridview/branchNode.d.ts +49 -49
  89. package/dist/cjs/gridview/branchNode.js +343 -343
  90. package/dist/cjs/gridview/gridview.d.ts +133 -133
  91. package/dist/cjs/gridview/gridview.js +547 -547
  92. package/dist/cjs/gridview/gridviewComponent.d.ts +80 -80
  93. package/dist/cjs/gridview/gridviewComponent.d.ts.map +1 -1
  94. package/dist/cjs/gridview/gridviewComponent.js +362 -360
  95. package/dist/cjs/gridview/gridviewComponent.js.map +1 -1
  96. package/dist/cjs/gridview/gridviewPanel.d.ts +65 -65
  97. package/dist/cjs/gridview/gridviewPanel.js +214 -214
  98. package/dist/cjs/gridview/leafNode.d.ts +34 -34
  99. package/dist/cjs/gridview/leafNode.js +170 -170
  100. package/dist/cjs/gridview/leafNode.js.map +1 -1
  101. package/dist/cjs/gridview/options.d.ts +17 -18
  102. package/dist/cjs/gridview/options.d.ts.map +1 -1
  103. package/dist/cjs/gridview/options.js +2 -2
  104. package/dist/cjs/gridview/types.d.ts +3 -3
  105. package/dist/cjs/gridview/types.js +2 -2
  106. package/dist/cjs/index.d.ts +42 -42
  107. package/dist/cjs/index.js +61 -61
  108. package/dist/cjs/lifecycle.d.ts +23 -23
  109. package/dist/cjs/lifecycle.js +65 -65
  110. package/dist/cjs/lifecycle.js.map +1 -1
  111. package/dist/cjs/math.d.ts +5 -5
  112. package/dist/cjs/math.js +34 -34
  113. package/dist/cjs/panel/componentFactory.d.ts +11 -10
  114. package/dist/cjs/panel/componentFactory.d.ts.map +1 -1
  115. package/dist/cjs/panel/componentFactory.js +30 -30
  116. package/dist/cjs/panel/componentFactory.js.map +1 -1
  117. package/dist/cjs/panel/types.d.ts +33 -33
  118. package/dist/cjs/panel/types.js +2 -2
  119. package/dist/cjs/paneview/defaultPaneviewHeader.d.ts +21 -21
  120. package/dist/cjs/paneview/defaultPaneviewHeader.js +90 -90
  121. package/dist/cjs/paneview/draggablePaneviewPanel.d.ts +21 -21
  122. package/dist/cjs/paneview/draggablePaneviewPanel.js +131 -131
  123. package/dist/cjs/paneview/options.d.ts +25 -28
  124. package/dist/cjs/paneview/options.d.ts.map +1 -1
  125. package/dist/cjs/paneview/options.js +2 -2
  126. package/dist/cjs/paneview/paneview.d.ts +40 -40
  127. package/dist/cjs/paneview/paneview.d.ts.map +1 -1
  128. package/dist/cjs/paneview/paneview.js +200 -201
  129. package/dist/cjs/paneview/paneview.js.map +1 -1
  130. package/dist/cjs/paneview/paneviewComponent.d.ts +128 -128
  131. package/dist/cjs/paneview/paneviewComponent.js +400 -397
  132. package/dist/cjs/paneview/paneviewComponent.js.map +1 -1
  133. package/dist/cjs/paneview/paneviewPanel.d.ts +92 -92
  134. package/dist/cjs/paneview/paneviewPanel.d.ts.map +1 -1
  135. package/dist/cjs/paneview/paneviewPanel.js +275 -275
  136. package/dist/cjs/resizable.d.ts +10 -7
  137. package/dist/cjs/resizable.d.ts.map +1 -1
  138. package/dist/cjs/resizable.js +79 -64
  139. package/dist/cjs/resizable.js.map +1 -1
  140. package/dist/cjs/splitview/options.d.ts +26 -27
  141. package/dist/cjs/splitview/options.d.ts.map +1 -1
  142. package/dist/cjs/splitview/options.js +2 -2
  143. package/dist/cjs/splitview/splitview.d.ts +128 -128
  144. package/dist/cjs/splitview/splitview.js +936 -936
  145. package/dist/cjs/splitview/splitview.js.map +1 -1
  146. package/dist/cjs/splitview/splitviewComponent.d.ts +101 -101
  147. package/dist/cjs/splitview/splitviewComponent.js +395 -392
  148. package/dist/cjs/splitview/splitviewComponent.js.map +1 -1
  149. package/dist/cjs/splitview/splitviewPanel.d.ts +45 -45
  150. package/dist/cjs/splitview/splitviewPanel.d.ts.map +1 -1
  151. package/dist/cjs/splitview/splitviewPanel.js +179 -179
  152. package/dist/cjs/splitview/splitviewPanel.js.map +1 -1
  153. package/dist/cjs/splitview/viewItem.d.ts +25 -25
  154. package/dist/cjs/splitview/viewItem.js +119 -119
  155. package/dist/cjs/svg.d.ts +3 -3
  156. package/dist/cjs/svg.js +43 -43
  157. package/dist/cjs/types.d.ts +2 -2
  158. package/dist/cjs/types.js +2 -2
  159. package/dist/dockview-core.amd.js +7650 -7316
  160. package/dist/dockview-core.amd.js.map +1 -1
  161. package/dist/dockview-core.amd.min.js +2 -2
  162. package/dist/dockview-core.amd.min.js.map +1 -1
  163. package/dist/dockview-core.amd.min.noStyle.js +2 -2
  164. package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
  165. package/dist/dockview-core.amd.noStyle.js +7601 -7267
  166. package/dist/dockview-core.amd.noStyle.js.map +1 -1
  167. package/dist/dockview-core.cjs.js +7650 -7316
  168. package/dist/dockview-core.cjs.js.map +1 -1
  169. package/dist/dockview-core.esm.js +7650 -7316
  170. package/dist/dockview-core.esm.js.map +1 -1
  171. package/dist/dockview-core.esm.min.js +2 -2
  172. package/dist/dockview-core.esm.min.js.map +1 -1
  173. package/dist/dockview-core.js +7650 -7316
  174. package/dist/dockview-core.js.map +1 -1
  175. package/dist/dockview-core.min.js +2 -2
  176. package/dist/dockview-core.min.js.map +1 -1
  177. package/dist/dockview-core.min.noStyle.js +2 -2
  178. package/dist/dockview-core.min.noStyle.js.map +1 -1
  179. package/dist/dockview-core.noStyle.js +7601 -7267
  180. package/dist/dockview-core.noStyle.js.map +1 -1
  181. package/dist/esm/api/component.api.d.ts +455 -152
  182. package/dist/esm/api/component.api.d.ts.map +1 -1
  183. package/dist/esm/api/component.api.js +638 -335
  184. package/dist/esm/api/component.api.js.map +1 -1
  185. package/dist/esm/api/dockviewGroupPanelApi.d.ts +29 -29
  186. package/dist/esm/api/dockviewGroupPanelApi.js +27 -27
  187. package/dist/esm/api/dockviewPanelApi.d.ts +47 -47
  188. package/dist/esm/api/dockviewPanelApi.js +53 -53
  189. package/dist/esm/api/gridviewPanelApi.d.ts +37 -37
  190. package/dist/esm/api/gridviewPanelApi.js +25 -25
  191. package/dist/esm/api/panelApi.d.ts +88 -88
  192. package/dist/esm/api/panelApi.js +93 -93
  193. package/dist/esm/api/paneviewPanelApi.d.ts +26 -26
  194. package/dist/esm/api/paneviewPanelApi.js +27 -27
  195. package/dist/esm/api/splitviewPanelApi.d.ts +32 -32
  196. package/dist/esm/api/splitviewPanelApi.js +25 -25
  197. package/dist/esm/array.d.ts +13 -13
  198. package/dist/esm/array.js +57 -57
  199. package/dist/esm/dnd/abstractDragHandler.d.ts +12 -12
  200. package/dist/esm/dnd/abstractDragHandler.js +63 -63
  201. package/dist/esm/dnd/dataTransfer.d.ts +30 -31
  202. package/dist/esm/dnd/dataTransfer.d.ts.map +1 -1
  203. package/dist/esm/dnd/dataTransfer.js +66 -69
  204. package/dist/esm/dnd/dataTransfer.js.map +1 -1
  205. package/dist/esm/dnd/dnd.d.ts +27 -27
  206. package/dist/esm/dnd/dnd.js +36 -36
  207. package/dist/esm/dnd/droptarget.d.ts +53 -53
  208. package/dist/esm/dnd/droptarget.js +274 -274
  209. package/dist/esm/dnd/droptarget.js.map +1 -1
  210. package/dist/esm/dnd/ghost.d.ts +1 -1
  211. package/dist/esm/dnd/ghost.js +11 -11
  212. package/dist/esm/dnd/groupDragHandler.d.ts +12 -12
  213. package/dist/esm/dnd/groupDragHandler.js +54 -54
  214. package/dist/esm/dnd/overlay.d.ts +43 -43
  215. package/dist/esm/dnd/overlay.d.ts.map +1 -1
  216. package/dist/esm/dnd/overlay.js +304 -304
  217. package/dist/esm/dnd/overlay.js.map +1 -1
  218. package/dist/esm/dockview/components/panel/content.d.ts +30 -30
  219. package/dist/esm/dockview/components/panel/content.js +73 -73
  220. package/dist/esm/dockview/components/tab/defaultTab.d.ts +21 -21
  221. package/dist/esm/dockview/components/tab/defaultTab.js +67 -67
  222. package/dist/esm/dockview/components/tab/tab.d.ts +34 -34
  223. package/dist/esm/dockview/components/tab/tab.js +90 -90
  224. package/dist/esm/dockview/components/titlebar/tabsContainer.d.ts +81 -81
  225. package/dist/esm/dockview/components/titlebar/tabsContainer.js +239 -239
  226. package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +17 -17
  227. package/dist/esm/dockview/components/titlebar/voidContainer.js +51 -51
  228. package/dist/esm/dockview/components/watermark/watermark.d.ts +18 -18
  229. package/dist/esm/dockview/components/watermark/watermark.js +61 -61
  230. package/dist/esm/dockview/deserializer.d.ts +12 -12
  231. package/dist/esm/dockview/deserializer.js +28 -28
  232. package/dist/esm/dockview/deserializer.js.map +1 -1
  233. package/dist/esm/dockview/dockviewComponent.d.ts +159 -159
  234. package/dist/esm/dockview/dockviewComponent.d.ts.map +1 -1
  235. package/dist/esm/dockview/dockviewComponent.js +932 -918
  236. package/dist/esm/dockview/dockviewComponent.js.map +1 -1
  237. package/dist/esm/dockview/dockviewFloatingGroupPanel.d.ts +23 -23
  238. package/dist/esm/dockview/dockviewFloatingGroupPanel.js +12 -12
  239. package/dist/esm/dockview/dockviewGroupPanel.d.ts +30 -30
  240. package/dist/esm/dockview/dockviewGroupPanel.js +51 -51
  241. package/dist/esm/dockview/dockviewGroupPanelModel.d.ts +185 -185
  242. package/dist/esm/dockview/dockviewGroupPanelModel.js +499 -498
  243. package/dist/esm/dockview/dockviewGroupPanelModel.js.map +1 -1
  244. package/dist/esm/dockview/dockviewPanel.d.ts +41 -41
  245. package/dist/esm/dockview/dockviewPanel.js +105 -104
  246. package/dist/esm/dockview/dockviewPanel.js.map +1 -1
  247. package/dist/esm/dockview/dockviewPanelModel.d.ts +35 -35
  248. package/dist/esm/dockview/dockviewPanelModel.js +74 -74
  249. package/dist/esm/dockview/dockviewPanelModel.js.map +1 -1
  250. package/dist/esm/dockview/options.d.ts +133 -136
  251. package/dist/esm/dockview/options.d.ts.map +1 -1
  252. package/dist/esm/dockview/options.js +24 -24
  253. package/dist/esm/dockview/types.d.ts +63 -63
  254. package/dist/esm/dockview/types.js +7 -7
  255. package/dist/esm/dom.d.ts +16 -16
  256. package/dist/esm/dom.js +126 -126
  257. package/dist/esm/events.d.ts +47 -47
  258. package/dist/esm/events.js +156 -156
  259. package/dist/esm/events.js.map +1 -1
  260. package/dist/esm/gridview/baseComponentGridview.d.ts +88 -87
  261. package/dist/esm/gridview/baseComponentGridview.d.ts.map +1 -1
  262. package/dist/esm/gridview/baseComponentGridview.js +184 -184
  263. package/dist/esm/gridview/baseComponentGridview.js.map +1 -1
  264. package/dist/esm/gridview/basePanelView.d.ts +40 -40
  265. package/dist/esm/gridview/basePanelView.js +85 -85
  266. package/dist/esm/gridview/branchNode.d.ts +49 -49
  267. package/dist/esm/gridview/branchNode.js +219 -219
  268. package/dist/esm/gridview/gridview.d.ts +133 -133
  269. package/dist/esm/gridview/gridview.js +461 -461
  270. package/dist/esm/gridview/gridviewComponent.d.ts +80 -80
  271. package/dist/esm/gridview/gridviewComponent.d.ts.map +1 -1
  272. package/dist/esm/gridview/gridviewComponent.js +264 -262
  273. package/dist/esm/gridview/gridviewComponent.js.map +1 -1
  274. package/dist/esm/gridview/gridviewPanel.d.ts +65 -65
  275. package/dist/esm/gridview/gridviewPanel.js +151 -151
  276. package/dist/esm/gridview/leafNode.d.ts +34 -34
  277. package/dist/esm/gridview/leafNode.js +103 -103
  278. package/dist/esm/gridview/options.d.ts +17 -18
  279. package/dist/esm/gridview/options.d.ts.map +1 -1
  280. package/dist/esm/gridview/options.js +1 -1
  281. package/dist/esm/gridview/types.d.ts +3 -3
  282. package/dist/esm/gridview/types.js +1 -1
  283. package/dist/esm/index.d.ts +42 -42
  284. package/dist/esm/index.js +34 -34
  285. package/dist/esm/lifecycle.d.ts +23 -23
  286. package/dist/esm/lifecycle.js +41 -41
  287. package/dist/esm/math.d.ts +5 -5
  288. package/dist/esm/math.js +28 -28
  289. package/dist/esm/panel/componentFactory.d.ts +11 -10
  290. package/dist/esm/panel/componentFactory.d.ts.map +1 -1
  291. package/dist/esm/panel/componentFactory.js +24 -24
  292. package/dist/esm/panel/componentFactory.js.map +1 -1
  293. package/dist/esm/panel/types.d.ts +33 -33
  294. package/dist/esm/panel/types.js +1 -1
  295. package/dist/esm/paneview/defaultPaneviewHeader.d.ts +21 -21
  296. package/dist/esm/paneview/defaultPaneviewHeader.js +63 -63
  297. package/dist/esm/paneview/draggablePaneviewPanel.d.ts +21 -21
  298. package/dist/esm/paneview/draggablePaneviewPanel.js +92 -92
  299. package/dist/esm/paneview/options.d.ts +25 -28
  300. package/dist/esm/paneview/options.d.ts.map +1 -1
  301. package/dist/esm/paneview/options.js +1 -1
  302. package/dist/esm/paneview/paneview.d.ts +40 -40
  303. package/dist/esm/paneview/paneview.d.ts.map +1 -1
  304. package/dist/esm/paneview/paneview.js +145 -145
  305. package/dist/esm/paneview/paneviewComponent.d.ts +128 -128
  306. package/dist/esm/paneview/paneviewComponent.js +276 -273
  307. package/dist/esm/paneview/paneviewComponent.js.map +1 -1
  308. package/dist/esm/paneview/paneviewPanel.d.ts +92 -92
  309. package/dist/esm/paneview/paneviewPanel.d.ts.map +1 -1
  310. package/dist/esm/paneview/paneviewPanel.js +192 -192
  311. package/dist/esm/resizable.d.ts +10 -7
  312. package/dist/esm/resizable.d.ts.map +1 -1
  313. package/dist/esm/resizable.js +48 -38
  314. package/dist/esm/resizable.js.map +1 -1
  315. package/dist/esm/splitview/options.d.ts +26 -27
  316. package/dist/esm/splitview/options.d.ts.map +1 -1
  317. package/dist/esm/splitview/options.js +1 -1
  318. package/dist/esm/splitview/splitview.d.ts +128 -128
  319. package/dist/esm/splitview/splitview.js +704 -704
  320. package/dist/esm/splitview/splitviewComponent.d.ts +101 -101
  321. package/dist/esm/splitview/splitviewComponent.js +261 -258
  322. package/dist/esm/splitview/splitviewComponent.js.map +1 -1
  323. package/dist/esm/splitview/splitviewPanel.d.ts +45 -45
  324. package/dist/esm/splitview/splitviewPanel.d.ts.map +1 -1
  325. package/dist/esm/splitview/splitviewPanel.js +108 -108
  326. package/dist/esm/splitview/splitviewPanel.js.map +1 -1
  327. package/dist/esm/splitview/viewItem.d.ts +25 -25
  328. package/dist/esm/splitview/viewItem.js +74 -74
  329. package/dist/esm/svg.d.ts +3 -3
  330. package/dist/esm/svg.js +31 -31
  331. package/dist/esm/types.d.ts +2 -2
  332. package/dist/esm/types.js +1 -1
  333. package/package.json +30 -42
  334. package/LICENSE +0 -21
@@ -1,361 +1,363 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
- var __values = (this && this.__values) || function(o) {
29
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
30
- if (m) return m.call(o);
31
- if (o && typeof o.length === "number") return {
32
- next: function () {
33
- if (o && i >= o.length) o = void 0;
34
- return { value: o && o[i++], done: !o };
35
- }
36
- };
37
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
38
- };
39
- var __read = (this && this.__read) || function (o, n) {
40
- var m = typeof Symbol === "function" && o[Symbol.iterator];
41
- if (!m) return o;
42
- var i = m.call(o), r, ar = [], e;
43
- try {
44
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
45
- }
46
- catch (error) { e = { error: error }; }
47
- finally {
48
- try {
49
- if (r && !r.done && (m = i["return"])) m.call(i);
50
- }
51
- finally { if (e) throw e.error; }
52
- }
53
- return ar;
54
- };
55
- Object.defineProperty(exports, "__esModule", { value: true });
56
- exports.GridviewComponent = void 0;
57
- var gridview_1 = require("./gridview");
58
- var array_1 = require("../array");
59
- var lifecycle_1 = require("../lifecycle");
60
- var baseComponentGridview_1 = require("./baseComponentGridview");
61
- var componentFactory_1 = require("../panel/componentFactory");
62
- var events_1 = require("../events");
63
- var GridviewComponent = /** @class */ (function (_super) {
64
- __extends(GridviewComponent, _super);
65
- function GridviewComponent(options) {
66
- var _this = _super.call(this, {
67
- parentElement: options.parentElement,
68
- proportionalLayout: options.proportionalLayout,
69
- orientation: options.orientation,
70
- styles: options.styles,
71
- }) || this;
72
- _this._onDidLayoutfromJSON = new events_1.Emitter();
73
- _this.onDidLayoutFromJSON = _this._onDidLayoutfromJSON.event;
74
- _this._options = options;
75
- if (!_this.options.components) {
76
- _this.options.components = {};
77
- }
78
- if (!_this.options.frameworkComponents) {
79
- _this.options.frameworkComponents = {};
80
- }
81
- return _this;
82
- }
83
- Object.defineProperty(GridviewComponent.prototype, "orientation", {
84
- get: function () {
85
- return this.gridview.orientation;
86
- },
87
- set: function (value) {
88
- this.gridview.orientation = value;
89
- },
90
- enumerable: false,
91
- configurable: true
92
- });
93
- Object.defineProperty(GridviewComponent.prototype, "options", {
94
- get: function () {
95
- return this._options;
96
- },
97
- enumerable: false,
98
- configurable: true
99
- });
100
- Object.defineProperty(GridviewComponent.prototype, "deserializer", {
101
- get: function () {
102
- return this._deserializer;
103
- },
104
- set: function (value) {
105
- this._deserializer = value;
106
- },
107
- enumerable: false,
108
- configurable: true
109
- });
110
- GridviewComponent.prototype.updateOptions = function (options) {
111
- var hasOrientationChanged = typeof options.orientation === 'string' &&
112
- this.gridview.orientation !== options.orientation;
113
- this._options = __assign(__assign({}, this.options), options);
114
- if (hasOrientationChanged) {
115
- this.gridview.orientation = options.orientation;
116
- }
117
- this.layout(this.gridview.width, this.gridview.height, true);
118
- };
119
- GridviewComponent.prototype.removePanel = function (panel) {
120
- this.removeGroup(panel);
121
- };
122
- /**
123
- * Serialize the current state of the layout
124
- *
125
- * @returns A JSON respresentation of the layout
126
- */
127
- GridviewComponent.prototype.toJSON = function () {
128
- var _a;
129
- var data = this.gridview.serialize();
130
- return {
131
- grid: data,
132
- activePanel: (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.id,
133
- };
134
- };
135
- GridviewComponent.prototype.setVisible = function (panel, visible) {
136
- this.gridview.setViewVisible((0, gridview_1.getGridLocation)(panel.element), visible);
137
- };
138
- GridviewComponent.prototype.setActive = function (panel) {
139
- this._groups.forEach(function (value, _key) {
140
- value.value.setActive(panel === value.value);
141
- });
142
- };
143
- GridviewComponent.prototype.focus = function () {
144
- var _a;
145
- (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
146
- };
147
- GridviewComponent.prototype.fromJSON = function (serializedGridview) {
148
- var e_1, _a;
149
- var _this = this;
150
- this.clear();
151
- var grid = serializedGridview.grid, activePanel = serializedGridview.activePanel;
152
- try {
153
- var queue_1 = [];
154
- // take note of the existing dimensions
155
- var width = this.width;
156
- var height = this.height;
157
- this.gridview.deserialize(grid, {
158
- fromJSON: function (node) {
159
- var data = node.data;
160
- var view = (0, componentFactory_1.createComponent)(data.id, data.component, _this.options.components || {}, _this.options.frameworkComponents || {}, _this.options.frameworkComponentFactory
161
- ? {
162
- createComponent: _this.options.frameworkComponentFactory
163
- .createComponent,
164
- }
165
- : undefined);
166
- queue_1.push(function () {
167
- return view.init({
168
- params: data.params,
169
- minimumWidth: data.minimumWidth,
170
- maximumWidth: data.maximumWidth,
171
- minimumHeight: data.minimumHeight,
172
- maximumHeight: data.maximumHeight,
173
- priority: data.priority,
174
- snap: !!data.snap,
175
- accessor: _this,
176
- isVisible: node.visible,
177
- });
178
- });
179
- _this._onDidAddGroup.fire(view);
180
- _this.registerPanel(view);
181
- return view;
182
- },
183
- });
184
- this.layout(width, height, true);
185
- queue_1.forEach(function (f) { return f(); });
186
- if (typeof activePanel === 'string') {
187
- var panel = this.getPanel(activePanel);
188
- if (panel) {
189
- this.doSetGroupActive(panel);
190
- }
191
- }
192
- }
193
- catch (err) {
194
- try {
195
- /**
196
- * To remove a group we cannot call this.removeGroup(...) since this makes assumptions about
197
- * the underlying HTMLElement existing in the Gridview.
198
- */
199
- for (var _b = __values(this.groups), _c = _b.next(); !_c.done; _c = _b.next()) {
200
- var group = _c.value;
201
- group.dispose();
202
- this._groups.delete(group.id);
203
- this._onDidRemoveGroup.fire(group);
204
- }
205
- }
206
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
207
- finally {
208
- try {
209
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
210
- }
211
- finally { if (e_1) throw e_1.error; }
212
- }
213
- // fires clean-up events and clears the underlying HTML gridview.
214
- this.clear();
215
- /**
216
- * even though we have cleaned-up we still want to inform the caller of their error
217
- * and we'll do this through re-throwing the original error since afterall you would
218
- * expect trying to load a corrupted layout to result in an error and not silently fail...
219
- */
220
- throw err;
221
- }
222
- this._onDidLayoutfromJSON.fire();
223
- };
224
- GridviewComponent.prototype.clear = function () {
225
- var e_2, _a;
226
- var hasActiveGroup = this.activeGroup;
227
- var groups = Array.from(this._groups.values()); // reassign since group panels will mutate
228
- try {
229
- for (var groups_1 = __values(groups), groups_1_1 = groups_1.next(); !groups_1_1.done; groups_1_1 = groups_1.next()) {
230
- var group = groups_1_1.value;
231
- group.disposable.dispose();
232
- this.doRemoveGroup(group.value, { skipActive: true });
233
- }
234
- }
235
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
236
- finally {
237
- try {
238
- if (groups_1_1 && !groups_1_1.done && (_a = groups_1.return)) _a.call(groups_1);
239
- }
240
- finally { if (e_2) throw e_2.error; }
241
- }
242
- if (hasActiveGroup) {
243
- this.doSetGroupActive(undefined);
244
- }
245
- this.gridview.clear();
246
- };
247
- GridviewComponent.prototype.movePanel = function (panel, options) {
248
- var _a;
249
- var relativeLocation;
250
- var removedPanel = this.gridview.remove(panel);
251
- var referenceGroup = (_a = this._groups.get(options.reference)) === null || _a === void 0 ? void 0 : _a.value;
252
- if (!referenceGroup) {
253
- throw new Error("reference group ".concat(options.reference, " does not exist"));
254
- }
255
- var target = (0, baseComponentGridview_1.toTarget)(options.direction);
256
- if (target === 'center') {
257
- throw new Error("".concat(target, " not supported as an option"));
258
- }
259
- else {
260
- var location_1 = (0, gridview_1.getGridLocation)(referenceGroup.element);
261
- relativeLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, location_1, target);
262
- }
263
- this.doAddGroup(removedPanel, relativeLocation, options.size);
264
- };
265
- GridviewComponent.prototype.addPanel = function (options) {
266
- var _a, _b;
267
- var relativeLocation = options.location || [0];
268
- if ((_a = options.position) === null || _a === void 0 ? void 0 : _a.referencePanel) {
269
- var referenceGroup = (_b = this._groups.get(options.position.referencePanel)) === null || _b === void 0 ? void 0 : _b.value;
270
- if (!referenceGroup) {
271
- throw new Error("reference group ".concat(options.position.referencePanel, " does not exist"));
272
- }
273
- var target = (0, baseComponentGridview_1.toTarget)(options.position.direction);
274
- if (target === 'center') {
275
- throw new Error("".concat(target, " not supported as an option"));
276
- }
277
- else {
278
- var location_2 = (0, gridview_1.getGridLocation)(referenceGroup.element);
279
- relativeLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, location_2, target);
280
- }
281
- }
282
- var view = (0, componentFactory_1.createComponent)(options.id, options.component, this.options.components || {}, this.options.frameworkComponents || {}, this.options.frameworkComponentFactory
283
- ? {
284
- createComponent: this.options.frameworkComponentFactory
285
- .createComponent,
286
- }
287
- : undefined);
288
- view.init({
289
- params: options.params || {},
290
- minimumWidth: options.minimumWidth,
291
- maximumWidth: options.maximumWidth,
292
- minimumHeight: options.minimumHeight,
293
- maximumHeight: options.maximumHeight,
294
- priority: options.priority,
295
- snap: !!options.snap,
296
- accessor: this,
297
- isVisible: true,
298
- });
299
- this.registerPanel(view);
300
- this.doAddGroup(view, relativeLocation, options.size);
301
- return view;
302
- };
303
- GridviewComponent.prototype.registerPanel = function (panel) {
304
- var _this = this;
305
- var disposable = new lifecycle_1.CompositeDisposable(panel.api.onDidFocusChange(function (event) {
306
- if (!event.isFocused) {
307
- return;
308
- }
309
- _this._groups.forEach(function (groupItem) {
310
- var group = groupItem.value;
311
- if (group !== panel) {
312
- group.setActive(false);
313
- }
314
- else {
315
- group.setActive(true);
316
- }
317
- });
318
- }));
319
- this._groups.set(panel.id, {
320
- value: panel,
321
- disposable: disposable,
322
- });
323
- };
324
- GridviewComponent.prototype.moveGroup = function (referenceGroup, groupId, target) {
325
- var sourceGroup = this.getPanel(groupId);
326
- if (!sourceGroup) {
327
- throw new Error('invalid operation');
328
- }
329
- var referenceLocation = (0, gridview_1.getGridLocation)(referenceGroup.element);
330
- var targetLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, referenceLocation, target);
331
- var _a = __read((0, array_1.tail)(targetLocation), 2), targetParentLocation = _a[0], to = _a[1];
332
- var sourceLocation = (0, gridview_1.getGridLocation)(sourceGroup.element);
333
- var _b = __read((0, array_1.tail)(sourceLocation), 2), sourceParentLocation = _b[0], from = _b[1];
334
- if ((0, array_1.sequenceEquals)(sourceParentLocation, targetParentLocation)) {
335
- // special case when 'swapping' two views within same grid location
336
- // if a group has one tab - we are essentially moving the 'group'
337
- // which is equivalent to swapping two views in this case
338
- this.gridview.moveView(sourceParentLocation, from, to);
339
- return;
340
- }
341
- // source group will become empty so delete the group
342
- var targetGroup = this.doRemoveGroup(sourceGroup, {
343
- skipActive: true,
344
- skipDispose: true,
345
- });
346
- // after deleting the group we need to re-evaulate the ref location
347
- var updatedReferenceLocation = (0, gridview_1.getGridLocation)(referenceGroup.element);
348
- var location = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, updatedReferenceLocation, target);
349
- this.doAddGroup(targetGroup, location);
350
- };
351
- GridviewComponent.prototype.removeGroup = function (group) {
352
- _super.prototype.removeGroup.call(this, group);
353
- };
354
- GridviewComponent.prototype.dispose = function () {
355
- _super.prototype.dispose.call(this);
356
- this._onDidLayoutfromJSON.dispose();
357
- };
358
- return GridviewComponent;
359
- }(baseComponentGridview_1.BaseGrid));
360
- exports.GridviewComponent = GridviewComponent;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ var __values = (this && this.__values) || function(o) {
29
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
30
+ if (m) return m.call(o);
31
+ if (o && typeof o.length === "number") return {
32
+ next: function () {
33
+ if (o && i >= o.length) o = void 0;
34
+ return { value: o && o[i++], done: !o };
35
+ }
36
+ };
37
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
38
+ };
39
+ var __read = (this && this.__read) || function (o, n) {
40
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
41
+ if (!m) return o;
42
+ var i = m.call(o), r, ar = [], e;
43
+ try {
44
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
45
+ }
46
+ catch (error) { e = { error: error }; }
47
+ finally {
48
+ try {
49
+ if (r && !r.done && (m = i["return"])) m.call(i);
50
+ }
51
+ finally { if (e) throw e.error; }
52
+ }
53
+ return ar;
54
+ };
55
+ Object.defineProperty(exports, "__esModule", { value: true });
56
+ exports.GridviewComponent = void 0;
57
+ var gridview_1 = require("./gridview");
58
+ var array_1 = require("../array");
59
+ var lifecycle_1 = require("../lifecycle");
60
+ var baseComponentGridview_1 = require("./baseComponentGridview");
61
+ var componentFactory_1 = require("../panel/componentFactory");
62
+ var events_1 = require("../events");
63
+ var GridviewComponent = /** @class */ (function (_super) {
64
+ __extends(GridviewComponent, _super);
65
+ function GridviewComponent(options) {
66
+ var _this = _super.call(this, {
67
+ parentElement: options.parentElement,
68
+ proportionalLayout: options.proportionalLayout,
69
+ orientation: options.orientation,
70
+ styles: options.styles,
71
+ disableAutoResizing: options.disableAutoResizing,
72
+ }) || this;
73
+ _this._onDidLayoutfromJSON = new events_1.Emitter();
74
+ _this.onDidLayoutFromJSON = _this._onDidLayoutfromJSON.event;
75
+ _this._options = options;
76
+ if (!_this.options.components) {
77
+ _this.options.components = {};
78
+ }
79
+ if (!_this.options.frameworkComponents) {
80
+ _this.options.frameworkComponents = {};
81
+ }
82
+ return _this;
83
+ }
84
+ Object.defineProperty(GridviewComponent.prototype, "orientation", {
85
+ get: function () {
86
+ return this.gridview.orientation;
87
+ },
88
+ set: function (value) {
89
+ this.gridview.orientation = value;
90
+ },
91
+ enumerable: false,
92
+ configurable: true
93
+ });
94
+ Object.defineProperty(GridviewComponent.prototype, "options", {
95
+ get: function () {
96
+ return this._options;
97
+ },
98
+ enumerable: false,
99
+ configurable: true
100
+ });
101
+ Object.defineProperty(GridviewComponent.prototype, "deserializer", {
102
+ get: function () {
103
+ return this._deserializer;
104
+ },
105
+ set: function (value) {
106
+ this._deserializer = value;
107
+ },
108
+ enumerable: false,
109
+ configurable: true
110
+ });
111
+ GridviewComponent.prototype.updateOptions = function (options) {
112
+ var hasOrientationChanged = typeof options.orientation === 'string' &&
113
+ this.gridview.orientation !== options.orientation;
114
+ this._options = __assign(__assign({}, this.options), options);
115
+ if (hasOrientationChanged) {
116
+ this.gridview.orientation = options.orientation;
117
+ }
118
+ this.layout(this.gridview.width, this.gridview.height, true);
119
+ };
120
+ GridviewComponent.prototype.removePanel = function (panel) {
121
+ this.removeGroup(panel);
122
+ };
123
+ /**
124
+ * Serialize the current state of the layout
125
+ *
126
+ * @returns A JSON respresentation of the layout
127
+ */
128
+ GridviewComponent.prototype.toJSON = function () {
129
+ var _a;
130
+ var data = this.gridview.serialize();
131
+ return {
132
+ grid: data,
133
+ activePanel: (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.id,
134
+ };
135
+ };
136
+ GridviewComponent.prototype.setVisible = function (panel, visible) {
137
+ this.gridview.setViewVisible((0, gridview_1.getGridLocation)(panel.element), visible);
138
+ };
139
+ GridviewComponent.prototype.setActive = function (panel) {
140
+ this._groups.forEach(function (value, _key) {
141
+ value.value.setActive(panel === value.value);
142
+ });
143
+ };
144
+ GridviewComponent.prototype.focus = function () {
145
+ var _a;
146
+ (_a = this.activeGroup) === null || _a === void 0 ? void 0 : _a.focus();
147
+ };
148
+ GridviewComponent.prototype.fromJSON = function (serializedGridview) {
149
+ var e_1, _a;
150
+ var _this = this;
151
+ this.clear();
152
+ var grid = serializedGridview.grid, activePanel = serializedGridview.activePanel;
153
+ try {
154
+ var queue_1 = [];
155
+ // take note of the existing dimensions
156
+ var width = this.width;
157
+ var height = this.height;
158
+ this.gridview.deserialize(grid, {
159
+ fromJSON: function (node) {
160
+ var _a, _b;
161
+ var data = node.data;
162
+ var view = (0, componentFactory_1.createComponent)(data.id, data.component, (_a = _this.options.components) !== null && _a !== void 0 ? _a : {}, (_b = _this.options.frameworkComponents) !== null && _b !== void 0 ? _b : {}, _this.options.frameworkComponentFactory
163
+ ? {
164
+ createComponent: _this.options.frameworkComponentFactory
165
+ .createComponent,
166
+ }
167
+ : undefined);
168
+ queue_1.push(function () {
169
+ return view.init({
170
+ params: data.params,
171
+ minimumWidth: data.minimumWidth,
172
+ maximumWidth: data.maximumWidth,
173
+ minimumHeight: data.minimumHeight,
174
+ maximumHeight: data.maximumHeight,
175
+ priority: data.priority,
176
+ snap: !!data.snap,
177
+ accessor: _this,
178
+ isVisible: node.visible,
179
+ });
180
+ });
181
+ _this._onDidAddGroup.fire(view);
182
+ _this.registerPanel(view);
183
+ return view;
184
+ },
185
+ });
186
+ this.layout(width, height, true);
187
+ queue_1.forEach(function (f) { return f(); });
188
+ if (typeof activePanel === 'string') {
189
+ var panel = this.getPanel(activePanel);
190
+ if (panel) {
191
+ this.doSetGroupActive(panel);
192
+ }
193
+ }
194
+ }
195
+ catch (err) {
196
+ try {
197
+ /**
198
+ * To remove a group we cannot call this.removeGroup(...) since this makes assumptions about
199
+ * the underlying HTMLElement existing in the Gridview.
200
+ */
201
+ for (var _b = __values(this.groups), _c = _b.next(); !_c.done; _c = _b.next()) {
202
+ var group = _c.value;
203
+ group.dispose();
204
+ this._groups.delete(group.id);
205
+ this._onDidRemoveGroup.fire(group);
206
+ }
207
+ }
208
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
209
+ finally {
210
+ try {
211
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
212
+ }
213
+ finally { if (e_1) throw e_1.error; }
214
+ }
215
+ // fires clean-up events and clears the underlying HTML gridview.
216
+ this.clear();
217
+ /**
218
+ * even though we have cleaned-up we still want to inform the caller of their error
219
+ * and we'll do this through re-throwing the original error since afterall you would
220
+ * expect trying to load a corrupted layout to result in an error and not silently fail...
221
+ */
222
+ throw err;
223
+ }
224
+ this._onDidLayoutfromJSON.fire();
225
+ };
226
+ GridviewComponent.prototype.clear = function () {
227
+ var e_2, _a;
228
+ var hasActiveGroup = this.activeGroup;
229
+ var groups = Array.from(this._groups.values()); // reassign since group panels will mutate
230
+ try {
231
+ for (var groups_1 = __values(groups), groups_1_1 = groups_1.next(); !groups_1_1.done; groups_1_1 = groups_1.next()) {
232
+ var group = groups_1_1.value;
233
+ group.disposable.dispose();
234
+ this.doRemoveGroup(group.value, { skipActive: true });
235
+ }
236
+ }
237
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
238
+ finally {
239
+ try {
240
+ if (groups_1_1 && !groups_1_1.done && (_a = groups_1.return)) _a.call(groups_1);
241
+ }
242
+ finally { if (e_2) throw e_2.error; }
243
+ }
244
+ if (hasActiveGroup) {
245
+ this.doSetGroupActive(undefined);
246
+ }
247
+ this.gridview.clear();
248
+ };
249
+ GridviewComponent.prototype.movePanel = function (panel, options) {
250
+ var _a;
251
+ var relativeLocation;
252
+ var removedPanel = this.gridview.remove(panel);
253
+ var referenceGroup = (_a = this._groups.get(options.reference)) === null || _a === void 0 ? void 0 : _a.value;
254
+ if (!referenceGroup) {
255
+ throw new Error("reference group ".concat(options.reference, " does not exist"));
256
+ }
257
+ var target = (0, baseComponentGridview_1.toTarget)(options.direction);
258
+ if (target === 'center') {
259
+ throw new Error("".concat(target, " not supported as an option"));
260
+ }
261
+ else {
262
+ var location_1 = (0, gridview_1.getGridLocation)(referenceGroup.element);
263
+ relativeLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, location_1, target);
264
+ }
265
+ this.doAddGroup(removedPanel, relativeLocation, options.size);
266
+ };
267
+ GridviewComponent.prototype.addPanel = function (options) {
268
+ var _a, _b, _c, _d, _e, _f;
269
+ var relativeLocation = (_a = options.location) !== null && _a !== void 0 ? _a : [0];
270
+ if ((_b = options.position) === null || _b === void 0 ? void 0 : _b.referencePanel) {
271
+ var referenceGroup = (_c = this._groups.get(options.position.referencePanel)) === null || _c === void 0 ? void 0 : _c.value;
272
+ if (!referenceGroup) {
273
+ throw new Error("reference group ".concat(options.position.referencePanel, " does not exist"));
274
+ }
275
+ var target = (0, baseComponentGridview_1.toTarget)(options.position.direction);
276
+ if (target === 'center') {
277
+ throw new Error("".concat(target, " not supported as an option"));
278
+ }
279
+ else {
280
+ var location_2 = (0, gridview_1.getGridLocation)(referenceGroup.element);
281
+ relativeLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, location_2, target);
282
+ }
283
+ }
284
+ var view = (0, componentFactory_1.createComponent)(options.id, options.component, (_d = this.options.components) !== null && _d !== void 0 ? _d : {}, (_e = this.options.frameworkComponents) !== null && _e !== void 0 ? _e : {}, this.options.frameworkComponentFactory
285
+ ? {
286
+ createComponent: this.options.frameworkComponentFactory
287
+ .createComponent,
288
+ }
289
+ : undefined);
290
+ view.init({
291
+ params: (_f = options.params) !== null && _f !== void 0 ? _f : {},
292
+ minimumWidth: options.minimumWidth,
293
+ maximumWidth: options.maximumWidth,
294
+ minimumHeight: options.minimumHeight,
295
+ maximumHeight: options.maximumHeight,
296
+ priority: options.priority,
297
+ snap: !!options.snap,
298
+ accessor: this,
299
+ isVisible: true,
300
+ });
301
+ this.registerPanel(view);
302
+ this.doAddGroup(view, relativeLocation, options.size);
303
+ return view;
304
+ };
305
+ GridviewComponent.prototype.registerPanel = function (panel) {
306
+ var _this = this;
307
+ var disposable = new lifecycle_1.CompositeDisposable(panel.api.onDidFocusChange(function (event) {
308
+ if (!event.isFocused) {
309
+ return;
310
+ }
311
+ _this._groups.forEach(function (groupItem) {
312
+ var group = groupItem.value;
313
+ if (group !== panel) {
314
+ group.setActive(false);
315
+ }
316
+ else {
317
+ group.setActive(true);
318
+ }
319
+ });
320
+ }));
321
+ this._groups.set(panel.id, {
322
+ value: panel,
323
+ disposable: disposable,
324
+ });
325
+ };
326
+ GridviewComponent.prototype.moveGroup = function (referenceGroup, groupId, target) {
327
+ var sourceGroup = this.getPanel(groupId);
328
+ if (!sourceGroup) {
329
+ throw new Error('invalid operation');
330
+ }
331
+ var referenceLocation = (0, gridview_1.getGridLocation)(referenceGroup.element);
332
+ var targetLocation = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, referenceLocation, target);
333
+ var _a = __read((0, array_1.tail)(targetLocation), 2), targetParentLocation = _a[0], to = _a[1];
334
+ var sourceLocation = (0, gridview_1.getGridLocation)(sourceGroup.element);
335
+ var _b = __read((0, array_1.tail)(sourceLocation), 2), sourceParentLocation = _b[0], from = _b[1];
336
+ if ((0, array_1.sequenceEquals)(sourceParentLocation, targetParentLocation)) {
337
+ // special case when 'swapping' two views within same grid location
338
+ // if a group has one tab - we are essentially moving the 'group'
339
+ // which is equivalent to swapping two views in this case
340
+ this.gridview.moveView(sourceParentLocation, from, to);
341
+ return;
342
+ }
343
+ // source group will become empty so delete the group
344
+ var targetGroup = this.doRemoveGroup(sourceGroup, {
345
+ skipActive: true,
346
+ skipDispose: true,
347
+ });
348
+ // after deleting the group we need to re-evaulate the ref location
349
+ var updatedReferenceLocation = (0, gridview_1.getGridLocation)(referenceGroup.element);
350
+ var location = (0, gridview_1.getRelativeLocation)(this.gridview.orientation, updatedReferenceLocation, target);
351
+ this.doAddGroup(targetGroup, location);
352
+ };
353
+ GridviewComponent.prototype.removeGroup = function (group) {
354
+ _super.prototype.removeGroup.call(this, group);
355
+ };
356
+ GridviewComponent.prototype.dispose = function () {
357
+ _super.prototype.dispose.call(this);
358
+ this._onDidLayoutfromJSON.dispose();
359
+ };
360
+ return GridviewComponent;
361
+ }(baseComponentGridview_1.BaseGrid));
362
+ exports.GridviewComponent = GridviewComponent;
361
363
  //# sourceMappingURL=gridviewComponent.js.map