@deephaven/golden-layout 0.17.1-beta.2 → 0.17.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LayoutManager.js +1140 -0
- package/dist/LayoutManager.js.map +1 -0
- package/dist/base.js +16 -0
- package/dist/base.js.map +1 -0
- package/dist/config/ItemDefaultConfig.js +8 -0
- package/dist/config/ItemDefaultConfig.js.map +1 -0
- package/dist/config/defaultConfig.js +42 -0
- package/dist/config/defaultConfig.js.map +1 -0
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -0
- package/dist/container/ItemContainer.js +192 -0
- package/dist/container/ItemContainer.js.map +1 -0
- package/dist/container/index.js +5 -0
- package/dist/container/index.js.map +1 -0
- package/dist/controls/BrowserPopout.js +260 -0
- package/dist/controls/BrowserPopout.js.map +1 -0
- package/dist/controls/DragProxy.js +236 -0
- package/dist/controls/DragProxy.js.map +1 -0
- package/dist/controls/DragSource.js +60 -0
- package/dist/controls/DragSource.js.map +1 -0
- package/dist/controls/DragSourceFromEvent.js +75 -0
- package/dist/controls/DragSourceFromEvent.js.map +1 -0
- package/dist/controls/DropTargetIndicator.js +28 -0
- package/dist/controls/DropTargetIndicator.js.map +1 -0
- package/dist/controls/Header.js +698 -0
- package/dist/controls/Header.js.map +1 -0
- package/dist/controls/HeaderButton.js +23 -0
- package/dist/controls/HeaderButton.js.map +1 -0
- package/dist/controls/Splitter.js +45 -0
- package/dist/controls/Splitter.js.map +1 -0
- package/dist/controls/Tab.js +259 -0
- package/dist/controls/Tab.js.map +1 -0
- package/dist/controls/TransitionIndicator.js +64 -0
- package/dist/controls/TransitionIndicator.js.map +1 -0
- package/dist/controls/index.js +23 -0
- package/dist/controls/index.js.map +1 -0
- package/dist/errors/ConfigurationError.js +10 -0
- package/dist/errors/ConfigurationError.js.map +1 -0
- package/dist/errors/index.js +5 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/items/AbstractContentItem.js +617 -0
- package/dist/items/AbstractContentItem.js.map +1 -0
- package/dist/items/Component.js +84 -0
- package/dist/items/Component.js.map +1 -0
- package/dist/items/Root.js +93 -0
- package/dist/items/Root.js.map +1 -0
- package/dist/items/RowOrColumn.js +550 -0
- package/dist/items/RowOrColumn.js.map +1 -0
- package/dist/items/Stack.js +498 -0
- package/dist/items/Stack.js.map +1 -0
- package/dist/items/index.js +13 -0
- package/dist/items/index.js.map +1 -0
- package/dist/utils/BubblingEvent.js +12 -0
- package/dist/utils/BubblingEvent.js.map +1 -0
- package/dist/utils/ConfigMinifier.js +160 -0
- package/dist/utils/ConfigMinifier.js.map +1 -0
- package/dist/utils/DragListener.js +128 -0
- package/dist/utils/DragListener.js.map +1 -0
- package/dist/utils/EventEmitter.js +133 -0
- package/dist/utils/EventEmitter.js.map +1 -0
- package/dist/utils/EventHub.js +147 -0
- package/dist/utils/EventHub.js.map +1 -0
- package/dist/utils/ReactComponentHandler.js +135 -0
- package/dist/utils/ReactComponentHandler.js.map +1 -0
- package/dist/utils/index.js +22 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/utils.js +195 -0
- package/dist/utils/utils.js.map +1 -0
- package/package.json +20 -47
- package/dist/goldenlayout.js +0 -6314
- package/dist/goldenlayout.min.js +0 -1
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
import $ from 'jquery';
|
|
2
|
+
import AbstractContentItem from './AbstractContentItem.js';
|
|
3
|
+
import utils from '../utils/index.js';
|
|
4
|
+
import controls from '../controls/index.js';
|
|
5
|
+
|
|
6
|
+
var RowOrColumn = function RowOrColumn(isColumn, layoutManager, config, parent) {
|
|
7
|
+
AbstractContentItem.call(this, layoutManager, config, parent);
|
|
8
|
+
this.isRow = !isColumn;
|
|
9
|
+
this.isColumn = isColumn;
|
|
10
|
+
this.element = $('<div class="lm_item lm_' + (isColumn ? 'column' : 'row') + '"></div>');
|
|
11
|
+
this.childElementContainer = this.element;
|
|
12
|
+
this._splitterSize = layoutManager.config.dimensions.borderWidth;
|
|
13
|
+
this._splitterGrabSize = layoutManager.config.dimensions.borderGrabWidth;
|
|
14
|
+
this._isColumn = isColumn;
|
|
15
|
+
this._dimension = isColumn ? 'height' : 'width';
|
|
16
|
+
this._splitter = [];
|
|
17
|
+
this._splitterPosition = null;
|
|
18
|
+
this._splitterMinPosition = null;
|
|
19
|
+
this._splitterMaxPosition = null;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
utils.extend(RowOrColumn, AbstractContentItem);
|
|
23
|
+
utils.copy(RowOrColumn.prototype, {
|
|
24
|
+
/**
|
|
25
|
+
* Add a new contentItem to the Row or Column
|
|
26
|
+
*
|
|
27
|
+
* @param {lm.item.AbstractContentItem} contentItem
|
|
28
|
+
* @param {[int]} index The position of the new item within the Row or Column.
|
|
29
|
+
* If no index is provided the item will be added to the end
|
|
30
|
+
* @param {[bool]} _$suspendResize If true the items won't be resized. This will leave the item in
|
|
31
|
+
* an inconsistent state and is only intended to be used if multiple
|
|
32
|
+
* children need to be added in one go and resize is called afterwards
|
|
33
|
+
*
|
|
34
|
+
* @returns {void}
|
|
35
|
+
*/
|
|
36
|
+
addChild: function addChild(contentItem, index, _$suspendResize) {
|
|
37
|
+
var newItemSize, itemSize, i, splitterElement;
|
|
38
|
+
contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);
|
|
39
|
+
|
|
40
|
+
if (index === undefined) {
|
|
41
|
+
index = this.contentItems.length;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (this.contentItems.length > 0) {
|
|
45
|
+
splitterElement = this._createSplitter(Math.max(0, index - 1)).element;
|
|
46
|
+
|
|
47
|
+
if (index > 0) {
|
|
48
|
+
this.contentItems[index - 1].element.after(splitterElement);
|
|
49
|
+
splitterElement.after(contentItem.element);
|
|
50
|
+
} else {
|
|
51
|
+
this.contentItems[0].element.before(splitterElement);
|
|
52
|
+
splitterElement.before(contentItem.element);
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
this.childElementContainer.append(contentItem.element);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
AbstractContentItem.prototype.addChild.call(this, contentItem, index);
|
|
59
|
+
newItemSize = 1 / this.contentItems.length * 100;
|
|
60
|
+
|
|
61
|
+
if (_$suspendResize === true) {
|
|
62
|
+
this.emitBubblingEvent('stateChanged');
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
for (i = 0; i < this.contentItems.length; i++) {
|
|
67
|
+
if (this.contentItems[i] === contentItem) {
|
|
68
|
+
contentItem.config[this._dimension] = newItemSize;
|
|
69
|
+
} else {
|
|
70
|
+
itemSize = this.contentItems[i].config[this._dimension] *= (100 - newItemSize) / 100;
|
|
71
|
+
this.contentItems[i].config[this._dimension] = itemSize;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
this.callDownwards('setSize');
|
|
76
|
+
this.emitBubblingEvent('stateChanged');
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Removes a child of this element
|
|
81
|
+
*
|
|
82
|
+
* @param {lm.items.AbstractContentItem} contentItem
|
|
83
|
+
* @param {boolean} keepChild If true the child will be removed, but not destroyed
|
|
84
|
+
*
|
|
85
|
+
* @returns {void}
|
|
86
|
+
*/
|
|
87
|
+
removeChild: function removeChild(contentItem, keepChild) {
|
|
88
|
+
var removedItemSize = contentItem.config[this._dimension],
|
|
89
|
+
index = utils.indexOf(contentItem, this.contentItems),
|
|
90
|
+
splitterIndex = Math.max(index - 1, 0),
|
|
91
|
+
i,
|
|
92
|
+
childItem;
|
|
93
|
+
|
|
94
|
+
if (index === -1) {
|
|
95
|
+
throw new Error("Can't remove child. ContentItem is not child of this Row or Column");
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Remove the splitter before the item or after if the item happens
|
|
99
|
+
* to be the first in the row/column
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
if (this._splitter[splitterIndex]) {
|
|
104
|
+
this._splitter[splitterIndex]._$destroy();
|
|
105
|
+
|
|
106
|
+
this._splitter.splice(splitterIndex, 1);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Allocate the space that the removed item occupied to the remaining items
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
for (i = 0; i < this.contentItems.length; i++) {
|
|
114
|
+
if (this.contentItems[i] !== contentItem) {
|
|
115
|
+
this.contentItems[i].config[this._dimension] += removedItemSize / (this.contentItems.length - 1);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
AbstractContentItem.prototype.removeChild.call(this, contentItem, keepChild);
|
|
120
|
+
|
|
121
|
+
if (this.contentItems.length === 1 && this.config.isClosable === true) {
|
|
122
|
+
childItem = this.contentItems[0];
|
|
123
|
+
this.contentItems = [];
|
|
124
|
+
this.parent.replaceChild(this, childItem, true);
|
|
125
|
+
} else {
|
|
126
|
+
this.callDownwards('setSize');
|
|
127
|
+
this.emitBubblingEvent('stateChanged');
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Replaces a child of this Row or Column with another contentItem
|
|
133
|
+
*
|
|
134
|
+
* @param {lm.items.AbstractContentItem} oldChild
|
|
135
|
+
* @param {lm.items.AbstractContentItem} newChild
|
|
136
|
+
*
|
|
137
|
+
* @returns {void}
|
|
138
|
+
*/
|
|
139
|
+
replaceChild: function replaceChild(oldChild, newChild) {
|
|
140
|
+
var size = oldChild.config[this._dimension];
|
|
141
|
+
AbstractContentItem.prototype.replaceChild.call(this, oldChild, newChild);
|
|
142
|
+
newChild.config[this._dimension] = size;
|
|
143
|
+
this.callDownwards('setSize');
|
|
144
|
+
this.emitBubblingEvent('stateChanged');
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Called whenever the dimensions of this item or one of its parents change
|
|
149
|
+
*
|
|
150
|
+
* @returns {void}
|
|
151
|
+
*/
|
|
152
|
+
setSize: function setSize() {
|
|
153
|
+
if (this.contentItems.length > 0) {
|
|
154
|
+
this._calculateRelativeSizes();
|
|
155
|
+
|
|
156
|
+
this._setAbsoluteSizes();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
this.emitBubblingEvent('stateChanged');
|
|
160
|
+
this.emit('resize');
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Invoked recursively by the layout manager. AbstractContentItem.init appends
|
|
165
|
+
* the contentItem's DOM elements to the container, RowOrColumn init adds splitters
|
|
166
|
+
* in between them
|
|
167
|
+
*
|
|
168
|
+
* @package private
|
|
169
|
+
* @override AbstractContentItem._$init
|
|
170
|
+
* @returns {void}
|
|
171
|
+
*/
|
|
172
|
+
_$init: function _$init() {
|
|
173
|
+
if (this.isInitialised === true) return;
|
|
174
|
+
var i;
|
|
175
|
+
|
|
176
|
+
AbstractContentItem.prototype._$init.call(this);
|
|
177
|
+
|
|
178
|
+
for (i = 0; i < this.contentItems.length - 1; i++) {
|
|
179
|
+
this.contentItems[i].element.after(this._createSplitter(i).element);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Turns the relative sizes calculated by _calculateRelativeSizes into
|
|
185
|
+
* absolute pixel values and applies them to the children's DOM elements
|
|
186
|
+
*
|
|
187
|
+
* Assigns additional pixels to counteract Math.floor
|
|
188
|
+
*
|
|
189
|
+
* @private
|
|
190
|
+
* @returns {void}
|
|
191
|
+
*/
|
|
192
|
+
_setAbsoluteSizes: function _setAbsoluteSizes() {
|
|
193
|
+
var i,
|
|
194
|
+
sizeData = this._calculateAbsoluteSizes();
|
|
195
|
+
|
|
196
|
+
for (i = 0; i < this.contentItems.length; i++) {
|
|
197
|
+
if (sizeData.additionalPixel - i > 0) {
|
|
198
|
+
sizeData.itemSizes[i]++;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (this._isColumn) {
|
|
202
|
+
this.contentItems[i].element.width(sizeData.totalWidth);
|
|
203
|
+
this.contentItems[i].element.height(sizeData.itemSizes[i]);
|
|
204
|
+
} else {
|
|
205
|
+
this.contentItems[i].element.width(sizeData.itemSizes[i]);
|
|
206
|
+
this.contentItems[i].element.height(sizeData.totalHeight);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Calculates the absolute sizes of all of the children of this Item.
|
|
213
|
+
* @returns {object} - Set with absolute sizes and additional pixels.
|
|
214
|
+
*/
|
|
215
|
+
_calculateAbsoluteSizes: function _calculateAbsoluteSizes() {
|
|
216
|
+
var i,
|
|
217
|
+
totalSplitterSize = (this.contentItems.length - 1) * this._splitterSize,
|
|
218
|
+
totalWidth = this.element.width(),
|
|
219
|
+
totalHeight = this.element.height(),
|
|
220
|
+
totalAssigned = 0,
|
|
221
|
+
additionalPixel,
|
|
222
|
+
itemSize,
|
|
223
|
+
itemSizes = [];
|
|
224
|
+
|
|
225
|
+
if (this._isColumn) {
|
|
226
|
+
totalHeight -= totalSplitterSize;
|
|
227
|
+
} else {
|
|
228
|
+
totalWidth -= totalSplitterSize;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
for (i = 0; i < this.contentItems.length; i++) {
|
|
232
|
+
if (this._isColumn) {
|
|
233
|
+
itemSize = Math.floor(totalHeight * (this.contentItems[i].config.height / 100));
|
|
234
|
+
} else {
|
|
235
|
+
itemSize = Math.floor(totalWidth * (this.contentItems[i].config.width / 100));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
totalAssigned += itemSize;
|
|
239
|
+
itemSizes.push(itemSize);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
additionalPixel = Math.floor((this._isColumn ? totalHeight : totalWidth) - totalAssigned);
|
|
243
|
+
return {
|
|
244
|
+
itemSizes: itemSizes,
|
|
245
|
+
additionalPixel: additionalPixel,
|
|
246
|
+
totalWidth: totalWidth,
|
|
247
|
+
totalHeight: totalHeight
|
|
248
|
+
};
|
|
249
|
+
},
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Calculates the relative sizes of all children of this Item. The logic
|
|
253
|
+
* is as follows:
|
|
254
|
+
*
|
|
255
|
+
* - Add up the total size of all items that have a configured size
|
|
256
|
+
*
|
|
257
|
+
* - If the total == 100 (check for floating point errors)
|
|
258
|
+
* Excellent, job done
|
|
259
|
+
*
|
|
260
|
+
* - If the total is > 100,
|
|
261
|
+
* set the size of items without set dimensions to 1/3 and add this to the total
|
|
262
|
+
* set the size off all items so that the total is hundred relative to their original size
|
|
263
|
+
*
|
|
264
|
+
* - If the total is < 100
|
|
265
|
+
* If there are items without set dimensions, distribute the remainder to 100 evenly between them
|
|
266
|
+
* If there are no items without set dimensions, increase all items sizes relative to
|
|
267
|
+
* their original size so that they add up to 100
|
|
268
|
+
*
|
|
269
|
+
* @private
|
|
270
|
+
* @returns {void}
|
|
271
|
+
*/
|
|
272
|
+
_calculateRelativeSizes: function _calculateRelativeSizes() {
|
|
273
|
+
var i,
|
|
274
|
+
total = 0,
|
|
275
|
+
itemsWithoutSetDimension = [],
|
|
276
|
+
dimension = this._isColumn ? 'height' : 'width';
|
|
277
|
+
|
|
278
|
+
for (i = 0; i < this.contentItems.length; i++) {
|
|
279
|
+
if (this.contentItems[i].config[dimension] !== undefined) {
|
|
280
|
+
total += this.contentItems[i].config[dimension];
|
|
281
|
+
} else {
|
|
282
|
+
itemsWithoutSetDimension.push(this.contentItems[i]);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Everything adds up to hundred, all good :-)
|
|
287
|
+
*/
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
if (Math.round(total) === 100) {
|
|
291
|
+
this._respectMinItemWidth();
|
|
292
|
+
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Allocate the remaining size to the items without a set dimension
|
|
297
|
+
*/
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
if (Math.round(total) < 100 && itemsWithoutSetDimension.length > 0) {
|
|
301
|
+
for (i = 0; i < itemsWithoutSetDimension.length; i++) {
|
|
302
|
+
itemsWithoutSetDimension[i].config[dimension] = (100 - total) / itemsWithoutSetDimension.length;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
this._respectMinItemWidth();
|
|
306
|
+
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* If the total is > 100, but there are also items without a set dimension left, assing 50
|
|
311
|
+
* as their dimension and add it to the total
|
|
312
|
+
*
|
|
313
|
+
* This will be reset in the next step
|
|
314
|
+
*/
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
if (Math.round(total) > 100) {
|
|
318
|
+
for (i = 0; i < itemsWithoutSetDimension.length; i++) {
|
|
319
|
+
itemsWithoutSetDimension[i].config[dimension] = 50;
|
|
320
|
+
total += 50;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Set every items size relative to 100 relative to its size to total
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
for (i = 0; i < this.contentItems.length; i++) {
|
|
329
|
+
this.contentItems[i].config[dimension] = this.contentItems[i].config[dimension] / total * 100;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
this._respectMinItemWidth();
|
|
333
|
+
},
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Adjusts the column widths to respect the dimensions minItemWidth if set.
|
|
337
|
+
* @returns {}
|
|
338
|
+
*/
|
|
339
|
+
_respectMinItemWidth: function _respectMinItemWidth() {
|
|
340
|
+
var minItemWidth = this.layoutManager.config.dimensions ? this.layoutManager.config.dimensions.minItemWidth || 0 : 0,
|
|
341
|
+
sizeData = null,
|
|
342
|
+
entriesOverMin = [],
|
|
343
|
+
totalOverMin = 0,
|
|
344
|
+
totalUnderMin = 0,
|
|
345
|
+
remainingWidth = 0,
|
|
346
|
+
itemSize = 0,
|
|
347
|
+
contentItem = null,
|
|
348
|
+
reducePercent,
|
|
349
|
+
reducedWidth,
|
|
350
|
+
allEntries = [],
|
|
351
|
+
entry;
|
|
352
|
+
|
|
353
|
+
if (this._isColumn || !minItemWidth || this.contentItems.length <= 1) {
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
sizeData = this._calculateAbsoluteSizes();
|
|
358
|
+
/**
|
|
359
|
+
* Figure out how much we are under the min item size total and how much room we have to use.
|
|
360
|
+
*/
|
|
361
|
+
|
|
362
|
+
for (var i = 0; i < this.contentItems.length; i++) {
|
|
363
|
+
contentItem = this.contentItems[i];
|
|
364
|
+
itemSize = sizeData.itemSizes[i];
|
|
365
|
+
|
|
366
|
+
if (itemSize < minItemWidth) {
|
|
367
|
+
totalUnderMin += minItemWidth - itemSize;
|
|
368
|
+
entry = {
|
|
369
|
+
width: minItemWidth
|
|
370
|
+
};
|
|
371
|
+
} else {
|
|
372
|
+
totalOverMin += itemSize - minItemWidth;
|
|
373
|
+
entry = {
|
|
374
|
+
width: itemSize
|
|
375
|
+
};
|
|
376
|
+
entriesOverMin.push(entry);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
allEntries.push(entry);
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* If there is nothing under min, or there is not enough over to make up the difference, do nothing.
|
|
383
|
+
*/
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
if (totalUnderMin === 0 || totalUnderMin > totalOverMin) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Evenly reduce all columns that are over the min item width to make up the difference.
|
|
391
|
+
*/
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
reducePercent = totalUnderMin / totalOverMin;
|
|
395
|
+
remainingWidth = totalUnderMin;
|
|
396
|
+
|
|
397
|
+
for (i = 0; i < entriesOverMin.length; i++) {
|
|
398
|
+
entry = entriesOverMin[i];
|
|
399
|
+
reducedWidth = Math.round((entry.width - minItemWidth) * reducePercent);
|
|
400
|
+
remainingWidth -= reducedWidth;
|
|
401
|
+
entry.width -= reducedWidth;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Take anything remaining from the last item.
|
|
405
|
+
*/
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
if (remainingWidth !== 0) {
|
|
409
|
+
allEntries[allEntries.length - 1].width -= remainingWidth;
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Set every items size relative to 100 relative to its size to total
|
|
413
|
+
*/
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
for (i = 0; i < this.contentItems.length; i++) {
|
|
417
|
+
this.contentItems[i].config.width = allEntries[i].width / sizeData.totalWidth * 100;
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Instantiates a new lm.controls.Splitter, binds events to it and adds
|
|
423
|
+
* it to the array of splitters at the position specified as the index argument
|
|
424
|
+
*
|
|
425
|
+
* What it doesn't do though is append the splitter to the DOM
|
|
426
|
+
*
|
|
427
|
+
* @param {Int} index The position of the splitter
|
|
428
|
+
*
|
|
429
|
+
* @returns {lm.controls.Splitter}
|
|
430
|
+
*/
|
|
431
|
+
_createSplitter: function _createSplitter(index) {
|
|
432
|
+
var splitter;
|
|
433
|
+
splitter = new controls.Splitter(this._isColumn, this._splitterSize, this._splitterGrabSize);
|
|
434
|
+
splitter.on('drag', utils.fnBind(this._onSplitterDrag, this, [splitter]), this);
|
|
435
|
+
splitter.on('dragStop', utils.fnBind(this._onSplitterDragStop, this, [splitter]), this);
|
|
436
|
+
splitter.on('dragStart', utils.fnBind(this._onSplitterDragStart, this, [splitter]), this);
|
|
437
|
+
|
|
438
|
+
this._splitter.splice(index, 0, splitter);
|
|
439
|
+
|
|
440
|
+
return splitter;
|
|
441
|
+
},
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Locates the instance of lm.controls.Splitter in the array of
|
|
445
|
+
* registered splitters and returns a map containing the contentItem
|
|
446
|
+
* before and after the splitters, both of which are affected if the
|
|
447
|
+
* splitter is moved
|
|
448
|
+
*
|
|
449
|
+
* @param {lm.controls.Splitter} splitter
|
|
450
|
+
*
|
|
451
|
+
* @returns {Object} A map of contentItems that the splitter affects
|
|
452
|
+
*/
|
|
453
|
+
_getItemsForSplitter: function _getItemsForSplitter(splitter) {
|
|
454
|
+
var index = utils.indexOf(splitter, this._splitter);
|
|
455
|
+
return {
|
|
456
|
+
before: this.contentItems[index],
|
|
457
|
+
after: this.contentItems[index + 1]
|
|
458
|
+
};
|
|
459
|
+
},
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Gets the minimum dimensions for the given item configuration array
|
|
463
|
+
* @param item
|
|
464
|
+
* @private
|
|
465
|
+
*/
|
|
466
|
+
_getMinimumDimensions: function _getMinimumDimensions(arr) {
|
|
467
|
+
var minWidth = 0,
|
|
468
|
+
minHeight = 0;
|
|
469
|
+
|
|
470
|
+
for (var i = 0; i < arr.length; ++i) {
|
|
471
|
+
minWidth = Math.max(arr[i].minWidth || 0, minWidth);
|
|
472
|
+
minHeight = Math.max(arr[i].minHeight || 0, minHeight);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
return {
|
|
476
|
+
horizontal: minWidth,
|
|
477
|
+
vertical: minHeight
|
|
478
|
+
};
|
|
479
|
+
},
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Invoked when a splitter's dragListener fires dragStart. Calculates the splitters
|
|
483
|
+
* movement area once (so that it doesn't need calculating on every mousemove event)
|
|
484
|
+
*
|
|
485
|
+
* @param {lm.controls.Splitter} splitter
|
|
486
|
+
*
|
|
487
|
+
* @returns {void}
|
|
488
|
+
*/
|
|
489
|
+
_onSplitterDragStart: function _onSplitterDragStart(splitter) {
|
|
490
|
+
var items = this._getItemsForSplitter(splitter),
|
|
491
|
+
minSize = this.layoutManager.config.dimensions[this._isColumn ? 'minItemHeight' : 'minItemWidth'];
|
|
492
|
+
|
|
493
|
+
var beforeMinDim = this._getMinimumDimensions(items.before.config.content);
|
|
494
|
+
|
|
495
|
+
var beforeMinSize = this._isColumn ? beforeMinDim.vertical : beforeMinDim.horizontal;
|
|
496
|
+
|
|
497
|
+
var afterMinDim = this._getMinimumDimensions(items.after.config.content);
|
|
498
|
+
|
|
499
|
+
var afterMinSize = this._isColumn ? afterMinDim.vertical : afterMinDim.horizontal;
|
|
500
|
+
this._splitterPosition = 0;
|
|
501
|
+
this._splitterMinPosition = -1 * (items.before.element[this._dimension]() - (beforeMinSize || minSize));
|
|
502
|
+
this._splitterMaxPosition = items.after.element[this._dimension]() - (afterMinSize || minSize);
|
|
503
|
+
},
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Invoked when a splitter's DragListener fires drag. Updates the splitters DOM position,
|
|
507
|
+
* but not the sizes of the elements the splitter controls in order to minimize resize events
|
|
508
|
+
*
|
|
509
|
+
* @param {lm.controls.Splitter} splitter
|
|
510
|
+
* @param {Int} offsetX Relative pixel values to the splitters original position. Can be negative
|
|
511
|
+
* @param {Int} offsetY Relative pixel values to the splitters original position. Can be negative
|
|
512
|
+
*
|
|
513
|
+
* @returns {void}
|
|
514
|
+
*/
|
|
515
|
+
_onSplitterDrag: function _onSplitterDrag(splitter, offsetX, offsetY) {
|
|
516
|
+
var offset = this._isColumn ? offsetY : offsetX;
|
|
517
|
+
|
|
518
|
+
if (offset > this._splitterMinPosition && offset < this._splitterMaxPosition) {
|
|
519
|
+
this._splitterPosition = offset;
|
|
520
|
+
splitter.element.css(this._isColumn ? 'top' : 'left', offset);
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Invoked when a splitter's DragListener fires dragStop. Resets the splitters DOM position,
|
|
526
|
+
* and applies the new sizes to the elements before and after the splitter and their children
|
|
527
|
+
* on the next animation frame
|
|
528
|
+
*
|
|
529
|
+
* @param {lm.controls.Splitter} splitter
|
|
530
|
+
*
|
|
531
|
+
* @returns {void}
|
|
532
|
+
*/
|
|
533
|
+
_onSplitterDragStop: function _onSplitterDragStop(splitter) {
|
|
534
|
+
var items = this._getItemsForSplitter(splitter),
|
|
535
|
+
sizeBefore = items.before.element[this._dimension](),
|
|
536
|
+
sizeAfter = items.after.element[this._dimension](),
|
|
537
|
+
splitterPositionInRange = (this._splitterPosition + sizeBefore) / (sizeBefore + sizeAfter),
|
|
538
|
+
totalRelativeSize = items.before.config[this._dimension] + items.after.config[this._dimension];
|
|
539
|
+
|
|
540
|
+
items.before.config[this._dimension] = splitterPositionInRange * totalRelativeSize;
|
|
541
|
+
items.after.config[this._dimension] = (1 - splitterPositionInRange) * totalRelativeSize;
|
|
542
|
+
splitter.element.css({
|
|
543
|
+
top: 0,
|
|
544
|
+
left: 0
|
|
545
|
+
});
|
|
546
|
+
utils.animFrame(utils.fnBind(this.callDownwards, this, ['setSize']));
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
export default RowOrColumn;
|
|
550
|
+
//# sourceMappingURL=RowOrColumn.js.map
|
|
@@ -0,0 +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,iBAAL,GAAyBV,aAAa,CAACC,MAAd,CAAqBO,UAArB,CAAgCG,eAAzD;EACA,KAAKC,SAAL,GAAiBb,QAAjB;EACA,KAAKc,UAAL,GAAkBd,QAAQ,GAAG,QAAH,G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