@deephaven/golden-layout 0.19.2-beta.10 → 0.19.2-beta.11

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 (144) hide show
  1. package/dist/LayoutManager.d.ts +313 -0
  2. package/dist/LayoutManager.d.ts.map +1 -0
  3. package/dist/LayoutManager.js +468 -450
  4. package/dist/LayoutManager.js.map +1 -1
  5. package/dist/base.d.ts +16 -0
  6. package/dist/base.d.ts.map +1 -0
  7. package/dist/base.js +6 -6
  8. package/dist/base.js.map +1 -1
  9. package/dist/config/Config.d.ts +146 -0
  10. package/dist/config/Config.d.ts.map +1 -0
  11. package/dist/config/{defaultConfig.js → Config.js} +6 -6
  12. package/dist/config/Config.js.map +1 -0
  13. package/dist/config/ItemConfig.d.ts +66 -0
  14. package/dist/config/ItemConfig.d.ts.map +1 -0
  15. package/dist/config/ItemConfig.js +14 -0
  16. package/dist/config/ItemConfig.js.map +1 -0
  17. package/dist/config/index.d.ts +3 -0
  18. package/dist/config/index.d.ts.map +1 -0
  19. package/dist/config/index.js +2 -6
  20. package/dist/config/index.js.map +1 -1
  21. package/dist/container/ItemContainer.d.ts +91 -0
  22. package/dist/container/ItemContainer.d.ts.map +1 -0
  23. package/dist/container/ItemContainer.js +110 -85
  24. package/dist/container/ItemContainer.js.map +1 -1
  25. package/dist/container/index.d.ts +3 -0
  26. package/dist/container/index.d.ts.map +1 -0
  27. package/dist/container/index.js +2 -4
  28. package/dist/container/index.js.map +1 -1
  29. package/dist/controls/BrowserPopout.d.ts +83 -0
  30. package/dist/controls/BrowserPopout.d.ts.map +1 -0
  31. package/dist/controls/BrowserPopout.js +135 -101
  32. package/dist/controls/BrowserPopout.js.map +1 -1
  33. package/dist/controls/DragProxy.d.ts +67 -0
  34. package/dist/controls/DragProxy.d.ts.map +1 -0
  35. package/dist/controls/DragProxy.js +135 -110
  36. package/dist/controls/DragProxy.js.map +1 -1
  37. package/dist/controls/DragSource.d.ts +30 -0
  38. package/dist/controls/DragSource.d.ts.map +1 -0
  39. package/dist/controls/DragSource.js +37 -29
  40. package/dist/controls/DragSource.js.map +1 -1
  41. package/dist/controls/DragSourceFromEvent.d.ts +30 -0
  42. package/dist/controls/DragSourceFromEvent.d.ts.map +1 -0
  43. package/dist/controls/DragSourceFromEvent.js +49 -36
  44. package/dist/controls/DragSourceFromEvent.js.map +1 -1
  45. package/dist/controls/DropTargetIndicator.d.ts +14 -0
  46. package/dist/controls/DropTargetIndicator.d.ts.map +1 -0
  47. package/dist/controls/DropTargetIndicator.js +18 -14
  48. package/dist/controls/DropTargetIndicator.js.map +1 -1
  49. package/dist/controls/Header.d.ts +145 -0
  50. package/dist/controls/Header.d.ts.map +1 -0
  51. package/dist/controls/Header.js +414 -271
  52. package/dist/controls/Header.js.map +1 -1
  53. package/dist/controls/HeaderButton.d.ts +9 -0
  54. package/dist/controls/HeaderButton.d.ts.map +1 -0
  55. package/dist/controls/HeaderButton.js +19 -13
  56. package/dist/controls/HeaderButton.js.map +1 -1
  57. package/dist/controls/Splitter.d.ts +12 -0
  58. package/dist/controls/Splitter.d.ts.map +1 -0
  59. package/dist/controls/Splitter.js +36 -20
  60. package/dist/controls/Splitter.js.map +1 -1
  61. package/dist/controls/Tab.d.ts +91 -0
  62. package/dist/controls/Tab.d.ts.map +1 -0
  63. package/dist/controls/Tab.js +131 -119
  64. package/dist/controls/Tab.js.map +1 -1
  65. package/dist/controls/TransitionIndicator.d.ts +25 -0
  66. package/dist/controls/TransitionIndicator.d.ts.map +1 -0
  67. package/dist/controls/TransitionIndicator.js +53 -39
  68. package/dist/controls/TransitionIndicator.js.map +1 -1
  69. package/dist/controls/index.d.ts +11 -0
  70. package/dist/controls/index.d.ts.map +1 -0
  71. package/dist/controls/index.js +10 -22
  72. package/dist/controls/index.js.map +1 -1
  73. package/dist/errors/ConfigurationError.d.ts +6 -0
  74. package/dist/errors/ConfigurationError.d.ts.map +1 -0
  75. package/dist/errors/ConfigurationError.js +15 -8
  76. package/dist/errors/ConfigurationError.js.map +1 -1
  77. package/dist/errors/index.d.ts +2 -0
  78. package/dist/errors/index.d.ts.map +1 -0
  79. package/dist/errors/index.js +1 -4
  80. package/dist/errors/index.js.map +1 -1
  81. package/dist/index.d.ts +9 -0
  82. package/dist/index.d.ts.map +1 -0
  83. package/dist/index.js +7 -1
  84. package/dist/index.js.map +1 -1
  85. package/dist/items/AbstractContentItem.d.ts +233 -0
  86. package/dist/items/AbstractContentItem.d.ts.map +1 -0
  87. package/dist/items/AbstractContentItem.js +284 -242
  88. package/dist/items/AbstractContentItem.js.map +1 -1
  89. package/dist/items/Component.d.ts +30 -0
  90. package/dist/items/Component.d.ts.map +1 -0
  91. package/dist/items/Component.js +61 -42
  92. package/dist/items/Component.js.map +1 -1
  93. package/dist/items/Root.d.ts +18 -0
  94. package/dist/items/Root.d.ts.map +1 -0
  95. package/dist/items/Root.js +68 -38
  96. package/dist/items/Root.js.map +1 -1
  97. package/dist/items/RowOrColumn.d.ts +157 -0
  98. package/dist/items/RowOrColumn.d.ts.map +1 -0
  99. package/dist/items/RowOrColumn.js +219 -187
  100. package/dist/items/RowOrColumn.js.map +1 -1
  101. package/dist/items/Stack.d.ts +108 -0
  102. package/dist/items/Stack.d.ts.map +1 -0
  103. package/dist/items/Stack.js +218 -151
  104. package/dist/items/Stack.js.map +1 -1
  105. package/dist/items/index.d.ts +8 -0
  106. package/dist/items/index.d.ts.map +1 -0
  107. package/dist/items/index.js +7 -12
  108. package/dist/items/index.js.map +1 -1
  109. package/dist/utils/BubblingEvent.d.ts +8 -0
  110. package/dist/utils/BubblingEvent.d.ts.map +1 -0
  111. package/dist/utils/BubblingEvent.js +18 -9
  112. package/dist/utils/BubblingEvent.js.map +1 -1
  113. package/dist/utils/ConfigMinifier.d.ts +21 -0
  114. package/dist/utils/ConfigMinifier.d.ts.map +1 -0
  115. package/dist/utils/ConfigMinifier.js +121 -121
  116. package/dist/utils/ConfigMinifier.js.map +1 -1
  117. package/dist/utils/DragListener.d.ts +34 -0
  118. package/dist/utils/DragListener.d.ts.map +1 -0
  119. package/dist/utils/DragListener.js +103 -70
  120. package/dist/utils/DragListener.js.map +1 -1
  121. package/dist/utils/EventEmitter.d.ts +59 -0
  122. package/dist/utils/EventEmitter.d.ts.map +1 -0
  123. package/dist/utils/EventEmitter.js +64 -70
  124. package/dist/utils/EventEmitter.js.map +1 -1
  125. package/dist/utils/EventHub.d.ts +55 -0
  126. package/dist/utils/EventHub.d.ts.map +1 -0
  127. package/dist/utils/EventHub.js +83 -105
  128. package/dist/utils/EventHub.js.map +1 -1
  129. package/dist/utils/ReactComponentHandler.d.ts +54 -0
  130. package/dist/utils/ReactComponentHandler.d.ts.map +1 -0
  131. package/dist/utils/ReactComponentHandler.js +58 -56
  132. package/dist/utils/ReactComponentHandler.js.map +1 -1
  133. package/dist/utils/index.d.ts +8 -0
  134. package/dist/utils/index.d.ts.map +1 -0
  135. package/dist/utils/index.js +7 -21
  136. package/dist/utils/index.js.map +1 -1
  137. package/dist/utils/utils.d.ts +25 -0
  138. package/dist/utils/utils.d.ts.map +1 -0
  139. package/dist/utils/utils.js +21 -145
  140. package/dist/utils/utils.js.map +1 -1
  141. package/package.json +9 -5
  142. package/dist/config/ItemDefaultConfig.js +0 -8
  143. package/dist/config/ItemDefaultConfig.js.map +0 -1
  144. package/dist/config/defaultConfig.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RowOrColumn.js","names":["$","AbstractContentItem","utils","controls","RowOrColumn","isColumn","layoutManager","config","parent","call","isRow","element","childElementContainer","_splitterSize","dimensions","borderWidth","_splitterGrabSize","borderGrabWidth","_isColumn","_dimension","_splitter","_splitterPosition","_splitterMinPosition","_splitterMaxPosition","extend","copy","prototype","addChild","contentItem","index","_$suspendResize","newItemSize","itemSize","i","splitterElement","_$normalizeContentItem","undefined","contentItems","length","_createSplitter","Math","max","after","before","append","emitBubblingEvent","callDownwards","removeChild","keepChild","removedItemSize","indexOf","splitterIndex","childItem","Error","_$destroy","splice","isClosable","replaceChild","oldChild","newChild","size","setSize","_calculateRelativeSizes","_setAbsoluteSizes","emit","_$init","isInitialised","sizeData","_calculateAbsoluteSizes","additionalPixel","itemSizes","width","totalWidth","height","totalHeight","totalSplitterSize","totalAssigned","floor","push","total","itemsWithoutSetDimension","dimension","round","_respectMinItemWidth","minItemWidth","entriesOverMin","totalOverMin","totalUnderMin","remainingWidth","reducePercent","reducedWidth","allEntries","entry","splitter","Splitter","on","fnBind","_onSplitterDrag","_onSplitterDragStop","_onSplitterDragStart","_getItemsForSplitter","_getMinimumDimensions","arr","minWidth","minHeight","horizontal","vertical","items","minSize","beforeMinDim","content","beforeMinSize","afterMinDim","afterMinSize","offsetX","offsetY","offset","css","sizeBefore","sizeAfter","splitterPositionInRange","totalRelativeSize","top","left","animFrame"],"sources":["../../src/items/RowOrColumn.js"],"sourcesContent":["import $ from 'jquery';\nimport AbstractContentItem from './AbstractContentItem.js';\nimport utils from '../utils/index.js';\nimport controls from '../controls/index.js';\n\nconst RowOrColumn = function (isColumn, layoutManager, config, parent) {\n AbstractContentItem.call(this, layoutManager, config, parent);\n\n this.isRow = !isColumn;\n this.isColumn = isColumn;\n\n this.element = $(\n '<div class=\"lm_item lm_' + (isColumn ? 'column' : 'row') + '\"></div>'\n );\n this.childElementContainer = this.element;\n this._splitterSize = layoutManager.config.dimensions.borderWidth;\n this._splitterGrabSize = layoutManager.config.dimensions.borderGrabWidth;\n this._isColumn = isColumn;\n this._dimension = isColumn ? 'height' : 'width';\n this._splitter = [];\n this._splitterPosition = null;\n this._splitterMinPosition = null;\n this._splitterMaxPosition = null;\n};\n\nutils.extend(RowOrColumn, AbstractContentItem);\n\nutils.copy(RowOrColumn.prototype, {\n /**\n * Add a new contentItem to the Row or Column\n *\n * @param {lm.item.AbstractContentItem} contentItem\n * @param {[int]} index The position of the new item within the Row or Column.\n * If no index is provided the item will be added to the end\n * @param {[bool]} _$suspendResize If true the items won't be resized. This will leave the item in\n * an inconsistent state and is only intended to be used if multiple\n * children need to be added in one go and resize is called afterwards\n *\n * @returns {void}\n */\n addChild: function (contentItem, index, _$suspendResize) {\n var newItemSize, itemSize, i, splitterElement;\n\n contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n\n if (index === undefined) {\n index = this.contentItems.length;\n }\n\n if (this.contentItems.length > 0) {\n splitterElement = this._createSplitter(Math.max(0, index - 1)).element;\n\n if (index > 0) {\n this.contentItems[index - 1].element.after(splitterElement);\n splitterElement.after(contentItem.element);\n } else {\n this.contentItems[0].element.before(splitterElement);\n splitterElement.before(contentItem.element);\n }\n } else {\n this.childElementContainer.append(contentItem.element);\n }\n\n AbstractContentItem.prototype.addChild.call(this, contentItem, index);\n\n newItemSize = (1 / this.contentItems.length) * 100;\n\n if (_$suspendResize === true) {\n this.emitBubblingEvent('stateChanged');\n return;\n }\n\n for (i = 0; i < this.contentItems.length; i++) {\n if (this.contentItems[i] === contentItem) {\n contentItem.config[this._dimension] = newItemSize;\n } else {\n itemSize = this.contentItems[i].config[this._dimension] *=\n (100 - newItemSize) / 100;\n this.contentItems[i].config[this._dimension] = itemSize;\n }\n }\n\n this.callDownwards('setSize');\n this.emitBubblingEvent('stateChanged');\n },\n\n /**\n * Removes a child of this element\n *\n * @param {lm.items.AbstractContentItem} contentItem\n * @param {boolean} keepChild If true the child will be removed, but not destroyed\n *\n * @returns {void}\n */\n removeChild: function (contentItem, keepChild) {\n var removedItemSize = contentItem.config[this._dimension],\n index = utils.indexOf(contentItem, this.contentItems),\n splitterIndex = Math.max(index - 1, 0),\n i,\n childItem;\n\n if (index === -1) {\n throw new Error(\n \"Can't remove child. ContentItem is not child of this Row or Column\"\n );\n }\n\n /**\n * Remove the splitter before the item or after if the item happens\n * to be the first in the row/column\n */\n if (this._splitter[splitterIndex]) {\n this._splitter[splitterIndex]._$destroy();\n this._splitter.splice(splitterIndex, 1);\n }\n\n /**\n * Allocate the space that the removed item occupied to the remaining items\n */\n for (i = 0; i < this.contentItems.length; i++) {\n if (this.contentItems[i] !== contentItem) {\n this.contentItems[i].config[this._dimension] +=\n removedItemSize / (this.contentItems.length - 1);\n }\n }\n\n AbstractContentItem.prototype.removeChild.call(\n this,\n contentItem,\n keepChild\n );\n\n if (this.contentItems.length === 1 && this.config.isClosable === true) {\n childItem = this.contentItems[0];\n this.contentItems = [];\n this.parent.replaceChild(this, childItem, true);\n } else {\n this.callDownwards('setSize');\n this.emitBubblingEvent('stateChanged');\n }\n },\n\n /**\n * Replaces a child of this Row or Column with another contentItem\n *\n * @param {lm.items.AbstractContentItem} oldChild\n * @param {lm.items.AbstractContentItem} newChild\n *\n * @returns {void}\n */\n replaceChild: function (oldChild, newChild) {\n var size = oldChild.config[this._dimension];\n AbstractContentItem.prototype.replaceChild.call(this, oldChild, newChild);\n newChild.config[this._dimension] = size;\n this.callDownwards('setSize');\n this.emitBubblingEvent('stateChanged');\n },\n\n /**\n * Called whenever the dimensions of this item or one of its parents change\n *\n * @returns {void}\n */\n setSize: function () {\n if (this.contentItems.length > 0) {\n this._calculateRelativeSizes();\n this._setAbsoluteSizes();\n }\n this.emitBubblingEvent('stateChanged');\n this.emit('resize');\n },\n\n /**\n * Invoked recursively by the layout manager. AbstractContentItem.init appends\n * the contentItem's DOM elements to the container, RowOrColumn init adds splitters\n * in between them\n *\n * @package private\n * @override AbstractContentItem._$init\n * @returns {void}\n */\n _$init: function () {\n if (this.isInitialised === true) return;\n\n var i;\n\n AbstractContentItem.prototype._$init.call(this);\n\n for (i = 0; i < this.contentItems.length - 1; i++) {\n this.contentItems[i].element.after(this._createSplitter(i).element);\n }\n },\n\n /**\n * Turns the relative sizes calculated by _calculateRelativeSizes into\n * absolute pixel values and applies them to the children's DOM elements\n *\n * Assigns additional pixels to counteract Math.floor\n *\n * @private\n * @returns {void}\n */\n _setAbsoluteSizes: function () {\n var i,\n sizeData = this._calculateAbsoluteSizes();\n\n for (i = 0; i < this.contentItems.length; i++) {\n if (sizeData.additionalPixel - i > 0) {\n sizeData.itemSizes[i]++;\n }\n\n if (this._isColumn) {\n this.contentItems[i].element.width(sizeData.totalWidth);\n this.contentItems[i].element.height(sizeData.itemSizes[i]);\n } else {\n this.contentItems[i].element.width(sizeData.itemSizes[i]);\n this.contentItems[i].element.height(sizeData.totalHeight);\n }\n }\n },\n\n /**\n * Calculates the absolute sizes of all of the children of this Item.\n * @returns {object} - Set with absolute sizes and additional pixels.\n */\n _calculateAbsoluteSizes: function () {\n var i,\n totalSplitterSize = (this.contentItems.length - 1) * this._splitterSize,\n totalWidth = this.element.width(),\n totalHeight = this.element.height(),\n totalAssigned = 0,\n additionalPixel,\n itemSize,\n itemSizes = [];\n\n if (this._isColumn) {\n totalHeight -= totalSplitterSize;\n } else {\n totalWidth -= totalSplitterSize;\n }\n\n for (i = 0; i < this.contentItems.length; i++) {\n if (this._isColumn) {\n itemSize = Math.floor(\n totalHeight * (this.contentItems[i].config.height / 100)\n );\n } else {\n itemSize = Math.floor(\n totalWidth * (this.contentItems[i].config.width / 100)\n );\n }\n\n totalAssigned += itemSize;\n itemSizes.push(itemSize);\n }\n\n additionalPixel = Math.floor(\n (this._isColumn ? totalHeight : totalWidth) - totalAssigned\n );\n\n return {\n itemSizes: itemSizes,\n additionalPixel: additionalPixel,\n totalWidth: totalWidth,\n totalHeight: totalHeight,\n };\n },\n\n /**\n * Calculates the relative sizes of all children of this Item. The logic\n * is as follows:\n *\n * - Add up the total size of all items that have a configured size\n *\n * - If the total == 100 (check for floating point errors)\n * Excellent, job done\n *\n * - If the total is > 100,\n * set the size of items without set dimensions to 1/3 and add this to the total\n * set the size off all items so that the total is hundred relative to their original size\n *\n * - If the total is < 100\n * If there are items without set dimensions, distribute the remainder to 100 evenly between them\n * If there are no items without set dimensions, increase all items sizes relative to\n * their original size so that they add up to 100\n *\n * @private\n * @returns {void}\n */\n _calculateRelativeSizes: function () {\n var i,\n total = 0,\n itemsWithoutSetDimension = [],\n dimension = this._isColumn ? 'height' : 'width';\n\n for (i = 0; i < this.contentItems.length; i++) {\n if (this.contentItems[i].config[dimension] !== undefined) {\n total += this.contentItems[i].config[dimension];\n } else {\n itemsWithoutSetDimension.push(this.contentItems[i]);\n }\n }\n\n /**\n * Everything adds up to hundred, all good :-)\n */\n if (Math.round(total) === 100) {\n this._respectMinItemWidth();\n return;\n }\n\n /**\n * Allocate the remaining size to the items without a set dimension\n */\n if (Math.round(total) < 100 && itemsWithoutSetDimension.length > 0) {\n for (i = 0; i < itemsWithoutSetDimension.length; i++) {\n itemsWithoutSetDimension[i].config[dimension] =\n (100 - total) / itemsWithoutSetDimension.length;\n }\n this._respectMinItemWidth();\n return;\n }\n\n /**\n * If the total is > 100, but there are also items without a set dimension left, assing 50\n * as their dimension and add it to the total\n *\n * This will be reset in the next step\n */\n if (Math.round(total) > 100) {\n for (i = 0; i < itemsWithoutSetDimension.length; i++) {\n itemsWithoutSetDimension[i].config[dimension] = 50;\n total += 50;\n }\n }\n\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].config[dimension] =\n (this.contentItems[i].config[dimension] / total) * 100;\n }\n\n this._respectMinItemWidth();\n },\n\n /**\n * Adjusts the column widths to respect the dimensions minItemWidth if set.\n * @returns {}\n */\n _respectMinItemWidth: function () {\n var minItemWidth = this.layoutManager.config.dimensions\n ? this.layoutManager.config.dimensions.minItemWidth || 0\n : 0,\n sizeData = null,\n entriesOverMin = [],\n totalOverMin = 0,\n totalUnderMin = 0,\n remainingWidth = 0,\n itemSize = 0,\n contentItem = null,\n reducePercent,\n reducedWidth,\n allEntries = [],\n entry;\n\n if (this._isColumn || !minItemWidth || this.contentItems.length <= 1) {\n return;\n }\n\n sizeData = this._calculateAbsoluteSizes();\n\n /**\n * Figure out how much we are under the min item size total and how much room we have to use.\n */\n for (var i = 0; i < this.contentItems.length; i++) {\n contentItem = this.contentItems[i];\n itemSize = sizeData.itemSizes[i];\n\n if (itemSize < minItemWidth) {\n totalUnderMin += minItemWidth - itemSize;\n entry = { width: minItemWidth };\n } else {\n totalOverMin += itemSize - minItemWidth;\n entry = { width: itemSize };\n entriesOverMin.push(entry);\n }\n\n allEntries.push(entry);\n }\n\n /**\n * If there is nothing under min, or there is not enough over to make up the difference, do nothing.\n */\n if (totalUnderMin === 0 || totalUnderMin > totalOverMin) {\n return;\n }\n\n /**\n * Evenly reduce all columns that are over the min item width to make up the difference.\n */\n reducePercent = totalUnderMin / totalOverMin;\n remainingWidth = totalUnderMin;\n for (i = 0; i < entriesOverMin.length; i++) {\n entry = entriesOverMin[i];\n reducedWidth = Math.round((entry.width - minItemWidth) * reducePercent);\n remainingWidth -= reducedWidth;\n entry.width -= reducedWidth;\n }\n\n /**\n * Take anything remaining from the last item.\n */\n if (remainingWidth !== 0) {\n allEntries[allEntries.length - 1].width -= remainingWidth;\n }\n\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].config.width =\n (allEntries[i].width / sizeData.totalWidth) * 100;\n }\n },\n\n /**\n * Instantiates a new lm.controls.Splitter, binds events to it and adds\n * it to the array of splitters at the position specified as the index argument\n *\n * What it doesn't do though is append the splitter to the DOM\n *\n * @param {Int} index The position of the splitter\n *\n * @returns {lm.controls.Splitter}\n */\n _createSplitter: function (index) {\n var splitter;\n splitter = new controls.Splitter(\n this._isColumn,\n this._splitterSize,\n this._splitterGrabSize\n );\n splitter.on(\n 'drag',\n utils.fnBind(this._onSplitterDrag, this, [splitter]),\n this\n );\n splitter.on(\n 'dragStop',\n utils.fnBind(this._onSplitterDragStop, this, [splitter]),\n this\n );\n splitter.on(\n 'dragStart',\n utils.fnBind(this._onSplitterDragStart, this, [splitter]),\n this\n );\n this._splitter.splice(index, 0, splitter);\n return splitter;\n },\n\n /**\n * Locates the instance of lm.controls.Splitter in the array of\n * registered splitters and returns a map containing the contentItem\n * before and after the splitters, both of which are affected if the\n * splitter is moved\n *\n * @param {lm.controls.Splitter} splitter\n *\n * @returns {Object} A map of contentItems that the splitter affects\n */\n _getItemsForSplitter: function (splitter) {\n var index = utils.indexOf(splitter, this._splitter);\n\n return {\n before: this.contentItems[index],\n after: this.contentItems[index + 1],\n };\n },\n\n /**\n * Gets the minimum dimensions for the given item configuration array\n * @param item\n * @private\n */\n _getMinimumDimensions: function (arr) {\n var minWidth = 0,\n minHeight = 0;\n\n for (var i = 0; i < arr.length; ++i) {\n minWidth = Math.max(arr[i].minWidth || 0, minWidth);\n minHeight = Math.max(arr[i].minHeight || 0, minHeight);\n }\n\n return { horizontal: minWidth, vertical: minHeight };\n },\n\n /**\n * Invoked when a splitter's dragListener fires dragStart. Calculates the splitters\n * movement area once (so that it doesn't need calculating on every mousemove event)\n *\n * @param {lm.controls.Splitter} splitter\n *\n * @returns {void}\n */\n _onSplitterDragStart: function (splitter) {\n var items = this._getItemsForSplitter(splitter),\n minSize = this.layoutManager.config.dimensions[\n this._isColumn ? 'minItemHeight' : 'minItemWidth'\n ];\n\n var beforeMinDim = this._getMinimumDimensions(items.before.config.content);\n var beforeMinSize = this._isColumn\n ? beforeMinDim.vertical\n : beforeMinDim.horizontal;\n\n var afterMinDim = this._getMinimumDimensions(items.after.config.content);\n var afterMinSize = this._isColumn\n ? afterMinDim.vertical\n : afterMinDim.horizontal;\n\n this._splitterPosition = 0;\n this._splitterMinPosition =\n -1 *\n (items.before.element[this._dimension]() - (beforeMinSize || minSize));\n this._splitterMaxPosition =\n items.after.element[this._dimension]() - (afterMinSize || minSize);\n },\n\n /**\n * Invoked when a splitter's DragListener fires drag. Updates the splitters DOM position,\n * but not the sizes of the elements the splitter controls in order to minimize resize events\n *\n * @param {lm.controls.Splitter} splitter\n * @param {Int} offsetX Relative pixel values to the splitters original position. Can be negative\n * @param {Int} offsetY Relative pixel values to the splitters original position. Can be negative\n *\n * @returns {void}\n */\n _onSplitterDrag: function (splitter, offsetX, offsetY) {\n var offset = this._isColumn ? offsetY : offsetX;\n\n if (\n offset > this._splitterMinPosition &&\n offset < this._splitterMaxPosition\n ) {\n this._splitterPosition = offset;\n splitter.element.css(this._isColumn ? 'top' : 'left', offset);\n }\n },\n\n /**\n * Invoked when a splitter's DragListener fires dragStop. Resets the splitters DOM position,\n * and applies the new sizes to the elements before and after the splitter and their children\n * on the next animation frame\n *\n * @param {lm.controls.Splitter} splitter\n *\n * @returns {void}\n */\n _onSplitterDragStop: function (splitter) {\n var items = this._getItemsForSplitter(splitter),\n sizeBefore = items.before.element[this._dimension](),\n sizeAfter = items.after.element[this._dimension](),\n splitterPositionInRange =\n (this._splitterPosition + sizeBefore) / (sizeBefore + sizeAfter),\n totalRelativeSize =\n items.before.config[this._dimension] +\n items.after.config[this._dimension];\n\n items.before.config[this._dimension] =\n splitterPositionInRange * totalRelativeSize;\n items.after.config[this._dimension] =\n (1 - splitterPositionInRange) * totalRelativeSize;\n\n splitter.element.css({\n top: 0,\n left: 0,\n });\n\n utils.animFrame(utils.fnBind(this.callDownwards, this, ['setSize']));\n },\n});\n\nexport default RowOrColumn;\n"],"mappings":"AAAA,OAAOA,CAAP,MAAc,QAAd;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,KAAP,MAAkB,mBAAlB;AACA,OAAOC,QAAP,MAAqB,sBAArB;;AAEA,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAAUC,QAAV,EAAoBC,aAApB,EAAmCC,MAAnC,EAA2CC,MAA3C,EAAmD;EACrEP,mBAAmB,CAACQ,IAApB,CAAyB,IAAzB,EAA+BH,aAA/B,EAA8CC,MAA9C,EAAsDC,MAAtD;EAEA,KAAKE,KAAL,GAAa,CAACL,QAAd;EACA,KAAKA,QAAL,GAAgBA,QAAhB;EAEA,KAAKM,OAAL,GAAeX,CAAC,CACd,6BAA6BK,QAAQ,GAAG,QAAH,GAAc,KAAnD,IAA4D,UAD9C,CAAhB;EAGA,KAAKO,qBAAL,GAA6B,KAAKD,OAAlC;EACA,KAAKE,aAAL,GAAqBP,aAAa,CAACC,MAAd,CAAqBO,UAArB,CAAgCC,WAArD;EACA,KAAKC,i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AU,GAAGC,SAAtD,CAJJ;IAAA,IAKEE,iBAAiB,GACfd,KAAK,CAAChE,MAAN,CAAapC,MAAb,CAAoB,KAAKY,UAAzB,IACAwF,KAAK,CAACjE,KAAN,CAAYnC,MAAZ,CAAmB,KAAKY,UAAxB,CAPJ;;IASAwF,KAAK,CAAChE,MAAN,CAAapC,MAAb,CAAoB,KAAKY,UAAzB,IACEqG,uBAAuB,GAAGC,iBAD5B;IAEAd,KAAK,CAACjE,KAAN,CAAYnC,MAAZ,CAAmB,KAAKY,UAAxB,IACE,CAAC,IAAIqG,uBAAL,IAAgCC,iBADlC;IAGA5B,QAAQ,CAAClF,OAAT,CAAiB0G,GAAjB,CAAqB;MACnBK,GAAG,EAAE,CADc;MAEnBC,IAAI,EAAE;IAFa,CAArB;IAKAzH,KAAK,CAAC0H,SAAN,CAAgB1H,KAAK,CAAC8F,MAAN,CAAa,KAAKlD,aAAlB,EAAiC,IAAjC,EAAuC,CAAC,SAAD,CAAvC,CAAhB;EACD;AA5iB+B,CAAlC;AA+iBA,eAAe1C,WAAf"}
1
+ {"version":3,"file":"RowOrColumn.js","names":["$","AbstractContentItem","animFrame","Splitter","RowOrColumn","constructor","isColumn","layoutManager","config","parent","isRow","childElementContainer","element","_splitterSize","dimensions","borderWidth","_splitterGrabSize","borderGrabWidth","_isColumn","_dimension","_splitterPosition","_splitterMinPosition","_splitterMaxPosition","addChild","contentItem","index","_$suspendResize","newItemSize","itemSize","i","splitterElement","_$normalizeContentItem","undefined","contentItems","length","_createSplitter","Math","max","after","before","append","prototype","call","emitBubblingEvent","callDownwards","removeChild","keepChild","removedItemSize","indexOf","splitterIndex","childItem","Error","_splitter","_$destroy","splice","isClosable","replaceChild","oldChild","newChild","size","setSize","_calculateRelativeSizes","_setAbsoluteSizes","emit","_$init","isInitialised","sizeData","_calculateAbsoluteSizes","additionalPixel","itemSizes","width","totalWidth","height","totalHeight","totalSplitterSize","totalAssigned","floor","push","total","itemsWithoutSetDimension","dimension","round","_respectMinItemWidth","minItemWidth","entriesOverMin","totalOverMin","totalUnderMin","remainingWidth","allEntries","entry","reducePercent","reducedWidth","splitter","on","_onSplitterDrag","bind","_onSplitterDragStop","_onSplitterDragStart","_getItemsForSplitter","_getMinimumDimensions","arr","minWidth","minHeight","horizontal","vertical","items","minSize","beforeMinDim","content","beforeMinSize","afterMinDim","afterMinSize","offsetX","offsetY","offset","css","sizeBefore","sizeAfter","splitterPositionInRange","totalRelativeSize","top","left"],"sources":["../../src/items/RowOrColumn.ts"],"sourcesContent":["import $ from 'jquery';\nimport AbstractContentItem from './AbstractContentItem';\nimport { animFrame } from '../utils';\nimport { Splitter } from '../controls';\nimport type LayoutManager from '../LayoutManager';\nimport type { ItemConfig, ItemConfigType } from '../config';\n\nexport default class RowOrColumn extends AbstractContentItem {\n isRow: boolean;\n isColumn: boolean;\n childElementContainer: JQuery<HTMLElement>;\n parent: AbstractContentItem;\n\n private _splitter: Splitter[] = [];\n private _splitterSize: number;\n private _splitterGrabSize: number;\n private _isColumn: boolean;\n private _dimension: 'height' | 'width';\n private _splitterPosition: number | null = null;\n private _splitterMinPosition: number | null = null;\n private _splitterMaxPosition: number | null = null;\n\n constructor(\n isColumn: boolean,\n layoutManager: LayoutManager,\n config: ItemConfigType,\n parent: AbstractContentItem\n ) {\n super(\n layoutManager,\n config,\n parent,\n $('<div class=\"lm_item lm_' + (isColumn ? 'column' : 'row') + '\"></div>')\n );\n this.parent = parent;\n\n this.isRow = !isColumn;\n this.isColumn = isColumn;\n\n this.childElementContainer = this.element;\n this._splitterSize = layoutManager.config.dimensions.borderWidth;\n this._splitterGrabSize = layoutManager.config.dimensions.borderGrabWidth;\n this._isColumn = isColumn;\n this._dimension = isColumn ? 'height' : 'width';\n this._splitterPosition = null;\n this._splitterMinPosition = null;\n this._splitterMaxPosition = null;\n }\n\n /**\n * Add a new contentItem to the Row or Column\n *\n * @param contentItem\n * @param index The position of the new item within the Row or Column.\n * If no index is provided the item will be added to the end\n * @param _$suspendResize If true the items won't be resized. This will leave the item in\n * an inconsistent state and is only intended to be used if multiple\n * children need to be added in one go and resize is called afterwards\n */\n addChild(\n contentItem: AbstractContentItem | { type: ItemConfig['type'] },\n index?: number,\n _$suspendResize?: boolean\n ) {\n var newItemSize, itemSize, i, splitterElement;\n\n contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n\n if (index === undefined) {\n index = this.contentItems.length;\n }\n\n if (this.contentItems.length > 0) {\n splitterElement = this._createSplitter(Math.max(0, index - 1)).element;\n\n if (index > 0) {\n this.contentItems[index - 1].element.after(splitterElement);\n splitterElement.after(contentItem.element);\n } else {\n this.contentItems[0].element.before(splitterElement);\n splitterElement.before(contentItem.element);\n }\n } else {\n this.childElementContainer.append(contentItem.element);\n }\n\n AbstractContentItem.prototype.addChild.call(this, contentItem, index);\n\n newItemSize = (1 / this.contentItems.length) * 100;\n\n if (_$suspendResize === true) {\n this.emitBubblingEvent('stateChanged');\n return;\n }\n\n for (i = 0; i < this.contentItems.length; i++) {\n if (this.contentItems[i] === contentItem) {\n contentItem.config[this._dimension] = newItemSize;\n } else {\n itemSize =\n ((this.contentItems[i].config[this._dimension] ?? 0) *\n (100 - newItemSize)) /\n 100;\n this.contentItems[i].config[this._dimension] = itemSize;\n }\n }\n\n this.callDownwards('setSize');\n this.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Removes a child of this element\n *\n * @param contentItem\n * @param keepChild If true the child will be removed, but not destroyed\n */\n removeChild(contentItem: AbstractContentItem, keepChild: boolean) {\n var removedItemSize = contentItem.config[this._dimension] ?? 0,\n index = this.contentItems.indexOf(contentItem),\n splitterIndex = Math.max(index - 1, 0),\n i,\n childItem;\n\n if (index === -1) {\n throw new Error(\n \"Can't remove child. ContentItem is not child of this Row or Column\"\n );\n }\n\n /**\n * Remove the splitter before the item or after if the item happens\n * to be the first in the row/column\n */\n if (this._splitter[splitterIndex]) {\n this._splitter[splitterIndex]._$destroy();\n this._splitter.splice(splitterIndex, 1);\n }\n\n /**\n * Allocate the space that the removed item occupied to the remaining items\n */\n for (i = 0; i < this.contentItems.length; i++) {\n if (this.contentItems[i] !== contentItem) {\n this.contentItems[i].config[this._dimension] =\n (this.contentItems[i].config[this._dimension] ?? 0) +\n removedItemSize / (this.contentItems.length - 1);\n }\n }\n\n AbstractContentItem.prototype.removeChild.call(\n this,\n contentItem,\n keepChild\n );\n\n if (this.contentItems.length === 1 && this.config.isClosable === true) {\n childItem = this.contentItems[0];\n this.contentItems = [];\n this.parent.replaceChild(this, childItem, true);\n } else {\n this.callDownwards('setSize');\n this.emitBubblingEvent('stateChanged');\n }\n }\n\n /**\n * Replaces a child of this Row or Column with another contentItem\n *\n * @param oldChild\n * @param newChild\n */\n replaceChild(oldChild: AbstractContentItem, newChild: AbstractContentItem) {\n var size = oldChild.config[this._dimension];\n super.replaceChild(oldChild, newChild);\n newChild.config[this._dimension] = size;\n this.callDownwards('setSize');\n this.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Called whenever the dimensions of this item or one of its parents change\n */\n setSize() {\n if (this.contentItems.length > 0) {\n this._calculateRelativeSizes();\n this._setAbsoluteSizes();\n }\n this.emitBubblingEvent('stateChanged');\n this.emit('resize');\n }\n\n /**\n * Invoked recursively by the layout manager. AbstractContentItem.init appends\n * the contentItem's DOM elements to the container, RowOrColumn init adds splitters\n * in between them\n */\n _$init() {\n if (this.isInitialised === true) return;\n\n var i;\n\n AbstractContentItem.prototype._$init.call(this);\n\n for (i = 0; i < this.contentItems.length - 1; i++) {\n this.contentItems[i].element.after(this._createSplitter(i).element);\n }\n }\n\n /**\n * Turns the relative sizes calculated by _calculateRelativeSizes into\n * absolute pixel values and applies them to the children's DOM elements\n *\n * Assigns additional pixels to counteract Math.floor\n */\n _setAbsoluteSizes() {\n var i,\n sizeData = this._calculateAbsoluteSizes();\n\n for (i = 0; i < this.contentItems.length; i++) {\n if (sizeData.additionalPixel - i > 0) {\n sizeData.itemSizes[i]++;\n }\n\n if (this._isColumn) {\n this.contentItems[i].element.width(sizeData.totalWidth);\n this.contentItems[i].element.height(sizeData.itemSizes[i]);\n } else {\n this.contentItems[i].element.width(sizeData.itemSizes[i]);\n this.contentItems[i].element.height(sizeData.totalHeight);\n }\n }\n }\n\n /**\n * Calculates the absolute sizes of all of the children of this Item.\n * @returns {object} - Set with absolute sizes and additional pixels.\n */\n _calculateAbsoluteSizes() {\n const totalSplitterSize =\n (this.contentItems.length - 1) * this._splitterSize;\n let totalWidth = this.element.width() ?? 0;\n let totalHeight = this.element.height() ?? 0;\n let totalAssigned = 0;\n const itemSizes: number[] = [];\n\n if (this._isColumn) {\n totalHeight -= totalSplitterSize;\n } else {\n totalWidth -= totalSplitterSize;\n }\n\n for (let i = 0; i < this.contentItems.length; i++) {\n const itemSize = this._isColumn\n ? Math.floor(\n totalHeight * ((this.contentItems[i].config.height ?? 0) / 100)\n )\n : Math.floor(\n totalWidth * ((this.contentItems[i].config.width ?? 0) / 100)\n );\n\n totalAssigned += itemSize;\n itemSizes.push(itemSize);\n }\n\n const additionalPixel = Math.floor(\n (this._isColumn ? totalHeight : totalWidth) - totalAssigned\n );\n\n return {\n itemSizes,\n additionalPixel,\n totalWidth,\n totalHeight,\n };\n }\n\n /**\n * Calculates the relative sizes of all children of this Item. The logic\n * is as follows:\n *\n * - Add up the total size of all items that have a configured size\n *\n * - If the total == 100 (check for floating point errors)\n * Excellent, job done\n *\n * - If the total is > 100,\n * set the size of items without set dimensions to 1/3 and add this to the total\n * set the size off all items so that the total is hundred relative to their original size\n *\n * - If the total is < 100\n * If there are items without set dimensions, distribute the remainder to 100 evenly between them\n * If there are no items without set dimensions, increase all items sizes relative to\n * their original size so that they add up to 100\n */\n _calculateRelativeSizes() {\n let total = 0;\n const itemsWithoutSetDimension: AbstractContentItem[] = [];\n const dimension = this._isColumn ? 'height' : 'width';\n\n for (let i = 0; i < this.contentItems.length; i++) {\n if (this.contentItems[i].config[dimension] !== undefined) {\n total += this.contentItems[i].config[dimension] ?? 0;\n } else {\n itemsWithoutSetDimension.push(this.contentItems[i]);\n }\n }\n\n /**\n * Everything adds up to hundred, all good :-)\n */\n if (Math.round(total) === 100) {\n this._respectMinItemWidth();\n return;\n }\n\n /**\n * Allocate the remaining size to the items without a set dimension\n */\n if (Math.round(total) < 100 && itemsWithoutSetDimension.length > 0) {\n for (let i = 0; i < itemsWithoutSetDimension.length; i++) {\n itemsWithoutSetDimension[i].config[dimension] =\n (100 - total) / itemsWithoutSetDimension.length;\n }\n this._respectMinItemWidth();\n return;\n }\n\n /**\n * If the total is > 100, but there are also items without a set dimension left, assing 50\n * as their dimension and add it to the total\n *\n * This will be reset in the next step\n */\n if (Math.round(total) > 100) {\n for (let i = 0; i < itemsWithoutSetDimension.length; i++) {\n itemsWithoutSetDimension[i].config[dimension] = 50;\n total += 50;\n }\n }\n\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].config[dimension] =\n ((this.contentItems[i].config[dimension] ?? 0) / total) * 100;\n }\n\n this._respectMinItemWidth();\n }\n\n /**\n * Adjusts the column widths to respect the dimensions minItemWidth if set.\n */\n _respectMinItemWidth() {\n const minItemWidth = this.layoutManager.config.dimensions\n ? this.layoutManager.config.dimensions.minItemWidth ?? 0\n : 0;\n const entriesOverMin = [];\n let totalOverMin = 0;\n let totalUnderMin = 0;\n let remainingWidth = 0;\n const allEntries = [];\n let entry;\n\n if (this._isColumn || !minItemWidth || this.contentItems.length <= 1) {\n return;\n }\n\n const sizeData = this._calculateAbsoluteSizes();\n\n /**\n * Figure out how much we are under the min item size total and how much room we have to use.\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n const itemSize = sizeData.itemSizes[i];\n\n if (itemSize < minItemWidth) {\n totalUnderMin += minItemWidth - itemSize;\n entry = { width: minItemWidth };\n } else {\n totalOverMin += itemSize - minItemWidth;\n entry = { width: itemSize };\n entriesOverMin.push(entry);\n }\n\n allEntries.push(entry);\n }\n\n /**\n * If there is nothing under min, or there is not enough over to make up the difference, do nothing.\n */\n if (totalUnderMin === 0 || totalUnderMin > totalOverMin) {\n return;\n }\n\n /**\n * Evenly reduce all columns that are over the min item width to make up the difference.\n */\n const reducePercent = totalUnderMin / totalOverMin;\n remainingWidth = totalUnderMin;\n for (let i = 0; i < entriesOverMin.length; i++) {\n entry = entriesOverMin[i];\n const reducedWidth = Math.round(\n (entry.width - minItemWidth) * reducePercent\n );\n remainingWidth -= reducedWidth;\n entry.width -= reducedWidth;\n }\n\n /**\n * Take anything remaining from the last item.\n */\n if (remainingWidth !== 0) {\n allEntries[allEntries.length - 1].width -= remainingWidth;\n }\n\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].config.width =\n (allEntries[i].width / sizeData.totalWidth) * 100;\n }\n }\n\n /**\n * Instantiates a new lm.controls.Splitter, binds events to it and adds\n * it to the array of splitters at the position specified as the index argument\n *\n * What it doesn't do though is append the splitter to the DOM\n *\n * @param index The position of the splitter\n * @returns The created splitter\n */\n _createSplitter(index: number): Splitter {\n var splitter;\n splitter = new Splitter(\n this._isColumn,\n this._splitterSize,\n this._splitterGrabSize\n );\n splitter.on('drag', this._onSplitterDrag.bind(this, splitter), this);\n splitter.on(\n 'dragStop',\n this._onSplitterDragStop.bind(this, splitter),\n this\n );\n splitter.on(\n 'dragStart',\n this._onSplitterDragStart.bind(this, splitter),\n this\n );\n this._splitter.splice(index, 0, splitter);\n return splitter;\n }\n\n /**\n * Locates the instance of lm.controls.Splitter in the array of\n * registered splitters and returns a map containing the contentItem\n * before and after the splitters, both of which are affected if the\n * splitter is moved\n *\n * @param splitter\n *\n * @returns A map of contentItems that the splitter affects\n */\n _getItemsForSplitter(splitter: Splitter) {\n const index = this._splitter.indexOf(splitter);\n\n if (index < 0) {\n throw new Error('Splitter not found in RowOrColumn');\n }\n\n return {\n before: this.contentItems[index],\n after: this.contentItems[index + 1],\n };\n }\n\n /**\n * Gets the minimum dimensions for the given item configuration array\n * @param item\n * @private\n */\n _getMinimumDimensions(arr: { minWidth?: number; minHeight?: number }[]) {\n var minWidth = 0,\n minHeight = 0;\n\n for (var i = 0; i < arr.length; ++i) {\n minWidth = Math.max(arr[i].minWidth ?? 0, minWidth);\n minHeight = Math.max(arr[i].minHeight ?? 0, minHeight);\n }\n\n return { horizontal: minWidth, vertical: minHeight };\n }\n\n /**\n * Invoked when a splitter's dragListener fires dragStart. Calculates the splitters\n * movement area once (so that it doesn't need calculating on every mousemove event)\n *\n * @param splitter\n */\n _onSplitterDragStart(splitter: Splitter) {\n const items = this._getItemsForSplitter(splitter);\n const minSize = this.layoutManager.config.dimensions[\n this._isColumn ? 'minItemHeight' : 'minItemWidth'\n ];\n\n var beforeMinDim = this._getMinimumDimensions(\n items.before.config.content ?? []\n );\n var beforeMinSize = this._isColumn\n ? beforeMinDim.vertical\n : beforeMinDim.horizontal;\n\n var afterMinDim = this._getMinimumDimensions(\n items.after.config.content ?? []\n );\n var afterMinSize = this._isColumn\n ? afterMinDim.vertical\n : afterMinDim.horizontal;\n\n this._splitterPosition = 0;\n this._splitterMinPosition =\n -1 *\n ((items.before.element[this._dimension]() ?? 0) -\n (beforeMinSize || minSize));\n this._splitterMaxPosition =\n (items.after.element[this._dimension]() ?? 0) - (afterMinSize || minSize);\n }\n\n /**\n * Invoked when a splitter's DragListener fires drag. Updates the splitters DOM position,\n * but not the sizes of the elements the splitter controls in order to minimize resize events\n *\n * @param splitter\n * @param offsetX Relative pixel values to the splitters original position. Can be negative\n * @param offsetY Relative pixel values to the splitters original position. Can be negative\n */\n _onSplitterDrag(splitter: Splitter, offsetX: number, offsetY: number) {\n const offset = this._isColumn ? offsetY : offsetX;\n\n if (\n this._splitterMaxPosition == null ||\n this._splitterMinPosition == null\n ) {\n return;\n }\n\n if (\n offset > this._splitterMinPosition &&\n offset < this._splitterMaxPosition\n ) {\n this._splitterPosition = offset;\n splitter.element.css(this._isColumn ? 'top' : 'left', offset);\n }\n }\n\n /**\n * Invoked when a splitter's DragListener fires dragStop. Resets the splitters DOM position,\n * and applies the new sizes to the elements before and after the splitter and their children\n * on the next animation frame\n *\n * @param {lm.controls.Splitter} splitter\n */\n _onSplitterDragStop(splitter: Splitter) {\n const items = this._getItemsForSplitter(splitter);\n const sizeBefore = items.before.element[this._dimension]() ?? 0;\n const sizeAfter = items.after.element[this._dimension]() ?? 0;\n const splitterPositionInRange =\n ((this._splitterPosition ?? 0) + sizeBefore) / (sizeBefore + sizeAfter);\n const totalRelativeSize =\n (items.before.config[this._dimension] ?? 0) +\n (items.after.config[this._dimension] ?? 0);\n\n items.before.config[this._dimension] =\n splitterPositionInRange * totalRelativeSize;\n items.after.config[this._dimension] =\n (1 - splitterPositionInRange) * totalRelativeSize;\n\n splitter.element.css({\n top: 0,\n left: 0,\n });\n\n animFrame(\n this.callDownwards.bind(this, 'setSize', undefined, undefined, undefined)\n );\n }\n}\n"],"mappings":";;AAAA,OAAOA,CAAP,MAAc,QAAd;OACOC,mB;SACEC,S;SACAC,Q;AAIT,eAAe,MAAMC,WAAN,SAA0BH,mBAA1B,CAA8C;EAe3DI,WAAW,CACTC,QADS,EAETC,aAFS,EAGTC,MAHS,EAITC,MAJS,EAKT;IACA,MACEF,aADF,EAEEC,MAFF,EAGEC,MAHF,EAIET,CAAC,CAAC,6BAA6BM,QAAQ,GAAG,QAAH,GAAc,KAAnD,IAA4D,UAA7D,CAJH;;IADA;;IAAA;;IAAA;;IAAA;;IAAA,mCAd8B,EAc9B;;IAAA;;IAAA;;IAAA;;IAAA;;IAAA,2CATyC,IASzC;;IAAA,8CAR4C,IAQ5C;;IAAA,8CAP4C,IAO5C;;IAOA,KAAKG,MAAL,GAAcA,MAAd;IAEA,KAAKC,KAAL,GAAa,CAACJ,QAAd;IACA,KAAKA,QAAL,GAAgBA,QAAhB;IAEA,KAAKK,qBAAL,GAA6B,KAAKC,OAAlC;IACA,KAAKC,aAAL,GAAqBN,aAAa,CAACC,MAAd,CAAqBM,UAArB,CAAgC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uB,GAAGC,iBAD5B;IAEAd,KAAK,CAACnE,KAAN,CAAY9B,MAAZ,CAAmB,KAAKW,UAAxB,IACE,CAAC,IAAImG,uBAAL,IAAgCC,iBADlC;IAGA3B,QAAQ,CAAChF,OAAT,CAAiBuG,GAAjB,CAAqB;MACnBK,GAAG,EAAE,CADc;MAEnBC,IAAI,EAAE;IAFa,CAArB;IAKAvH,SAAS,CACP,KAAK0C,aAAL,CAAmBmD,IAAnB,CAAwB,IAAxB,EAA8B,SAA9B,EAAyC/D,SAAzC,EAAoDA,SAApD,EAA+DA,SAA/D,CADO,CAAT;EAGD;;AAxkB0D"}
@@ -0,0 +1,108 @@
1
+ import AbstractContentItem from './AbstractContentItem';
2
+ import type LayoutManager from '../LayoutManager';
3
+ import type { ComponentConfig, ItemConfigType } from '../config';
4
+ import { Header } from '../controls';
5
+ import type RowOrColumn from './RowOrColumn';
6
+ interface HoverDimensions {
7
+ hoverArea: {
8
+ x1: number;
9
+ y1: number;
10
+ x2: number;
11
+ y2: number;
12
+ };
13
+ highlightArea: {
14
+ x1: number;
15
+ y1: number;
16
+ x2: number;
17
+ y2: number;
18
+ };
19
+ }
20
+ declare type ContentAreaDimensions = {
21
+ header: HoverDimensions;
22
+ body?: HoverDimensions;
23
+ top?: HoverDimensions;
24
+ bottom?: HoverDimensions;
25
+ left?: HoverDimensions;
26
+ right?: HoverDimensions;
27
+ };
28
+ declare type BodySegment = keyof ContentAreaDimensions;
29
+ export interface StackHeaderConfig {
30
+ show?: boolean | 'top' | 'left' | 'right' | 'bottom';
31
+ popout?: string;
32
+ maximise?: string;
33
+ close?: string;
34
+ minimise?: string;
35
+ }
36
+ export default class Stack extends AbstractContentItem {
37
+ private _activeContentItem;
38
+ _header: StackHeaderConfig;
39
+ childElementContainer: JQuery<HTMLElement>;
40
+ header: Header;
41
+ parent: RowOrColumn;
42
+ isStack: boolean;
43
+ private _dropZones;
44
+ private _dropSegment;
45
+ _contentAreaDimensions: ContentAreaDimensions | null;
46
+ private _dropIndex;
47
+ _side: boolean | 'top' | 'left' | 'right' | 'bottom';
48
+ _sided: boolean;
49
+ config: ComponentConfig & {
50
+ activeItemIndex?: number;
51
+ };
52
+ constructor(layoutManager: LayoutManager & {
53
+ config: LayoutManager['config'] & {
54
+ header?: StackHeaderConfig;
55
+ };
56
+ }, config: ComponentConfig & {
57
+ header?: StackHeaderConfig;
58
+ hasHeaders?: boolean;
59
+ }, parent: RowOrColumn);
60
+ setSize(): void;
61
+ _$init(): void;
62
+ setActiveContentItem(contentItem: AbstractContentItem): void;
63
+ getActiveContentItem(): AbstractContentItem | null;
64
+ addChild(contentItem: AbstractContentItem | ItemConfigType, index?: number): void;
65
+ removeChild(contentItem: AbstractContentItem, keepChild?: boolean): void;
66
+ /**
67
+ * Validates that the stack is still closable or not. If a stack is able
68
+ * to close, but has a non closable component added to it, the stack is no
69
+ * longer closable until all components are closable.
70
+ */
71
+ _$validateClosability(): void;
72
+ _$destroy(): void;
73
+ /**
74
+ * Ok, this one is going to be the tricky one: The user has dropped {contentItem} onto this stack.
75
+ *
76
+ * It was dropped on either the stacks header or the top, right, bottom or left bit of the content area
77
+ * (which one of those is stored in this._dropSegment). Now, if the user has dropped on the header the case
78
+ * is relatively clear: We add the item to the existing stack... job done (might be good to have
79
+ * tab reordering at some point, but lets not sweat it right now)
80
+ *
81
+ * If the item was dropped on the content part things are a bit more complicated. If it was dropped on either the
82
+ * top or bottom region we need to create a new column and place the items accordingly.
83
+ * Unless, of course if the stack is already within a column... in which case we want
84
+ * to add the newly created item to the existing column...
85
+ * either prepend or append it, depending on wether its top or bottom.
86
+ *
87
+ * Same thing for rows and left / right drop segments... so in total there are 9 things that can potentially happen
88
+ * (left, top, right, bottom) * is child of the right parent (row, column) + header drop
89
+ *
90
+ * @param contentItem
91
+ */
92
+ _$onDrop(contentItem: AbstractContentItem): void;
93
+ /**
94
+ * If the user hovers above the header part of the stack, indicate drop positions for tabs.
95
+ * otherwise indicate which segment of the body the dragged item would be dropped on
96
+ *
97
+ * @param x Absolute Screen X
98
+ * @param y Absolute Screen Y
99
+ */
100
+ _$highlightDropZone(x: number, y: number): void;
101
+ _$getArea(): import("./AbstractContentItem").ItemArea<this> | null;
102
+ _highlightHeaderDropZone(x: number): void;
103
+ _resetHeaderDropZone(): void;
104
+ _setupHeaderPosition(): void;
105
+ _highlightBodyDropZone(segment: BodySegment): void;
106
+ }
107
+ export {};
108
+ //# sourceMappingURL=Stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../src/items/Stack.ts"],"names":[],"mappings":"AACA,OAAO,mBAAoC,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAE7C,UAAU,eAAe;IACvB,SAAS,EAAE;QACT,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,aAAa,EAAE;QACb,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH;AAED,aAAK,qBAAqB,GAAG;IAC3B,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,GAAG,CAAC,EAAE,eAAe,CAAC;IACtB,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,aAAK,WAAW,GAAG,MAAM,qBAAqB,CAAC;AAE/C,MAAM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