jqwidgets-ng 18.2.0 → 19.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.
Files changed (269) hide show
  1. package/esm2020/jqxdatatable/angular_jqxdatatable.mjs +0 -3
  2. package/esm2020/jqxgrid/angular_jqxgrid.mjs +72 -5
  3. package/esm2020/jqxtreegrid/angular_jqxtreegrid.mjs +0 -3
  4. package/fesm2015/jqwidgets-ng-jqxbarcode.mjs +2 -4
  5. package/fesm2015/jqwidgets-ng-jqxbargauge.mjs +3 -5
  6. package/fesm2015/jqwidgets-ng-jqxbulletchart.mjs +4 -6
  7. package/fesm2015/jqwidgets-ng-jqxbuttongroup.mjs +3 -5
  8. package/fesm2015/jqwidgets-ng-jqxbuttons.mjs +2 -4
  9. package/fesm2015/jqwidgets-ng-jqxcalendar.mjs +6 -8
  10. package/fesm2015/jqwidgets-ng-jqxchart.mjs +9 -11
  11. package/fesm2015/jqwidgets-ng-jqxcheckbox.mjs +2 -4
  12. package/fesm2015/jqwidgets-ng-jqxcheckboxgroup.mjs +3 -5
  13. package/fesm2015/jqwidgets-ng-jqxcolorpicker.mjs +5 -7
  14. package/fesm2015/jqwidgets-ng-jqxcombobox.mjs +6 -8
  15. package/fesm2015/jqwidgets-ng-jqxcomplexinput.mjs +3 -5
  16. package/fesm2015/jqwidgets-ng-jqxdatatable.mjs +12 -17
  17. package/fesm2015/jqwidgets-ng-jqxdatetimeinput.mjs +6 -8
  18. package/fesm2015/jqwidgets-ng-jqxdocking.mjs +4 -6
  19. package/fesm2015/jqwidgets-ng-jqxdockinglayout.mjs +8 -10
  20. package/fesm2015/jqwidgets-ng-jqxdockpanel.mjs +2 -4
  21. package/fesm2015/jqwidgets-ng-jqxdragdrop.mjs +2 -4
  22. package/fesm2015/jqwidgets-ng-jqxdraw.mjs +2 -4
  23. package/fesm2015/jqwidgets-ng-jqxdropdownbutton.mjs +3 -5
  24. package/fesm2015/jqwidgets-ng-jqxdropdownlist.mjs +6 -8
  25. package/fesm2015/jqwidgets-ng-jqxeditor.mjs +12 -14
  26. package/fesm2015/jqwidgets-ng-jqxexpander.mjs +2 -4
  27. package/fesm2015/jqwidgets-ng-jqxfileupload.mjs +3 -5
  28. package/fesm2015/jqwidgets-ng-jqxform.mjs +17 -19
  29. package/fesm2015/jqwidgets-ng-jqxformattedinput.mjs +2 -4
  30. package/fesm2015/jqwidgets-ng-jqxgantt.mjs +4 -6
  31. package/fesm2015/jqwidgets-ng-jqxgauge.mjs +3 -5
  32. package/fesm2015/jqwidgets-ng-jqxgrid.mjs +101 -36
  33. package/fesm2015/jqwidgets-ng-jqxheatmap.mjs +2 -4
  34. package/fesm2015/jqwidgets-ng-jqxinput.mjs +3 -5
  35. package/fesm2015/jqwidgets-ng-jqxkanban.mjs +5 -7
  36. package/fesm2015/jqwidgets-ng-jqxknob.mjs +3 -5
  37. package/fesm2015/jqwidgets-ng-jqxlayout.mjs +5 -7
  38. package/fesm2015/jqwidgets-ng-jqxlineargauge.mjs +3 -5
  39. package/fesm2015/jqwidgets-ng-jqxlinkbutton.mjs +2 -4
  40. package/fesm2015/jqwidgets-ng-jqxlistbox.mjs +6 -8
  41. package/fesm2015/jqwidgets-ng-jqxlistmenu.mjs +5 -7
  42. package/fesm2015/jqwidgets-ng-jqxloader.mjs +2 -4
  43. package/fesm2015/jqwidgets-ng-jqxmaskedinput.mjs +2 -4
  44. package/fesm2015/jqwidgets-ng-jqxmenu.mjs +3 -5
  45. package/fesm2015/jqwidgets-ng-jqxnavbar.mjs +2 -4
  46. package/fesm2015/jqwidgets-ng-jqxnavigationbar.mjs +2 -4
  47. package/fesm2015/jqwidgets-ng-jqxnotification.mjs +3 -5
  48. package/fesm2015/jqwidgets-ng-jqxnumberinput.mjs +3 -5
  49. package/fesm2015/jqwidgets-ng-jqxpanel.mjs +4 -6
  50. package/fesm2015/jqwidgets-ng-jqxpasswordinput.mjs +3 -5
  51. package/fesm2015/jqwidgets-ng-jqxpivotdesigner.mjs +1 -3
  52. package/fesm2015/jqwidgets-ng-jqxpivotgrid.mjs +14 -16
  53. package/fesm2015/jqwidgets-ng-jqxpopover.mjs +2 -4
  54. package/fesm2015/jqwidgets-ng-jqxprogressbar.mjs +2 -4
  55. package/fesm2015/jqwidgets-ng-jqxqrcode.mjs +3 -5
  56. package/fesm2015/jqwidgets-ng-jqxradiobutton.mjs +2 -4
  57. package/fesm2015/jqwidgets-ng-jqxradiobuttongroup.mjs +3 -5
  58. package/fesm2015/jqwidgets-ng-jqxrangeselector.mjs +4 -6
  59. package/fesm2015/jqwidgets-ng-jqxrating.mjs +2 -4
  60. package/fesm2015/jqwidgets-ng-jqxrepeatbutton.mjs +2 -4
  61. package/fesm2015/jqwidgets-ng-jqxresponsivepanel.mjs +2 -4
  62. package/fesm2015/jqwidgets-ng-jqxribbon.mjs +4 -6
  63. package/fesm2015/jqwidgets-ng-jqxscheduler.mjs +22 -24
  64. package/fesm2015/jqwidgets-ng-jqxscrollbar.mjs +3 -5
  65. package/fesm2015/jqwidgets-ng-jqxscrollview.mjs +3 -5
  66. package/fesm2015/jqwidgets-ng-jqxslider.mjs +3 -5
  67. package/fesm2015/jqwidgets-ng-jqxsortable.mjs +3 -5
  68. package/fesm2015/jqwidgets-ng-jqxsplitlayout.mjs +2 -4
  69. package/fesm2015/jqwidgets-ng-jqxsplitter.mjs +3 -5
  70. package/fesm2015/jqwidgets-ng-jqxswitchbutton.mjs +2 -4
  71. package/fesm2015/jqwidgets-ng-jqxtabs.mjs +3 -5
  72. package/fesm2015/jqwidgets-ng-jqxtagcloud.mjs +4 -6
  73. package/fesm2015/jqwidgets-ng-jqxtextarea.mjs +5 -7
  74. package/fesm2015/jqwidgets-ng-jqxtimepicker.mjs +3 -5
  75. package/fesm2015/jqwidgets-ng-jqxtogglebutton.mjs +2 -4
  76. package/fesm2015/jqwidgets-ng-jqxtoolbar.mjs +8 -10
  77. package/fesm2015/jqwidgets-ng-jqxtooltip.mjs +2 -4
  78. package/fesm2015/jqwidgets-ng-jqxtree.mjs +8 -10
  79. package/fesm2015/jqwidgets-ng-jqxtreegrid.mjs +13 -18
  80. package/fesm2015/jqwidgets-ng-jqxtreemap.mjs +4 -6
  81. package/fesm2015/jqwidgets-ng-jqxvalidator.mjs +2 -4
  82. package/fesm2015/jqwidgets-ng-jqxwindow.mjs +3 -5
  83. package/fesm2020/jqwidgets-ng-jqxbarcode.mjs +2 -4
  84. package/fesm2020/jqwidgets-ng-jqxbargauge.mjs +3 -5
  85. package/fesm2020/jqwidgets-ng-jqxbulletchart.mjs +4 -6
  86. package/fesm2020/jqwidgets-ng-jqxbuttongroup.mjs +3 -5
  87. package/fesm2020/jqwidgets-ng-jqxbuttons.mjs +2 -4
  88. package/fesm2020/jqwidgets-ng-jqxcalendar.mjs +6 -8
  89. package/fesm2020/jqwidgets-ng-jqxchart.mjs +9 -11
  90. package/fesm2020/jqwidgets-ng-jqxcheckbox.mjs +2 -4
  91. package/fesm2020/jqwidgets-ng-jqxcheckboxgroup.mjs +3 -5
  92. package/fesm2020/jqwidgets-ng-jqxcolorpicker.mjs +5 -7
  93. package/fesm2020/jqwidgets-ng-jqxcombobox.mjs +6 -8
  94. package/fesm2020/jqwidgets-ng-jqxcomplexinput.mjs +3 -5
  95. package/fesm2020/jqwidgets-ng-jqxdatatable.mjs +12 -17
  96. package/fesm2020/jqwidgets-ng-jqxdatetimeinput.mjs +6 -8
  97. package/fesm2020/jqwidgets-ng-jqxdocking.mjs +4 -6
  98. package/fesm2020/jqwidgets-ng-jqxdockinglayout.mjs +8 -10
  99. package/fesm2020/jqwidgets-ng-jqxdockpanel.mjs +2 -4
  100. package/fesm2020/jqwidgets-ng-jqxdragdrop.mjs +2 -4
  101. package/fesm2020/jqwidgets-ng-jqxdraw.mjs +2 -4
  102. package/fesm2020/jqwidgets-ng-jqxdropdownbutton.mjs +3 -5
  103. package/fesm2020/jqwidgets-ng-jqxdropdownlist.mjs +6 -8
  104. package/fesm2020/jqwidgets-ng-jqxeditor.mjs +12 -14
  105. package/fesm2020/jqwidgets-ng-jqxexpander.mjs +2 -4
  106. package/fesm2020/jqwidgets-ng-jqxfileupload.mjs +3 -5
  107. package/fesm2020/jqwidgets-ng-jqxform.mjs +17 -19
  108. package/fesm2020/jqwidgets-ng-jqxformattedinput.mjs +2 -4
  109. package/fesm2020/jqwidgets-ng-jqxgantt.mjs +4 -6
  110. package/fesm2020/jqwidgets-ng-jqxgauge.mjs +3 -5
  111. package/fesm2020/jqwidgets-ng-jqxgrid.mjs +101 -36
  112. package/fesm2020/jqwidgets-ng-jqxheatmap.mjs +2 -4
  113. package/fesm2020/jqwidgets-ng-jqxinput.mjs +3 -5
  114. package/fesm2020/jqwidgets-ng-jqxkanban.mjs +5 -7
  115. package/fesm2020/jqwidgets-ng-jqxknob.mjs +3 -5
  116. package/fesm2020/jqwidgets-ng-jqxlayout.mjs +5 -7
  117. package/fesm2020/jqwidgets-ng-jqxlineargauge.mjs +3 -5
  118. package/fesm2020/jqwidgets-ng-jqxlinkbutton.mjs +2 -4
  119. package/fesm2020/jqwidgets-ng-jqxlistbox.mjs +6 -8
  120. package/fesm2020/jqwidgets-ng-jqxlistmenu.mjs +5 -7
  121. package/fesm2020/jqwidgets-ng-jqxloader.mjs +2 -4
  122. package/fesm2020/jqwidgets-ng-jqxmaskedinput.mjs +2 -4
  123. package/fesm2020/jqwidgets-ng-jqxmenu.mjs +3 -5
  124. package/fesm2020/jqwidgets-ng-jqxnavbar.mjs +2 -4
  125. package/fesm2020/jqwidgets-ng-jqxnavigationbar.mjs +2 -4
  126. package/fesm2020/jqwidgets-ng-jqxnotification.mjs +3 -5
  127. package/fesm2020/jqwidgets-ng-jqxnumberinput.mjs +3 -5
  128. package/fesm2020/jqwidgets-ng-jqxpanel.mjs +4 -6
  129. package/fesm2020/jqwidgets-ng-jqxpasswordinput.mjs +3 -5
  130. package/fesm2020/jqwidgets-ng-jqxpivotdesigner.mjs +1 -3
  131. package/fesm2020/jqwidgets-ng-jqxpivotgrid.mjs +14 -16
  132. package/fesm2020/jqwidgets-ng-jqxpopover.mjs +2 -4
  133. package/fesm2020/jqwidgets-ng-jqxprogressbar.mjs +2 -4
  134. package/fesm2020/jqwidgets-ng-jqxqrcode.mjs +3 -5
  135. package/fesm2020/jqwidgets-ng-jqxradiobutton.mjs +2 -4
  136. package/fesm2020/jqwidgets-ng-jqxradiobuttongroup.mjs +3 -5
  137. package/fesm2020/jqwidgets-ng-jqxrangeselector.mjs +4 -6
  138. package/fesm2020/jqwidgets-ng-jqxrating.mjs +2 -4
  139. package/fesm2020/jqwidgets-ng-jqxrepeatbutton.mjs +2 -4
  140. package/fesm2020/jqwidgets-ng-jqxresponsivepanel.mjs +2 -4
  141. package/fesm2020/jqwidgets-ng-jqxribbon.mjs +4 -6
  142. package/fesm2020/jqwidgets-ng-jqxscheduler.mjs +22 -24
  143. package/fesm2020/jqwidgets-ng-jqxscrollbar.mjs +3 -5
  144. package/fesm2020/jqwidgets-ng-jqxscrollview.mjs +3 -5
  145. package/fesm2020/jqwidgets-ng-jqxslider.mjs +3 -5
  146. package/fesm2020/jqwidgets-ng-jqxsortable.mjs +3 -5
  147. package/fesm2020/jqwidgets-ng-jqxsplitlayout.mjs +2 -4
  148. package/fesm2020/jqwidgets-ng-jqxsplitter.mjs +3 -5
  149. package/fesm2020/jqwidgets-ng-jqxswitchbutton.mjs +2 -4
  150. package/fesm2020/jqwidgets-ng-jqxtabs.mjs +3 -5
  151. package/fesm2020/jqwidgets-ng-jqxtagcloud.mjs +4 -6
  152. package/fesm2020/jqwidgets-ng-jqxtextarea.mjs +5 -7
  153. package/fesm2020/jqwidgets-ng-jqxtimepicker.mjs +3 -5
  154. package/fesm2020/jqwidgets-ng-jqxtogglebutton.mjs +2 -4
  155. package/fesm2020/jqwidgets-ng-jqxtoolbar.mjs +8 -10
  156. package/fesm2020/jqwidgets-ng-jqxtooltip.mjs +2 -4
  157. package/fesm2020/jqwidgets-ng-jqxtree.mjs +8 -10
  158. package/fesm2020/jqwidgets-ng-jqxtreegrid.mjs +13 -18
  159. package/fesm2020/jqwidgets-ng-jqxtreemap.mjs +4 -6
  160. package/fesm2020/jqwidgets-ng-jqxvalidator.mjs +2 -4
  161. package/fesm2020/jqwidgets-ng-jqxwindow.mjs +3 -5
  162. package/jqwidgets/jqx-all.js +41 -26
  163. package/jqwidgets/jqxangular.js +1 -1
  164. package/jqwidgets/jqxbarcode.js +1 -1
  165. package/jqwidgets/jqxbargauge.js +1 -1
  166. package/jqwidgets/jqxbulletchart.js +1 -1
  167. package/jqwidgets/jqxbuttongroup.js +1 -1
  168. package/jqwidgets/jqxbuttons.js +1 -1
  169. package/jqwidgets/jqxcalendar.js +1 -1
  170. package/jqwidgets/jqxchart.annotations.js +1 -1
  171. package/jqwidgets/jqxchart.api.js +1 -1
  172. package/jqwidgets/jqxchart.core.js +1 -1
  173. package/jqwidgets/jqxchart.js +1 -1
  174. package/jqwidgets/jqxchart.rangeselector.js +1 -1
  175. package/jqwidgets/jqxchart.waterfall.js +1 -1
  176. package/jqwidgets/jqxcheckbox.js +1 -1
  177. package/jqwidgets/jqxcheckboxgroup.js +13 -5
  178. package/jqwidgets/jqxcolorpicker.js +1 -1
  179. package/jqwidgets/jqxcombobox.js +1 -1
  180. package/jqwidgets/jqxcomplexinput.js +1 -1
  181. package/jqwidgets/jqxcore.js +1 -1
  182. package/jqwidgets/jqxdata.export.js +1 -1
  183. package/jqwidgets/jqxdata.js +1 -1
  184. package/jqwidgets/jqxdatatable.js +1 -1
  185. package/jqwidgets/jqxdate.js +1 -1
  186. package/jqwidgets/jqxdatetimeinput.js +1 -1
  187. package/jqwidgets/jqxdocking.js +1 -1
  188. package/jqwidgets/jqxdockinglayout.js +1 -1
  189. package/jqwidgets/jqxdockpanel.js +1 -1
  190. package/jqwidgets/jqxdragdrop.js +1 -1
  191. package/jqwidgets/jqxdraw.js +1 -1
  192. package/jqwidgets/jqxdropdownbutton.js +1 -1
  193. package/jqwidgets/jqxdropdownlist.js +2 -2
  194. package/jqwidgets/jqxeditor.js +2 -2
  195. package/jqwidgets/jqxexpander.js +1 -1
  196. package/jqwidgets/jqxfileupload.js +1 -1
  197. package/jqwidgets/jqxform.js +1 -1
  198. package/jqwidgets/jqxformattedinput.js +1 -1
  199. package/jqwidgets/jqxgantt.api.js +64 -64
  200. package/jqwidgets/jqxgantt.js +1 -1
  201. package/jqwidgets/jqxgauge.js +1 -1
  202. package/jqwidgets/jqxgrid.aggregates.js +1 -1
  203. package/jqwidgets/jqxgrid.chart.js +15 -14
  204. package/jqwidgets/jqxgrid.columnsreorder.js +2 -2
  205. package/jqwidgets/jqxgrid.columnsresize.js +2 -2
  206. package/jqwidgets/jqxgrid.edit.js +2 -2
  207. package/jqwidgets/jqxgrid.export.js +1 -1
  208. package/jqwidgets/jqxgrid.filter.js +2 -2
  209. package/jqwidgets/jqxgrid.grouping.js +2 -2
  210. package/jqwidgets/jqxgrid.js +2 -2
  211. package/jqwidgets/jqxgrid.pager.js +1 -1
  212. package/jqwidgets/jqxgrid.selection.js +2 -2
  213. package/jqwidgets/jqxgrid.sort.js +1 -1
  214. package/jqwidgets/jqxgrid.storage.js +2 -2
  215. package/jqwidgets/jqxheatmap.js +1 -1
  216. package/jqwidgets/jqxinput.js +1 -1
  217. package/jqwidgets/jqxkanban.js +2 -2
  218. package/jqwidgets/jqxknob.js +1 -1
  219. package/jqwidgets/jqxknockout.js +1 -1
  220. package/jqwidgets/jqxlayout.js +1 -1
  221. package/jqwidgets/jqxlistbox.js +1 -1
  222. package/jqwidgets/jqxlistmenu.js +1 -1
  223. package/jqwidgets/jqxloader.js +1 -1
  224. package/jqwidgets/jqxmaskedinput.js +2 -2
  225. package/jqwidgets/jqxmenu.js +1 -1
  226. package/jqwidgets/jqxnavbar.js +1 -1
  227. package/jqwidgets/jqxnavigationbar.js +1 -1
  228. package/jqwidgets/jqxnotification.js +1 -1
  229. package/jqwidgets/jqxnumberinput.js +2 -2
  230. package/jqwidgets/jqxpanel.js +1 -1
  231. package/jqwidgets/jqxpasswordinput.js +1 -1
  232. package/jqwidgets/jqxpivot.js +1 -1
  233. package/jqwidgets/jqxpivotdesigner.js +1 -1
  234. package/jqwidgets/jqxpivotgrid.js +1 -1
  235. package/jqwidgets/jqxpopover.js +2 -2
  236. package/jqwidgets/jqxprogressbar.js +1 -1
  237. package/jqwidgets/jqxqrcode.js +1 -1
  238. package/jqwidgets/jqxradiobutton.js +1 -1
  239. package/jqwidgets/jqxradiobuttongroup.js +12 -5
  240. package/jqwidgets/jqxrangeselector.js +1 -1
  241. package/jqwidgets/jqxrating.js +2 -2
  242. package/jqwidgets/jqxresponsivepanel.js +1 -1
  243. package/jqwidgets/jqxribbon.js +1 -1
  244. package/jqwidgets/jqxscheduler.api.js +1 -1
  245. package/jqwidgets/jqxscheduler.js +2 -2
  246. package/jqwidgets/jqxscrollbar.js +1 -1
  247. package/jqwidgets/jqxscrollview.js +1 -1
  248. package/jqwidgets/jqxslider.js +1 -1
  249. package/jqwidgets/jqxsortable.js +1 -1
  250. package/jqwidgets/jqxsplitlayout.js +2506 -2
  251. package/jqwidgets/jqxsplitter.js +1 -1
  252. package/jqwidgets/jqxswitchbutton.js +1 -1
  253. package/jqwidgets/jqxtabs.js +1 -1
  254. package/jqwidgets/jqxtagcloud.js +1 -1
  255. package/jqwidgets/jqxtextarea.js +2 -2
  256. package/jqwidgets/jqxtimepicker.js +1 -1
  257. package/jqwidgets/jqxtoolbar.js +1 -1
  258. package/jqwidgets/jqxtooltip.js +1 -1
  259. package/jqwidgets/jqxtouch.js +1 -1
  260. package/jqwidgets/jqxtree.js +1 -1
  261. package/jqwidgets/jqxtreegrid.js +1 -1
  262. package/jqwidgets/jqxtreemap.js +1 -1
  263. package/jqwidgets/jqxvalidator.js +1 -1
  264. package/jqwidgets/jqxwindow.js +1 -1
  265. package/jqwidgets/styles/jqx.base.css +10 -0
  266. package/jqwidgets/styles/jqx.fluent.css +6 -0
  267. package/jqwidgets.d.ts +5 -0
  268. package/jqxgrid/angular_jqxgrid.d.ts +11 -1
  269. package/package.json +1 -1
@@ -1,9 +1,2513 @@
1
1
  /*
2
- jQWidgets v18.2.0 (2024-Feb)
2
+ jQWidgets v19.0.0 (2024-Feb)
3
3
  Copyright (c) 2011-2024 jQWidgets.
4
4
  License: https://jqwidgets.com/license/
5
5
  */
6
6
  /* eslint-disable */
7
7
 
8
- function _typeof(b){if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){a=function a(c){return typeof c}}else{a=function a(c){return c&&typeof Symbol==="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c}}return a(b)}function _get(d,c,b){if(typeof Reflect!=="undefined"&&Reflect.get){a=Reflect.get}else{a=function a(h,g,f){var e=_superPropBase(h,g);if(!e){return}var i=Object.getOwnPropertyDescriptor(e,g);if(i.get){return i.get.call(f)}return i.value}}return a(d,c,b||d)}function _superPropBase(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=_getPrototypeOf(a);if(a===null){break}}return a}function _classCallCheck(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(d,b){for(var a=0;a<b.length;a++){var c=b[a];c.enumerable=c.enumerable||false;c.configurable=true;if("value" in c){c.writable=true}Object.defineProperty(d,c.key,c)}}function _createClass(c,a,b){if(a){_defineProperties(c.prototype,a)}if(b){_defineProperties(c,b)}return c}function _inherits(b,a){if(typeof a!=="function"&&a!==null){throw new TypeError("Super expression must either be null or a function")}b.prototype=Object.create(a&&a.prototype,{constructor:{value:b,writable:true,configurable:true}});if(a){_setPrototypeOf(b,a)}}function _createSuper(b){var c=_isNativeReflectConstruct();return function a(){var e=_getPrototypeOf(b),d;if(c){var f=_getPrototypeOf(this).constructor;d=Reflect.construct(e,arguments,f)}else{d=e.apply(this,arguments)}return _possibleConstructorReturn(this,d)}}function _possibleConstructorReturn(a,b){if(b&&(_typeof(b)==="object"||typeof b==="function")){return b}return _assertThisInitialized(a)}function _assertThisInitialized(a){if(a===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function _wrapNativeSuper(a){var c=typeof Map==="function"?new Map():undefined;b=function b(d){if(d===null||!_isNativeFunction(d)){return d}if(typeof d!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof c!=="undefined"){if(c.has(d)){return c.get(d)}c.set(d,e)}function e(){return _construct(d,arguments,_getPrototypeOf(this).constructor)}e.prototype=Object.create(d.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});return _setPrototypeOf(e,d)};return b(a)}function _construct(d,c,b){if(_isNativeReflectConstruct()){a=Reflect.construct}else{a=function a(i,h,g){var f=[null];f.push.apply(f,h);var j=Function.bind.apply(i,f);var e=new j();if(g){_setPrototypeOf(e,g.prototype)}return e}}return a.apply(null,arguments)}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct){return false}if(Reflect.construct.sham){return false}if(typeof Proxy==="function"){return true}try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true}catch(a){return false}}function _isNativeFunction(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function _setPrototypeOf(b,a){c=Object.setPrototypeOf||function c(e,d){e.__proto__=d;return e};return c(b,a)}function _getPrototypeOf(b){a=Object.setPrototypeOf?Object.getPrototypeOf:function a(c){return c.__proto__||Object.getPrototypeOf(c)};return a(b)}if(!window.JQX){window.JQX={Utilities:{Core:{isMobile:function isMobile(){var a=/(iphone|ipod|ipad|android|iemobile|blackberry|bada)/.test(window.navigator.userAgent.toLowerCase());var b=function b(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend" in document};if(!a){return b()}return a}}}}}var LayoutItem=function(e){_inherits(j,e);var i=_createSuper(j);function j(){var k;_classCallCheck(this,j);k=i.call(this);k._properties={min:50,label:"Item",modifiers:["resize","drag","close"],size:null};return k}_createClass(j,[{key:"_setProperty",value:function d(n,m){var l=this;if(l._properties[n]===m){return}l._properties[n]=m;l._updating=true;if(n==="disabled"||n==="modifiers"){if(m){l.setAttribute(n,m)}else{l.removeAttribute(n)}}else{if(m===null){l.removeAttribute(n)}else{l.setAttribute(n,m)}}if(!l.isCompleted){return}var k=l.closest("jqx-layout");if(k){if(!k._resizeDetails&&!k._updating&&k.isRendered){k.refresh()}}l._updating=false}},{key:"label",get:function b(){return this._properties.label},set:function h(k){this._setProperty("label",k)}},{key:"modifiers",get:function b(){return this._properties.modifiers},set:function h(k){this._setProperty("modifiers",k)}},{key:"min",get:function b(){return this._properties.min},set:function h(k){this._setProperty("min",k)}},{key:"size",get:function b(){return this._properties.size},set:function h(k){if(k!==null){if(typeof k==="string"){this._setProperty("size",k)}else{this._setProperty("size",Math.max(this.min,k))}}else{this._setProperty("size",k)}}},{key:"attributeChangedCallback",value:function f(l,k,n){var m=this;if(k===n){return}if(!m.isCompleted){return}if(l==="size"){if(!m._updating){if(n===null){this[l]=null;return}m[l]=Math.max(m.min,parseInt(n))}}else{m[l]=n}}},{key:"connectedCallback",value:function g(){if(!this.isCompleted){this.render()}}},{key:"whenRendered",value:function c(l){var k=this;if(k.isRendered){l();return}if(!k.whenRenderedCallbacks){k.whenRenderedCallbacks=[]}k.whenRenderedCallbacks.push(l)}},{key:"render",value:function a(){var o=this;if(!o.hasAttribute("data-id")){o.setAttribute("data-id","id"+Math.random().toString(16).slice(2))}if(!o.hasAttribute("label")){o.setAttribute("label",o.label)}if(!o.hasAttribute("min")){o.setAttribute("min",o.min)}if(!o.hasAttribute("label")){o.setAttribute("label",o.label)}if(!o.hasAttribute("modifiers")){o.setAttribute("modifiers",o.modifiers)}for(var l=0;l<o.attributes.length;l++){var n=o.attributes[l];var k=n.name;var m=n.value;if(!isNaN(m)&&(k==="min"||k==="size")){o._properties[k]=parseInt(m);continue}o._properties[k]=m}o.classList.add("jqx-layout-item");o.isCompleted=true;if(o.whenRenderedCallbacks){for(var l=0;l<o.whenRenderedCallbacks.length;l++){o.whenRenderedCallbacks[l]()}o.whenRenderedCallbacks=[]}}}],[{key:"observedAttributes",get:function b(){return["min","size","label","modifiers"]}}]);return j}(_wrapNativeSuper(HTMLElement));var LayoutGroup=function(e){_inherits(d,e);var c=_createSuper(d);function d(){var g;_classCallCheck(this,d);g=c.call(this);g._properties.label="Group";g._properties.orientation="vertical";return g}_createClass(d,[{key:"orientation",get:function a(){return this._properties.orientation},set:function f(g){this._setProperty("orientation",g)}},{key:"render",value:function b(){var g=this;_get(_getPrototypeOf(d.prototype),"render",this).call(this);g.className="jqx-layout-group";if(!g.hasAttribute("orientation")){g.setAttribute("orientation",g._properties.orientation)}else{g._properties.orientation=g.getAttribute("orientation")}}}],[{key:"observedAttributes",get:function a(){return["min","size","modifiers","orientation","position"]}}]);return d}(LayoutItem);var TabLayoutGroup=function(d){_inherits(b,d);var e=_createSuper(b);function b(){var g;_classCallCheck(this,b);g=e.call(this);g._properties.position="top";g._properties.label="TabGroup";return g}_createClass(b,[{key:"position",get:function a(){return this._properties.position},set:function f(g){this._setProperty("position",g)}},{key:"render",value:function c(){var g=this;_get(_getPrototypeOf(b.prototype),"render",this).call(this);if(!g.hasAttribute("position")&&g.position){g.setAttribute("position","top")}}}],[{key:"observedAttributes",get:function a(){return["min","size","modifiers","orientation","position"]}}]);return b}(LayoutGroup);var TabLayoutItem=function(b){_inherits(a,b);var c=_createSuper(a);function a(){var d;_classCallCheck(this,a);d=c.call(this);d._properties.label="TabItem";return d}return a}(LayoutGroup);(function(g){g.jqx.jqxWidget("jqxSplitLayout","",{});g.extend(g.jqx._jqxSplitLayout.prototype,{defineInstance:function e(){var h={dataSource:null,ready:null,orientation:"vertical"};if(this===g.jqx._jqxSplitLayout.prototype){return h}g.extend(true,this,h);return h},createInstance:function a(){var h=this;this._properties={dataSource:null,ready:null,orientation:"vertical"};var h=this;h.layout=document.createElement("jqx-split-layout");h.layout.style.width="100%";h.layout.style.height="100%";h.element.className+=h.toThemeProperty("jqx-split-layout-component jqx-rc-all jqx-widget");h.layout.dataSource=h.dataSource;h.layout.orientation=h.orientation;h.layout.ready=h.ready;h.element.appendChild(h.layout)},propertyChangedHandler:function b(i,j,h,l){var k=i;if(h!=l||l instanceof Object){if(!k.layout){return}k.layout[j]=l}},render:function d(){var h=this;if(!h.layout){return}h.layout.render()},refresh:function c(){var h=this;if(!h.layout){return}if(!h.layout.isRendered){return}h.layout.refresh()},dataBind:function f(){var h=this;if(!h.layout){return}h.layout.dataBind()}})})(jqxBaseFramework);var SplitLayout=function(G){_inherits(i,G);var g=_createSuper(i);function i(){var O;_classCallCheck(this,i);O=g.call(this);O._properties={dataSource:null,orientation:"vertical"};return O}_createClass(i,[{key:"orientation",get:function J(){return this._properties.orientation},set:function s(O){this._properties.orientation=O}},{key:"dataSource",get:function J(){return this._properties.dataSource},set:function s(O){this._properties.dataSource=O}},{key:"_dragStart",value:function L(O){O.stopPropagation();O.preventDefault()}},{key:"_leaveHandler",value:function C(){var O=this;if(O._resizeDetails){return}O._handleButtonsVisibility(null);O._hideSplitter();requestAnimationFrame(function(){})}},{key:"_enterHandler",value:function y(){var O=this;if(O._resizeDetails){return}O._handleButtonsVisibility(O._selectedItem);O._updateSplitter();requestAnimationFrame(function(){O.classList.add("outline")})}},{key:"template",value:function j(){return'<div class="jqx-container" id="container" role="presentation"><jqx-layout-group data-id="root" id="itemsContainer"></jqx-layout-group><div root-splitter id="splitter" class="jqx-layout-splitter"></div>'}},{key:"propertyChangedHandler",value:function B(O,P,R){var Q=this;switch(O){case"orientation":if(Q.$.itemsContainer){Q.$.itemsContainer.orientation=Q.orientation}break;case"dataSource":Q.dataBind();break;case"selectedIndex":Q._handleItemClick(Q.getItem(R+""),true);break;default:_get(_getPrototypeOf(i.prototype),"propertyChangedHandler",this).call(this,O,P,R);break}}},{key:"dataBind",value:function p(){var Q=this;Q.$.itemsContainer.innerHTML="";var O="";var P=function P(R,Y){for(var V=0;V<R.length;V++){var ad=R[V];var ae=ad.size;var U=ad.min;var ac=ad.modifiers;var aa=ad.type;var W=ad.position;var T=ad.orientation?ad.orientation:"vertical";var S=ad.id;var ab=ad.label;var Z="";if(S!==undefined){Z+='id="'.concat(S,'" ')}if(ae!==undefined){Z+='size="'.concat(ae,'" ')}if(ab!==undefined){Z+='label="'.concat(ab,'" ')}if(U!==undefined){Z+='min="'.concat(U,'" ')}if(ac!==undefined){Z+='modifiers="'.concat(ac,'" ')}if(W!==undefined){Z+='position="'.concat(W,'" ')}if(ad.items){Z+="orientation=".concat(T," ");if(aa==="tabs"){O+="<jqx-tab-layout-group ".concat(Z,">");P(ad.items,true);O+="</jqx-tab-layout-group>"}else{O+="<jqx-layout-group ".concat(Z,">");P(ad.items);O+="</jqx-layout-group>"}}else{var X=ad.content||"";if(Y){O+="<jqx-tab-layout-item ".concat(Z,">")+X+"</jqx-tab-layout-item>"}else{if(aa==="tabs"){O+="<jqx-tab-layout-group>";O+="<jqx-tab-layout-item ".concat(Z,">")+X+"</jqx-tab-layout-item>";O+="</jqx-tab-layout-group>"}else{O+="<jqx-layout-item ".concat(Z,">")+X+"</jqx-layout-item>"}}}}};P(Q.dataSource);Q.$.itemsContainer.innerHTML=O;Q.refresh()}},{key:"render",value:function w(){var P=this;P.setAttribute("role","group");if(P.selectedIndex){P._handleItemClick(P.getItem(P.selectedIndex+""),true)}var O=function O(){if(!P.dataSource){P.dataSource=P._getDataSource(P._getLayout())}else{P.dataBind()}P.$.itemsContainer.orientation=P.orientation;P.refresh();P._updateSplitter();P.isRendered=true;P.classList.add("outline");if(P.ready){P.ready()}};if(document.readyState==="complete"){O()}else{window.addEventListener("load",function(){O()})}}},{key:"connectedCallback",value:function H(){var P=this;var O=function O(){var Q=document.createDocumentFragment();while(P.childNodes.length){Q.appendChild(P.firstChild)}P.innerHTML=P.template();P.classList.add("jqx-widget");P.$={container:P.querySelector("#container"),itemsContainer:P.querySelector("#itemsContainer"),splitter:P.querySelector("#splitter")};delete P.$.container.id;delete P.$.itemsContainer.id;delete P.$.splitter.id;P.$.itemsContainer.appendChild(Q);P.classList.add("jqx-split-layout");document.addEventListener("pointerdown",function(R){P._documentDownHandler(R)});document.addEventListener("pointermove",function(R){P._documentMoveHandler(R)});document.addEventListener("pointerup",function(R){P._documentUpHandler(R)});document.addEventListener("selectstart",function(R){P._documentSelectStartHandler(R)});document.addEventListener("keyup",function(R){P._keyUpHandler(R)});P.addEventListener("mouseleave",function(R){P._leaveHandler(R)});P.addEventListener("mouseenter",function(R){P._enterHandler(R)});P.addEventListener("dragStart",function(R){P._dragStart(R)});P.render()};if(document.readyState==="complete"){O()}else{window.addEventListener("load",function(){O()})}}},{key:"getItem",value:function c(P){var S=this;if(P===undefined||P===null){return}P=(P+"").split(".");var O=S._getDataSource(S._getLayout()),R;for(var Q=0;Q<P.length;Q++){R=O[P[Q]];if(!R){break}O=R.items}return R}},{key:"_documentDownHandler",value:function D(P){var O=this,Q=P.target;if(O.contains(Q)&&Q.closest){O._target=Q;O._updateSplitter()}}},{key:"_documentMoveHandler",value:function u(ak){var ab=this,au=ak.target,Q=ab._contextMenu;if(Q&&!JQX.Utilities.Core.isMobile){if(Q.querySelector(".jqx-layout-context-menu-item[hover]")){var ai=Q.children;for(var al=0;al<ai.length;al++){ai[al].removeAttribute("hover")}}if(Q.contains(au)&&au.closest&&au.closest(".jqx-layout-context-menu-item")){au.setAttribute("hover","")}}if(ab._dragDetails){var ao=Math.abs(ab._dragDetails.pageX-ak.pageX);var an=Math.abs(ab._dragDetails.pageY-ak.pageY);if(an<=5&&ao<=5){return}if(!ab._dragDetails.feedback.parentElement){document.body.appendChild(ab._dragDetails.feedback);document.body.appendChild(ab._dragDetails.overlay);setTimeout(function(){ab._dragDetails.feedback.classList.add("dragging")},100)}ab._dragDetails.dragging=true;ab._dragDetails.feedback.style.left=ak.pageX-ab._dragDetails.feedback.offsetWidth/2-5+"px";ab._dragDetails.feedback.style.top=ak.pageY-ab._dragDetails.feedback.offsetHeight/2-5+"px";var ag=document.elementsFromPoint(ak.pageX,ak.pageY);var ad=null;var Z=false;for(var al=0;al<ag.length;al++){var S=ag[al];if(ab._dragDetails.feedback.contains(S)){continue}if(S.classList.contains("jqx-layout-tab-strip")){if(ab._dragDetails.element.contains(S)){continue}ad=S.parentElement;Z=true;break}if((S.parentElement===ab._dragDetails.parent||S===ab._dragDetails.parent)&&ab._dragDetails.layoutGroup.items.length===1){continue}if(ab._dragDetails.element.contains(S)){continue}if(S instanceof TabLayoutItem){ad=S.parentElement;break}else{if(S instanceof TabLayoutGroup){ad=S;break}}}var at=function at(aC,aF){var ay=ab.offset(aC);var aA=null;var ax=50;var aE=aF;var aw=aF;if(!aF){aw=aC.offsetWidth/3;aE=aC.offsetHeight/3}else{ax=0}var aD=[{left:ay.left,top:ay.top,right:ay.left+ax,bottom:ay.top+ax,position:"top"},{left:ay.left+ax,top:ay.top,right:ay.left+aC.offsetWidth-ax,bottom:ay.top+aE-ax,position:"top"},{left:ay.left+aC.offsetWidth-ax,top:ay.top,right:ay.left+aC.offsetWidth,bottom:ay.top+ax,position:"top"},{left:ay.left,top:ay.top+ax,right:ay.left+aw,bottom:ay.top+aC.offsetHeight-ax,position:"left"},{left:ay.left+aC.offsetWidth-aw,top:ay.top+ax,right:ay.left+aC.offsetWidth,bottom:ay.top+aC.offsetHeight-ax,position:"right"},{left:ay.left,top:ay.top+aC.offsetHeight-ax,right:ay.left+ax,bottom:ay.top+aC.offsetHeight,position:"bottom"},{left:ay.left+ax,top:ay.top+aC.offsetHeight-aE+ax,right:ay.left+aC.offsetWidth-ax,bottom:ay.top+aC.offsetHeight,position:"bottom"},{left:ay.left+aC.offsetWidth-ax,top:ay.top+aC.offsetHeight-ax,right:ay.left+aC.offsetWidth,bottom:ay.top+aC.offsetHeight,position:"bottom"}];for(var az=0;az<aD.length;az++){var aB=aD[az];if(aB.left<=ak.pageX&&ak.pageX<=aB.right){if(aB.top<=ak.pageY&&ak.pageY<=aB.bottom){aA=aB.position;break}}}return aA};var af=ab.querySelector("jqx-layout-group");var av=at(af,10);var U=null;if(!av){if(!ad){ab._handleDropArea(null)}else{if(Z){if(ad!==ab._dragDetails.parent){av="center";U=ad}}else{av=at(ad)||"center";U=ad}}}else{U=af}if(U){ab._dragDetails.current=U;ab._dragDetails.position=av;ab._handleDropArea(U,av)}}if(ab._resizeDetails){var ao=Math.abs(ab._resizeDetails.clientX-ak.clientX);var an=Math.abs(ab._resizeDetails.clientY-ak.clientY);var T=ab._resizeDetails.splitter;var aq=ab._resizeDetails.item;var ap=ab._resizeDetails.itemRect;var ar=ab._resizeDetails.previousItemRect;var am=ab._resizeDetails.previousItem;var R=ab._resizeDetails.nextItemRect;var aa=ab._resizeDetails.nextItem;var P=parseInt(aq.getAttribute("min"));var ac=function ac(aw){if(aw.classList.contains("jqx-visibility-hidden")){return}aw.style.right="";aw.style.top="";aw.style.left="";aw.style.bottom=""};ac(T);ac(ab.$.splitter);T.classList.remove("error");T.classList.add("active");if(!ab._resizeDetails.dragging){if(T.classList.contains("horizontal")&&an<=5){return}else{if(T.classList.contains("vertical")&&ao<=5){return}}ab._resizeDetails.dragging=true}var aj={clientPos:"clientX",pos:"x",size:"width",near:"left",far:"right",offsetSize:"offsetWidth"};if(T.classList.contains("horizontal")){aj={clientPos:"clientY",pos:"y",size:"height",near:"top",far:"bottom",offsetSize:"offsetHeight"}}var W=function W(ax){var ay=ab.offset(ax);var aw=ab.offset(ab);aw.left++;aw.top++;ab.$.splitter.style.width=ax.offsetWidth+"px";ab.$.splitter.style.height=ax.offsetHeight+"px";ab.$.splitter.className=ax.className;ab.$.splitter.style.left=ay.left-aw.left+"px";ab.$.splitter.style.top=ay.top-aw.top+"px";ax.setAttribute("drag","");ab.$.splitter.setAttribute("drag","")};if(T.classList.contains("last")){var V=ak[aj.clientPos]-ab._resizeDetails.splitterRect[aj.pos];var Y=ap[aj.size]-P;if(V>Y){V=Y;T.classList.add("error")}if(ar){var P=parseInt(am.getAttribute("min"));var X=ar[aj.size]-P;if(V<-X){V=-X;T.classList.add("error")}}T.style[aj.near]=V+"px";var O=aq[aj.offsetSize]-V;aq.setAttribute("size",O);if(am){var ae=aq[aj.offsetSize]+am[aj.offsetSize]-O;am.setAttribute("size",ae)}}else{var V=-ak[aj.clientPos]+ab._resizeDetails.splitterRect[aj.pos];var X=ap[aj.size]-P;if(V>X){V=X;T.classList.add("error")}if(R){var P=parseInt(aa.getAttribute("min"));var Y=-R[aj.size]+P;if(V<Y){V=Y;T.classList.add("error")}}T.style[aj.far]=V+"px";var O=aq[aj.offsetSize]-V;aq.setAttribute("size",O);if(aa){var ah=aa[aj.offsetSize]+aq[aj.offsetSize]-O;aa.setAttribute("size",ah)}}W(T)}}},{key:"_offsetTop",value:function r(O){var P=this;if(!O){return 0}return O.offsetTop+P._offsetTop(O.offsetParent)}},{key:"_offsetLeft",value:function z(O){var P=this;if(!O){return 0}return O.offsetLeft+P._offsetLeft(O.offsetParent)}},{key:"offset",value:function F(O){return{left:this._offsetLeft(O),top:this._offsetTop(O)}}},{key:"_keyUpHandler",value:function M(Q){var P=this;if(Q.key==="Escape"){if(P._dragDetails){P._dragDetails.feedback.remove();P._dragDetails.overlay.remove();P._dragDetails=null;P._handleDropArea(null)}if(P._resizeDetails){var O=P._resizeDetails;O.splitter.classList.contains("last")?O.previousItem.size=O.previousItemSize:O.nextItem.size=O.nextItem.previousItemSize;O.item.size=O.itemSize;P.refresh();P._handleItemClick(O.item);P._resizeDetails=null;return}}else{if(Q.key==="Delete"){if(P._selectedItem){P._removeLayoutItem(P._selectedItem)}}}}},{key:"_endDrag",value:function e(){var T=this;T._handleDropArea(null);if(!T._dragDetails.dragging){T._dragDetails=null;return}var V=T._dragDetails.current;var S=T._dragDetails.element;var O=T._dragDetails.position;T._handleDropArea(null);if(V){T._addTabLayoutItem(V,O,S);T._removeLayoutItem(S);if(V.parentElement&&Array.from(V.parentElement.parentElement.children).filter(function(W){if(W.classList.contains("jqx-layout-group")){return true}return false}).length===1){var R=V.parentElement;var U=R.parentElement;var P=U.parentElement;if(!(U.getAttribute("data-id")==="root"||P.getAttribute("data-id")==="root")&&P!==T){var Q=Array.from(P.children).indexOf(R.parentElement);if(Q>=0){P.insertBefore(R,P.children[Q])}else{P.appendChild(R)}U.remove()}}T.refresh();T._updateSplitter();requestAnimationFrame(function(){T.classList.add("outline");T.querySelectorAll(".jqx-element").forEach(function(W){T.dispatchEvent(new CustomEvent("resize"))})})}T.dispatchEvent(new CustomEvent("stateChange",{type:"insert",item:S}));T._dragDetails.feedback.remove();T._dragDetails.overlay.remove();T._dragDetails=null}},{key:"_documentUpHandler",value:function q(S){var R=this,O=JQX.Utilities.Core.isMobile,T=O?document.elementFromPoint(S.pageX-window.pageXOffset,S.pageY-window.pageYOffset):S.target;if(S.button===2){return}if(R._dragDetails){R._endDrag(S)}if(R._resizeDetails){var Q=R._resizeDetails;if(Q.item){Q.item.style.overflow=""}if(Q.previousItem){Q.previousItem.style.overflow=""}if(Q.nextItem){Q.nextItem.style.overflow=""}R.refresh();R._handleItemClick(Q.item);R._resizeDetails=null;window.dispatchEvent(new Event("resize"));R.querySelectorAll(".jqx-element").forEach(function(U){U.dispatchEvent(new CustomEvent("resize"))});return}if(!R.contains(T)){return}R.classList.add("outline");if(R._target&&!T.item){if(T instanceof TabLayoutItem){R._handleItemClick(T)}else{R._handleItemClick(T.closest(".jqx-layout-item"))}}if(R._target){if(R._target!==T){delete R._target;return}if(!S.button&&T.closest(".jqx-layout-buttons-container")){var P=S.target;R._handleButtonClick(P.item,P.position)}else{if(T.closest(".jqx-layout-context-menu")&&(!O&&!S.button||O)){R._handleMenuItemClick(T.closest(".jqx-layout-context-menu-item"))}}delete R._target}}},{key:"_documentSelectStartHandler",value:function t(P){var O=this;if(O._target){P.preventDefault()}}},{key:"_getDataSource",value:function o(R,W,T){var S=this;var P=[];if(!T){T=0}if(!W){W=""}for(var Q=0;Q<R.length;Q++){var O=R[Q];var V={label:O.label,id:O.getAttribute("data-id"),orientation:O.orientation,size:O.size,min:O.min,type:O.type,modifiers:O.modifiers,position:O.position};O.removeAttribute("index");if(O instanceof LayoutGroup){P.push(V);V.index=W!==""?W+"."+T:T.toString();O.setAttribute("index",V.index);if(O.items){var U=S._getDataSource(O.items,V.index,0);V.items=U}}else{if(O instanceof LayoutItem){if(O.items){var U=S._getDataSource(O.items,W,T);P=P.concat(U)}else{V.index=W!==""?W+"."+T:T.toString();O.setAttribute("index",V.index);P.push(V)}}}T++}return P}},{key:"_getLayout",value:function K(){var S=this;var V=!arguments.length?S.$.itemsContainer:arguments[0];if(S._buttons){S._buttons.remove()}if(S._dropArea){S._dropArea.remove()}var R=S.querySelectorAll(".jqx-layout-splitter");for(var P=0;P<R.length;P++){var U=R[P];if(U!==S.$.splitter){U.remove()}}V.items=Array.from(V.children);V.items=V.items.filter(function(W){return W!==V.tabs&&W.hasAttribute("data-id")});var O=V.items.map(function(X){if(X.classList.contains("jqx-layout-tab-strip")){return null}var W=X;var Y=X instanceof LayoutGroup?X:null;if(Y){W.items=S._getLayout(Y)}return W});if(V!==S.$.itemsContainer){return O.filter(function(W){return W!==null&&W!==V.tabs})}var T=[];var Q=V;Q.items=O.filter(function(W){return W!==null&&W!==V.tabs});T.push(Q);return T}},{key:"_updateSplitter",value:function l(){var R=this;if(R._buttons&&R._dragDetails){R._buttons.remove()}R._removeSplitter();var O=R.querySelectorAll("[data-id]");for(var P=0;P<O.length;P++){var Q=O[P];if(Q.getAttribute("data-id")==="root"){continue}if(Q.hasAttribute("role")){var S=Q.getAttribute("role");if(S==="gridcell"||S==="row"||S==="columnheader"||S==="rowheader"){continue}}Q.setAttribute("hover","");R._handleSplitter(Q)}}},{key:"_hideSplitter",value:function h(){var R=this;var O=R.querySelectorAll("[data-id]");for(var P=0;P<O.length;P++){var Q=O[P];Q.removeAttribute("hover")}}},{key:"_removeSplitter",value:function x(){var Q=this;var P=Q.querySelectorAll(".jqx-layout-splitter");for(var O=0;O<P.length;O++){var R=P[O];if(R!==Q.$.splitter){R.remove()}}Q._hideSplitter()}},{key:"_handleItemClick",value:function I(R){var Q=this,O=Q.selectedIndex;var P=null;if(!R){Q.selectedIndex=null;Q.querySelectorAll("[data-id]").forEach(function(S){S.removeAttribute("selected")});Q._selectedItem=null;return}else{P=R instanceof HTMLElement?R:Q.querySelector("[data-id="+R.id+"]");if(P&&P.readonly){Q.selectedIndex=null;return}Q.querySelectorAll("[data-id]").forEach(function(S){S.removeAttribute("selected")});if(!P){Q.refresh();return}Q.selectedIndex=P.getAttribute("index");P.setAttribute("selected","");P.setAttribute("hover","");Q._selectedItem=P;if(P.classList.contains("jqx-hidden")){Q.refresh()}Q._handleButtonsVisibility(P);if(O!==Q.selectedIndex){Q.dispatchEvent(new CustomEvent("change"))}}Q._updateSplitter()}},{key:"_handleButtonClick",value:function n(R,O){var Q=this,P=Q._addLayoutItem(R,O);Q.dispatchEvent(new CustomEvent("stateChange",{type:"insert",item:P}));Q._handleItemClick(P,true)}},{key:"_removeLayoutItem",value:function k(R){var Q=this;if(R.getAttribute("data-id")==="root"){return}if(R instanceof LayoutItem&&R.parentElement.items.length===1){var P=R.parentElement;var O=P;while(P&&P.items&&P.items.length===1){if(P.getAttribute("data-id")==="root"){break}O=P;P=P.parentElement}if(O.getAttribute("data-id")!=="root"){O.remove()}else{if(Q.allowLiveSplit){O.appendChild(document.createElement("jqx-layout-item"))}}}else{R.remove()}Q.refresh();Q.dispatchEvent(new CustomEvent("stateChange",{type:"delete",item:R}))}},{key:"refresh",value:function N(){var Q=this;if(Q._isUpdating){return}Q.dataSource=Q._getDataSource(Q._getLayout());Q.$.splitter.className="jqx-visibility-hidden jqx-layout-splitter";var R=function R(ab){var ae=Q.getItem(ab.getAttribute("index"));if(!ae){return}ab.style.gridTemplateColumns="";ab.style.gridTemplateRows="";var ac="";var S=0;var Y=0;if(ab instanceof TabLayoutGroup){if(ab.tabs){ab.tabs.remove()}var X=document.createElement("div");X.classList.add("jqx-layout-tab-strip");if(Q._selectedItem&&ab.contains(Q._selectedItem)&&Q._selectedItem instanceof TabLayoutItem){ab.selectedIndex=Math.max(0,ab.items.indexOf(Q._selectedItem))}if(ab.selectedIndex>=ab.children.length){ab.selectedIndex=0}for(var W=0;W<ab.children.length;W++){var T=ab.children[W];var Z=Q.getItem(T.getAttribute("index"));if(!Z){continue}var U=document.createElement("div");U.classList.add("jqx-layout-tab");U.innerHTML="<label>"+Z.label+'</label><span class="jqx-close-button"></span>';X.appendChild(U);T.setAttribute("tab","");T.classList.add("jqx-hidden");U.content=T;U.item=Z;U.group=ae;if(T.modifiers){if(T.modifiers.indexOf("close")===-1){U.querySelector(".jqx-close-button").classList.add("jqx-hidden")}}else{U.querySelector(".jqx-close-button").classList.add("jqx-hidden")}if(undefined===ab.selectedIndex||W===ab.selectedIndex){U.classList.add("selected");T.classList.remove("jqx-hidden");ab.selectedIndex=W}U.onpointerup=function(ag){if(ag.target.classList.contains("jqx-close-button")&&U.close){ab.selectedIndex=0;Q._removeLayoutItem(Q._selectedItem);Q._handleItemClick(parent)}};U.onpointerdown=function(ah){var ag=this.closest(".jqx-layout-group");Q._handleItemClick(this.content);U.close=false;if(!ah.target.classList.contains("jqx-close-button")){if(Z.modifiers&&Z.modifiers.indexOf("drag")>=0&&ag.modifiers.indexOf("drag")>=0){Q._beginDrag(ag,this,ah)}}else{U.close=true}}}ab.tabs=X;if(ae.position==="top"||ae.position==="left"){ab.insertBefore(X,ab.firstChild)}else{ab.appendChild(X)}}else{for(var W=0;W<ab.children.length;W++){var T=ab.children[W];if(T.hasAttribute("size")){var af=T.getAttribute("size");var V=parseFloat(af);var aa=ab.orientation==="vertical"?ab.offsetWidth:ab.offsetHeight;var ad=af.indexOf("%")>=0?parseFloat(af):parseFloat(V/aa*100);S+=ad;Y++;if(Y===ab.children.length){if(S<100){ac+="1fr ";S=100;continue}else{if(S>100){S-=ad;ad=100-S;S=100}}}else{if(S>100||ad===0){Y=ab.children.length;S=0;break}}ac+=ad+"% ";continue}ac+="1fr "}if(Y===ab.children.length){if(S<99||S>100){ac="";for(var W=0;W<ab.children.length;W++){var T=ab.children[W];T.removeAttribute("size");ac+="1fr "}}}if(ab.orientation==="vertical"){ab.style.gridTemplateColumns=ac}else{ab.style.gridTemplateRows=ac}}ab.items=Array.from(ab.children);ab.items=ab.items.filter(function(ag){return ag!==ab.tabs})};var P=Q.querySelectorAll(".jqx-layout-group");for(var O=0;O<P.length;O++){R(P[O])}}},{key:"_beginDrag",value:function A(W,S,O){var T=this;if(T._dragDetails){T._dragDetails.feedback.remove()}var P=document.createElement("div");var Q=document.createElement("div");var U=W.querySelector(".jqx-layout-tab-strip");var V="";if(U){for(var R=0;R<Array.from(U.children).length;R++){if(R===W.selectedIndex){V=U.children[R].innerText}}}P.innerHTML='<jqx-split-layout><jqx-tab-layout-group><jqx-tab-layout-item label="'.concat(V,'"></jqx-tab-layout-item></jqx-tab-layout-group></jqx-split-layout>');T._feedback=P;T._feedback.classList.add("jqx-split-layout-feedback","jqx-split-layout","jqx-widget");Q.classList.add("jqx-split-layout-overlay");T._dragDetails={element:S.content,item:S.item,layoutGroup:S.group,parent:W,overlay:Q,feedback:P,pageX:O.pageX,pageY:O.pageY}}},{key:"moveChildren",value:function v(Q,O){O.innerHTML="";var P=Q;while(P.firstChild){var R=P.firstChild;O.appendChild(R)}}},{key:"createLayoutItem",value:function d(R,O){var S=this;var P=function P(){var V=document.createElement("jqx-layout-item");V.innerHTML="";S.dispatchEvent(new CustomEvent("createItem",{type:"layoutItem",item:V}));return V};var U=function U(){var V=document.createElement("jqx-tab-layout-item");V.innerHTML="";S.dispatchEvent(new CustomEvent("createItem",{type:"tabLayoutItem",item:V}));return V};var T=function T(V){var X=document.createElement("jqx-layout-group");var W=V==="top"||V==="bottom"?"horizontal":"vertical";S.dispatchEvent(new CustomEvent("createGroup",{type:"layoutGroup",item:X}));X.setAttribute("orientation",W);X.orientation=W;return X};var Q=function Q(V){var X=document.createElement("jqx-tab-layout-group");var W=V==="top"||V==="bottom"?"horizontal":"vertical";X.setAttribute("orientation",W);X.orientation=W;S.dispatchEvent(new CustomEvent("tabLayoutGroup",{type:"layoutGroup",item:X}));return X};if(R==="layoutItem"||!R){return P()}else{if(R==="tabLayoutItem"||!R){return U()}else{if(R==="tabLayoutGroup"){return Q(O)}else{return T(O)}}}}},{key:"_addTabLayoutItem",value:function b(S,T,Q){var W=this;var U=W.createLayoutItem("tabLayoutItem");var R=S.closest("jqx-tab-layout-group");var X;if(Q){U.label=Q.label;U.modifiers=Q.modifiers;W.moveChildren(Q,U)}var Z=function Z(ab){for(var aa=0;aa<ab.children.length;aa++){var ac=ab.children[aa];ac.removeAttribute("size")}ab.removeAttribute("size")};var P=function P(aa){S.removeAttribute("size");if(S.querySelector("jqx-layout-group")){W._addLayoutItem(S.querySelector("jqx-layout-group"),aa)}else{X=W.createLayoutItem("layoutGroup",aa);var ab=W.createLayoutItem();W.moveChildren(S,ab);if(aa==="top"||aa==="left"){X.appendChild(W.createLayoutItem());X.appendChild(ab)}else{X.appendChild(ab);X.appendChild(W.createLayoutItem())}S.appendChild(X)}};var O=function O(ab,aa){var ac=S.parentElement;var ad=S;var ae=W.createLayoutItem("layoutGroup",aa);ac.insertBefore(ae,ad);if(aa==="top"||aa==="left"){ae.append(ab);ae.appendChild(ad)}else{ae.appendChild(ad);ae.append(ab)}if(ad.getAttribute("data-id")==="root"){ad.setAttribute("data-id",ae.getAttribute("data-id"));ae.setAttribute("data-id","root");W.$.itemsContainer=ae}Z(ad);Z(ac)};if(Q){switch(T){case"center":if(S instanceof TabLayoutGroup||S instanceof TabLayoutItem){R.appendChild(U)}else{var V=W.createLayoutItem("tabLayoutGroup","top");V.appendChild(U);if(S instanceof LayoutGroup&&!(S instanceof TabLayoutItem)){S.appendChild(V);Z(S)}else{if(S instanceof LayoutItem){X=W.createLayoutItem("layoutGroup");S.parentElement.insertBefore(X,S);X.appendChild(S);X.appendChild(V);Z(X)}}}break;case"left":case"right":var V=W.createLayoutItem("tabLayoutGroup","top");V.appendChild(U);if(S.getAttribute("data-id")==="root"){V.position=T;O(V,T)}else{O(V,T)}break;case"top":case"bottom":var V=W.createLayoutItem("tabLayoutGroup","top");V.appendChild(U);if(S.getAttribute("data-id")==="root"){V.position=T;O(V,T)}else{O(V,T)}break}return}switch(T){case"center":if(S instanceof TabLayoutGroup||S instanceof TabLayoutItem){R.appendChild(U)}else{P()}break;case"left":case"right":if(S instanceof TabLayoutGroup){var Y=S.querySelector("jqx-tab-layout-item");if(Y&&T==="left"){S.insertBefore(U,Y)}else{S.appendChild(U)}}else{if(S instanceof TabLayoutItem){var V=W.createLayoutItem("tabLayoutGroup","top");var R=S.parentElement;V.appendChild(U);X=W.createLayoutItem("layoutGroup");R.parentElement.insertBefore(X,R);if(T==="right"){X.appendChild(R);X.appendChild(V)}else{if(T==="left"){X.appendChild(V);X.appendChild(R)}}}else{if(Q){var V=W.createLayoutItem("tabLayoutGroup","top");V.appendChild(U);if(S instanceof LayoutGroup){S.insertBefore(S.firstChild,V)}else{if(S instanceof LayoutItem){X=W.createLayoutItem("layoutGroup");X.orientation=R.orientation;X.setAttribute("orientation",R.orientation);S.removeAttribute("size");S.parentElement.insertBefore(X,S);X.appendChild(S);X.appendChild(V)}}}else{P(T)}}}break;case"top":case"bottom":if(S instanceof TabLayoutGroup){X=W.createLayoutItem("layoutGroup","top");S.removeAttribute("size");S.parentElement.insertBefore(X,S);if(T==="top"){X.appendChild(W.createLayoutItem());X.appendChild(S)}else{X.appendChild(S);X.appendChild(W.createLayoutItem())}}else{P(T)}break}W.refresh()}},{key:"_addLayoutItem",value:function E(R,S,O){var W=this;if(!R){return}var Z=function Z(ab){for(var aa=0;aa<ab.children.length;aa++){var ac=ab.children[aa];ac.removeAttribute("size")}ab.removeAttribute("size")};var Y=R instanceof TabLayoutItem||R instanceof TabLayoutGroup||O&&O instanceof TabLayoutItem;if(Y){return W._addTabLayoutItem(R,S,O)}var U=W.createLayoutItem();var P=R.closest(".jqx-layout-group");var X;if(O){W.moveChildren(O,U)}if(S==="center"){if(R instanceof LayoutGroup){X=P;X.appendChild(U);Z(X);W.refresh();return U}else{if(R instanceof LayoutItem){X=W.createLayoutItem("layoutGroup");X.orientation=P.orientation;X.setAttribute("orientation",P.orientation);R.removeAttribute("size");R.parentElement.insertBefore(X,R);X.appendChild(R);X.appendChild(U);W.refresh();return X}}}if(P.orientation==="vertical"&&(S==="left"||S==="right")||P.orientation==="horizontal"&&(S==="top"||S==="bottom")){X=P;if(R instanceof LayoutGroup){if(S==="left"||S==="top"){X.insertBefore(U,X.children[0])}else{X.appendChild(U)}Z(R)}else{var T=X.items,Q=Math.max(0,T.indexOf(R)+(S==="top"||S==="left"?0:1));X.insertBefore(U,T[Q]);Z(X)}}else{if(R instanceof LayoutGroup){var P=R.parentElement;X=R;var V=W.createLayoutItem("layoutGroup",S);P.insertBefore(V,X);if(S==="top"||S==="left"){V.append(U);V.appendChild(X)}else{V.appendChild(X);V.append(U)}if(X.getAttribute("data-id")==="root"){X.setAttribute("data-id",V.getAttribute("data-id"));V.setAttribute("data-id","root");W.$.itemsContainer=V}Z(P)}else{X=W.createLayoutItem("layoutGroup",S);P.insertBefore(X,R);if(S==="top"||S==="left"){X.appendChild(U);X.appendChild(R)}else{X.appendChild(R);X.appendChild(U)}Z(X)}}W.refresh();return U}},{key:"_handleButtonsVisibility",value:function a(T){var S=this;if(!S._buttons){S._buttons=document.createElement("div");S._buttons.classList.add("jqx-layout-buttons-container");S._buttons.innerHTML='<div role="button" position="top"></div>\n <div role="button" position="bottom"></div>\n <div role="button" position="center"></div>\n <div role="button" position="left"></div>\n <div role="button" position="right"></div>'}if(!T){if(S._buttons.parentElement){S._buttons.parentElement.removeChild(S._buttons);return}}if(T){var Q=T._buttonPosition||[],R=S._buttons.children;for(var O=0;O<R.length;O++){var P=R[O];P.position=P.getAttribute("position");P.item=T;Q.length&&Q.indexOf(P.getAttribute("position"))<0?P.classList.add("jqx-hidden"):P.classList.remove("jqx-hidden");P.onmouseenter=function(){P.setAttribute("hover","")};P.onmouseleave=function(){P.removeAttribute("hover")}}if(S.allowLiveSplit&&S._buttons.parentElement!==T){T.appendChild(S._buttons)}}}},{key:"_handleDropArea",value:function f(R){var O=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"center";var Q=this;var P=function P(T){var S=50;switch(T){case"left":Q._dropArea.style.top="0px";Q._dropArea.style.left="0px";Q._dropArea.style.width=S+"%";Q._dropArea.style.height="100%";break;case"right":Q._dropArea.style.top="0px";Q._dropArea.style.left="calc(100% - ".concat(S,"%)");Q._dropArea.style.width=S+"%";Q._dropArea.style.height="100%";break;case"top":Q._dropArea.style.top="0px";Q._dropArea.style.left="0px";Q._dropArea.style.width="100%";Q._dropArea.style.height=S+"%";break;case"bottom":Q._dropArea.style.top="calc(100% - ".concat(S,"%)");Q._dropArea.style.left="0px";Q._dropArea.style.width="100%";Q._dropArea.style.height=S+"%";break;case"center":Q._dropArea.style.top="0px";Q._dropArea.style.left="0px";Q._dropArea.style.width="100%";Q._dropArea.style.height="100%";break}};if(Q._dropArea&&Q._dropArea.parentElement===R){P(O);return}if(Q._dropArea){Q._dropArea.remove()}if(!Q._dragDetails||!R){return}Q._dropArea=document.createElement("div");Q._dropArea.classList.add("jqx-layout-drop-area");R.appendChild(Q._dropArea);Q._dropArea.style.opacity=1;P(O)}},{key:"_handleSplitter",value:function m(R){var Q=this;if(!R){return}if(R.hasAttribute("tab")){R=R.parentElement}if(R._splitter){R._splitter.remove()}if(!R._splitter){R._splitter=document.createElement("div")}if(Q._dragDetails&&Q._dragDetails.dragging){R._splitter.remove();return}if(R.modifiers.indexOf("resize")===-1){return}R.appendChild(R._splitter);var P=R.parentElement;if(P){R._splitter.className="jqx-layout-splitter";R._splitter.item=R;R._splitter.removeAttribute("drag");var O=P.orientation;if(R.nextElementSibling&&R.nextElementSibling.hasAttribute("data-id")){R._splitter.classList.add(O)}else{if(R.previousElementSibling&&R.previousElementSibling.hasAttribute("data-id")){R._splitter.classList.add(O);R._splitter.classList.add("last")}}var S=function S(T){T.style.top="";T.style.left="";T.style.bottom="";T.style.right="";T.onpointerdown=function(V){var U=V.target.item;U.style.overflow="hidden";Q._resizeDetails={splitter:V.target,splitterRect:V.target.getBoundingClientRect(),itemRect:U.getBoundingClientRect(),item:U,itemSize:U.size,group:U.parentElement,clientX:V.clientX,clientY:V.clientY};if(Q._selectedItem!==U){Q.querySelectorAll("[data-id]").forEach(function(W){W.removeAttribute("selected")});Q.selectedIndex=U.getAttribute("index");U.setAttribute("selected","");Q._selectedItem=U;Q._handleButtonsVisibility(U)}if(U.previousElementSibling&&U.previousElementSibling.hasAttribute("data-id")){Q._resizeDetails.previousItemRect=U.previousElementSibling.getBoundingClientRect();Q._resizeDetails.previousItem=U.previousElementSibling;Q._resizeDetails.previousItemSize=U.previousElementSibling.size;Q._resizeDetails.previousItem.style.overflow="hidden"}else{Q._resizeDetails.previousItemRect=null;Q._resizeDetails.previousItem=null}if(U.nextElementSibling&&U.nextElementSibling.hasAttribute("data-id")){Q._resizeDetails.nextItemRect=U.nextElementSibling.getBoundingClientRect();Q._resizeDetails.nextItem=U.nextElementSibling;Q._resizeDetails.nextItemSize=U.nextElementSibling.size;Q._resizeDetails.nextItem.style.overflow="hidden"}else{Q._resizeDetails.nextItemRect=null;Q._resizeDetails.nextItem=null}}};S(R._splitter)}}}]);return i}(_wrapNativeSuper(HTMLElement));customElements.define("jqx-layout-group",LayoutGroup);customElements.define("jqx-layout-item",LayoutItem);customElements.define("jqx-tab-layout-group",TabLayoutGroup);customElements.define("jqx-tab-layout-item",TabLayoutItem);customElements.define("jqx-split-layout",SplitLayout);
8
+ /* eslint-disable */
9
+
10
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
11
+
12
+ function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
13
+
14
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
15
+
16
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
+
18
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
19
+
20
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
21
+
22
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
23
+
24
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
25
+
26
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
27
+
28
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
29
+
30
+ function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
31
+
32
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
33
+
34
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
35
+
36
+ function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
37
+
38
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
39
+
40
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
+
42
+ /* tslint:disable */
43
+
44
+ /* eslint-disable */
45
+ if (!window.JQX) {
46
+ window.JQX = {
47
+ Utilities: {
48
+ Core: {
49
+ isMobile: function isMobile() {
50
+ var isMobile = /(iphone|ipod|ipad|android|iemobile|blackberry|bada)/.test(window.navigator.userAgent.toLowerCase());
51
+
52
+ var iOS = function iOS() {
53
+ return ['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(navigator.platform) // iPad on iOS 13 detection
54
+ || navigator.userAgent.includes('Mac') && 'ontouchend' in document;
55
+ };
56
+
57
+ if (!isMobile) {
58
+ return iOS();
59
+ }
60
+
61
+ return isMobile;
62
+ }
63
+ }
64
+ }
65
+ };
66
+ }
67
+
68
+ var LayoutItem = /*#__PURE__*/function (_HTMLElement) {
69
+ "use strict";
70
+
71
+ _inherits(LayoutItem, _HTMLElement);
72
+
73
+ var _super = _createSuper(LayoutItem);
74
+
75
+ function LayoutItem() {
76
+ var _this;
77
+
78
+ _classCallCheck(this, LayoutItem);
79
+
80
+ _this = _super.call(this);
81
+ _this._properties = {
82
+ 'min': 50,
83
+ 'label': 'Item',
84
+ 'modifiers': ['resize', 'drag', 'close'],
85
+ 'size': null
86
+ };
87
+ return _this;
88
+ }
89
+
90
+ _createClass(LayoutItem, [{
91
+ key: "_setProperty",
92
+ value: function _setProperty(property, value) {
93
+ var that = this;
94
+
95
+ if (that._properties[property] === value) {
96
+ return;
97
+ }
98
+
99
+ that._properties[property] = value;
100
+ that._updating = true;
101
+
102
+ if (property === 'disabled' || property === 'modifiers') {
103
+ if (value) {
104
+ that.setAttribute(property, value);
105
+ } else {
106
+ that.removeAttribute(property);
107
+ }
108
+ } else {
109
+ if (value === null) {
110
+ that.removeAttribute(property);
111
+ } else {
112
+ that.setAttribute(property, value);
113
+ }
114
+ }
115
+
116
+ if (!that.isCompleted) {
117
+ return;
118
+ }
119
+
120
+ var layout = that.closest('jqx-layout');
121
+
122
+ if (layout) {
123
+ if (!layout._resizeDetails && !layout._updating && layout.isRendered) {
124
+ layout.refresh();
125
+ }
126
+ }
127
+
128
+ that._updating = false;
129
+ }
130
+ }, {
131
+ key: "label",
132
+ get: function get() {
133
+ return this._properties['label'];
134
+ },
135
+ set: function set(value) {
136
+ this._setProperty('label', value);
137
+ }
138
+ }, {
139
+ key: "modifiers",
140
+ get: function get() {
141
+ return this._properties['modifiers'];
142
+ },
143
+ set: function set(value) {
144
+ this._setProperty('modifiers', value);
145
+ }
146
+ }, {
147
+ key: "min",
148
+ get: function get() {
149
+ return this._properties['min'];
150
+ },
151
+ set: function set(value) {
152
+ this._setProperty('min', value);
153
+ }
154
+ }, {
155
+ key: "size",
156
+ get: function get() {
157
+ return this._properties['size'];
158
+ },
159
+ set: function set(value) {
160
+ if (value !== null) {
161
+ if (typeof value === 'string') {
162
+ this._setProperty('size', value);
163
+ } else {
164
+ this._setProperty('size', Math.max(this.min, value));
165
+ }
166
+ } else {
167
+ this._setProperty('size', value);
168
+ }
169
+ }
170
+ }, {
171
+ key: "attributeChangedCallback",
172
+ value: function attributeChangedCallback(name, oldValue, newValue) {
173
+ var that = this;
174
+
175
+ if (oldValue === newValue) {
176
+ return;
177
+ }
178
+
179
+ if (!that.isCompleted) {
180
+ return;
181
+ }
182
+
183
+ if (name === 'size') {
184
+ if (!that._updating) {
185
+ if (newValue === null) {
186
+ this[name] = null;
187
+ return;
188
+ }
189
+
190
+ that[name] = Math.max(that.min, parseInt(newValue));
191
+ }
192
+ } else {
193
+ that[name] = newValue;
194
+ }
195
+ }
196
+ }, {
197
+ key: "connectedCallback",
198
+ value: function connectedCallback() {
199
+ if (!this.isCompleted) {
200
+ this.render();
201
+ }
202
+ }
203
+ }, {
204
+ key: "whenRendered",
205
+ value: function whenRendered(callback) {
206
+ var that = this;
207
+
208
+ if (that.isRendered) {
209
+ callback();
210
+ return;
211
+ }
212
+
213
+ if (!that.whenRenderedCallbacks) {
214
+ that.whenRenderedCallbacks = [];
215
+ }
216
+
217
+ that.whenRenderedCallbacks.push(callback);
218
+ }
219
+ }, {
220
+ key: "render",
221
+ value: function render() {
222
+ var that = this;
223
+
224
+ if (!that.hasAttribute('data-id')) {
225
+ that.setAttribute('data-id', 'id' + Math.random().toString(16).slice(2));
226
+ }
227
+
228
+ if (!that.hasAttribute('label')) {
229
+ that.setAttribute('label', that.label);
230
+ }
231
+
232
+ if (!that.hasAttribute('min')) {
233
+ that.setAttribute('min', that.min);
234
+ }
235
+
236
+ if (!that.hasAttribute('label')) {
237
+ that.setAttribute('label', that.label);
238
+ }
239
+
240
+ if (!that.hasAttribute('modifiers')) {
241
+ that.setAttribute('modifiers', that.modifiers);
242
+ }
243
+
244
+ for (var i = 0; i < that.attributes.length; i++) {
245
+ var attribute = that.attributes[i];
246
+ var attributeName = attribute.name;
247
+ var attributeValue = attribute.value;
248
+
249
+ if (!isNaN(attributeValue) && (attributeName === 'min' || attributeName === 'size')) {
250
+ that._properties[attributeName] = parseInt(attributeValue);
251
+ continue;
252
+ }
253
+
254
+ that._properties[attributeName] = attributeValue;
255
+ }
256
+
257
+ that.classList.add('jqx-layout-item');
258
+ that.isCompleted = true;
259
+
260
+ if (that.whenRenderedCallbacks) {
261
+ for (var i = 0; i < that.whenRenderedCallbacks.length; i++) {
262
+ that.whenRenderedCallbacks[i]();
263
+ }
264
+
265
+ that.whenRenderedCallbacks = [];
266
+ }
267
+ }
268
+ }], [{
269
+ key: "observedAttributes",
270
+ get: function get() {
271
+ return ['min', 'size', 'label', 'modifiers'];
272
+ }
273
+ }]);
274
+
275
+ return LayoutItem;
276
+ }( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
277
+
278
+ var LayoutGroup = /*#__PURE__*/function (_LayoutItem) {
279
+ "use strict";
280
+
281
+ _inherits(LayoutGroup, _LayoutItem);
282
+
283
+ var _super2 = _createSuper(LayoutGroup);
284
+
285
+ function LayoutGroup() {
286
+ var _this2;
287
+
288
+ _classCallCheck(this, LayoutGroup);
289
+
290
+ _this2 = _super2.call(this);
291
+ _this2._properties['label'] = 'Group';
292
+ _this2._properties['orientation'] = 'vertical';
293
+ return _this2;
294
+ }
295
+
296
+ _createClass(LayoutGroup, [{
297
+ key: "orientation",
298
+ get: function get() {
299
+ return this._properties.orientation;
300
+ },
301
+ set: function set(value) {
302
+ this._setProperty('orientation', value);
303
+ }
304
+ }, {
305
+ key: "render",
306
+ value: function render() {
307
+ var that = this;
308
+
309
+ _get(_getPrototypeOf(LayoutGroup.prototype), "render", this).call(this);
310
+
311
+ that.className = 'jqx-layout-group';
312
+
313
+ if (!that.hasAttribute('orientation')) {
314
+ that.setAttribute('orientation', that._properties['orientation']);
315
+ } else {
316
+ that._properties['orientation'] = that.getAttribute('orientation');
317
+ }
318
+ }
319
+ }], [{
320
+ key: "observedAttributes",
321
+ get: function get() {
322
+ return ['min', 'size', 'modifiers', 'orientation', 'position'];
323
+ }
324
+ }]);
325
+
326
+ return LayoutGroup;
327
+ }(LayoutItem);
328
+
329
+ var TabLayoutGroup = /*#__PURE__*/function (_LayoutGroup) {
330
+ "use strict";
331
+
332
+ _inherits(TabLayoutGroup, _LayoutGroup);
333
+
334
+ var _super3 = _createSuper(TabLayoutGroup);
335
+
336
+ function TabLayoutGroup() {
337
+ var _this3;
338
+
339
+ _classCallCheck(this, TabLayoutGroup);
340
+
341
+ _this3 = _super3.call(this);
342
+ _this3._properties['position'] = 'top';
343
+ _this3._properties['label'] = 'TabGroup';
344
+ return _this3;
345
+ }
346
+
347
+ _createClass(TabLayoutGroup, [{
348
+ key: "position",
349
+ get: function get() {
350
+ return this._properties.position;
351
+ },
352
+ set: function set(value) {
353
+ this._setProperty('position', value);
354
+ }
355
+ }, {
356
+ key: "render",
357
+ value: function render() {
358
+ var that = this;
359
+
360
+ _get(_getPrototypeOf(TabLayoutGroup.prototype), "render", this).call(this);
361
+
362
+ if (!that.hasAttribute('position') && that.position) {
363
+ that.setAttribute('position', 'top');
364
+ }
365
+ }
366
+ }], [{
367
+ key: "observedAttributes",
368
+ get: function get() {
369
+ return ['min', 'size', 'modifiers', 'orientation', 'position'];
370
+ }
371
+ }]);
372
+
373
+ return TabLayoutGroup;
374
+ }(LayoutGroup);
375
+
376
+ var TabLayoutItem = /*#__PURE__*/function (_LayoutGroup2) {
377
+ "use strict";
378
+
379
+ _inherits(TabLayoutItem, _LayoutGroup2);
380
+
381
+ var _super4 = _createSuper(TabLayoutItem);
382
+
383
+ function TabLayoutItem() {
384
+ var _this4;
385
+
386
+ _classCallCheck(this, TabLayoutItem);
387
+
388
+ _this4 = _super4.call(this);
389
+ _this4._properties['label'] = 'TabItem';
390
+ return _this4;
391
+ }
392
+
393
+ return TabLayoutItem;
394
+ }(LayoutGroup);
395
+
396
+ (function ($) {
397
+ "use strict";
398
+
399
+ $.jqx.jqxWidget("jqxSplitLayout", "", {});
400
+ $.extend($.jqx._jqxSplitLayout.prototype, {
401
+ defineInstance: function defineInstance() {
402
+ var settings = {
403
+ 'dataSource': null,
404
+ 'ready': null,
405
+ 'orientation': 'vertical'
406
+ };
407
+
408
+ if (this === $.jqx._jqxSplitLayout.prototype) {
409
+ return settings;
410
+ }
411
+
412
+ $.extend(true, this, settings);
413
+ return settings;
414
+ },
415
+ createInstance: function createInstance() {
416
+ var that = this;
417
+ this._properties = {
418
+ 'dataSource': null,
419
+ 'ready': null,
420
+ 'orientation': 'vertical'
421
+ };
422
+ var that = this;
423
+ that.layout = document.createElement('jqx-split-layout');
424
+ that.layout.style.width = '100%';
425
+ that.layout.style.height = '100%';
426
+ that.element.className += that.toThemeProperty("jqx-split-layout-component jqx-rc-all jqx-widget");
427
+ that.layout.dataSource = that.dataSource;
428
+ that.layout.orientation = that.orientation;
429
+ that.layout.ready = that.ready;
430
+ that.element.appendChild(that.layout);
431
+ },
432
+ propertyChangedHandler: function propertyChangedHandler(object, key, oldValue, value) {
433
+ var that = object;
434
+
435
+ if (oldValue != value || value instanceof Object) {
436
+ if (!that.layout) {
437
+ return;
438
+ }
439
+
440
+ that.layout[key] = value;
441
+ }
442
+ },
443
+ render: function render() {
444
+ var that = this;
445
+
446
+ if (!that.layout) {
447
+ return;
448
+ }
449
+
450
+ that.layout.render();
451
+ },
452
+ refresh: function refresh() {
453
+ var that = this;
454
+
455
+ if (!that.layout) {
456
+ return;
457
+ }
458
+
459
+ if (!that.layout.isRendered) {
460
+ return;
461
+ }
462
+
463
+ that.layout.refresh();
464
+ },
465
+ dataBind: function dataBind() {
466
+ var that = this;
467
+
468
+ if (!that.layout) {
469
+ return;
470
+ }
471
+
472
+ that.layout.dataBind();
473
+ }
474
+ });
475
+ })(jqxBaseFramework);
476
+
477
+ var SplitLayout = /*#__PURE__*/function (_HTMLElement2) {
478
+ "use strict";
479
+
480
+ _inherits(SplitLayout, _HTMLElement2);
481
+
482
+ var _super5 = _createSuper(SplitLayout);
483
+
484
+ function SplitLayout() {
485
+ var _this5;
486
+
487
+ _classCallCheck(this, SplitLayout);
488
+
489
+ _this5 = _super5.call(this);
490
+ _this5._properties = {
491
+ 'dataSource': null,
492
+ 'orientation': 'vertical'
493
+ };
494
+ return _this5;
495
+ }
496
+
497
+ _createClass(SplitLayout, [{
498
+ key: "orientation",
499
+ get: function get() {
500
+ return this._properties['orientation'];
501
+ },
502
+ set: function set(value) {
503
+ this._properties['orientation'] = value;
504
+ }
505
+ }, {
506
+ key: "dataSource",
507
+ get: function get() {
508
+ return this._properties['dataSource'];
509
+ },
510
+ set: function set(value) {
511
+ this._properties['dataSource'] = value;
512
+ }
513
+ }, {
514
+ key: "_dragStart",
515
+ value: function _dragStart(event) {
516
+ event.stopPropagation();
517
+ event.preventDefault();
518
+ }
519
+ }, {
520
+ key: "_leaveHandler",
521
+ value: function _leaveHandler() {
522
+ var that = this;
523
+
524
+ if (that._resizeDetails) {
525
+ return;
526
+ }
527
+
528
+ that._handleButtonsVisibility(null);
529
+
530
+ that._hideSplitter();
531
+
532
+ requestAnimationFrame(function () {// that.classList.remove('outline');
533
+ });
534
+ }
535
+ }, {
536
+ key: "_enterHandler",
537
+ value: function _enterHandler() {
538
+ var that = this;
539
+
540
+ if (that._resizeDetails) {
541
+ return;
542
+ }
543
+
544
+ that._handleButtonsVisibility(that._selectedItem);
545
+
546
+ that._updateSplitter();
547
+
548
+ requestAnimationFrame(function () {
549
+ that.classList.add('outline');
550
+ });
551
+ }
552
+ /**
553
+ * Element's HTML template.
554
+ */
555
+
556
+ }, {
557
+ key: "template",
558
+ value: function template() {
559
+ return '<div class="jqx-container" id="container" role="presentation"><jqx-layout-group data-id="root" id="itemsContainer"></jqx-layout-group><div root-splitter id="splitter" class="jqx-layout-splitter"></div>';
560
+ }
561
+ /**
562
+ * Updates the element when a property is changed.
563
+ * @param {string} propertyName The name of the property.
564
+ * @param {number/string} oldValue The previously entered value. Max, min and value are of type Number. The rest are of type String.
565
+ * @param {number/string} newValue The new entered value. Max, min and value are of type Number. The rest are of type String.
566
+ */
567
+
568
+ }, {
569
+ key: "propertyChangedHandler",
570
+ value: function propertyChangedHandler(propertyName, oldValue, newValue) {
571
+ var that = this;
572
+
573
+ switch (propertyName) {
574
+ case 'orientation':
575
+ if (that.$.itemsContainer) {
576
+ that.$.itemsContainer.orientation = that.orientation;
577
+ }
578
+
579
+ break;
580
+
581
+ case 'dataSource':
582
+ that.dataBind();
583
+ break;
584
+
585
+ case 'selectedIndex':
586
+ that._handleItemClick(that.getItem(newValue + ''), true);
587
+
588
+ break;
589
+
590
+ default:
591
+ _get(_getPrototypeOf(SplitLayout.prototype), "propertyChangedHandler", this).call(this, propertyName, oldValue, newValue);
592
+
593
+ break;
594
+ }
595
+ }
596
+ }, {
597
+ key: "dataBind",
598
+ value: function dataBind() {
599
+ var that = this;
600
+ that.$.itemsContainer.innerHTML = '';
601
+ var template = '';
602
+
603
+ var processDataSource = function processDataSource(dataSource, isTabLayoutGroup) {
604
+ for (var i = 0; i < dataSource.length; i++) {
605
+ var item = dataSource[i];
606
+ var size = item.size;
607
+ var min = item.min;
608
+ var modifiers = item.modifiers;
609
+ var type = item.type;
610
+ var position = item.position;
611
+ var orientation = item.orientation ? item.orientation : 'vertical';
612
+ var id = item.id;
613
+ var label = item.label;
614
+ var props = '';
615
+
616
+ if (id !== undefined) {
617
+ props += "id=\"".concat(id, "\" ");
618
+ }
619
+
620
+ if (size !== undefined) {
621
+ props += "size=\"".concat(size, "\" ");
622
+ }
623
+
624
+ if (label !== undefined) {
625
+ props += "label=\"".concat(label, "\" ");
626
+ }
627
+
628
+ if (min !== undefined) {
629
+ props += "min=\"".concat(min, "\" ");
630
+ }
631
+
632
+ if (modifiers !== undefined) {
633
+ props += "modifiers=\"".concat(modifiers, "\" ");
634
+ }
635
+
636
+ if (position !== undefined) {
637
+ props += "position=\"".concat(position, "\" ");
638
+ }
639
+
640
+ if (item.items) {
641
+ props += "orientation=".concat(orientation, " ");
642
+
643
+ if (type === 'tabs') {
644
+ template += "<jqx-tab-layout-group ".concat(props, ">");
645
+ processDataSource(item.items, true);
646
+ template += '</jqx-tab-layout-group>';
647
+ } else {
648
+ template += "<jqx-layout-group ".concat(props, ">");
649
+ processDataSource(item.items);
650
+ template += '</jqx-layout-group>';
651
+ }
652
+ } else {
653
+ var content = item.content || '';
654
+
655
+ if (isTabLayoutGroup) {
656
+ template += "<jqx-tab-layout-item ".concat(props, ">") + content + '</jqx-tab-layout-item>';
657
+ } else {
658
+ if (type === 'tabs') {
659
+ template += "<jqx-tab-layout-group>";
660
+ template += "<jqx-tab-layout-item ".concat(props, ">") + content + '</jqx-tab-layout-item>';
661
+ template += '</jqx-tab-layout-group>';
662
+ } else {
663
+ template += "<jqx-layout-item ".concat(props, ">") + content + '</jqx-layout-item>';
664
+ }
665
+ }
666
+ }
667
+ }
668
+ };
669
+
670
+ processDataSource(that.dataSource);
671
+ that.$.itemsContainer.innerHTML = template;
672
+ that.refresh();
673
+ }
674
+ /**
675
+ * Element's render funciton
676
+ */
677
+
678
+ }, {
679
+ key: "render",
680
+ value: function render() {
681
+ var that = this;
682
+ that.setAttribute('role', 'group');
683
+
684
+ if (that.selectedIndex) {
685
+ that._handleItemClick(that.getItem(that.selectedIndex + ''), true);
686
+ }
687
+
688
+ var render = function render() {
689
+ if (!that.dataSource) {
690
+ that.dataSource = that._getDataSource(that._getLayout());
691
+ } else {
692
+ that.dataBind();
693
+ }
694
+
695
+ that.$.itemsContainer.orientation = that.orientation;
696
+ that.refresh();
697
+
698
+ that._updateSplitter();
699
+
700
+ that.isRendered = true;
701
+ that.classList.add('outline');
702
+
703
+ if (that.ready) {
704
+ that.ready();
705
+ }
706
+ };
707
+
708
+ if (document.readyState === 'complete') {
709
+ render();
710
+ } else {
711
+ window.addEventListener('load', function () {
712
+ render();
713
+ });
714
+ }
715
+ }
716
+ }, {
717
+ key: "connectedCallback",
718
+ value: function connectedCallback() {
719
+ var that = this;
720
+
721
+ var setup = function setup() {
722
+ var fragment = document.createDocumentFragment();
723
+
724
+ while (that.childNodes.length) {
725
+ fragment.appendChild(that.firstChild);
726
+ }
727
+
728
+ that.innerHTML = that.template();
729
+ that.classList.add('jqx-widget');
730
+ that.$ = {
731
+ container: that.querySelector("#container"),
732
+ itemsContainer: that.querySelector("#itemsContainer"),
733
+ splitter: that.querySelector("#splitter")
734
+ };
735
+ delete that.$.container.id;
736
+ delete that.$.itemsContainer.id;
737
+ delete that.$.splitter.id;
738
+ that.$.itemsContainer.appendChild(fragment);
739
+ that.classList.add('jqx-split-layout');
740
+ document.addEventListener('pointerdown', function (event) {
741
+ that._documentDownHandler(event);
742
+ });
743
+ document.addEventListener('pointermove', function (event) {
744
+ that._documentMoveHandler(event);
745
+ });
746
+ document.addEventListener('pointerup', function (event) {
747
+ that._documentUpHandler(event);
748
+ });
749
+ document.addEventListener('selectstart', function (event) {
750
+ that._documentSelectStartHandler(event);
751
+ });
752
+ document.addEventListener('keyup', function (event) {
753
+ that._keyUpHandler(event);
754
+ });
755
+ that.addEventListener('mouseleave', function (event) {
756
+ that._leaveHandler(event);
757
+ });
758
+ that.addEventListener('mouseenter', function (event) {
759
+ that._enterHandler(event);
760
+ });
761
+ that.addEventListener('dragStart', function (event) {
762
+ that._dragStart(event);
763
+ });
764
+ that.render();
765
+ };
766
+
767
+ if (document.readyState === 'complete') {
768
+ setup();
769
+ } else {
770
+ window.addEventListener('load', function () {
771
+ setup();
772
+ });
773
+ }
774
+ }
775
+ /**
776
+ * Returns the Splitter item according to the index
777
+ * @param {any} index - string, e.g. '0.1'
778
+ */
779
+
780
+ }, {
781
+ key: "getItem",
782
+ value: function getItem(index) {
783
+ var that = this;
784
+
785
+ if (index === undefined || index === null) {
786
+ return;
787
+ }
788
+
789
+ index = (index + '').split('.');
790
+
791
+ var items = that._getDataSource(that._getLayout()),
792
+ item;
793
+
794
+ for (var i = 0; i < index.length; i++) {
795
+ item = items[index[i]];
796
+
797
+ if (!item) {
798
+ break;
799
+ }
800
+
801
+ items = item.items;
802
+ }
803
+
804
+ return item;
805
+ }
806
+ /**
807
+ * Document down handler
808
+ * @param {any} event
809
+ */
810
+
811
+ }, {
812
+ key: "_documentDownHandler",
813
+ value: function _documentDownHandler(event) {
814
+ var that = this,
815
+ target = event.target;
816
+
817
+ if (that.contains(target) && target.closest) {
818
+ that._target = target;
819
+
820
+ that._updateSplitter();
821
+ }
822
+ }
823
+ /**
824
+ * Document move handler
825
+ * @param {any} event
826
+ */
827
+
828
+ }, {
829
+ key: "_documentMoveHandler",
830
+ value: function _documentMoveHandler(event) {
831
+ var that = this,
832
+ target = event.target,
833
+ menu = that._contextMenu;
834
+
835
+ if (menu && !JQX.Utilities.Core.isMobile) {
836
+ if (menu.querySelector('.jqx-layout-context-menu-item[hover]')) {
837
+ var items = menu.children;
838
+
839
+ for (var i = 0; i < items.length; i++) {
840
+ items[i].removeAttribute('hover');
841
+ }
842
+ }
843
+
844
+ if (menu.contains(target) && target.closest && target.closest('.jqx-layout-context-menu-item')) {
845
+ target.setAttribute('hover', '');
846
+ }
847
+ }
848
+
849
+ if (that._dragDetails) {
850
+ var offsetX = Math.abs(that._dragDetails.pageX - event.pageX);
851
+ var offsetY = Math.abs(that._dragDetails.pageY - event.pageY);
852
+
853
+ if (offsetY <= 5 && offsetX <= 5) {
854
+ return;
855
+ }
856
+
857
+ if (!that._dragDetails.feedback.parentElement) {
858
+ document.body.appendChild(that._dragDetails.feedback);
859
+ document.body.appendChild(that._dragDetails.overlay);
860
+ setTimeout(function () {
861
+ that._dragDetails.feedback.classList.add('dragging');
862
+ }, 100);
863
+ }
864
+
865
+ that._dragDetails.dragging = true;
866
+ that._dragDetails.feedback.style.left = event.pageX - that._dragDetails.feedback.offsetWidth / 2 - 5 + 'px';
867
+ that._dragDetails.feedback.style.top = event.pageY - that._dragDetails.feedback.offsetHeight / 2 - 5 + 'px';
868
+ var elements = document.elementsFromPoint(event.pageX, event.pageY);
869
+ var group = null;
870
+ var isTabStrip = false;
871
+
872
+ for (var i = 0; i < elements.length; i++) {
873
+ var element = elements[i];
874
+
875
+ if (that._dragDetails.feedback.contains(element)) {
876
+ continue;
877
+ }
878
+
879
+ if (element.classList.contains('jqx-layout-tab-strip')) {
880
+ if (that._dragDetails.element.contains(element)) {
881
+ continue;
882
+ }
883
+
884
+ group = element.parentElement;
885
+ isTabStrip = true;
886
+ break;
887
+ }
888
+
889
+ if ((element.parentElement === that._dragDetails.parent || element === that._dragDetails.parent) && that._dragDetails.layoutGroup.items.length === 1) {
890
+ continue;
891
+ }
892
+
893
+ if (that._dragDetails.element.contains(element)) {
894
+ continue;
895
+ }
896
+
897
+ if (element instanceof TabLayoutItem) {
898
+ group = element.parentElement;
899
+ break;
900
+ } else if (element instanceof TabLayoutGroup) {
901
+ group = element;
902
+ break;
903
+ }
904
+ }
905
+
906
+ var getPosition = function getPosition(group, size) {
907
+ var offset = that.offset(group);
908
+ var position = null;
909
+ var edgeSize = 50;
910
+ var height = size;
911
+ var width = size;
912
+
913
+ if (!size) {
914
+ width = group.offsetWidth / 3;
915
+ height = group.offsetHeight / 3;
916
+ } else {
917
+ edgeSize = 0;
918
+ }
919
+
920
+ var positionRects = [{
921
+ left: offset.left,
922
+ top: offset.top,
923
+ right: offset.left + edgeSize,
924
+ bottom: offset.top + edgeSize,
925
+ position: 'top'
926
+ }, {
927
+ left: offset.left + edgeSize,
928
+ top: offset.top,
929
+ right: offset.left + group.offsetWidth - edgeSize,
930
+ bottom: offset.top + height - edgeSize,
931
+ position: 'top'
932
+ }, {
933
+ left: offset.left + group.offsetWidth - edgeSize,
934
+ top: offset.top,
935
+ right: offset.left + group.offsetWidth,
936
+ bottom: offset.top + edgeSize,
937
+ position: 'top'
938
+ }, {
939
+ left: offset.left,
940
+ top: offset.top + edgeSize,
941
+ right: offset.left + width,
942
+ bottom: offset.top + group.offsetHeight - edgeSize,
943
+ position: 'left'
944
+ }, {
945
+ left: offset.left + group.offsetWidth - width,
946
+ top: offset.top + edgeSize,
947
+ right: offset.left + group.offsetWidth,
948
+ bottom: offset.top + group.offsetHeight - edgeSize,
949
+ position: 'right'
950
+ }, {
951
+ left: offset.left,
952
+ top: offset.top + group.offsetHeight - edgeSize,
953
+ right: offset.left + edgeSize,
954
+ bottom: offset.top + group.offsetHeight,
955
+ position: 'bottom'
956
+ }, {
957
+ left: offset.left + edgeSize,
958
+ top: offset.top + group.offsetHeight - height + edgeSize,
959
+ right: offset.left + group.offsetWidth - edgeSize,
960
+ bottom: offset.top + group.offsetHeight,
961
+ position: 'bottom'
962
+ }, {
963
+ left: offset.left + group.offsetWidth - edgeSize,
964
+ top: offset.top + group.offsetHeight - edgeSize,
965
+ right: offset.left + group.offsetWidth,
966
+ bottom: offset.top + group.offsetHeight,
967
+ position: 'bottom'
968
+ }];
969
+
970
+ for (var i = 0; i < positionRects.length; i++) {
971
+ var rect = positionRects[i];
972
+
973
+ if (rect.left <= event.pageX && event.pageX <= rect.right) {
974
+ if (rect.top <= event.pageY && event.pageY <= rect.bottom) {
975
+ position = rect.position;
976
+ break;
977
+ }
978
+ }
979
+ }
980
+
981
+ return position;
982
+ };
983
+
984
+ var rootGroup = that.querySelector('jqx-layout-group');
985
+ var position = getPosition(rootGroup, 10);
986
+ var currentGroup = null;
987
+
988
+ if (!position) {
989
+ if (!group) {
990
+ that._handleDropArea(null);
991
+ } else {
992
+ if (isTabStrip) {
993
+ if (group !== that._dragDetails.parent) {
994
+ position = 'center';
995
+ currentGroup = group;
996
+ }
997
+ } else {
998
+ position = getPosition(group) || 'center';
999
+ currentGroup = group;
1000
+ }
1001
+ }
1002
+ } else {
1003
+ currentGroup = rootGroup;
1004
+ }
1005
+
1006
+ if (currentGroup) {
1007
+ that._dragDetails.current = currentGroup;
1008
+ that._dragDetails.position = position;
1009
+
1010
+ that._handleDropArea(currentGroup, position);
1011
+ }
1012
+ }
1013
+
1014
+ if (that._resizeDetails) {
1015
+ var offsetX = Math.abs(that._resizeDetails.clientX - event.clientX);
1016
+ var offsetY = Math.abs(that._resizeDetails.clientY - event.clientY);
1017
+ var splitter = that._resizeDetails.splitter;
1018
+ var item = that._resizeDetails.item;
1019
+ var itemRect = that._resizeDetails.itemRect;
1020
+ var previousItemRect = that._resizeDetails.previousItemRect;
1021
+ var previousItem = that._resizeDetails.previousItem;
1022
+ var nextItemRect = that._resizeDetails.nextItemRect;
1023
+ var nextItem = that._resizeDetails.nextItem;
1024
+ var minSize = parseInt(item.getAttribute('min'));
1025
+
1026
+ var resetSplitter = function resetSplitter(splitter) {
1027
+ if (splitter.classList.contains('jqx-visibility-hidden')) {
1028
+ return;
1029
+ }
1030
+
1031
+ splitter.style.right = '';
1032
+ splitter.style.top = '';
1033
+ splitter.style.left = '';
1034
+ splitter.style.bottom = '';
1035
+ };
1036
+
1037
+ resetSplitter(splitter);
1038
+ resetSplitter(that.$.splitter);
1039
+ splitter.classList.remove('error');
1040
+ splitter.classList.add('active');
1041
+
1042
+ if (!that._resizeDetails.dragging) {
1043
+ if (splitter.classList.contains('horizontal') && offsetY <= 5) {
1044
+ return;
1045
+ } else if (splitter.classList.contains('vertical') && offsetX <= 5) {
1046
+ return;
1047
+ }
1048
+
1049
+ that._resizeDetails.dragging = true;
1050
+ }
1051
+
1052
+ var normalized = {
1053
+ 'clientPos': 'clientX',
1054
+ 'pos': 'x',
1055
+ 'size': 'width',
1056
+ 'near': 'left',
1057
+ 'far': 'right',
1058
+ 'offsetSize': 'offsetWidth'
1059
+ };
1060
+
1061
+ if (splitter.classList.contains('horizontal')) {
1062
+ normalized = {
1063
+ 'clientPos': 'clientY',
1064
+ 'pos': 'y',
1065
+ 'size': 'height',
1066
+ 'near': 'top',
1067
+ 'far': 'bottom',
1068
+ 'offsetSize': 'offsetHeight'
1069
+ };
1070
+ }
1071
+
1072
+ var updateSplitter = function updateSplitter(splitter) {
1073
+ var offset = that.offset(splitter);
1074
+ var elementOffset = that.offset(that);
1075
+ elementOffset.left++;
1076
+ elementOffset.top++;
1077
+ that.$.splitter.style.width = splitter.offsetWidth + 'px';
1078
+ that.$.splitter.style.height = splitter.offsetHeight + 'px';
1079
+ that.$.splitter.className = splitter.className;
1080
+ that.$.splitter.style.left = offset.left - elementOffset.left + 'px';
1081
+ that.$.splitter.style.top = offset.top - elementOffset.top + 'px';
1082
+ splitter.setAttribute('drag', '');
1083
+ that.$.splitter.setAttribute('drag', '');
1084
+ };
1085
+
1086
+ if (splitter.classList.contains('last')) {
1087
+ var newPosition = event[normalized.clientPos] - that._resizeDetails.splitterRect[normalized.pos];
1088
+ var maxPosition = itemRect[normalized.size] - minSize;
1089
+
1090
+ if (newPosition > maxPosition) {
1091
+ newPosition = maxPosition;
1092
+ splitter.classList.add('error');
1093
+ }
1094
+
1095
+ if (previousItemRect) {
1096
+ var minSize = parseInt(previousItem.getAttribute('min'));
1097
+ var minPosition = previousItemRect[normalized.size] - minSize;
1098
+
1099
+ if (newPosition < -minPosition) {
1100
+ newPosition = -minPosition;
1101
+ splitter.classList.add('error');
1102
+ }
1103
+ }
1104
+
1105
+ splitter.style[normalized.near] = newPosition + 'px';
1106
+ var newSize = item[normalized.offsetSize] - newPosition;
1107
+ item.setAttribute('size', newSize);
1108
+
1109
+ if (previousItem) {
1110
+ var previousItemSize = item[normalized.offsetSize] + previousItem[normalized.offsetSize] - newSize;
1111
+ previousItem.setAttribute('size', previousItemSize);
1112
+ }
1113
+ } else {
1114
+ var newPosition = -event[normalized.clientPos] + that._resizeDetails.splitterRect[normalized.pos];
1115
+ var minPosition = itemRect[normalized.size] - minSize;
1116
+
1117
+ if (newPosition > minPosition) {
1118
+ newPosition = minPosition;
1119
+ splitter.classList.add('error');
1120
+ }
1121
+
1122
+ if (nextItemRect) {
1123
+ var minSize = parseInt(nextItem.getAttribute('min'));
1124
+ var maxPosition = -nextItemRect[normalized.size] + minSize;
1125
+
1126
+ if (newPosition < maxPosition) {
1127
+ newPosition = maxPosition;
1128
+ splitter.classList.add('error');
1129
+ }
1130
+ }
1131
+
1132
+ splitter.style[normalized.far] = newPosition + 'px';
1133
+ var newSize = item[normalized.offsetSize] - newPosition;
1134
+ item.setAttribute('size', newSize);
1135
+
1136
+ if (nextItem) {
1137
+ var nextItemSize = nextItem[normalized.offsetSize] + item[normalized.offsetSize] - newSize;
1138
+ nextItem.setAttribute('size', nextItemSize);
1139
+ }
1140
+ }
1141
+
1142
+ updateSplitter(splitter);
1143
+ }
1144
+ }
1145
+ }, {
1146
+ key: "_offsetTop",
1147
+ value: function _offsetTop(element) {
1148
+ var that = this;
1149
+
1150
+ if (!element) {
1151
+ return 0;
1152
+ }
1153
+
1154
+ return element.offsetTop + that._offsetTop(element.offsetParent);
1155
+ }
1156
+ }, {
1157
+ key: "_offsetLeft",
1158
+ value: function _offsetLeft(element) {
1159
+ var that = this;
1160
+
1161
+ if (!element) {
1162
+ return 0;
1163
+ }
1164
+
1165
+ return element.offsetLeft + that._offsetLeft(element.offsetParent);
1166
+ }
1167
+ }, {
1168
+ key: "offset",
1169
+ value: function offset(element) {
1170
+ return {
1171
+ left: this._offsetLeft(element),
1172
+ top: this._offsetTop(element)
1173
+ };
1174
+ }
1175
+ }, {
1176
+ key: "_keyUpHandler",
1177
+ value: function _keyUpHandler(event) {
1178
+ var that = this;
1179
+
1180
+ if (event.key === 'Escape') {
1181
+ if (that._dragDetails) {
1182
+ that._dragDetails.feedback.remove();
1183
+
1184
+ that._dragDetails.overlay.remove();
1185
+
1186
+ that._dragDetails = null;
1187
+
1188
+ that._handleDropArea(null);
1189
+ }
1190
+
1191
+ if (that._resizeDetails) {
1192
+ var drag = that._resizeDetails;
1193
+ drag.splitter.classList.contains('last') ? drag.previousItem.size = drag.previousItemSize : drag.nextItem.size = drag.nextItem.previousItemSize;
1194
+ drag.item.size = drag.itemSize;
1195
+ that.refresh();
1196
+
1197
+ that._handleItemClick(drag.item);
1198
+
1199
+ that._resizeDetails = null;
1200
+ return;
1201
+ }
1202
+ } else if (event.key === 'Delete') {
1203
+ if (that._selectedItem) {
1204
+ that._removeLayoutItem(that._selectedItem);
1205
+ }
1206
+ }
1207
+ }
1208
+ }, {
1209
+ key: "_endDrag",
1210
+ value: function _endDrag() {
1211
+ var that = this;
1212
+
1213
+ that._handleDropArea(null);
1214
+
1215
+ if (!that._dragDetails.dragging) {
1216
+ that._dragDetails = null;
1217
+ return;
1218
+ }
1219
+
1220
+ var group = that._dragDetails.current;
1221
+ var item = that._dragDetails.element;
1222
+ var position = that._dragDetails.position;
1223
+
1224
+ that._handleDropArea(null);
1225
+
1226
+ if (group) {
1227
+ that._addTabLayoutItem(group, position, item);
1228
+
1229
+ that._removeLayoutItem(item);
1230
+
1231
+ if (group.parentElement && Array.from(group.parentElement.parentElement.children).filter(function (value) {
1232
+ if (value.classList.contains('jqx-layout-group')) {
1233
+ return true;
1234
+ }
1235
+
1236
+ return false;
1237
+ }).length === 1) {
1238
+ var parent = group.parentElement;
1239
+ var parentGroup = parent.parentElement;
1240
+ var ownerGroup = parentGroup.parentElement;
1241
+
1242
+ if (!(parentGroup.getAttribute('data-id') === 'root' || ownerGroup.getAttribute('data-id') === 'root') && ownerGroup !== that) {
1243
+ var index = Array.from(ownerGroup.children).indexOf(parent.parentElement);
1244
+
1245
+ if (index >= 0) {
1246
+ ownerGroup.insertBefore(parent, ownerGroup.children[index]);
1247
+ } else {
1248
+ ownerGroup.appendChild(parent);
1249
+ }
1250
+
1251
+ parentGroup.remove();
1252
+ }
1253
+ }
1254
+
1255
+ that.refresh();
1256
+
1257
+ that._updateSplitter();
1258
+
1259
+ requestAnimationFrame(function () {
1260
+ that.classList.add('outline');
1261
+ that.querySelectorAll('.jqx-element').forEach(function (control) {
1262
+ that.dispatchEvent(new CustomEvent('resize'));
1263
+ });
1264
+ });
1265
+ }
1266
+
1267
+ that.dispatchEvent(new CustomEvent('stateChange', {
1268
+ type: 'insert',
1269
+ item: item
1270
+ }));
1271
+
1272
+ that._dragDetails.feedback.remove();
1273
+
1274
+ that._dragDetails.overlay.remove();
1275
+
1276
+ that._dragDetails = null;
1277
+ }
1278
+ /**
1279
+ * Document up handler
1280
+ * @param {any} event
1281
+ */
1282
+
1283
+ }, {
1284
+ key: "_documentUpHandler",
1285
+ value: function _documentUpHandler(event) {
1286
+ var that = this,
1287
+ isMobile = JQX.Utilities.Core.isMobile,
1288
+ target = isMobile ? document.elementFromPoint(event.pageX - window.pageXOffset, event.pageY - window.pageYOffset) : event.target;
1289
+
1290
+ if (event.button === 2) {
1291
+ return;
1292
+ }
1293
+
1294
+ if (that._dragDetails) {
1295
+ that._endDrag(event);
1296
+ }
1297
+
1298
+ if (that._resizeDetails) {
1299
+ var drag = that._resizeDetails;
1300
+
1301
+ if (drag.item) {
1302
+ drag.item.style.overflow = '';
1303
+ }
1304
+
1305
+ if (drag.previousItem) {
1306
+ drag.previousItem.style.overflow = '';
1307
+ }
1308
+
1309
+ if (drag.nextItem) {
1310
+ drag.nextItem.style.overflow = '';
1311
+ }
1312
+
1313
+ that.refresh();
1314
+
1315
+ that._handleItemClick(drag.item);
1316
+
1317
+ that._resizeDetails = null;
1318
+ window.dispatchEvent(new Event('resize'));
1319
+ that.querySelectorAll('.jqx-element').forEach(function (control) {
1320
+ control.dispatchEvent(new CustomEvent('resize'));
1321
+ });
1322
+ return;
1323
+ }
1324
+
1325
+ if (!that.contains(target)) {
1326
+ return;
1327
+ }
1328
+
1329
+ that.classList.add('outline');
1330
+
1331
+ if (that._target && !target.item) {
1332
+ if (target instanceof TabLayoutItem) {
1333
+ that._handleItemClick(target);
1334
+ } else {
1335
+ that._handleItemClick(target.closest('.jqx-layout-item'));
1336
+ }
1337
+ }
1338
+
1339
+ if (that._target) {
1340
+ if (that._target !== target) {
1341
+ delete that._target;
1342
+ return;
1343
+ }
1344
+
1345
+ if (!event.button && target.closest('.jqx-layout-buttons-container')) {
1346
+ var button = event.target;
1347
+
1348
+ that._handleButtonClick(button.item, button.position);
1349
+ } else if (target.closest('.jqx-layout-context-menu') && (!isMobile && !event.button || isMobile)) {
1350
+ that._handleMenuItemClick(target.closest('.jqx-layout-context-menu-item'));
1351
+ }
1352
+
1353
+ delete that._target;
1354
+ }
1355
+ }
1356
+ /**
1357
+ * Document Select Start event handler
1358
+ */
1359
+
1360
+ }, {
1361
+ key: "_documentSelectStartHandler",
1362
+ value: function _documentSelectStartHandler(event) {
1363
+ var that = this;
1364
+
1365
+ if (that._target) {
1366
+ event.preventDefault();
1367
+ }
1368
+ }
1369
+ /**
1370
+ * Adds labels to the items that do not have set
1371
+ * @param {any} data
1372
+ */
1373
+
1374
+ }, {
1375
+ key: "_getDataSource",
1376
+ value: function _getDataSource(layout, path, index) {
1377
+ var that = this;
1378
+ var data = [];
1379
+
1380
+ if (!index) {
1381
+ index = 0;
1382
+ }
1383
+
1384
+ if (!path) {
1385
+ path = '';
1386
+ }
1387
+
1388
+ for (var i = 0; i < layout.length; i++) {
1389
+ var layoutItem = layout[i];
1390
+ var item = {
1391
+ label: layoutItem.label,
1392
+ id: layoutItem.getAttribute('data-id'),
1393
+ orientation: layoutItem.orientation,
1394
+ size: layoutItem.size,
1395
+ min: layoutItem.min,
1396
+ type: layoutItem.type,
1397
+ modifiers: layoutItem.modifiers,
1398
+ position: layoutItem.position
1399
+ };
1400
+ layoutItem.removeAttribute('index');
1401
+
1402
+ if (layoutItem instanceof LayoutGroup) {
1403
+ data.push(item);
1404
+ item.index = path !== '' ? path + '.' + index : index.toString();
1405
+ layoutItem.setAttribute('index', item.index);
1406
+
1407
+ if (layoutItem.items) {
1408
+ var items = that._getDataSource(layoutItem.items, item.index, 0);
1409
+
1410
+ item.items = items;
1411
+ }
1412
+ } else if (layoutItem instanceof LayoutItem) {
1413
+ if (layoutItem.items) {
1414
+ var items = that._getDataSource(layoutItem.items, path, index);
1415
+
1416
+ data = data.concat(items);
1417
+ } else {
1418
+ item.index = path !== '' ? path + '.' + index : index.toString();
1419
+ layoutItem.setAttribute('index', item.index);
1420
+ data.push(item);
1421
+ }
1422
+ }
1423
+
1424
+ index++;
1425
+ }
1426
+
1427
+ return data;
1428
+ }
1429
+ /**
1430
+ * Generates the JSON array of the current structure of the element
1431
+ */
1432
+
1433
+ }, {
1434
+ key: "_getLayout",
1435
+ value: function _getLayout() {
1436
+ var that = this;
1437
+ var group = !arguments.length ? that.$.itemsContainer : arguments[0];
1438
+
1439
+ if (that._buttons) {
1440
+ that._buttons.remove();
1441
+ }
1442
+
1443
+ if (that._dropArea) {
1444
+ that._dropArea.remove();
1445
+ }
1446
+
1447
+ var splitters = that.querySelectorAll('.jqx-layout-splitter');
1448
+
1449
+ for (var i = 0; i < splitters.length; i++) {
1450
+ var splitter = splitters[i];
1451
+
1452
+ if (splitter !== that.$.splitter) {
1453
+ splitter.remove();
1454
+ }
1455
+ }
1456
+
1457
+ group.items = Array.from(group.children);
1458
+ group.items = group.items.filter(function (value) {
1459
+ return value !== group.tabs && value.hasAttribute('data-id');
1460
+ });
1461
+ var items = group.items.map(function (value) {
1462
+ if (value.classList.contains('jqx-layout-tab-strip')) {
1463
+ return null;
1464
+ }
1465
+
1466
+ var item = value;
1467
+ var itemGroup = value instanceof LayoutGroup ? value : null;
1468
+
1469
+ if (itemGroup) {
1470
+ item.items = that._getLayout(itemGroup);
1471
+ }
1472
+
1473
+ return item;
1474
+ });
1475
+
1476
+ if (group !== that.$.itemsContainer) {
1477
+ return items.filter(function (value) {
1478
+ return value !== null && value !== group.tabs;
1479
+ });
1480
+ }
1481
+
1482
+ var data = [];
1483
+ var item = group;
1484
+ item.items = items.filter(function (value) {
1485
+ return value !== null && value !== group.tabs;
1486
+ });
1487
+ data.push(item);
1488
+ return data;
1489
+ }
1490
+ }, {
1491
+ key: "_updateSplitter",
1492
+ value: function _updateSplitter() {
1493
+ var that = this;
1494
+
1495
+ if (that._buttons && that._dragDetails) {
1496
+ that._buttons.remove();
1497
+ }
1498
+
1499
+ that._removeSplitter();
1500
+
1501
+ var items = that.querySelectorAll('[data-id]');
1502
+
1503
+ for (var i = 0; i < items.length; i++) {
1504
+ var item = items[i];
1505
+
1506
+ if (item.getAttribute('data-id') === 'root') {
1507
+ continue;
1508
+ }
1509
+
1510
+ if (item.hasAttribute('role')) {
1511
+ var role = item.getAttribute('role');
1512
+
1513
+ if (role === 'gridcell' || role === 'row' || role === 'columnheader' || role === 'rowheader') {
1514
+ continue;
1515
+ }
1516
+ }
1517
+
1518
+ item.setAttribute('hover', '');
1519
+
1520
+ that._handleSplitter(item);
1521
+ }
1522
+ }
1523
+ }, {
1524
+ key: "_hideSplitter",
1525
+ value: function _hideSplitter() {
1526
+ var that = this;
1527
+ var items = that.querySelectorAll('[data-id]');
1528
+
1529
+ for (var i = 0; i < items.length; i++) {
1530
+ var item = items[i];
1531
+ item.removeAttribute('hover');
1532
+ }
1533
+ }
1534
+ }, {
1535
+ key: "_removeSplitter",
1536
+ value: function _removeSplitter() {
1537
+ var that = this;
1538
+ var splitters = that.querySelectorAll('.jqx-layout-splitter');
1539
+
1540
+ for (var i = 0; i < splitters.length; i++) {
1541
+ var splitter = splitters[i];
1542
+
1543
+ if (splitter !== that.$.splitter) {
1544
+ splitter.remove();
1545
+ }
1546
+ }
1547
+
1548
+ that._hideSplitter();
1549
+ }
1550
+ /**
1551
+ * Handles item selection
1552
+ * @param {any} target - target element that was clicked
1553
+ * @param {any} isOnDemand - selection on demand
1554
+ */
1555
+
1556
+ }, {
1557
+ key: "_handleItemClick",
1558
+ value: function _handleItemClick(target) {
1559
+ var that = this,
1560
+ previouslySelectedIndex = that.selectedIndex;
1561
+ var item = null;
1562
+
1563
+ if (!target) {
1564
+ that.selectedIndex = null;
1565
+ that.querySelectorAll('[data-id]').forEach(function (i) {
1566
+ i.removeAttribute('selected');
1567
+ });
1568
+ that._selectedItem = null;
1569
+ return;
1570
+ } else {
1571
+ item = target instanceof HTMLElement ? target : that.querySelector('[data-id=' + target.id + ']');
1572
+
1573
+ if (item && item.readonly) {
1574
+ that.selectedIndex = null;
1575
+ return;
1576
+ }
1577
+
1578
+ that.querySelectorAll('[data-id]').forEach(function (i) {
1579
+ i.removeAttribute('selected');
1580
+ });
1581
+
1582
+ if (!item) {
1583
+ that.refresh();
1584
+ return;
1585
+ }
1586
+
1587
+ that.selectedIndex = item.getAttribute('index');
1588
+ item.setAttribute('selected', '');
1589
+ item.setAttribute('hover', '');
1590
+ that._selectedItem = item;
1591
+
1592
+ if (item.classList.contains('jqx-hidden')) {
1593
+ that.refresh();
1594
+ }
1595
+
1596
+ that._handleButtonsVisibility(item);
1597
+
1598
+ if (previouslySelectedIndex !== that.selectedIndex) {
1599
+ that.dispatchEvent(new CustomEvent('change'));
1600
+ }
1601
+ }
1602
+
1603
+ that._updateSplitter();
1604
+ }
1605
+ /**
1606
+ * Handles Layout Button click
1607
+ * @param {any} target
1608
+ */
1609
+
1610
+ }, {
1611
+ key: "_handleButtonClick",
1612
+ value: function _handleButtonClick(target, position) {
1613
+ var that = this,
1614
+ newItem = that._addLayoutItem(target, position); //Select the new empty item
1615
+
1616
+
1617
+ that.dispatchEvent(new CustomEvent('stateChange', {
1618
+ type: 'insert',
1619
+ item: newItem
1620
+ }));
1621
+
1622
+ that._handleItemClick(newItem, true);
1623
+ }
1624
+ }, {
1625
+ key: "_removeLayoutItem",
1626
+ value: function _removeLayoutItem(item) {
1627
+ var that = this;
1628
+
1629
+ if (item.getAttribute('data-id') === 'root') {
1630
+ return;
1631
+ }
1632
+
1633
+ if (item instanceof LayoutItem && item.parentElement.items.length === 1) {
1634
+ var parent = item.parentElement;
1635
+ var currentParent = parent;
1636
+
1637
+ while (parent && parent.items && parent.items.length === 1) {
1638
+ if (parent.getAttribute('data-id') === 'root') {
1639
+ break;
1640
+ }
1641
+
1642
+ currentParent = parent;
1643
+ parent = parent.parentElement;
1644
+ }
1645
+
1646
+ if (currentParent.getAttribute('data-id') !== 'root') {
1647
+ currentParent.remove();
1648
+ } else if (that.allowLiveSplit) {
1649
+ currentParent.appendChild(document.createElement('jqx-layout-item'));
1650
+ }
1651
+ } else {
1652
+ item.remove();
1653
+ }
1654
+
1655
+ that.refresh();
1656
+ that.dispatchEvent(new CustomEvent('stateChange', {
1657
+ type: 'delete',
1658
+ item: item
1659
+ }));
1660
+ }
1661
+ /**
1662
+ * Refreshes the UI Component.
1663
+ */
1664
+
1665
+ }, {
1666
+ key: "refresh",
1667
+ value: function refresh() {
1668
+ var that = this;
1669
+
1670
+ if (that._isUpdating) {
1671
+ return;
1672
+ }
1673
+
1674
+ that.dataSource = that._getDataSource(that._getLayout());
1675
+ that.$.splitter.className = 'jqx-visibility-hidden jqx-layout-splitter';
1676
+
1677
+ var refreshLayoutGroup = function refreshLayoutGroup(group) {
1678
+ var item = that.getItem(group.getAttribute('index'));
1679
+
1680
+ if (!item) {
1681
+ return;
1682
+ }
1683
+
1684
+ group.style.gridTemplateColumns = '';
1685
+ group.style.gridTemplateRows = '';
1686
+ var template = '';
1687
+ var percentages = 0;
1688
+ var withSizeCount = 0;
1689
+
1690
+ if (group instanceof TabLayoutGroup) {
1691
+ if (group.tabs) {
1692
+ group.tabs.remove();
1693
+ }
1694
+
1695
+ var header = document.createElement('div');
1696
+ header.classList.add('jqx-layout-tab-strip');
1697
+
1698
+ if (that._selectedItem && group.contains(that._selectedItem) && that._selectedItem instanceof TabLayoutItem) {
1699
+ group.selectedIndex = Math.max(0, group.items.indexOf(that._selectedItem));
1700
+ }
1701
+
1702
+ if (group.selectedIndex >= group.children.length) {
1703
+ group.selectedIndex = 0;
1704
+ }
1705
+
1706
+ for (var i = 0; i < group.children.length; i++) {
1707
+ var child = group.children[i];
1708
+ var childItem = that.getItem(child.getAttribute('index'));
1709
+
1710
+ if (!childItem) {
1711
+ continue;
1712
+ }
1713
+
1714
+ var tab = document.createElement('div');
1715
+ tab.classList.add('jqx-layout-tab');
1716
+ tab.innerHTML = '<label>' + childItem.label + '</label><span class="jqx-close-button"></span>';
1717
+ header.appendChild(tab);
1718
+ child.setAttribute('tab', '');
1719
+ child.classList.add('jqx-hidden');
1720
+ tab.content = child;
1721
+ tab.item = childItem;
1722
+ tab.group = item;
1723
+
1724
+ if (child.modifiers) {
1725
+ if (child.modifiers.indexOf('close') === -1) {
1726
+ tab.querySelector('.jqx-close-button').classList.add('jqx-hidden');
1727
+ }
1728
+ } else {
1729
+ tab.querySelector('.jqx-close-button').classList.add('jqx-hidden');
1730
+ }
1731
+
1732
+ if (undefined === group.selectedIndex || i === group.selectedIndex) {
1733
+ tab.classList.add('selected');
1734
+ child.classList.remove('jqx-hidden');
1735
+ group.selectedIndex = i;
1736
+ }
1737
+
1738
+ tab.onpointerup = function (event) {
1739
+ if (event.target.classList.contains('jqx-close-button') && tab.close) {
1740
+ group.selectedIndex = 0;
1741
+
1742
+ that._removeLayoutItem(that._selectedItem);
1743
+
1744
+ that._handleItemClick(parent);
1745
+ }
1746
+ };
1747
+
1748
+ tab.onpointerdown = function (event) {
1749
+ var parent = this.closest('.jqx-layout-group');
1750
+
1751
+ that._handleItemClick(this.content);
1752
+
1753
+ tab.close = false;
1754
+
1755
+ if (!event.target.classList.contains('jqx-close-button')) {
1756
+ if (childItem.modifiers && childItem.modifiers.indexOf('drag') >= 0 && parent.modifiers.indexOf('drag') >= 0) {
1757
+ that._beginDrag(parent, this, event);
1758
+ }
1759
+ } else {
1760
+ tab.close = true;
1761
+ }
1762
+ };
1763
+ }
1764
+
1765
+ group.tabs = header;
1766
+
1767
+ if (item.position === 'top' || item.position === 'left') {
1768
+ group.insertBefore(header, group.firstChild);
1769
+ } else {
1770
+ group.appendChild(header);
1771
+ }
1772
+ } else {
1773
+ for (var i = 0; i < group.children.length; i++) {
1774
+ var child = group.children[i];
1775
+
1776
+ if (child.hasAttribute('size')) {
1777
+ var size = child.getAttribute('size');
1778
+ var pixels = parseFloat(size);
1779
+ var groupSize = group.orientation === 'vertical' ? group.offsetWidth : group.offsetHeight;
1780
+ var percentage = size.indexOf('%') >= 0 ? parseFloat(size) : parseFloat(pixels / groupSize * 100);
1781
+ percentages += percentage;
1782
+ withSizeCount++;
1783
+
1784
+ if (withSizeCount === group.children.length) {
1785
+ if (percentages < 100) {
1786
+ template += '1fr ';
1787
+ percentages = 100;
1788
+ continue;
1789
+ } else if (percentages > 100) {
1790
+ percentages -= percentage;
1791
+ percentage = 100 - percentages;
1792
+ percentages = 100;
1793
+ }
1794
+ } else if (percentages > 100 || percentage === 0) {
1795
+ withSizeCount = group.children.length;
1796
+ percentages = 0;
1797
+ break;
1798
+ }
1799
+
1800
+ template += percentage + '% ';
1801
+ continue;
1802
+ }
1803
+
1804
+ template += '1fr ';
1805
+ }
1806
+
1807
+ if (withSizeCount === group.children.length) {
1808
+ if (percentages < 99 || percentages > 100) {
1809
+ template = '';
1810
+
1811
+ for (var i = 0; i < group.children.length; i++) {
1812
+ var child = group.children[i];
1813
+ child.removeAttribute('size');
1814
+ template += '1fr ';
1815
+ }
1816
+ }
1817
+ }
1818
+
1819
+ if (group.orientation === 'vertical') {
1820
+ group.style.gridTemplateColumns = template;
1821
+ } else {
1822
+ group.style.gridTemplateRows = template;
1823
+ }
1824
+ }
1825
+
1826
+ group.items = Array.from(group.children);
1827
+ group.items = group.items.filter(function (value) {
1828
+ return value !== group.tabs;
1829
+ });
1830
+ };
1831
+
1832
+ var layoutGroups = that.querySelectorAll('.jqx-layout-group');
1833
+
1834
+ for (var i = 0; i < layoutGroups.length; i++) {
1835
+ refreshLayoutGroup(layoutGroups[i]);
1836
+ }
1837
+ }
1838
+ }, {
1839
+ key: "_beginDrag",
1840
+ value: function _beginDrag(parent, element, event) {
1841
+ var that = this;
1842
+
1843
+ if (that._dragDetails) {
1844
+ that._dragDetails.feedback.remove();
1845
+ }
1846
+
1847
+ var feedback = document.createElement('div');
1848
+ var overlay = document.createElement('div');
1849
+ var tabs = parent.querySelector('.jqx-layout-tab-strip');
1850
+ var label = '';
1851
+
1852
+ if (tabs) {
1853
+ for (var i = 0; i < Array.from(tabs.children).length; i++) {
1854
+ if (i === parent.selectedIndex) {
1855
+ label = tabs.children[i].innerText;
1856
+ }
1857
+ }
1858
+ }
1859
+
1860
+ feedback.innerHTML = "<jqx-split-layout><jqx-tab-layout-group><jqx-tab-layout-item label=\"".concat(label, "\"></jqx-tab-layout-item></jqx-tab-layout-group></jqx-split-layout>");
1861
+ that._feedback = feedback;
1862
+
1863
+ that._feedback.classList.add('jqx-split-layout-feedback', 'jqx-split-layout', 'jqx-widget');
1864
+
1865
+ overlay.classList.add('jqx-split-layout-overlay');
1866
+ that._dragDetails = {
1867
+ element: element.content,
1868
+ item: element.item,
1869
+ layoutGroup: element.group,
1870
+ parent: parent,
1871
+ overlay: overlay,
1872
+ feedback: feedback,
1873
+ pageX: event.pageX,
1874
+ pageY: event.pageY
1875
+ };
1876
+ }
1877
+ }, {
1878
+ key: "moveChildren",
1879
+ value: function moveChildren(oldItem, newItem) {
1880
+ newItem.innerHTML = '';
1881
+ var content = oldItem;
1882
+
1883
+ while (content.firstChild) {
1884
+ var child = content.firstChild;
1885
+ newItem.appendChild(child);
1886
+ }
1887
+ }
1888
+ }, {
1889
+ key: "createLayoutItem",
1890
+ value: function createLayoutItem(type, position) {
1891
+ var that = this;
1892
+
1893
+ var getLayoutItem = function getLayoutItem() {
1894
+ var item = document.createElement('jqx-layout-item');
1895
+ item.innerHTML = '';
1896
+ that.dispatchEvent(new CustomEvent('createItem', {
1897
+ type: 'layoutItem',
1898
+ item: item
1899
+ }));
1900
+ return item;
1901
+ };
1902
+
1903
+ var getTabLayoutItem = function getTabLayoutItem() {
1904
+ var item = document.createElement('jqx-tab-layout-item');
1905
+ item.innerHTML = '';
1906
+ that.dispatchEvent(new CustomEvent('createItem', {
1907
+ type: 'tabLayoutItem',
1908
+ item: item
1909
+ }));
1910
+ return item;
1911
+ };
1912
+
1913
+ var getLayoutGroup = function getLayoutGroup(position) {
1914
+ var item = document.createElement('jqx-layout-group');
1915
+ var orientation = position === 'top' || position === 'bottom' ? 'horizontal' : 'vertical';
1916
+ that.dispatchEvent(new CustomEvent('createGroup', {
1917
+ type: 'layoutGroup',
1918
+ item: item
1919
+ }));
1920
+ item.setAttribute('orientation', orientation);
1921
+ item.orientation = orientation;
1922
+ return item;
1923
+ };
1924
+
1925
+ var getTabLayoutGroup = function getTabLayoutGroup(position) {
1926
+ var item = document.createElement('jqx-tab-layout-group');
1927
+ var orientation = position === 'top' || position === 'bottom' ? 'horizontal' : 'vertical';
1928
+ item.setAttribute('orientation', orientation);
1929
+ item.orientation = orientation;
1930
+ that.dispatchEvent(new CustomEvent('tabLayoutGroup', {
1931
+ type: 'layoutGroup',
1932
+ item: item
1933
+ }));
1934
+ return item;
1935
+ };
1936
+
1937
+ if (type === 'layoutItem' || !type) {
1938
+ return getLayoutItem();
1939
+ } else if (type === 'tabLayoutItem' || !type) {
1940
+ return getTabLayoutItem();
1941
+ } else if (type === 'tabLayoutGroup') {
1942
+ return getTabLayoutGroup(position);
1943
+ } else {
1944
+ return getLayoutGroup(position);
1945
+ }
1946
+ }
1947
+ }, {
1948
+ key: "_addTabLayoutItem",
1949
+ value: function _addTabLayoutItem(targetItem, position, myItem) {
1950
+ var that = this;
1951
+ var newItem = that.createLayoutItem('tabLayoutItem');
1952
+ var parentLayoutGroup = targetItem.closest('jqx-tab-layout-group');
1953
+ var layoutGroup;
1954
+
1955
+ if (myItem) {
1956
+ newItem.label = myItem.label;
1957
+ newItem.modifiers = myItem.modifiers;
1958
+ that.moveChildren(myItem, newItem);
1959
+ }
1960
+
1961
+ var resetGroup = function resetGroup(group) {
1962
+ for (var i = 0; i < group.children.length; i++) {
1963
+ var child = group.children[i];
1964
+ child.removeAttribute('size');
1965
+ }
1966
+
1967
+ group.removeAttribute('size');
1968
+ };
1969
+
1970
+ var addTabItemChild = function addTabItemChild(position) {
1971
+ targetItem.removeAttribute('size');
1972
+
1973
+ if (targetItem.querySelector('jqx-layout-group')) {
1974
+ that._addLayoutItem(targetItem.querySelector('jqx-layout-group'), position);
1975
+ } else {
1976
+ layoutGroup = that.createLayoutItem('layoutGroup', position);
1977
+ var newLayoutItem = that.createLayoutItem();
1978
+ that.moveChildren(targetItem, newLayoutItem);
1979
+
1980
+ if (position === 'top' || position === 'left') {
1981
+ layoutGroup.appendChild(that.createLayoutItem());
1982
+ layoutGroup.appendChild(newLayoutItem);
1983
+ } else {
1984
+ layoutGroup.appendChild(newLayoutItem);
1985
+ layoutGroup.appendChild(that.createLayoutItem());
1986
+ }
1987
+
1988
+ targetItem.appendChild(layoutGroup);
1989
+ }
1990
+ };
1991
+
1992
+ var addRootTab = function addRootTab(tabLayoutGroup, position) {
1993
+ var parentLayoutGroup = targetItem.parentElement;
1994
+ var layoutGroup = targetItem;
1995
+ var newLayoutGroup = that.createLayoutItem('layoutGroup', position);
1996
+ parentLayoutGroup.insertBefore(newLayoutGroup, layoutGroup);
1997
+
1998
+ if (position === 'top' || position === 'left') {
1999
+ newLayoutGroup.append(tabLayoutGroup);
2000
+ newLayoutGroup.appendChild(layoutGroup);
2001
+ } else {
2002
+ newLayoutGroup.appendChild(layoutGroup);
2003
+ newLayoutGroup.append(tabLayoutGroup);
2004
+ }
2005
+
2006
+ if (layoutGroup.getAttribute('data-id') === 'root') {
2007
+ layoutGroup.setAttribute('data-id', newLayoutGroup.getAttribute('data-id'));
2008
+ newLayoutGroup.setAttribute('data-id', 'root');
2009
+ that.$.itemsContainer = newLayoutGroup;
2010
+ }
2011
+
2012
+ resetGroup(layoutGroup);
2013
+ resetGroup(parentLayoutGroup);
2014
+ };
2015
+
2016
+ if (myItem) {
2017
+ switch (position) {
2018
+ case 'center':
2019
+ {
2020
+ if (targetItem instanceof TabLayoutGroup || targetItem instanceof TabLayoutItem) {
2021
+ parentLayoutGroup.appendChild(newItem);
2022
+ } else {
2023
+ var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
2024
+ tabLayoutGroup.appendChild(newItem);
2025
+
2026
+ if (targetItem instanceof LayoutGroup && !(targetItem instanceof TabLayoutItem)) {
2027
+ targetItem.appendChild(tabLayoutGroup);
2028
+ resetGroup(targetItem);
2029
+ } else if (targetItem instanceof LayoutItem) {
2030
+ layoutGroup = that.createLayoutItem('layoutGroup');
2031
+ targetItem.parentElement.insertBefore(layoutGroup, targetItem);
2032
+ layoutGroup.appendChild(targetItem);
2033
+ layoutGroup.appendChild(tabLayoutGroup);
2034
+ resetGroup(layoutGroup);
2035
+ }
2036
+ }
2037
+ }
2038
+ break;
2039
+
2040
+ case 'left':
2041
+ case 'right':
2042
+ {
2043
+ var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
2044
+ tabLayoutGroup.appendChild(newItem);
2045
+
2046
+ if (targetItem.getAttribute('data-id') === 'root') {
2047
+ tabLayoutGroup.position = position;
2048
+ addRootTab(tabLayoutGroup, position);
2049
+ } else {
2050
+ addRootTab(tabLayoutGroup, position);
2051
+ }
2052
+ }
2053
+ break;
2054
+
2055
+ case 'top':
2056
+ case 'bottom':
2057
+ {
2058
+ var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
2059
+ tabLayoutGroup.appendChild(newItem);
2060
+
2061
+ if (targetItem.getAttribute('data-id') === 'root') {
2062
+ tabLayoutGroup.position = position;
2063
+ addRootTab(tabLayoutGroup, position);
2064
+ } else {
2065
+ addRootTab(tabLayoutGroup, position);
2066
+ }
2067
+
2068
+ break;
2069
+ }
2070
+ }
2071
+
2072
+ return;
2073
+ }
2074
+
2075
+ switch (position) {
2076
+ case 'center':
2077
+ if (targetItem instanceof TabLayoutGroup || targetItem instanceof TabLayoutItem) {
2078
+ parentLayoutGroup.appendChild(newItem);
2079
+ } else {
2080
+ addTabItemChild();
2081
+ }
2082
+
2083
+ break;
2084
+
2085
+ case 'left':
2086
+ case 'right':
2087
+ if (targetItem instanceof TabLayoutGroup) {
2088
+ var firstItem = targetItem.querySelector('jqx-tab-layout-item');
2089
+
2090
+ if (firstItem && position === 'left') {
2091
+ targetItem.insertBefore(newItem, firstItem);
2092
+ } else {
2093
+ targetItem.appendChild(newItem);
2094
+ }
2095
+ } else if (targetItem instanceof TabLayoutItem) {
2096
+ var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
2097
+ var parentLayoutGroup = targetItem.parentElement;
2098
+ tabLayoutGroup.appendChild(newItem);
2099
+ layoutGroup = that.createLayoutItem('layoutGroup');
2100
+ parentLayoutGroup.parentElement.insertBefore(layoutGroup, parentLayoutGroup);
2101
+
2102
+ if (position === 'right') {
2103
+ layoutGroup.appendChild(parentLayoutGroup);
2104
+ layoutGroup.appendChild(tabLayoutGroup);
2105
+ } else if (position === 'left') {
2106
+ layoutGroup.appendChild(tabLayoutGroup);
2107
+ layoutGroup.appendChild(parentLayoutGroup);
2108
+ }
2109
+ } else if (myItem) {
2110
+ var tabLayoutGroup = that.createLayoutItem('tabLayoutGroup', 'top');
2111
+ tabLayoutGroup.appendChild(newItem);
2112
+
2113
+ if (targetItem instanceof LayoutGroup) {
2114
+ targetItem.insertBefore(targetItem.firstChild, tabLayoutGroup);
2115
+ } else if (targetItem instanceof LayoutItem) {
2116
+ layoutGroup = that.createLayoutItem('layoutGroup');
2117
+ layoutGroup.orientation = parentLayoutGroup.orientation;
2118
+ layoutGroup.setAttribute('orientation', parentLayoutGroup.orientation);
2119
+ targetItem.removeAttribute('size');
2120
+ targetItem.parentElement.insertBefore(layoutGroup, targetItem);
2121
+ layoutGroup.appendChild(targetItem);
2122
+ layoutGroup.appendChild(tabLayoutGroup);
2123
+ }
2124
+ } else {
2125
+ addTabItemChild(position);
2126
+ }
2127
+
2128
+ break;
2129
+
2130
+ case 'top':
2131
+ case 'bottom':
2132
+ if (targetItem instanceof TabLayoutGroup) {
2133
+ layoutGroup = that.createLayoutItem('layoutGroup', 'top');
2134
+ targetItem.removeAttribute('size');
2135
+ targetItem.parentElement.insertBefore(layoutGroup, targetItem);
2136
+
2137
+ if (position === 'top') {
2138
+ layoutGroup.appendChild(that.createLayoutItem());
2139
+ layoutGroup.appendChild(targetItem);
2140
+ } else {
2141
+ layoutGroup.appendChild(targetItem);
2142
+ layoutGroup.appendChild(that.createLayoutItem());
2143
+ }
2144
+ } else {
2145
+ addTabItemChild(position);
2146
+ }
2147
+
2148
+ break;
2149
+ }
2150
+
2151
+ that.refresh();
2152
+ }
2153
+ /**
2154
+ * Creates a new item by splitting the target Splitter
2155
+ */
2156
+
2157
+ }, {
2158
+ key: "_addLayoutItem",
2159
+ value: function _addLayoutItem(targetItem, position, myItem) {
2160
+ var that = this;
2161
+
2162
+ if (!targetItem) {
2163
+ return;
2164
+ }
2165
+
2166
+ var resetGroup = function resetGroup(group) {
2167
+ for (var i = 0; i < group.children.length; i++) {
2168
+ var child = group.children[i];
2169
+ child.removeAttribute('size');
2170
+ }
2171
+
2172
+ group.removeAttribute('size');
2173
+ };
2174
+
2175
+ var isTabItem = targetItem instanceof TabLayoutItem || targetItem instanceof TabLayoutGroup || myItem && myItem instanceof TabLayoutItem;
2176
+
2177
+ if (isTabItem) {
2178
+ return that._addTabLayoutItem(targetItem, position, myItem);
2179
+ }
2180
+
2181
+ var newItem = that.createLayoutItem();
2182
+ var parentLayoutGroup = targetItem.closest('.jqx-layout-group');
2183
+ var layoutGroup;
2184
+
2185
+ if (myItem) {
2186
+ that.moveChildren(myItem, newItem);
2187
+ }
2188
+
2189
+ if (position === 'center') {
2190
+ if (targetItem instanceof LayoutGroup) {
2191
+ layoutGroup = parentLayoutGroup;
2192
+ layoutGroup.appendChild(newItem);
2193
+ resetGroup(layoutGroup);
2194
+ that.refresh();
2195
+ return newItem;
2196
+ } else if (targetItem instanceof LayoutItem) {
2197
+ layoutGroup = that.createLayoutItem('layoutGroup');
2198
+ layoutGroup.orientation = parentLayoutGroup.orientation;
2199
+ layoutGroup.setAttribute('orientation', parentLayoutGroup.orientation);
2200
+ targetItem.removeAttribute('size');
2201
+ targetItem.parentElement.insertBefore(layoutGroup, targetItem);
2202
+ layoutGroup.appendChild(targetItem);
2203
+ layoutGroup.appendChild(newItem);
2204
+ that.refresh();
2205
+ return layoutGroup;
2206
+ }
2207
+ }
2208
+
2209
+ if (parentLayoutGroup.orientation === 'vertical' && (position === 'left' || position === 'right') || parentLayoutGroup.orientation === 'horizontal' && (position === 'top' || position === 'bottom')) {
2210
+ layoutGroup = parentLayoutGroup;
2211
+
2212
+ if (targetItem instanceof LayoutGroup) {
2213
+ if (position === 'left' || position === 'top') {
2214
+ layoutGroup.insertBefore(newItem, layoutGroup.children[0]);
2215
+ } else {
2216
+ layoutGroup.appendChild(newItem);
2217
+ }
2218
+
2219
+ resetGroup(targetItem);
2220
+ } else {
2221
+ var layoutGroupItems = layoutGroup.items,
2222
+ newItemIndex = Math.max(0, layoutGroupItems.indexOf(targetItem) + (position === 'top' || position === 'left' ? 0 : 1));
2223
+ layoutGroup.insertBefore(newItem, layoutGroupItems[newItemIndex]);
2224
+ resetGroup(layoutGroup);
2225
+ }
2226
+ } else {
2227
+ if (targetItem instanceof LayoutGroup) {
2228
+ var parentLayoutGroup = targetItem.parentElement;
2229
+ layoutGroup = targetItem;
2230
+ var newLayoutGroup = that.createLayoutItem('layoutGroup', position);
2231
+ parentLayoutGroup.insertBefore(newLayoutGroup, layoutGroup);
2232
+
2233
+ if (position === 'top' || position === 'left') {
2234
+ newLayoutGroup.append(newItem);
2235
+ newLayoutGroup.appendChild(layoutGroup);
2236
+ } else {
2237
+ newLayoutGroup.appendChild(layoutGroup);
2238
+ newLayoutGroup.append(newItem);
2239
+ }
2240
+
2241
+ if (layoutGroup.getAttribute('data-id') === 'root') {
2242
+ layoutGroup.setAttribute('data-id', newLayoutGroup.getAttribute('data-id'));
2243
+ newLayoutGroup.setAttribute('data-id', 'root');
2244
+ that.$.itemsContainer = newLayoutGroup;
2245
+ }
2246
+
2247
+ resetGroup(parentLayoutGroup);
2248
+ } else {
2249
+ layoutGroup = that.createLayoutItem('layoutGroup', position);
2250
+ parentLayoutGroup.insertBefore(layoutGroup, targetItem);
2251
+
2252
+ if (position === 'top' || position === 'left') {
2253
+ layoutGroup.appendChild(newItem);
2254
+ layoutGroup.appendChild(targetItem);
2255
+ } else {
2256
+ layoutGroup.appendChild(targetItem);
2257
+ layoutGroup.appendChild(newItem);
2258
+ }
2259
+
2260
+ resetGroup(layoutGroup);
2261
+ }
2262
+ }
2263
+
2264
+ that.refresh();
2265
+ return newItem;
2266
+ }
2267
+ /**
2268
+ * Shows/Hides the Add buttons
2269
+ * @param {any} item
2270
+ */
2271
+
2272
+ }, {
2273
+ key: "_handleButtonsVisibility",
2274
+ value: function _handleButtonsVisibility(item) {
2275
+ var that = this;
2276
+
2277
+ if (!that._buttons) {
2278
+ that._buttons = document.createElement('div');
2279
+
2280
+ that._buttons.classList.add('jqx-layout-buttons-container');
2281
+
2282
+ that._buttons.innerHTML = "<div role=\"button\" position=\"top\"></div>\n <div role=\"button\" position=\"bottom\"></div>\n <div role=\"button\" position=\"center\"></div>\n <div role=\"button\" position=\"left\"></div>\n <div role=\"button\" position=\"right\"></div>";
2283
+ }
2284
+
2285
+ if (!item) {
2286
+ if (that._buttons.parentElement) {
2287
+ that._buttons.parentElement.removeChild(that._buttons);
2288
+
2289
+ return;
2290
+ }
2291
+ }
2292
+
2293
+ if (item) {
2294
+ var buttonPosition = item._buttonPosition || [],
2295
+ buttons = that._buttons.children;
2296
+
2297
+ for (var b = 0; b < buttons.length; b++) {
2298
+ var button = buttons[b];
2299
+ button.position = button.getAttribute('position');
2300
+ button.item = item;
2301
+ buttonPosition.length && buttonPosition.indexOf(button.getAttribute('position')) < 0 ? button.classList.add('jqx-hidden') : button.classList.remove('jqx-hidden');
2302
+
2303
+ button.onmouseenter = function () {
2304
+ button.setAttribute('hover', '');
2305
+ };
2306
+
2307
+ button.onmouseleave = function () {
2308
+ button.removeAttribute('hover');
2309
+ };
2310
+ }
2311
+
2312
+ if (that.allowLiveSplit && that._buttons.parentElement !== item) {
2313
+ item.appendChild(that._buttons);
2314
+ }
2315
+ }
2316
+ }
2317
+ }, {
2318
+ key: "_handleDropArea",
2319
+ value: function _handleDropArea(item) {
2320
+ var position = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'center';
2321
+ var that = this;
2322
+
2323
+ var positionDropArea = function positionDropArea(position) {
2324
+ var areaSize = 50;
2325
+
2326
+ switch (position) {
2327
+ case 'left':
2328
+ that._dropArea.style.top = '0px';
2329
+ that._dropArea.style.left = '0px';
2330
+ that._dropArea.style.width = areaSize + '%';
2331
+ that._dropArea.style.height = '100%';
2332
+ break;
2333
+
2334
+ case 'right':
2335
+ that._dropArea.style.top = '0px';
2336
+ that._dropArea.style.left = "calc(100% - ".concat(areaSize, "%)");
2337
+ that._dropArea.style.width = areaSize + '%';
2338
+ that._dropArea.style.height = '100%';
2339
+ break;
2340
+
2341
+ case 'top':
2342
+ that._dropArea.style.top = '0px';
2343
+ that._dropArea.style.left = '0px';
2344
+ that._dropArea.style.width = '100%';
2345
+ that._dropArea.style.height = areaSize + '%';
2346
+ break;
2347
+
2348
+ case 'bottom':
2349
+ that._dropArea.style.top = "calc(100% - ".concat(areaSize, "%)");
2350
+ that._dropArea.style.left = '0px';
2351
+ that._dropArea.style.width = '100%';
2352
+ that._dropArea.style.height = areaSize + '%';
2353
+ break;
2354
+
2355
+ case 'center':
2356
+ that._dropArea.style.top = '0px';
2357
+ that._dropArea.style.left = '0px';
2358
+ that._dropArea.style.width = '100%';
2359
+ that._dropArea.style.height = '100%';
2360
+ break;
2361
+ }
2362
+ };
2363
+
2364
+ if (that._dropArea && that._dropArea.parentElement === item) {
2365
+ positionDropArea(position);
2366
+ return;
2367
+ }
2368
+
2369
+ if (that._dropArea) {
2370
+ that._dropArea.remove();
2371
+ }
2372
+
2373
+ if (!that._dragDetails || !item) {
2374
+ return;
2375
+ }
2376
+
2377
+ that._dropArea = document.createElement('div');
2378
+
2379
+ that._dropArea.classList.add('jqx-layout-drop-area');
2380
+
2381
+ item.appendChild(that._dropArea);
2382
+ that._dropArea.style.opacity = 1;
2383
+ positionDropArea(position);
2384
+ }
2385
+ }, {
2386
+ key: "_handleSplitter",
2387
+ value: function _handleSplitter(item) {
2388
+ var that = this;
2389
+
2390
+ if (!item) {
2391
+ return;
2392
+ }
2393
+
2394
+ if (item.hasAttribute('tab')) {
2395
+ item = item.parentElement;
2396
+ }
2397
+
2398
+ if (item._splitter) {
2399
+ item._splitter.remove();
2400
+ }
2401
+
2402
+ if (!item._splitter) {
2403
+ item._splitter = document.createElement('div');
2404
+ }
2405
+
2406
+ if (that._dragDetails && that._dragDetails.dragging) {
2407
+ item._splitter.remove();
2408
+
2409
+ return;
2410
+ }
2411
+
2412
+ if (item.modifiers.indexOf('resize') === -1) {
2413
+ return;
2414
+ }
2415
+
2416
+ item.appendChild(item._splitter);
2417
+ var layoutGroup = item.parentElement;
2418
+
2419
+ if (layoutGroup) {
2420
+ item._splitter.className = 'jqx-layout-splitter';
2421
+ item._splitter.item = item;
2422
+
2423
+ item._splitter.removeAttribute('drag');
2424
+
2425
+ var orientation = layoutGroup.orientation;
2426
+
2427
+ if (item.nextElementSibling && item.nextElementSibling.hasAttribute('data-id')) {
2428
+ item._splitter.classList.add(orientation);
2429
+ } else if (item.previousElementSibling && item.previousElementSibling.hasAttribute('data-id')) {
2430
+ item._splitter.classList.add(orientation);
2431
+
2432
+ item._splitter.classList.add('last');
2433
+ }
2434
+
2435
+ var handleResize = function handleResize(splitter) {
2436
+ splitter.style.top = '';
2437
+ splitter.style.left = '';
2438
+ splitter.style.bottom = '';
2439
+ splitter.style.right = '';
2440
+
2441
+ splitter.onpointerdown = function (event) {
2442
+ var item = event.target.item;
2443
+ item.style.overflow = 'hidden';
2444
+ that._resizeDetails = {
2445
+ splitter: event.target,
2446
+ splitterRect: event.target.getBoundingClientRect(),
2447
+ itemRect: item.getBoundingClientRect(),
2448
+ item: item,
2449
+ itemSize: item.size,
2450
+ group: item.parentElement,
2451
+ clientX: event.clientX,
2452
+ clientY: event.clientY
2453
+ };
2454
+
2455
+ if (that._selectedItem !== item) {
2456
+ that.querySelectorAll('[data-id]').forEach(function (i) {
2457
+ i.removeAttribute('selected');
2458
+ });
2459
+ that.selectedIndex = item.getAttribute('index');
2460
+ item.setAttribute('selected', '');
2461
+ that._selectedItem = item;
2462
+
2463
+ that._handleButtonsVisibility(item);
2464
+ }
2465
+
2466
+ if (item.previousElementSibling && item.previousElementSibling.hasAttribute('data-id')) {
2467
+ that._resizeDetails.previousItemRect = item.previousElementSibling.getBoundingClientRect();
2468
+ that._resizeDetails.previousItem = item.previousElementSibling;
2469
+ that._resizeDetails.previousItemSize = item.previousElementSibling.size;
2470
+ that._resizeDetails.previousItem.style.overflow = 'hidden';
2471
+ } else {
2472
+ that._resizeDetails.previousItemRect = null;
2473
+ that._resizeDetails.previousItem = null;
2474
+ }
2475
+
2476
+ if (item.nextElementSibling && item.nextElementSibling.hasAttribute('data-id')) {
2477
+ that._resizeDetails.nextItemRect = item.nextElementSibling.getBoundingClientRect();
2478
+ that._resizeDetails.nextItem = item.nextElementSibling;
2479
+ that._resizeDetails.nextItemSize = item.nextElementSibling.size;
2480
+ that._resizeDetails.nextItem.style.overflow = 'hidden';
2481
+ } else {
2482
+ that._resizeDetails.nextItemRect = null;
2483
+ that._resizeDetails.nextItem = null;
2484
+ }
2485
+ };
2486
+ };
2487
+
2488
+ handleResize(item._splitter);
2489
+ }
2490
+ }
2491
+ }]);
2492
+
2493
+ return SplitLayout;
2494
+ }( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
2495
+
2496
+ customElements.define('jqx-layout-group', LayoutGroup);
2497
+ customElements.define('jqx-layout-item', LayoutItem);
2498
+ customElements.define('jqx-tab-layout-group', TabLayoutGroup);
2499
+ customElements.define('jqx-tab-layout-item', TabLayoutItem);
2500
+ customElements.define('jqx-split-layout', SplitLayout);
2501
+
2502
+
2503
+
2504
+
2505
+
2506
+
2507
+
2508
+
2509
+
2510
+
2511
+
2512
+
9
2513