@deephaven/golden-layout 0.43.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/goldenlayout-base.css +1 -1
- package/css/goldenlayout-base.css.map +1 -1
- package/css/goldenlayout-dark-theme.css +1 -1
- package/css/goldenlayout-dark-theme.css.map +1 -1
- package/dist/GoldenLayout.module.css +1 -0
- package/dist/GoldenLayout.module.css.map +1 -0
- package/dist/GoldenLayoutThemeExport.js +6 -0
- package/dist/GoldenLayoutThemeExport.js.map +1 -0
- package/dist/LayoutManager.js +1001 -0
- package/dist/LayoutManager.js.map +1 -0
- package/dist/base.js +16 -0
- package/dist/base.js.map +1 -0
- package/dist/config/Config.js +42 -0
- package/dist/config/Config.js.map +1 -0
- package/dist/config/ItemConfig.js +14 -0
- package/dist/config/ItemConfig.js.map +1 -0
- package/dist/config/index.js +3 -0
- package/dist/config/index.js.map +1 -0
- package/dist/container/ItemContainer.js +199 -0
- package/dist/container/ItemContainer.js.map +1 -0
- package/dist/container/index.js +3 -0
- package/dist/container/index.js.map +1 -0
- package/dist/controls/BrowserPopout.js +250 -0
- package/dist/controls/BrowserPopout.js.map +1 -0
- package/dist/controls/DragProxy.js +204 -0
- package/dist/controls/DragProxy.js.map +1 -0
- package/dist/controls/DragSource.js +52 -0
- package/dist/controls/DragSource.js.map +1 -0
- package/dist/controls/DragSourceFromEvent.js +71 -0
- package/dist/controls/DragSourceFromEvent.js.map +1 -0
- package/dist/controls/DropTargetIndicator.js +27 -0
- package/dist/controls/DropTargetIndicator.js.map +1 -0
- package/dist/controls/Header.js +736 -0
- package/dist/controls/Header.js.map +1 -0
- package/dist/controls/HeaderButton.js +22 -0
- package/dist/controls/HeaderButton.js.map +1 -0
- package/dist/controls/Splitter.js +49 -0
- package/dist/controls/Splitter.js.map +1 -0
- package/dist/controls/Tab.js +225 -0
- package/dist/controls/Tab.js.map +1 -0
- package/dist/controls/index.js +10 -0
- package/dist/controls/index.js.map +1 -0
- package/dist/declaration.d.js +2 -0
- package/dist/declaration.d.js.map +1 -0
- package/dist/errors/ConfigurationError.js +14 -0
- package/dist/errors/ConfigurationError.js.map +1 -0
- package/dist/errors/index.js +2 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/items/AbstractContentItem.js +565 -0
- package/dist/items/AbstractContentItem.js.map +1 -0
- package/dist/items/Component.js +80 -0
- package/dist/items/Component.js.map +1 -0
- package/dist/items/Root.js +100 -0
- package/dist/items/Root.js.map +1 -0
- package/dist/items/RowOrColumn.js +488 -0
- package/dist/items/RowOrColumn.js.map +1 -0
- package/dist/items/Stack.js +479 -0
- package/dist/items/Stack.js.map +1 -0
- package/dist/items/index.js +8 -0
- package/dist/items/index.js.map +1 -0
- package/dist/utils/BubblingEvent.js +17 -0
- package/dist/utils/BubblingEvent.js.map +1 -0
- package/dist/utils/ConfigMinifier.js +147 -0
- package/dist/utils/ConfigMinifier.js.map +1 -0
- package/dist/utils/DragListener.js +125 -0
- package/dist/utils/DragListener.js.map +1 -0
- package/dist/utils/EventEmitter.js +117 -0
- package/dist/utils/EventEmitter.js.map +1 -0
- package/dist/utils/EventHub.js +108 -0
- package/dist/utils/EventHub.js.map +1 -0
- package/dist/utils/ReactComponentHandler.js +136 -0
- package/dist/utils/ReactComponentHandler.js.map +1 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/utils.js +65 -0
- package/dist/utils/utils.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
import { animFrame, BubblingEvent, EventEmitter } from "../utils/index.js";
|
|
5
|
+
import { ConfigurationError } from "../errors/index.js";
|
|
6
|
+
import { itemDefaultConfig } from "../config/index.js";
|
|
7
|
+
export function isStack(item) {
|
|
8
|
+
return item.isStack;
|
|
9
|
+
}
|
|
10
|
+
export function isComponent(item) {
|
|
11
|
+
return item.isComponent;
|
|
12
|
+
}
|
|
13
|
+
export function isRoot(item) {
|
|
14
|
+
return item.isRoot;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* This is the baseclass that all content items inherit from.
|
|
18
|
+
* Most methods provide a subset of what the sub-classes do.
|
|
19
|
+
*
|
|
20
|
+
* It also provides a number of functions for tree traversal
|
|
21
|
+
*
|
|
22
|
+
* @param {lm.LayoutManager} layoutManager
|
|
23
|
+
* @param {item node configuration} config
|
|
24
|
+
* @param {lm.item} parent
|
|
25
|
+
*
|
|
26
|
+
* @event stateChanged
|
|
27
|
+
* @event beforeItemDestroyed
|
|
28
|
+
* @event itemDestroyed
|
|
29
|
+
* @event itemCreated
|
|
30
|
+
* @event componentCreated
|
|
31
|
+
* @event rowCreated
|
|
32
|
+
* @event columnCreated
|
|
33
|
+
* @event stackCreated
|
|
34
|
+
*
|
|
35
|
+
* @constructor
|
|
36
|
+
*/
|
|
37
|
+
export default class AbstractContentItem extends EventEmitter {
|
|
38
|
+
constructor(layoutManager, config, parent, element) {
|
|
39
|
+
super();
|
|
40
|
+
_defineProperty(this, "config", void 0);
|
|
41
|
+
_defineProperty(this, "type", void 0);
|
|
42
|
+
_defineProperty(this, "contentItems", void 0);
|
|
43
|
+
_defineProperty(this, "parent", void 0);
|
|
44
|
+
_defineProperty(this, "layoutManager", void 0);
|
|
45
|
+
_defineProperty(this, "element", void 0);
|
|
46
|
+
_defineProperty(this, "childElementContainer", void 0);
|
|
47
|
+
_defineProperty(this, "componentName", void 0);
|
|
48
|
+
_defineProperty(this, "isInitialised", false);
|
|
49
|
+
_defineProperty(this, "isMaximised", false);
|
|
50
|
+
_defineProperty(this, "isRoot", false);
|
|
51
|
+
_defineProperty(this, "isRow", false);
|
|
52
|
+
_defineProperty(this, "isColumn", false);
|
|
53
|
+
_defineProperty(this, "isStack", false);
|
|
54
|
+
_defineProperty(this, "isComponent", false);
|
|
55
|
+
_defineProperty(this, "tab", void 0);
|
|
56
|
+
_defineProperty(this, "_pendingEventPropagations", void 0);
|
|
57
|
+
_defineProperty(this, "_throttledEvents", void 0);
|
|
58
|
+
this.element = element;
|
|
59
|
+
|
|
60
|
+
// Some GL things expect this config to not change
|
|
61
|
+
this.config = this._extendItemNode(config);
|
|
62
|
+
this.type = config.type;
|
|
63
|
+
this.contentItems = [];
|
|
64
|
+
this.parent = parent;
|
|
65
|
+
this.layoutManager = layoutManager;
|
|
66
|
+
this._pendingEventPropagations = {};
|
|
67
|
+
this._throttledEvents = ['stateChanged'];
|
|
68
|
+
this.on(EventEmitter.ALL_EVENT, this._propagateEvent, this);
|
|
69
|
+
if (config.content) {
|
|
70
|
+
this._createContentItems(config);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Set the size of the component and its children, called recursively
|
|
76
|
+
*
|
|
77
|
+
* @abstract
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Calls a method recursively downwards on the tree
|
|
82
|
+
*
|
|
83
|
+
* @param functionName the name of the function to be called
|
|
84
|
+
* @param functionArguments optional arguments that are passed to every function
|
|
85
|
+
* @param bottomUp Call methods from bottom to top, defaults to false
|
|
86
|
+
* @param skipSelf Don't invoke the method on the class that calls it, defaults to false
|
|
87
|
+
*/
|
|
88
|
+
callDownwards(functionName) {
|
|
89
|
+
var functionArguments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
90
|
+
var bottomUp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
91
|
+
var skipSelf = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
92
|
+
if (bottomUp !== true && skipSelf !== true) {
|
|
93
|
+
this[functionName].apply(this, functionArguments);
|
|
94
|
+
}
|
|
95
|
+
for (var i = 0; i < this.contentItems.length; i++) {
|
|
96
|
+
this.contentItems[i].callDownwards(functionName, functionArguments, bottomUp);
|
|
97
|
+
}
|
|
98
|
+
if (bottomUp === true && skipSelf !== true) {
|
|
99
|
+
this[functionName].apply(this, functionArguments);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Removes a child node (and its children) from the tree
|
|
105
|
+
*
|
|
106
|
+
* @param contentItem
|
|
107
|
+
*/
|
|
108
|
+
removeChild(contentItem) {
|
|
109
|
+
var _this$config$content;
|
|
110
|
+
var keepChild = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
111
|
+
/*
|
|
112
|
+
* Get the position of the item that's to be removed within all content items this node contains
|
|
113
|
+
*/
|
|
114
|
+
var index = this.contentItems.indexOf(contentItem);
|
|
115
|
+
|
|
116
|
+
/*
|
|
117
|
+
* Make sure the content item to be removed is actually a child of this item
|
|
118
|
+
*/
|
|
119
|
+
if (index === -1) {
|
|
120
|
+
throw new Error("Can't remove child item. Unknown content item");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Call ._$destroy on the content item. This also calls ._$destroy on all its children
|
|
125
|
+
*/
|
|
126
|
+
if (keepChild !== true) {
|
|
127
|
+
this.contentItems[index]._$destroy();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Remove the content item from this nodes array of children
|
|
132
|
+
*/
|
|
133
|
+
this.contentItems.splice(index, 1);
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Remove the item from the configuration
|
|
137
|
+
*/
|
|
138
|
+
(_this$config$content = this.config.content) === null || _this$config$content === void 0 ? void 0 : _this$config$content.splice(index, 1);
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* If this node still contains other content items, adjust their size
|
|
142
|
+
*/
|
|
143
|
+
if (this.contentItems.length > 0) {
|
|
144
|
+
this.callDownwards('setSize');
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* If this was the last content item, remove this node as well
|
|
148
|
+
*/
|
|
149
|
+
} else if (this.type !== 'root' && this.config.isClosable) {
|
|
150
|
+
var _this$parent;
|
|
151
|
+
(_this$parent = this.parent) === null || _this$parent === void 0 ? void 0 : _this$parent.removeChild(this);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Sets up the tree structure for the newly added child
|
|
157
|
+
* The responsibility for the actual DOM manipulations lies
|
|
158
|
+
* with the concrete item
|
|
159
|
+
*
|
|
160
|
+
* @param contentItem
|
|
161
|
+
* @param index If omitted item will be appended
|
|
162
|
+
*/
|
|
163
|
+
addChild(contentItem, index) {
|
|
164
|
+
contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);
|
|
165
|
+
if (index === undefined) {
|
|
166
|
+
index = this.contentItems.length;
|
|
167
|
+
}
|
|
168
|
+
this.contentItems.splice(index, 0, contentItem);
|
|
169
|
+
if (this.config.content === undefined) {
|
|
170
|
+
this.config.content = [];
|
|
171
|
+
}
|
|
172
|
+
this.config.content.splice(index, 0, contentItem.config);
|
|
173
|
+
contentItem.parent = this;
|
|
174
|
+
if (contentItem.parent.isInitialised === true && contentItem.isInitialised === false) {
|
|
175
|
+
contentItem._$init();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Replaces oldChild with newChild. This used to use jQuery.replaceWith... which for
|
|
181
|
+
* some reason removes all event listeners, so isn't really an option.
|
|
182
|
+
*
|
|
183
|
+
* @param oldChild
|
|
184
|
+
* @param newChild
|
|
185
|
+
*/
|
|
186
|
+
replaceChild(oldChild, newChild) {
|
|
187
|
+
var _$destroyOldChild = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
188
|
+
newChild = this.layoutManager._$normalizeContentItem(newChild);
|
|
189
|
+
var index = this.contentItems.indexOf(oldChild);
|
|
190
|
+
var parentNode = oldChild.element[0].parentNode;
|
|
191
|
+
if (index === -1) {
|
|
192
|
+
throw new Error("Can't replace child. oldChild is not child of this");
|
|
193
|
+
}
|
|
194
|
+
parentNode === null || parentNode === void 0 ? void 0 : parentNode.replaceChild(newChild.element[0], oldChild.element[0]);
|
|
195
|
+
|
|
196
|
+
/*
|
|
197
|
+
* Optionally destroy the old content item
|
|
198
|
+
*/
|
|
199
|
+
if (_$destroyOldChild === true) {
|
|
200
|
+
oldChild.parent = null;
|
|
201
|
+
oldChild._$destroy();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/*
|
|
205
|
+
* Wire the new contentItem into the tree
|
|
206
|
+
*/
|
|
207
|
+
this.contentItems[index] = newChild;
|
|
208
|
+
newChild.parent = this;
|
|
209
|
+
|
|
210
|
+
/*
|
|
211
|
+
* Update tab reference
|
|
212
|
+
*/
|
|
213
|
+
if (isStack(this)) {
|
|
214
|
+
this.header.tabs[index].contentItem = newChild;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
//TODO This doesn't update the config... refactor to leave item nodes untouched after creation
|
|
218
|
+
if (newChild.parent.isInitialised === true && newChild.isInitialised === false) {
|
|
219
|
+
newChild._$init();
|
|
220
|
+
}
|
|
221
|
+
this.callDownwards('setSize');
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Convenience method.
|
|
226
|
+
* Shorthand for this.parent.removeChild( this )
|
|
227
|
+
*/
|
|
228
|
+
remove() {
|
|
229
|
+
var _this$parent2;
|
|
230
|
+
(_this$parent2 = this.parent) === null || _this$parent2 === void 0 ? void 0 : _this$parent2.removeChild(this);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Removes the component from the layout and creates a new
|
|
235
|
+
* browser window with the component and its children inside
|
|
236
|
+
*/
|
|
237
|
+
popout() {
|
|
238
|
+
var browserPopout = this.layoutManager.createPopout(this);
|
|
239
|
+
this.emitBubblingEvent('stateChanged');
|
|
240
|
+
return browserPopout;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Maximises the Item or minimises it if it is already maximised
|
|
245
|
+
*/
|
|
246
|
+
toggleMaximise(e) {
|
|
247
|
+
e && e.preventDefault();
|
|
248
|
+
if (this.isMaximised === true) {
|
|
249
|
+
this.layoutManager._$minimiseItem(this);
|
|
250
|
+
} else {
|
|
251
|
+
this.layoutManager._$maximiseItem(this);
|
|
252
|
+
}
|
|
253
|
+
this.isMaximised = !this.isMaximised;
|
|
254
|
+
this.emitBubblingEvent('stateChanged');
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Selects the item if it is not already selected
|
|
259
|
+
*/
|
|
260
|
+
select() {
|
|
261
|
+
if (this.layoutManager.selectedItem !== this) {
|
|
262
|
+
this.layoutManager.selectItem(this, true);
|
|
263
|
+
this.element.addClass('lm_selected');
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* De-selects the item if it is selected
|
|
269
|
+
*/
|
|
270
|
+
deselect() {
|
|
271
|
+
if (this.layoutManager.selectedItem === this) {
|
|
272
|
+
this.layoutManager.selectedItem = null;
|
|
273
|
+
this.element.removeClass('lm_selected');
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Set this component's title
|
|
279
|
+
* @param title
|
|
280
|
+
*/
|
|
281
|
+
setTitle(title) {
|
|
282
|
+
this.config.title = title;
|
|
283
|
+
this.emit('titleChanged', title);
|
|
284
|
+
this.emitBubblingEvent('stateChanged');
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Checks whether a provided id is present
|
|
289
|
+
* @param id
|
|
290
|
+
* @returns isPresent
|
|
291
|
+
*/
|
|
292
|
+
hasId(id) {
|
|
293
|
+
if (!this.config.id) {
|
|
294
|
+
return false;
|
|
295
|
+
} else if (typeof this.config.id === 'string') {
|
|
296
|
+
return this.config.id === id;
|
|
297
|
+
} else if (this.config.id instanceof Array) {
|
|
298
|
+
return this.config.id.indexOf(id) !== -1;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Adds an id. Adds it as a string if the component doesn't
|
|
304
|
+
* have an id yet or creates/uses an array
|
|
305
|
+
* @param id
|
|
306
|
+
*/
|
|
307
|
+
addId(id) {
|
|
308
|
+
if (this.hasId(id)) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
if (!this.config.id) {
|
|
312
|
+
this.config.id = id;
|
|
313
|
+
} else if (typeof this.config.id === 'string') {
|
|
314
|
+
this.config.id = [this.config.id, id];
|
|
315
|
+
} else if (this.config.id instanceof Array) {
|
|
316
|
+
this.config.id.push(id);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Removes an existing id. Throws an error
|
|
322
|
+
* if the id is not present
|
|
323
|
+
* @param id
|
|
324
|
+
*/
|
|
325
|
+
removeId(id) {
|
|
326
|
+
if (!this.hasId(id)) {
|
|
327
|
+
throw new Error('Id not found');
|
|
328
|
+
}
|
|
329
|
+
if (typeof this.config.id === 'string') {
|
|
330
|
+
delete this.config.id;
|
|
331
|
+
} else if (this.config.id instanceof Array) {
|
|
332
|
+
var index = this.config.id.indexOf(id);
|
|
333
|
+
this.config.id.splice(index, 1);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/****************************************
|
|
338
|
+
* SELECTOR
|
|
339
|
+
****************************************/
|
|
340
|
+
getItemsByFilter(filter) {
|
|
341
|
+
var result = [];
|
|
342
|
+
var next = function next(contentItem) {
|
|
343
|
+
for (var i = 0; i < contentItem.contentItems.length; i++) {
|
|
344
|
+
if (filter(contentItem.contentItems[i]) === true) {
|
|
345
|
+
result.push(contentItem.contentItems[i]);
|
|
346
|
+
}
|
|
347
|
+
next(contentItem.contentItems[i]);
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
next(this);
|
|
351
|
+
return result;
|
|
352
|
+
}
|
|
353
|
+
getItemsById(id) {
|
|
354
|
+
return this.getItemsByFilter(function (item) {
|
|
355
|
+
if (item.config.id instanceof Array) {
|
|
356
|
+
return item.config.id.indexOf(id) !== -1;
|
|
357
|
+
} else {
|
|
358
|
+
return item.config.id === id;
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
getItemsByType(type) {
|
|
363
|
+
return this._$getItemsByProperty('type', type);
|
|
364
|
+
}
|
|
365
|
+
getComponentsByName(componentName) {
|
|
366
|
+
var components = this._$getItemsByProperty('componentName', componentName);
|
|
367
|
+
var instances = [];
|
|
368
|
+
for (var i = 0; i < components.length; i++) {
|
|
369
|
+
instances.push(components[i].instance);
|
|
370
|
+
}
|
|
371
|
+
return instances;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/****************************************
|
|
375
|
+
* PACKAGE PRIVATE
|
|
376
|
+
****************************************/
|
|
377
|
+
_$getItemsByProperty(key, value) {
|
|
378
|
+
return this.getItemsByFilter(function (item) {
|
|
379
|
+
return item[key] === value;
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
_$setParent(parent) {
|
|
383
|
+
this.parent = parent;
|
|
384
|
+
}
|
|
385
|
+
_$highlightDropZone(x, y, area) {
|
|
386
|
+
var _this$layoutManager$d;
|
|
387
|
+
(_this$layoutManager$d = this.layoutManager.dropTargetIndicator) === null || _this$layoutManager$d === void 0 ? void 0 : _this$layoutManager$d.highlightArea(area);
|
|
388
|
+
}
|
|
389
|
+
_$onDrop(contentItem, area) {
|
|
390
|
+
this.addChild(contentItem);
|
|
391
|
+
}
|
|
392
|
+
_$hide() {
|
|
393
|
+
this._callOnActiveComponents('hide');
|
|
394
|
+
this.element.hide();
|
|
395
|
+
this.layoutManager.updateSize();
|
|
396
|
+
}
|
|
397
|
+
_$show() {
|
|
398
|
+
this._callOnActiveComponents('show');
|
|
399
|
+
this.element.show();
|
|
400
|
+
this.layoutManager.updateSize();
|
|
401
|
+
}
|
|
402
|
+
_callOnActiveComponents(methodName) {
|
|
403
|
+
var stacks = this.getItemsByType('stack');
|
|
404
|
+
var activeContentItem = null;
|
|
405
|
+
for (var i = 0; i < stacks.length; i++) {
|
|
406
|
+
activeContentItem = stacks[i].getActiveContentItem();
|
|
407
|
+
if (activeContentItem && isComponent(activeContentItem)) {
|
|
408
|
+
activeContentItem.container[methodName]();
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Destroys this item ands its children
|
|
415
|
+
*/
|
|
416
|
+
_$destroy() {
|
|
417
|
+
this.emitBubblingEvent('beforeItemDestroyed');
|
|
418
|
+
this.callDownwards('_$destroy', [], true, true);
|
|
419
|
+
this.element.remove();
|
|
420
|
+
this.emitBubblingEvent('itemDestroyed');
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Returns the area the component currently occupies in the format
|
|
425
|
+
*
|
|
426
|
+
* {
|
|
427
|
+
* x1: int
|
|
428
|
+
* x2: int
|
|
429
|
+
* y1: int
|
|
430
|
+
* y2: int
|
|
431
|
+
* contentItem: contentItem
|
|
432
|
+
* }
|
|
433
|
+
*/
|
|
434
|
+
_$getArea(element) {
|
|
435
|
+
var _element$offset, _element$width, _element$height;
|
|
436
|
+
element = element || this.element;
|
|
437
|
+
var offset = (_element$offset = element.offset()) !== null && _element$offset !== void 0 ? _element$offset : {
|
|
438
|
+
left: 0,
|
|
439
|
+
top: 0
|
|
440
|
+
};
|
|
441
|
+
var width = (_element$width = element.width()) !== null && _element$width !== void 0 ? _element$width : 0;
|
|
442
|
+
var height = (_element$height = element.height()) !== null && _element$height !== void 0 ? _element$height : 0;
|
|
443
|
+
return {
|
|
444
|
+
x1: offset.left,
|
|
445
|
+
y1: offset.top,
|
|
446
|
+
x2: offset.left + width,
|
|
447
|
+
y2: offset.top + height,
|
|
448
|
+
surface: width * height,
|
|
449
|
+
contentItem: this,
|
|
450
|
+
side: ''
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* The tree of content items is created in two steps: First all content items are instantiated,
|
|
456
|
+
* then init is called recursively from top to bottem. This is the basic init function,
|
|
457
|
+
* it can be used, extended or overwritten by the content items
|
|
458
|
+
*
|
|
459
|
+
* Its behaviour depends on the content item
|
|
460
|
+
*/
|
|
461
|
+
_$init() {
|
|
462
|
+
this.setSize();
|
|
463
|
+
for (var i = 0; i < this.contentItems.length; i++) {
|
|
464
|
+
var _this$childElementCon;
|
|
465
|
+
(_this$childElementCon = this.childElementContainer) === null || _this$childElementCon === void 0 ? void 0 : _this$childElementCon.append(this.contentItems[i].element);
|
|
466
|
+
}
|
|
467
|
+
this.isInitialised = true;
|
|
468
|
+
this.emitBubblingEvent('itemCreated');
|
|
469
|
+
this.emitBubblingEvent(this.type + 'Created');
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Emit an event that bubbles up the item tree.
|
|
474
|
+
*
|
|
475
|
+
* @param name The name of the event
|
|
476
|
+
*/
|
|
477
|
+
emitBubblingEvent(name) {
|
|
478
|
+
var event = new BubblingEvent(name, this);
|
|
479
|
+
this.emit(name, event);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Private method, creates all content items for this node at initialisation time
|
|
484
|
+
* PLEASE NOTE, please see addChild for adding contentItems add runtime
|
|
485
|
+
* @param {configuration item node} config
|
|
486
|
+
*/
|
|
487
|
+
_createContentItems(config) {
|
|
488
|
+
var oContentItem;
|
|
489
|
+
if (!(config.content instanceof Array)) {
|
|
490
|
+
throw new ConfigurationError('content must be an Array', config);
|
|
491
|
+
}
|
|
492
|
+
for (var i = 0; i < config.content.length; i++) {
|
|
493
|
+
oContentItem = this.layoutManager.createContentItem(config.content[i], this);
|
|
494
|
+
this.contentItems.push(oContentItem);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Extends an item configuration node with default settings
|
|
500
|
+
* @param config
|
|
501
|
+
* @returns extended config
|
|
502
|
+
*/
|
|
503
|
+
_extendItemNode(config) {
|
|
504
|
+
for (var [key, value] of Object.entries(itemDefaultConfig)) {
|
|
505
|
+
// This just appeases TS
|
|
506
|
+
var k = key;
|
|
507
|
+
if (config[k] === undefined) {
|
|
508
|
+
config[k] = value;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
return config;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Called for every event on the item tree. Decides whether the event is a bubbling
|
|
516
|
+
* event and propagates it to its parent
|
|
517
|
+
*
|
|
518
|
+
* @param name the name of the event
|
|
519
|
+
* @param event
|
|
520
|
+
*/
|
|
521
|
+
_propagateEvent(name, event) {
|
|
522
|
+
if (event instanceof BubblingEvent && event.isPropagationStopped === false && this.isInitialised === true) {
|
|
523
|
+
/**
|
|
524
|
+
* In some cases (e.g. if an element is created from a DragSource) it
|
|
525
|
+
* doesn't have a parent and is not below root. If that's the case
|
|
526
|
+
* propagate the bubbling event from the top level of the substree directly
|
|
527
|
+
* to the layoutManager
|
|
528
|
+
*/
|
|
529
|
+
if (this.isRoot === false && this.parent) {
|
|
530
|
+
this.parent.emit.apply(this.parent, [name, event]);
|
|
531
|
+
} else {
|
|
532
|
+
this._scheduleEventPropagationToLayoutManager(name, event);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* All raw events bubble up to the root element. Some events that
|
|
539
|
+
* are propagated to - and emitted by - the layoutManager however are
|
|
540
|
+
* only string-based, batched and sanitized to make them more usable
|
|
541
|
+
*
|
|
542
|
+
* @param name the name of the event
|
|
543
|
+
*/
|
|
544
|
+
_scheduleEventPropagationToLayoutManager(name, event) {
|
|
545
|
+
if (this._throttledEvents.indexOf(name) === -1) {
|
|
546
|
+
this.layoutManager.emit(name, event.origin);
|
|
547
|
+
} else {
|
|
548
|
+
if (this._pendingEventPropagations[name] !== true) {
|
|
549
|
+
this._pendingEventPropagations[name] = true;
|
|
550
|
+
animFrame(this._propagateEventToLayoutManager.bind(this, name, event));
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Callback for events scheduled by _scheduleEventPropagationToLayoutManager
|
|
557
|
+
*
|
|
558
|
+
* @param name the name of the event
|
|
559
|
+
*/
|
|
560
|
+
_propagateEventToLayoutManager(name, event) {
|
|
561
|
+
this._pendingEventPropagations[name] = false;
|
|
562
|
+
this.layoutManager.emit(name, event);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
//# sourceMappingURL=AbstractContentItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbstractContentItem.js","names":["animFrame","BubblingEvent","EventEmitter","ConfigurationError","itemDefaultConfig","isStack","item","isComponent","isRoot","AbstractContentItem","constructor","layoutManager","config","parent","element","_extendItemNode","type","contentItems","_pendingEventPropagations","_throttledEvents","on","ALL_EVENT","_propagateEvent","content","_createContentItems","callDownwards","functionName","functionArguments","bottomUp","skipSelf","apply","i","length","removeChild","contentItem","keepChild","index","indexOf","Error","_$destroy","splice","isClosable","addChild","_$normalizeContentItem","undefined","isInitialised","_$init","replaceChild","oldChild","newChild","_$destroyOldChild","parentNode","header","tabs","remove","popout","browserPopout","createPopout","emitBubblingEvent","toggleMaximise","e","preventDefault","isMaximised","_$minimiseItem","_$maximiseItem","select","selectedItem","selectItem","addClass","deselect","removeClass","setTitle","title","emit","hasId","id","Array","addId","push","removeId","getItemsByFilter","filter","result","next","getItemsById","getItemsByType","_$getItemsByProperty","getComponentsByName","componentName","components","instances","instance","key","value","_$setParent","_$highlightDropZone","x","y","area","dropTargetIndicator","highlightArea","_$onDrop","_$hide","_callOnActiveComponents","hide","updateSize","_$show","show","methodName","stacks","activeContentItem","getActiveContentItem","container","_$getArea","offset","left","top","width","height","x1","y1","x2","y2","surface","side","setSize","childElementContainer","append","name","event","oContentItem","createContentItem","Object","entries","k","isPropagationStopped","_scheduleEventPropagationToLayoutManager","origin","_propagateEventToLayoutManager","bind"],"sources":["../../src/items/AbstractContentItem.ts"],"sourcesContent":["import { animFrame, BubblingEvent, EventEmitter } from '../utils';\nimport { ConfigurationError } from '../errors';\nimport { itemDefaultConfig } from '../config';\nimport type { ItemConfig, ItemConfigType } from '../config';\nimport type LayoutManager from '../LayoutManager';\nimport type Tab from '../controls/Tab';\nimport type Stack from './Stack';\nimport type Component from './Component';\nimport type Root from './Root';\n\nexport function isStack(item: AbstractContentItem): item is Stack {\n return item.isStack;\n}\n\nexport function isComponent(item: AbstractContentItem): item is Component {\n return item.isComponent;\n}\n\nexport function isRoot(item: AbstractContentItem): item is Root {\n return item.isRoot;\n}\n\nexport type ItemArea<C = AbstractContentItem> = {\n x1: number;\n x2: number;\n y1: number;\n y2: number;\n surface: number;\n side: 'left' | 'right' | 'top' | 'bottom' | '';\n contentItem: C;\n};\n\ntype AbstractItemConfig =\n | ItemConfig\n | {\n type: ItemConfig['type'];\n content: ItemConfigType[];\n };\n\n/**\n * This is the baseclass that all content items inherit from.\n * Most methods provide a subset of what the sub-classes do.\n *\n * It also provides a number of functions for tree traversal\n *\n * @param {lm.LayoutManager} layoutManager\n * @param {item node configuration} config\n * @param {lm.item} parent\n *\n * @event stateChanged\n * @event beforeItemDestroyed\n * @event itemDestroyed\n * @event itemCreated\n * @event componentCreated\n * @event rowCreated\n * @event columnCreated\n * @event stackCreated\n *\n * @constructor\n */\nexport default abstract class AbstractContentItem extends EventEmitter {\n config: ItemConfig;\n type: string;\n contentItems: AbstractContentItem[];\n parent: AbstractContentItem | null;\n layoutManager: LayoutManager;\n element: JQuery<HTMLElement>;\n childElementContainer?: JQuery<HTMLElement>;\n componentName?: string;\n\n isInitialised = false;\n isMaximised = false;\n isRoot = false;\n isRow = false;\n isColumn = false;\n isStack = false;\n isComponent = false;\n\n tab?: Tab;\n\n private _pendingEventPropagations: Record<string, boolean>;\n private _throttledEvents: string[];\n\n constructor(\n layoutManager: LayoutManager,\n config: AbstractItemConfig,\n parent: AbstractContentItem | null,\n element: JQuery<HTMLElement>\n ) {\n super();\n this.element = element;\n\n // Some GL things expect this config to not change\n this.config = this._extendItemNode(config);\n this.type = config.type;\n this.contentItems = [];\n this.parent = parent;\n\n this.layoutManager = layoutManager;\n this._pendingEventPropagations = {};\n this._throttledEvents = ['stateChanged'];\n\n this.on(EventEmitter.ALL_EVENT, this._propagateEvent, this);\n\n if (config.content) {\n this._createContentItems(config);\n }\n }\n\n /**\n * Set the size of the component and its children, called recursively\n *\n * @abstract\n */\n abstract setSize(width?: number, height?: number): void;\n\n /**\n * Calls a method recursively downwards on the tree\n *\n * @param functionName the name of the function to be called\n * @param functionArguments optional arguments that are passed to every function\n * @param bottomUp Call methods from bottom to top, defaults to false\n * @param skipSelf Don't invoke the method on the class that calls it, defaults to false\n */\n callDownwards<N extends 'setSize' | '_$destroy' | '_$init' | '_$show'>(\n functionName: N,\n functionArguments = [] as Parameters<AbstractContentItem[N]>,\n bottomUp = false,\n skipSelf = false\n ) {\n if (bottomUp !== true && skipSelf !== true) {\n this[functionName].apply(this, functionArguments);\n }\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].callDownwards(\n functionName,\n functionArguments,\n bottomUp\n );\n }\n if (bottomUp === true && skipSelf !== true) {\n this[functionName].apply(this, functionArguments);\n }\n }\n\n /**\n * Removes a child node (and its children) from the tree\n *\n * @param contentItem\n */\n removeChild(contentItem: AbstractContentItem, keepChild = false) {\n /*\n * Get the position of the item that's to be removed within all content items this node contains\n */\n const index = this.contentItems.indexOf(contentItem);\n\n /*\n * Make sure the content item to be removed is actually a child of this item\n */\n if (index === -1) {\n throw new Error(\"Can't remove child item. Unknown content item\");\n }\n\n /**\n * Call ._$destroy on the content item. This also calls ._$destroy on all its children\n */\n if (keepChild !== true) {\n this.contentItems[index]._$destroy();\n }\n\n /**\n * Remove the content item from this nodes array of children\n */\n this.contentItems.splice(index, 1);\n\n /**\n * Remove the item from the configuration\n */\n this.config.content?.splice(index, 1);\n\n /**\n * If this node still contains other content items, adjust their size\n */\n if (this.contentItems.length > 0) {\n this.callDownwards('setSize');\n\n /**\n * If this was the last content item, remove this node as well\n */\n } else if (this.type !== 'root' && this.config.isClosable) {\n this.parent?.removeChild(this);\n }\n }\n\n /**\n * Sets up the tree structure for the newly added child\n * The responsibility for the actual DOM manipulations lies\n * with the concrete item\n *\n * @param contentItem\n * @param index If omitted item will be appended\n */\n addChild(\n contentItem:\n | AbstractContentItem\n | ItemConfigType\n | { type: ItemConfig['type'] },\n index?: number\n ) {\n contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n if (index === undefined) {\n index = this.contentItems.length;\n }\n\n this.contentItems.splice(index, 0, contentItem);\n\n if (this.config.content === undefined) {\n this.config.content = [];\n }\n\n this.config.content.splice(index, 0, contentItem.config);\n contentItem.parent = this;\n\n if (\n contentItem.parent.isInitialised === true &&\n contentItem.isInitialised === false\n ) {\n contentItem._$init();\n }\n }\n\n /**\n * Replaces oldChild with newChild. This used to use jQuery.replaceWith... which for\n * some reason removes all event listeners, so isn't really an option.\n *\n * @param oldChild\n * @param newChild\n */\n replaceChild(\n oldChild: AbstractContentItem,\n newChild: AbstractContentItem,\n _$destroyOldChild = false\n ) {\n newChild = this.layoutManager._$normalizeContentItem(newChild);\n\n const index = this.contentItems.indexOf(oldChild);\n const parentNode = oldChild.element[0].parentNode;\n\n if (index === -1) {\n throw new Error(\"Can't replace child. oldChild is not child of this\");\n }\n\n parentNode?.replaceChild(newChild.element[0], oldChild.element[0]);\n\n /*\n * Optionally destroy the old content item\n */\n if (_$destroyOldChild === true) {\n oldChild.parent = null;\n oldChild._$destroy();\n }\n\n /*\n * Wire the new contentItem into the tree\n */\n this.contentItems[index] = newChild;\n newChild.parent = this;\n\n /*\n * Update tab reference\n */\n if (isStack(this)) {\n this.header.tabs[index].contentItem = newChild;\n }\n\n //TODO This doesn't update the config... refactor to leave item nodes untouched after creation\n if (\n newChild.parent.isInitialised === true &&\n newChild.isInitialised === false\n ) {\n newChild._$init();\n }\n\n this.callDownwards('setSize');\n }\n\n /**\n * Convenience method.\n * Shorthand for this.parent.removeChild( this )\n */\n remove() {\n this.parent?.removeChild(this);\n }\n\n /**\n * Removes the component from the layout and creates a new\n * browser window with the component and its children inside\n */\n popout() {\n var browserPopout = this.layoutManager.createPopout(this);\n this.emitBubblingEvent('stateChanged');\n return browserPopout;\n }\n\n /**\n * Maximises the Item or minimises it if it is already maximised\n */\n toggleMaximise(e?: Event) {\n e && e.preventDefault();\n if (this.isMaximised === true) {\n this.layoutManager._$minimiseItem(this);\n } else {\n this.layoutManager._$maximiseItem(this);\n }\n\n this.isMaximised = !this.isMaximised;\n this.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Selects the item if it is not already selected\n */\n select() {\n if (this.layoutManager.selectedItem !== this) {\n this.layoutManager.selectItem(this, true);\n this.element.addClass('lm_selected');\n }\n }\n\n /**\n * De-selects the item if it is selected\n */\n deselect() {\n if (this.layoutManager.selectedItem === this) {\n this.layoutManager.selectedItem = null;\n this.element.removeClass('lm_selected');\n }\n }\n\n /**\n * Set this component's title\n * @param title\n */\n setTitle(title: string) {\n this.config.title = title;\n this.emit('titleChanged', title);\n this.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Checks whether a provided id is present\n * @param id\n * @returns isPresent\n */\n hasId(id: string) {\n if (!this.config.id) {\n return false;\n } else if (typeof this.config.id === 'string') {\n return this.config.id === id;\n } else if (this.config.id instanceof Array) {\n return this.config.id.indexOf(id) !== -1;\n }\n }\n\n /**\n * Adds an id. Adds it as a string if the component doesn't\n * have an id yet or creates/uses an array\n * @param id\n */\n addId(id: string) {\n if (this.hasId(id)) {\n return;\n }\n\n if (!this.config.id) {\n this.config.id = id;\n } else if (typeof this.config.id === 'string') {\n this.config.id = [this.config.id, id];\n } else if (this.config.id instanceof Array) {\n this.config.id.push(id);\n }\n }\n\n /**\n * Removes an existing id. Throws an error\n * if the id is not present\n * @param id\n */\n removeId(id: string) {\n if (!this.hasId(id)) {\n throw new Error('Id not found');\n }\n\n if (typeof this.config.id === 'string') {\n delete this.config.id;\n } else if (this.config.id instanceof Array) {\n var index = this.config.id.indexOf(id);\n this.config.id.splice(index, 1);\n }\n }\n\n /****************************************\n * SELECTOR\n ****************************************/\n getItemsByFilter(filter: (item: AbstractContentItem) => boolean) {\n const result: AbstractContentItem[] = [];\n const next = function (contentItem: AbstractContentItem) {\n for (let i = 0; i < contentItem.contentItems.length; i++) {\n if (filter(contentItem.contentItems[i]) === true) {\n result.push(contentItem.contentItems[i]);\n }\n\n next(contentItem.contentItems[i]);\n }\n };\n\n next(this);\n return result;\n }\n\n getItemsById(id: string) {\n return this.getItemsByFilter(function (item) {\n if (item.config.id instanceof Array) {\n return item.config.id.indexOf(id) !== -1;\n } else {\n return item.config.id === id;\n }\n });\n }\n\n getItemsByType(type: string) {\n return this._$getItemsByProperty('type', type);\n }\n\n getComponentsByName(componentName: string) {\n const components = this._$getItemsByProperty(\n 'componentName',\n componentName\n ) as Component[];\n const instances: unknown[] = [];\n\n for (let i = 0; i < components.length; i++) {\n instances.push(components[i].instance);\n }\n\n return instances;\n }\n\n /****************************************\n * PACKAGE PRIVATE\n ****************************************/\n _$getItemsByProperty(key: keyof AbstractContentItem, value: string) {\n return this.getItemsByFilter(function (item) {\n return item[key] === value;\n });\n }\n\n _$setParent(parent: AbstractContentItem | null) {\n this.parent = parent;\n }\n\n _$highlightDropZone(x: number, y: number, area: ItemArea) {\n this.layoutManager.dropTargetIndicator?.highlightArea(area);\n }\n\n _$onDrop(contentItem: AbstractContentItem, area: ItemArea) {\n this.addChild(contentItem);\n }\n\n _$hide() {\n this._callOnActiveComponents('hide');\n this.element.hide();\n this.layoutManager.updateSize();\n }\n\n _$show() {\n this._callOnActiveComponents('show');\n this.element.show();\n this.layoutManager.updateSize();\n }\n\n _callOnActiveComponents(methodName: 'hide' | 'show') {\n const stacks = (this.getItemsByType('stack') as unknown) as Stack[];\n let activeContentItem: AbstractContentItem | null = null;\n\n for (let i = 0; i < stacks.length; i++) {\n activeContentItem = stacks[i].getActiveContentItem();\n\n if (activeContentItem && isComponent(activeContentItem)) {\n activeContentItem.container[methodName]();\n }\n }\n }\n\n /**\n * Destroys this item ands its children\n */\n _$destroy() {\n this.emitBubblingEvent('beforeItemDestroyed');\n this.callDownwards('_$destroy', [], true, true);\n this.element.remove();\n this.emitBubblingEvent('itemDestroyed');\n }\n\n /**\n * Returns the area the component currently occupies in the format\n *\n * {\n *\t\tx1: int\n *\t\tx2: int\n *\t\ty1: int\n *\t\ty2: int\n *\t\tcontentItem: contentItem\n * }\n */\n _$getArea(element?: JQuery<HTMLElement>): ItemArea<this> | null {\n element = element || this.element;\n\n const offset = element.offset() ?? { left: 0, top: 0 };\n const width = element.width() ?? 0;\n const height = element.height() ?? 0;\n\n return {\n x1: offset.left,\n y1: offset.top,\n x2: offset.left + width,\n y2: offset.top + height,\n surface: width * height,\n contentItem: this,\n side: '',\n };\n }\n\n /**\n * The tree of content items is created in two steps: First all content items are instantiated,\n * then init is called recursively from top to bottem. This is the basic init function,\n * it can be used, extended or overwritten by the content items\n *\n * Its behaviour depends on the content item\n */\n _$init() {\n this.setSize();\n\n for (let i = 0; i < this.contentItems.length; i++) {\n this.childElementContainer?.append(this.contentItems[i].element);\n }\n\n this.isInitialised = true;\n this.emitBubblingEvent('itemCreated');\n this.emitBubblingEvent(this.type + 'Created');\n }\n\n /**\n * Emit an event that bubbles up the item tree.\n *\n * @param name The name of the event\n */\n emitBubblingEvent(name: string) {\n var event = new BubblingEvent(name, this);\n this.emit(name, event);\n }\n\n /**\n * Private method, creates all content items for this node at initialisation time\n * PLEASE NOTE, please see addChild for adding contentItems add runtime\n * @param {configuration item node} config\n */\n _createContentItems(config: AbstractItemConfig) {\n var oContentItem;\n\n if (!(config.content instanceof Array)) {\n throw new ConfigurationError('content must be an Array', config);\n }\n\n for (let i = 0; i < config.content.length; i++) {\n oContentItem = this.layoutManager.createContentItem(\n config.content[i],\n this\n );\n this.contentItems.push(oContentItem);\n }\n }\n\n /**\n * Extends an item configuration node with default settings\n * @param config\n * @returns extended config\n */\n _extendItemNode(config: AbstractItemConfig) {\n for (let [key, value] of Object.entries(itemDefaultConfig)) {\n // This just appeases TS\n const k = key as keyof AbstractItemConfig;\n if (config[k] === undefined) {\n config[k] = value;\n }\n }\n\n return config;\n }\n\n /**\n * Called for every event on the item tree. Decides whether the event is a bubbling\n * event and propagates it to its parent\n *\n * @param name the name of the event\n * @param event\n */\n _propagateEvent(name: string, event: BubblingEvent) {\n if (\n event instanceof BubblingEvent &&\n event.isPropagationStopped === false &&\n this.isInitialised === true\n ) {\n /**\n * In some cases (e.g. if an element is created from a DragSource) it\n * doesn't have a parent and is not below root. If that's the case\n * propagate the bubbling event from the top level of the substree directly\n * to the layoutManager\n */\n if (this.isRoot === false && this.parent) {\n this.parent.emit.apply(this.parent, [name, event]);\n } else {\n this._scheduleEventPropagationToLayoutManager(name, event);\n }\n }\n }\n\n /**\n * All raw events bubble up to the root element. Some events that\n * are propagated to - and emitted by - the layoutManager however are\n * only string-based, batched and sanitized to make them more usable\n *\n * @param name the name of the event\n */\n _scheduleEventPropagationToLayoutManager(name: string, event: BubblingEvent) {\n if (this._throttledEvents.indexOf(name) === -1) {\n this.layoutManager.emit(name, event.origin);\n } else {\n if (this._pendingEventPropagations[name] !== true) {\n this._pendingEventPropagations[name] = true;\n animFrame(this._propagateEventToLayoutManager.bind(this, name, event));\n }\n }\n }\n\n /**\n * Callback for events scheduled by _scheduleEventPropagationToLayoutManager\n *\n * @param name the name of the event\n */\n _propagateEventToLayoutManager(name: string, event: BubblingEvent) {\n this._pendingEventPropagations[name] = false;\n this.layoutManager.emit(name, event);\n }\n}\n"],"mappings":";;;SAASA,SAAS,EAAEC,aAAa,EAAEC,YAAY;AAAA,SACtCC,kBAAkB;AAAA,SAClBC,iBAAiB;AAQ1B,OAAO,SAASC,OAAO,CAACC,IAAyB,EAAiB;EAChE,OAAOA,IAAI,CAACD,OAAO;AACrB;AAEA,OAAO,SAASE,WAAW,CAACD,IAAyB,EAAqB;EACxE,OAAOA,IAAI,CAACC,WAAW;AACzB;AAEA,OAAO,SAASC,MAAM,CAACF,IAAyB,EAAgB;EAC9D,OAAOA,IAAI,CAACE,MAAM;AACpB;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAeC,mBAAmB,SAASP,YAAY,CAAC;EAuBrEQ,WAAW,CACTC,aAA4B,EAC5BC,MAA0B,EAC1BC,MAAkC,EAClCC,OAA4B,EAC5B;IACA,KAAK,EAAE;IAAC;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,uCAnBM,KAAK;IAAA,qCACP,KAAK;IAAA,gCACV,KAAK;IAAA,+BACN,KAAK;IAAA,kCACF,KAAK;IAAA,iCACN,KAAK;IAAA,qCACD,KAAK;IAAA;IAAA;IAAA;IAcjB,IAAI,CAACA,OAAO,GAAGA,OAAO;;IAEtB;IACA,IAAI,CAACF,MAAM,GAAG,IAAI,CAACG,eAAe,CAACH,MAAM,CAAC;IAC1C,IAAI,CAACI,IAAI,GAAGJ,MAAM,CAACI,IAAI;IACvB,IAAI,CAACC,YAAY,GAAG,EAAE;IACtB,IAAI,CAACJ,MAAM,GAAGA,MAAM;I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