@deephaven/golden-layout 1.7.2-beta.1 → 1.7.2-beta.3

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 (55) hide show
  1. package/dist/GoldenLayoutThemeExport.js.map +1 -1
  2. package/dist/LayoutManager.js +18 -20
  3. package/dist/LayoutManager.js.map +1 -1
  4. package/dist/base.js.map +1 -1
  5. package/dist/config/Config.js.map +1 -1
  6. package/dist/config/ItemConfig.js.map +1 -1
  7. package/dist/config/index.js.map +1 -1
  8. package/dist/container/ItemContainer.js +1 -2
  9. package/dist/container/ItemContainer.js.map +1 -1
  10. package/dist/container/index.js.map +1 -1
  11. package/dist/controls/BrowserPopout.js +6 -6
  12. package/dist/controls/BrowserPopout.js.map +1 -1
  13. package/dist/controls/DragProxy.js +1 -1
  14. package/dist/controls/DragProxy.js.map +1 -1
  15. package/dist/controls/DragSource.js.map +1 -1
  16. package/dist/controls/DragSourceFromEvent.js +1 -2
  17. package/dist/controls/DragSourceFromEvent.js.map +1 -1
  18. package/dist/controls/DropTargetIndicator.js.map +1 -1
  19. package/dist/controls/Header.js +13 -16
  20. package/dist/controls/Header.js.map +1 -1
  21. package/dist/controls/HeaderButton.js.map +1 -1
  22. package/dist/controls/Splitter.js +2 -2
  23. package/dist/controls/Splitter.js.map +1 -1
  24. package/dist/controls/Tab.js +4 -5
  25. package/dist/controls/Tab.js.map +1 -1
  26. package/dist/controls/index.js.map +1 -1
  27. package/dist/declaration.d.js.map +1 -1
  28. package/dist/errors/ConfigurationError.js.map +1 -1
  29. package/dist/errors/index.js.map +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/items/AbstractContentItem.js +9 -9
  32. package/dist/items/AbstractContentItem.js.map +1 -1
  33. package/dist/items/Component.js +1 -1
  34. package/dist/items/Component.js.map +1 -1
  35. package/dist/items/Root.js.map +1 -1
  36. package/dist/items/RowOrColumn.js +1 -1
  37. package/dist/items/RowOrColumn.js.map +1 -1
  38. package/dist/items/Stack.js +8 -8
  39. package/dist/items/Stack.js.map +1 -1
  40. package/dist/items/index.js.map +1 -1
  41. package/dist/utils/BubblingEvent.js.map +1 -1
  42. package/dist/utils/ConfigMinifier.js +0 -1
  43. package/dist/utils/ConfigMinifier.js.map +1 -1
  44. package/dist/utils/DragListener.js +22 -24
  45. package/dist/utils/DragListener.js.map +1 -1
  46. package/dist/utils/EventEmitter.js +15 -18
  47. package/dist/utils/EventEmitter.js.map +1 -1
  48. package/dist/utils/EventHub.js.map +1 -1
  49. package/dist/utils/EventUtils.js +2 -2
  50. package/dist/utils/EventUtils.js.map +1 -1
  51. package/dist/utils/ReactComponentHandler.js +1 -1
  52. package/dist/utils/ReactComponentHandler.js.map +1 -1
  53. package/dist/utils/index.js.map +1 -1
  54. package/dist/utils/utils.js.map +1 -1
  55. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"GoldenLayoutThemeExport.js","names":["GoldenLayout","Object","freeze","tabHeight","parseInt","dragBorderWidth"],"sources":["../src/GoldenLayoutThemeExport.ts"],"sourcesContent":["import GoldenLayout from './GoldenLayout.module.scss';\n\n// parseInt for unitless values, stripping \"px\"\nexport default Object.freeze({\n tabHeight: parseInt(GoldenLayout['tab-height'], 10),\n dragBorderWidth: parseInt(GoldenLayout['drag-border-width'], 10),\n});\n"],"mappings":"OAAOA,YAAY,mCAEnB;AACA,eAAeC,MAAM,CAACC,MAAM,CAAC;EAC3BC,SAAS,EAAEC,QAAQ,CAACJ,YAAY,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC;EACnDK,eAAe,EAAED,QAAQ,CAACJ,YAAY,CAAC,mBAAmB,CAAC,EAAE,EAAE;AACjE,CAAC,CAAC"}
1
+ {"version":3,"file":"GoldenLayoutThemeExport.js","names":["GoldenLayout","Object","freeze","tabHeight","parseInt","dragBorderWidth"],"sources":["../src/GoldenLayoutThemeExport.ts"],"sourcesContent":["import GoldenLayout from './GoldenLayout.module.scss';\n\n// parseInt for unitless values, stripping \"px\"\nexport default Object.freeze({\n tabHeight: parseInt(GoldenLayout['tab-height'], 10),\n dragBorderWidth: parseInt(GoldenLayout['drag-border-width'], 10),\n});\n"],"mappings":"OAAOA,YAAY,mCAEnB;AACA,eAAeC,MAAM,CAACC,MAAM,CAAC;EAC3BC,SAAS,EAAEC,QAAQ,CAACJ,YAAY,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC;EACnDK,eAAe,EAAED,QAAQ,CAACJ,YAAY,CAAC,mBAAmB,CAAC,EAAE,EAAE;AACjE,CAAC,CAAC","ignoreList":[]}
@@ -31,10 +31,6 @@ var LAYOUT_ITEM_CONFIG_TYPES = ['column', 'row', 'stack', 'component'];
31
31
  * @param container Can be a jQuery selector string or a Dom element. Defaults to body
32
32
  */
33
33
  export class LayoutManager extends EventEmitter {
34
- /**
35
- * Hook that allows to access private classes
36
- */
37
-
38
34
  /**
39
35
  * Returns true if the given item config can be used to create a layout item.
40
36
  * (Used internally by `createContentItem`).
@@ -65,9 +61,6 @@ export class LayoutManager extends EventEmitter {
65
61
  static unminifyConfig(config) {
66
62
  return unminifyConfig(config);
67
63
  }
68
-
69
- // This will be created after init is called.
70
-
71
64
  constructor(config, container) {
72
65
  super();
73
66
  _defineProperty(this, "isInitialised", false);
@@ -91,6 +84,7 @@ export class LayoutManager extends EventEmitter {
91
84
  _defineProperty(this, "width", null);
92
85
  _defineProperty(this, "height", null);
93
86
  _defineProperty(this, "root", void 0);
87
+ // This will be created after init is called.
94
88
  _defineProperty(this, "openPopouts", []);
95
89
  _defineProperty(this, "selectedItem", null);
96
90
  _defineProperty(this, "isSubWindow", false);
@@ -180,10 +174,10 @@ export class LayoutManager extends EventEmitter {
180
174
  /*
181
175
  * Content
182
176
  */
183
- var next = function next(configNode, item) {
184
- for (var _key in item.config) {
185
- if (_key !== 'content') {
186
- configNode[_key] = item.config[_key];
177
+ var _next = function next(configNode, item) {
178
+ for (var key in item.config) {
179
+ if (key !== 'content') {
180
+ configNode[key] = item.config[key];
187
181
  }
188
182
  }
189
183
  if (configNode.componentName === 'lm-react-component') {
@@ -194,16 +188,16 @@ export class LayoutManager extends EventEmitter {
194
188
  configNode.content = [];
195
189
  for (var i = 0; i < item.contentItems.length; i++) {
196
190
  configNode.content[i] = {};
197
- next(configNode.content[i], item.contentItems[i]);
191
+ _next(configNode.content[i], item.contentItems[i]);
198
192
  }
199
193
  }
200
194
  };
201
195
  if (root) {
202
- next(config, {
196
+ _next(config, {
203
197
  contentItems: [root]
204
198
  });
205
199
  } else {
206
- next(config, this.root);
200
+ _next(config, this.root);
207
201
  }
208
202
 
209
203
  /*
@@ -388,7 +382,7 @@ export class LayoutManager extends EventEmitter {
388
382
  this.root.callDownwards('_$destroy', [], true);
389
383
  this.root.contentItems = [];
390
384
  this.tabDropPlaceholder.remove();
391
- (_this$dropTargetIndic = this.dropTargetIndicator) === null || _this$dropTargetIndic === void 0 ? void 0 : _this$dropTargetIndic.destroy();
385
+ (_this$dropTargetIndic = this.dropTargetIndicator) === null || _this$dropTargetIndic === void 0 || _this$dropTargetIndic.destroy();
392
386
  this.eventHub.destroy();
393
387
  this._dragSources.forEach(function (dragSource) {
394
388
  dragSource._dragListener.destroy();
@@ -411,6 +405,7 @@ export class LayoutManager extends EventEmitter {
411
405
 
412
406
  // This signature is necessary for this function to handle the broader
413
407
  // `ItemConfig` type since it won't be able to narrow the result in such cases.
408
+
414
409
  createContentItem(config, parent) {
415
410
  var _config$id;
416
411
  var typeErrorMsg, contentItem;
@@ -493,7 +488,7 @@ export class LayoutManager extends EventEmitter {
493
488
  child = _parent;
494
489
  _parent = _parent.parent;
495
490
  }
496
- (_parent3 = _parent) === null || _parent3 === void 0 ? void 0 : _parent3.addId(parentId);
491
+ (_parent3 = _parent) === null || _parent3 === void 0 || _parent3.addId(parentId);
497
492
  if (indexInParent == undefined || Number.isNaN(indexInParent)) {
498
493
  var _parent4;
499
494
  indexInParent = (_parent4 = _parent) === null || _parent4 === void 0 ? void 0 : _parent4.contentItems.indexOf(child);
@@ -621,7 +616,7 @@ export class LayoutManager extends EventEmitter {
621
616
  contentItem.removeId('__glMaximised');
622
617
  this._maximisePlaceholder.after(contentItem.element);
623
618
  this._maximisePlaceholder.remove();
624
- (_contentItem$parent = contentItem.parent) === null || _contentItem$parent === void 0 ? void 0 : _contentItem$parent.callDownwards('setSize');
619
+ (_contentItem$parent = contentItem.parent) === null || _contentItem$parent === void 0 || _contentItem$parent.callDownwards('setSize');
625
620
  this._maximisedItem = null;
626
621
  contentItem.emit('minimised');
627
622
  this.emit('stateChanged');
@@ -849,18 +844,18 @@ export class LayoutManager extends EventEmitter {
849
844
  localStorage.removeItem(windowConfigKey);
850
845
  }
851
846
  config = $.extend(true, {}, defaultConfig, config);
852
- var nextNode = function nextNode(node) {
847
+ var _nextNode = function nextNode(node) {
853
848
  for (var key in node) {
854
849
  var value = node[key];
855
850
  if (key !== 'props' && typeof value === 'object' && value != null) {
856
- nextNode(value);
851
+ _nextNode(value);
857
852
  } else if (key === 'type' && value === 'react-component') {
858
853
  node.type = 'component';
859
854
  node.componentName = 'lm-react-component';
860
855
  }
861
856
  }
862
857
  };
863
- nextNode(config);
858
+ _nextNode(config);
864
859
  if (((_config$settings = config.settings) === null || _config$settings === void 0 ? void 0 : _config$settings.hasHeaders) === false) {
865
860
  config.dimensions.headerHeight = 0;
866
861
  }
@@ -1069,6 +1064,9 @@ export class LayoutManager extends EventEmitter {
1069
1064
  });
1070
1065
  }
1071
1066
  }
1067
+ /**
1068
+ * Hook that allows to access private classes
1069
+ */
1072
1070
  _defineProperty(LayoutManager, "__lm", lm);
1073
1071
  export default LayoutManager;
1074
1072
  //# sourceMappingURL=LayoutManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutManager.js","names":["$","lm","defaultConfig","BrowserPopout","DragSource","DragSourceFromEvent","DropTargetIndicator","ConfigurationError","AbstractContentItem","isStack","Component","Root","RowOrColumn","Stack","minifyConfig","unminifyConfig","EventEmitter","EventHub","ReactComponentHandler","getQueryStringParam","getUniqueId","stripTags","LAYOUT_ITEM_CONFIG_TYPES","LayoutManager","isLayoutItemConfig","config","includes","type","constructor","container","_defineProperty","Map","_onResize","bind","_onUnload","_windowBlur","_windowFocus","_windowKeydown","_createConfig","_originalContainer","_getContainer","_initialHeaderHeight","dimensions","headerHeight","isSubWindow","css","registerComponent","name","render","Error","_components","undefined","cleanup","setFallbackComponent","_fallbackComponent","toConfig","root","isInitialised","settings","_objectSpread","labels","content","next","configNode","item","key","componentName","contentItems","length","i","_$reconcilePopoutWindows","openPopouts","push","maximisedItemId","_maximisedItem","getComponent","getFallbackComponent","init","_subWindowsCreated","_createSubWindows","document","readyState","body","ready","_creationTimeoutPassed","setTimeout","_adjustToWindowMode","_setContainer","dropTargetIndicator","updateSize","_create","_bindEvents","_adjustColumnsResponsive","emit","addReactChild","id","element","_reactChildMap","set","_reactChildren","values","removeReactChild","mapElem","get","delete","getReactChildren","enableHeaders","hasHeaders","_findAllStackContainers","forEach","stack","_header","show","header","toggle","disableHeaders","width","height","_ref","_ref2","callDownwards","_this$container$width","_this$container$heigh","destroy","_this$dropTargetIndic","window","off","tabDropPlaceholder","remove","eventHub","_dragSources","dragSource","_dragListener","createContentItem","parent","_config$id","typeErrorMsg","contentItem","join","createPopout","configOrContentItem","parentId","indexInParent","configArray","isItem","self","_parent3","child","_parent2","isRoot","addId","Number","isNaN","_parent4","indexOf","Array","_configOrContentItem$","_configOrContentItem$2","_configOrContentItem$3","windowLeft","screenX","screenLeft","windowTop","screenY","screenTop","offset","left","top","browserPopout","on","createDragSource","itemConfig","constrainDragToContainer","createDragSourceFromEvent","event","selectItem","_$silent","selectionEnabled","selectedItem","deselect","select","_$maximiseItem","_this$container$width2","_this$container$heigh2","_$minimiseItem","addClass","after","_maximisePlaceholder","prepend","_contentItem$parent","removeClass","removeId","_$closeWindow","close","_$getArea","x","y","smallestSurface","Infinity","mathingArea","_itemAreas","area","x1","x2","y1","y2","surface","_$createRootItemAreas","areaSize","rootArea","areas","side","_$calculateItemAreas","allContentItems","_getAllContentItems","concat","_area$contentItem$_co","_contentAreaDimensions","highlightArea","_$normalizeContentItem","contentItemOrConfig","isPlainObject","newContentItem","_this$openPopouts$i$g","getWindow","closed","addChildren","_isFullPage","resize","e","active","activeElement","tagName","isContentEditable","toggleMaximise","clearTimeout","_resizeTimeoutId","_config$settings","windowConfigKey","JSON","parse","localStorage","getItem","removeItem","extend","nextNode","node","value","_this$config$content$","popInButton","popin","click","title","append","html","offsetHeight","__glInstance","popout","margin","padding","overflow","errorMsg","getItemsById","closePopoutsOnUnload","_useResponsiveLayout","_updatingColumnsResponsive","minItemWidth","isRow","_firstLoad","columnCount","totalMinWidth","finalColumnCount","Math","max","floor","stackColumnCount","rootContentItem","firstStackContainer","column","_addChildContentItemsToContainer","responsiveMode","addChild","removeChild","stackContainers","_findAllStackContainersRecursive","isComponent"],"sources":["../src/LayoutManager.ts"],"sourcesContent":["import $ from 'jquery';\nimport React from 'react';\nimport lm from './base';\nimport {\n ColumnItemConfig,\n defaultConfig,\n DefaultItemConfig,\n RootItemConfig,\n RowItemConfig,\n StackItemConfig,\n} from './config';\nimport type {\n ItemConfig,\n Config,\n ComponentConfig,\n ReactComponentConfig,\n} from './config';\nimport type { ItemContainer } from './container';\nimport {\n BrowserPopout,\n DragSource,\n DragSourceFromEvent,\n DropTargetIndicator,\n} from './controls';\nimport { ConfigurationError } from './errors';\nimport {\n AbstractContentItem,\n ItemArea,\n isStack,\n Component,\n Root,\n RowOrColumn,\n Stack,\n} from './items';\nimport {\n minifyConfig,\n unminifyConfig,\n EventEmitter,\n EventHub,\n ReactComponentHandler,\n getQueryStringParam,\n getUniqueId,\n stripTags,\n} from './utils';\nimport { DragListenerEvent } from './utils/DragListener';\n\nexport type ComponentConstructor<\n C extends ComponentConfig | ReactComponentConfig = ComponentConfig,\n> = {\n new (container: ItemContainer<C>, state: unknown): unknown;\n};\n\n/**\n * Item configuration types that are supported inside of `createContentItem` to\n * create content items. Note that `ReactComponentConfig` is a valid input type,\n * but it gets converted to `ComponentConfig` inside the method before this\n * constraint comes into play.\n */\ntype LayoutItemConfig =\n | ColumnItemConfig\n | RowItemConfig\n | StackItemConfig\n | ComponentConfig;\n\n/**\n * Item configuration `type` values that are supported inside of\n * `createContentItem` to create content items. Note that `react-component`\n * is a valid input value, but it gets converted to `component` inside the\n * method before this constraint comes into play.\n */\nconst LAYOUT_ITEM_CONFIG_TYPES = [\n 'column',\n 'row',\n 'stack',\n 'component',\n] as const satisfies Readonly<LayoutItemConfig['type'][]>;\n\n/**\n * The main class that will be exposed as GoldenLayout.\n *\n * @param config\n * @param container Can be a jQuery selector string or a Dom element. Defaults to body\n */\nexport class LayoutManager extends EventEmitter {\n /**\n * Hook that allows to access private classes\n */\n static __lm = lm;\n\n /**\n * Returns true if the given item config can be used to create a layout item.\n * (Used internally by `createContentItem`).\n */\n static isLayoutItemConfig(config: ItemConfig): config is LayoutItemConfig {\n return (LAYOUT_ITEM_CONFIG_TYPES as Readonly<string[]>).includes(\n config.type\n );\n }\n\n /**\n * Takes a GoldenLayout configuration object and\n * replaces its keys and values recursively with\n * one letter codes\n *\n * @param config A GoldenLayout config object\n * @returns minified config\n */\n static minifyConfig(config: Config): Record<string, unknown> {\n return minifyConfig(config);\n }\n\n /**\n * Takes a configuration Object that was previously minified\n * using minifyConfig and returns its original version\n *\n * @param minifiedConfig\n * @returns the original configuration\n */\n static unminifyConfig(config: Record<string, unknown>): Config {\n return unminifyConfig(config);\n }\n\n isInitialised = false;\n private _isFullPage = false;\n private _resizeTimeoutId: number | undefined;\n\n private _components: {\n [name: string]:\n | ComponentConstructor\n | ComponentConstructor<ReactComponentConfig>\n | React.Component\n | React.ComponentType;\n } = { 'lm-react-component': ReactComponentHandler };\n\n private _fallbackComponent?:\n | ComponentConstructor\n | React.ForwardRefExoticComponent<any>;\n private _itemAreas: ItemArea[] = [];\n private _maximisedItem: AbstractContentItem | null = null;\n private _maximisePlaceholder = $('<div class=\"lm_maximise_place\"></div>');\n private _creationTimeoutPassed = false;\n private _subWindowsCreated = false;\n private _dragSources: DragSource[] = [];\n private _updatingColumnsResponsive = false;\n private _firstLoad = true;\n private _reactChildMap = new Map<string, React.ReactNode>();\n private _reactChildren: React.ReactNode = null;\n private _initialHeaderHeight: number;\n\n width: number | null = null;\n height: number | null = null;\n root!: Root; // This will be created after init is called.\n openPopouts: BrowserPopout[] = [];\n selectedItem: AbstractContentItem | null = null;\n isSubWindow = false;\n eventHub = new EventHub(this);\n config: Config;\n container: JQuery<HTMLElement>;\n private _originalContainer: JQuery<HTMLElement> | HTMLElement | undefined;\n dropTargetIndicator: DropTargetIndicator | null = null;\n tabDropPlaceholder = $('<div class=\"lm_drop_tab_placeholder\"></div>');\n\n constructor(\n config: Config,\n container: JQuery<HTMLElement> | HTMLElement | undefined\n ) {\n super();\n\n this._onResize = this._onResize.bind(this);\n this._onUnload = this._onUnload.bind(this);\n this._windowBlur = this._windowBlur.bind(this);\n this._windowFocus = this._windowFocus.bind(this);\n this._windowKeydown = this._windowKeydown.bind(this);\n\n this.config = this._createConfig(config);\n this._originalContainer = container;\n this.container = this._getContainer();\n this._initialHeaderHeight = this.config.dimensions.headerHeight;\n\n if (this.isSubWindow) {\n $('body').css('visibility', 'hidden');\n }\n }\n\n /**\n * Register a component with the layout manager. If a configuration node\n * of type component is reached it will look up componentName and create the\n * associated component\n *\n * {\n *\t\ttype: \"component\",\n *\t\tcomponentName: \"EquityNewsFeed\",\n *\t\tcomponentState: { \"feedTopic\": \"us-bluechips\" }\n * }\n *\n * @param name\n * @param constructor\n * @returns cleanup function to deregister component\n */\n registerComponent(\n name: string,\n constructor:\n | ComponentConstructor\n | React.Component\n | React.ComponentType<any>\n ) {\n if (\n typeof constructor !== 'function' &&\n (constructor == null ||\n constructor.render == null ||\n typeof constructor.render !== 'function')\n ) {\n throw new Error('Please register a constructor function');\n }\n\n if (this._components[name] !== undefined) {\n throw new Error('Component ' + name + ' is already registered');\n }\n\n this._components[name] = constructor;\n\n const cleanup = () => {\n if (this._components[name] === undefined) {\n throw new Error('Component ' + name + ' is not registered');\n }\n\n delete this._components[name];\n };\n\n return cleanup;\n }\n\n /**\n * Set a fallback component to be rendered in place of unregistered components\n * @param constructor\n */\n setFallbackComponent(\n constructor: ComponentConstructor | React.ForwardRefExoticComponent<any>\n ) {\n this._fallbackComponent = constructor;\n }\n\n /**\n * Creates a layout configuration object based on the the current state\n * @param root\n * @returns GoldenLayout configuration\n */\n toConfig(root?: AbstractContentItem) {\n if (this.isInitialised === false) {\n throw new Error(\"Can't create config, layout not yet initialised\");\n }\n\n if (root && !(root instanceof AbstractContentItem)) {\n throw new Error('Root must be a ContentItem');\n }\n\n /*\n * settings & labels\n */\n const config: Config = {\n settings: { ...this.config.settings },\n dimensions: { ...this.config.dimensions },\n labels: { ...this.config.labels },\n content: [],\n };\n\n /*\n * Content\n */\n const next = function (\n configNode: (ComponentConfig | ReactComponentConfig) & {\n [key: string]: unknown;\n },\n item: AbstractContentItem & {\n config: Record<string, unknown>;\n }\n ) {\n for (let key in item.config) {\n if (key !== 'content') {\n configNode[key] = item.config[key];\n }\n }\n\n if (configNode.componentName === 'lm-react-component') {\n // We change the type in `createContentItem`, so change it back here\n configNode.type = 'react-component';\n }\n\n if (item.contentItems.length) {\n configNode.content = [];\n\n for (let i = 0; i < item.contentItems.length; i++) {\n configNode.content[i] = {} as ItemConfig;\n next(\n configNode.content[i] as ComponentConfig & Record<string, unknown>,\n item.contentItems[i] as AbstractContentItem & {\n config: Record<string, unknown>;\n }\n );\n }\n }\n };\n\n if (root) {\n next(\n config as unknown as ComponentConfig & Record<string, unknown>,\n { contentItems: [root] } as AbstractContentItem & {\n config: Record<string, unknown>;\n }\n );\n } else {\n next(\n config as unknown as ComponentConfig & Record<string, unknown>,\n this.root as unknown as AbstractContentItem & {\n config: Record<string, unknown>;\n }\n );\n }\n\n /*\n * Retrieve config for subwindows\n */\n this._$reconcilePopoutWindows();\n config.openPopouts = [];\n for (let i = 0; i < this.openPopouts.length; i++) {\n config.openPopouts.push(this.openPopouts[i].toConfig());\n }\n\n /*\n * Add maximised item\n */\n config.maximisedItemId = this._maximisedItem ? '__glMaximised' : undefined;\n return config;\n }\n\n /**\n * Returns a previously registered component\n * @param name The name used\n */\n getComponent(name: string) {\n return this._components[name];\n }\n\n /**\n * Returns a fallback component to render in place of unregistered components\n *\n * @public\n *\n * @returns {Function}\n */\n getFallbackComponent() {\n return this._fallbackComponent;\n }\n\n /**\n * Creates the actual layout. Must be called after all initial components\n * are registered. Recurses through the configuration and sets up\n * the item tree.\n *\n * If called before the document is ready it adds itself as a listener\n * to the document.ready event\n */\n init() {\n /**\n * Create the popout windows straight away. If popouts are blocked\n * an error is thrown on the same 'thread' rather than a timeout and can\n * be caught. This also prevents any further initilisation from taking place.\n */\n if (this._subWindowsCreated === false) {\n this._createSubWindows();\n this._subWindowsCreated = true;\n }\n\n /**\n * If the document isn't ready yet, wait for it.\n */\n if (document.readyState === 'loading' || document.body === null) {\n $(document).ready(this.init.bind(this));\n return;\n }\n\n /**\n * If this is a subwindow, wait a few milliseconds for the original\n * page's js calls to be executed, then replace the bodies content\n * with GoldenLayout\n */\n if (this.isSubWindow === true && this._creationTimeoutPassed === false) {\n setTimeout(this.init.bind(this), 7);\n this._creationTimeoutPassed = true;\n return;\n }\n\n if (this.isSubWindow === true) {\n this._adjustToWindowMode();\n }\n\n this._setContainer();\n this.dropTargetIndicator = new DropTargetIndicator();\n this.updateSize();\n this._create(this.config);\n this._bindEvents();\n this.isInitialised = true;\n this._adjustColumnsResponsive();\n this.emit('initialised');\n }\n\n /**\n * Adds a react child to the layout manager\n * @param id Unique panel id\n * @param element The React element\n */\n addReactChild(id: string, element: React.ReactNode) {\n this._reactChildMap.set(id, element);\n this._reactChildren = [...this._reactChildMap.values()];\n this.emit('reactChildrenChanged');\n }\n\n /**\n * Removes a react child from the layout manager\n * Only removes if the elements for the panelId has not been replaced by a different element\n * @param id Unique panel id\n * @param element The React element\n */\n removeReactChild(id: string, element: React.ReactNode) {\n const mapElem = this._reactChildMap.get(id);\n if (mapElem === element) {\n // If an element was replaced it may be destroyed after the other is created\n // In that case, the new element would be removed\n // Make sure the element being removed is the current element associated with its id\n this._reactChildMap.delete(id);\n this._reactChildren = [...this._reactChildMap.values()];\n this.emit('reactChildrenChanged');\n }\n }\n\n /**\n * Gets the react children in the layout\n *\n * Used in @deephaven/dashboard to mount the react elements\n * inside the app's React tree\n *\n * @returns The react children to mount for this layout manager\n */\n getReactChildren() {\n return this._reactChildren;\n }\n\n enableHeaders() {\n this.config.settings.hasHeaders = true;\n this.config.dimensions.headerHeight = this._initialHeaderHeight;\n this._findAllStackContainers().forEach(stack => {\n stack._header.show = true;\n stack.header.element.toggle(true);\n });\n this.updateSize();\n }\n\n disableHeaders() {\n this.config.settings.hasHeaders = false;\n this.config.dimensions.headerHeight = 0;\n this._findAllStackContainers().forEach(stack => {\n stack._header.show = false;\n stack.header.element.toggle(false);\n });\n this.updateSize();\n }\n\n /**\n * Updates the layout managers size\n * @param width width in pixels\n * @param height height in pixels\n */\n updateSize(width?: number, height?: number) {\n this.width = width ?? this.container.width() ?? 0;\n this.height = height ?? this.container.height() ?? 0;\n\n if (this.isInitialised === true) {\n this.root.callDownwards('setSize', [this.width, this.height]);\n\n if (this._maximisedItem) {\n this._maximisedItem.element.width(this.container.width() ?? 0);\n this._maximisedItem.element.height(this.container.height() ?? 0);\n this._maximisedItem.callDownwards('setSize');\n }\n\n this._adjustColumnsResponsive();\n }\n }\n\n /**\n * Destroys the LayoutManager instance itself as well as every ContentItem\n * within it. After this is called nothing should be left of the LayoutManager.\n */\n destroy() {\n if (this.isInitialised === false || !this.root) {\n return;\n }\n this._onUnload();\n $(window).off('resize', this._onResize);\n $(window).off('unload beforeunload', this._onUnload);\n $(window).off('blur.lm').off('focus.lm');\n $(window).off('keydown', this._windowKeydown);\n this.root.callDownwards('_$destroy', [], true);\n this.root.contentItems = [];\n this.tabDropPlaceholder.remove();\n this.dropTargetIndicator?.destroy();\n this.eventHub.destroy();\n\n this._dragSources.forEach(function (dragSource) {\n dragSource._dragListener.destroy();\n });\n this._dragSources = [];\n }\n\n /**\n * Recursively creates new item tree structures based on a provided\n * ItemConfiguration object\n *\n * @public\n * @param config ItemConfig\n * @param parent The item the newly created item should be a child of\n *\n * @returns Created item\n */\n createContentItem(\n config: StackItemConfig,\n parent: AbstractContentItem | null\n ): Stack;\n createContentItem(\n config: ColumnItemConfig | RowItemConfig,\n parent: AbstractContentItem | null\n ): RowOrColumn;\n createContentItem(\n config: ComponentConfig | ReactComponentConfig,\n parent: AbstractContentItem | null\n ): Component | Stack;\n // Default and Root configs will throw an error hence the `never` return type\n createContentItem(\n config: DefaultItemConfig | RootItemConfig,\n parent: AbstractContentItem | null\n ): never;\n // This signature is necessary for this function to handle the broader\n // `ItemConfig` type since it won't be able to narrow the result in such cases.\n createContentItem(\n config: ItemConfig,\n parent: AbstractContentItem | null\n ): Component | RowOrColumn | Stack;\n createContentItem(\n config: ItemConfig,\n parent: AbstractContentItem | null\n ): Component | RowOrColumn | Stack {\n var typeErrorMsg, contentItem;\n\n if (typeof config.type !== 'string') {\n throw new ConfigurationError(\"Missing parameter 'type'\", config);\n }\n\n if (config.type === 'react-component') {\n (config as unknown as ComponentConfig).type = 'component';\n (config as unknown as ComponentConfig).componentName =\n 'lm-react-component';\n }\n\n if (!LayoutManager.isLayoutItemConfig(config)) {\n typeErrorMsg =\n \"Unknown type '\" +\n config.type +\n \"'. \" +\n 'Valid types are ' +\n LAYOUT_ITEM_CONFIG_TYPES.join(',');\n\n throw new ConfigurationError(typeErrorMsg);\n }\n\n /**\n * We add an additional stack around every component that's not within a stack anyways.\n */\n if (\n // If this is a component\n config.type === 'component' &&\n // and it's not already within a stack\n !(parent instanceof Stack) &&\n // and we have a parent\n !!parent &&\n // and it's not the topmost item in a new window\n !(this.isSubWindow === true && parent instanceof Root)\n ) {\n config = {\n type: 'stack',\n width: config.width,\n height: config.height,\n content: [config],\n };\n }\n\n config.id = config.id ?? getUniqueId();\n\n if (config.type === 'stack') {\n return new Stack(this, config, parent);\n }\n\n if (config.type === 'row') {\n return new RowOrColumn(false, this, config, parent);\n }\n\n if (config.type === 'column') {\n return new RowOrColumn(true, this, config, parent);\n }\n\n return new Component(this, config, parent);\n }\n\n /**\n\t * Creates a popout window with the specified content and dimensions\n\t *\n\t * @param configOrContentItem\n\t * @param dimensions A map with width, height, left and top\n\t * @param parentId the id of the element this item will be appended to\n\t * when popIn is called\n\t * @param indexInParent The position of this item within its parent element\n\n\t * @returns Created popout\n\t */\n createPopout(\n configOrContentItem: ItemConfig | AbstractContentItem | ItemConfig[],\n dimensions?: { width: number; height: number; left: number; top: number },\n parentId?: string,\n indexInParent?: number\n ): BrowserPopout | undefined {\n let config = configOrContentItem;\n let configArray: ItemConfig[] = [];\n const isItem = configOrContentItem instanceof AbstractContentItem;\n const self = this;\n\n if (isItem) {\n configArray = this.toConfig(configOrContentItem).content;\n parentId = getUniqueId();\n\n /**\n * If the item is the only component within a stack or for some\n * other reason the only child of its parent the parent will be destroyed\n * when the child is removed.\n *\n * In order to support this we move up the tree until we find something\n * that will remain after the item is being popped out\n */\n let parent = configOrContentItem.parent;\n let child = configOrContentItem;\n while (parent?.contentItems.length === 1 && !parent.isRoot) {\n child = parent;\n parent = parent.parent;\n }\n\n parent?.addId(parentId);\n if (indexInParent == undefined || Number.isNaN(indexInParent)) {\n indexInParent = parent?.contentItems.indexOf(child);\n }\n } else {\n if (!(configOrContentItem instanceof Array)) {\n configArray = [configOrContentItem];\n } else {\n configArray = configOrContentItem;\n }\n }\n\n if (!dimensions && isItem) {\n const windowLeft = window.screenX || window.screenLeft;\n const windowTop = window.screenY || window.screenTop;\n const offset = configOrContentItem.element.offset() ?? {\n left: 0,\n top: 0,\n };\n\n dimensions = {\n left: windowLeft + offset.left,\n top: windowTop + offset.top,\n width: configOrContentItem.element.width() ?? 0,\n height: configOrContentItem.element.height() ?? 0,\n };\n }\n\n if (!dimensions && !isItem) {\n dimensions = {\n left: window.screenX || window.screenLeft + 20,\n top: window.screenY || window.screenTop + 20,\n width: 500,\n height: 309,\n };\n }\n\n if (isItem) {\n configOrContentItem.remove();\n }\n\n if (!dimensions || !parentId || indexInParent === undefined) {\n return;\n }\n\n const browserPopout = new BrowserPopout(\n configArray,\n dimensions,\n parentId,\n indexInParent,\n this\n );\n\n browserPopout.on('initialised', function () {\n self.emit('windowOpened', browserPopout);\n });\n\n browserPopout.on('closed', function () {\n self._$reconcilePopoutWindows();\n });\n\n this.openPopouts.push(browserPopout);\n\n return browserPopout;\n }\n\n /**\n * Attaches DragListener to any given DOM element\n * and turns it into a way of creating new ContentItems\n * by 'dragging' the DOM element into the layout\n *\n * @param element\n * @param itemConfig for the new item to be created, or a function which will provide it\n */\n createDragSource(\n element: JQuery<HTMLElement>,\n itemConfig: ComponentConfig | (() => ComponentConfig)\n ) {\n this.config.settings.constrainDragToContainer = false;\n var dragSource = new DragSource(element, itemConfig, this);\n this._dragSources.push(dragSource);\n\n return dragSource;\n }\n\n /**\n * Create a new item in a dragging state, given a starting mouse event to act as the initial position\n *\n * @param itemConfig for the new item to be created, or a function which will provide it\n * @param event used as the starting position for the dragProxy\n */\n createDragSourceFromEvent(\n itemConfig: ItemConfig | (() => ItemConfig),\n event: DragListenerEvent\n ) {\n this.config.settings.constrainDragToContainer = false;\n return new DragSourceFromEvent(itemConfig, this, event);\n }\n\n /**\n * Programmatically selects an item. This deselects\n * the currently selected item, selects the specified item\n * and emits a selectionChanged event\n *\n * @param item\n * @param _$silent Wheather to notify the item of its selection\n */\n selectItem(item: AbstractContentItem, _$silent?: boolean) {\n if (this.config.settings.selectionEnabled !== true) {\n throw new Error(\n 'Please set selectionEnabled to true to use this feature'\n );\n }\n\n if (item === this.selectedItem) {\n return;\n }\n\n if (this.selectedItem !== null) {\n this.selectedItem.deselect();\n }\n\n if (item && _$silent !== true) {\n item.select();\n }\n\n this.selectedItem = item;\n\n this.emit('selectionChanged', item);\n }\n\n /*************************\n * PACKAGE PRIVATE\n *************************/\n _$maximiseItem(contentItem: AbstractContentItem) {\n if (this._maximisedItem !== null) {\n this._$minimiseItem(this._maximisedItem);\n }\n this._maximisedItem = contentItem;\n this._maximisedItem.addId('__glMaximised');\n contentItem.element.addClass('lm_maximised');\n contentItem.element.after(this._maximisePlaceholder);\n this.root.element.prepend(contentItem.element);\n contentItem.element.width(this.container.width() ?? 0);\n contentItem.element.height(this.container.height() ?? 0);\n contentItem.callDownwards('setSize');\n this._maximisedItem.emit('maximised');\n this.emit('stateChanged');\n }\n\n _$minimiseItem(contentItem: AbstractContentItem) {\n contentItem.element.removeClass('lm_maximised');\n contentItem.removeId('__glMaximised');\n this._maximisePlaceholder.after(contentItem.element);\n this._maximisePlaceholder.remove();\n contentItem.parent?.callDownwards('setSize');\n this._maximisedItem = null;\n contentItem.emit('minimised');\n this.emit('stateChanged');\n }\n\n /**\n * This method is used to get around sandboxed iframe restrictions.\n * If 'allow-top-navigation' is not specified in the iframe's 'sandbox' attribute\n * (as is the case with codepens) the parent window is forbidden from calling certain\n * methods on the child, such as window.close() or setting document.location.href.\n *\n * This prevented GoldenLayout popouts from popping in in codepens. The fix is to call\n * _$closeWindow on the child window's gl instance which (after a timeout to disconnect\n * the invoking method from the close call) closes itself.\n */\n _$closeWindow() {\n window.setTimeout(function () {\n window.close();\n }, 1);\n }\n\n _$getArea(x: number, y: number) {\n let smallestSurface = Infinity;\n let mathingArea: ItemArea | null = null;\n\n for (let i = 0; i < this._itemAreas.length; i++) {\n const area = this._itemAreas[i];\n\n if (\n x > area.x1 &&\n x < area.x2 &&\n y > area.y1 &&\n y < area.y2 &&\n smallestSurface > area.surface\n ) {\n smallestSurface = area.surface;\n mathingArea = area;\n }\n }\n\n return mathingArea;\n }\n\n /**\n * Creates the drop zones at the edges of the screen\n */\n _$createRootItemAreas() {\n const areaSize = 50;\n const rootArea = { ...this.root._$getArea() };\n\n const areas = [\n {\n ...rootArea,\n side: 'left' as const,\n x2: rootArea.x1 + areaSize,\n },\n {\n ...rootArea,\n side: 'right' as const,\n x1: rootArea.x2 - areaSize,\n },\n {\n ...rootArea,\n side: 'top' as const,\n y2: rootArea.y1 + areaSize,\n },\n {\n ...rootArea,\n side: 'bottom' as const,\n y1: rootArea.y2 - areaSize,\n },\n ];\n\n areas.forEach(area => {\n area.surface = (area.x2 - area.x1) * (area.y2 - area.y1);\n });\n\n this._itemAreas.push(...areas);\n }\n\n _$calculateItemAreas() {\n const allContentItems = this._getAllContentItems();\n this._itemAreas = [];\n\n /**\n * If the last item is dragged out, highlight the entire container size to\n * allow to re-drop it. allContentItems[ 0 ] === this.root at this point\n *\n * Don't include root into the possible drop areas though otherwise since it\n * will used for every gap in the layout, e.g. splitters\n */\n if (allContentItems.length === 1) {\n this._itemAreas.push(this.root._$getArea());\n return;\n }\n this._$createRootItemAreas();\n\n for (let i = 0; i < allContentItems.length; i++) {\n const item = allContentItems[i];\n if (!isStack(item)) {\n continue;\n }\n\n const area = item._$getArea();\n\n if (area === null) {\n continue;\n } else if (area instanceof Array) {\n this._itemAreas = this._itemAreas.concat(area);\n } else {\n this._itemAreas.push(area);\n let header = {\n ...area,\n ...area.contentItem._contentAreaDimensions?.header.highlightArea,\n };\n header.surface = (header.x2 - header.x1) * (header.y2 - header.y1);\n this._itemAreas.push(header);\n }\n }\n }\n\n /**\n * Takes a contentItem or a configuration and optionally a parent\n * item and returns an initialised instance of the contentItem.\n * If the contentItem is a function, it is first called\n *\n * @param contentItemOrConfig\n * @param parent Only necessary when passing in config\n */\n _$normalizeContentItem(\n contentItemOrConfig:\n | ItemConfig\n | AbstractContentItem\n | (() => AbstractContentItem),\n parent?: AbstractContentItem\n ) {\n if (!contentItemOrConfig) {\n throw new Error('No content item defined');\n }\n\n if (typeof contentItemOrConfig === 'function') {\n contentItemOrConfig = contentItemOrConfig();\n }\n\n if (contentItemOrConfig instanceof AbstractContentItem) {\n return contentItemOrConfig;\n }\n\n if ($.isPlainObject(contentItemOrConfig) && contentItemOrConfig.type) {\n const newContentItem = this.createContentItem(\n contentItemOrConfig,\n parent ?? null\n );\n newContentItem.callDownwards('_$init');\n return newContentItem;\n } else {\n throw new Error('Invalid contentItem');\n }\n }\n\n /**\n * Iterates through the array of open popout windows and removes the ones\n * that are effectively closed. This is necessary due to the lack of reliably\n * listening for window.close / unload events in a cross browser compatible fashion.\n */\n _$reconcilePopoutWindows() {\n const openPopouts: BrowserPopout[] = [];\n\n for (let i = 0; i < this.openPopouts.length; i++) {\n if (this.openPopouts[i].getWindow()?.closed === false) {\n openPopouts.push(this.openPopouts[i]);\n } else {\n this.emit('windowClosed', this.openPopouts[i]);\n }\n }\n\n if (this.openPopouts.length !== openPopouts.length) {\n this.emit('stateChanged');\n this.openPopouts = openPopouts;\n }\n }\n\n /***************************\n * PRIVATE\n ***************************/\n /**\n * Returns a flattened array of all content items,\n * regardles of level or type\n * @return Flattened array of content items\n */\n _getAllContentItems() {\n const allContentItems: AbstractContentItem[] = [];\n\n const addChildren = (contentItem: AbstractContentItem) => {\n allContentItems.push(contentItem);\n\n if (contentItem.contentItems instanceof Array) {\n for (let i = 0; i < contentItem.contentItems.length; i++) {\n addChildren(contentItem.contentItems[i]);\n }\n }\n };\n\n addChildren(this.root);\n\n return allContentItems;\n }\n\n /**\n * Binds to DOM/BOM events on init\n */\n _bindEvents() {\n if (this._isFullPage) {\n $(window).resize(this._onResize);\n }\n $(window)\n .on('unload beforeunload', this._onUnload)\n .on('blur.lm', this._windowBlur)\n .on('focus.lm', this._windowFocus)\n .on('keydown', this._windowKeydown);\n }\n\n /**\n * Handles setting a class based on window focus, useful for focus indicators\n */\n _windowBlur() {\n this.root.element.addClass('lm_window_blur');\n }\n\n _windowFocus() {\n this.root.element.removeClass('lm_window_blur');\n }\n\n /**\n * Handles the escape key to close maximized items, as long as the focus isn't within an input.\n * The escape key has local behaviors in inputs like the Monaco editor or search that we don't\n * want to react to as they are not captured.\n *\n * @private\n * @param e The keydown event\n */\n _windowKeydown(e: JQuery.KeyDownEvent) {\n if (e.key === 'Escape' && this._maximisedItem !== null) {\n const active = document.activeElement;\n if (\n active &&\n (active.tagName === 'INPUT' ||\n active.tagName === 'TEXTAREA' ||\n active.tagName === 'SELECT' ||\n (active as HTMLElement).isContentEditable)\n ) {\n return;\n }\n\n this._maximisedItem.toggleMaximise();\n }\n }\n\n /**\n * Debounces resize events\n */\n _onResize() {\n clearTimeout(this._resizeTimeoutId);\n this._resizeTimeoutId = window.setTimeout(this.updateSize.bind(this), 100);\n }\n\n /**\n * Extends the default config with the user specific settings and applies\n * derivations. Please note that there's a seperate method (AbstractContentItem._extendItemNode)\n * that deals with the extension of item configs\n *\n * @param config\n * @returns config\n */\n _createConfig(config: Config): Config {\n var windowConfigKey = getQueryStringParam('gl-window');\n\n if (windowConfigKey) {\n this.isSubWindow = true;\n config = JSON.parse(localStorage.getItem(windowConfigKey) || '{}');\n config = unminifyConfig(config);\n localStorage.removeItem(windowConfigKey);\n }\n\n config = $.extend(true, {}, defaultConfig, config);\n\n var nextNode = function (node: Record<string, unknown>) {\n for (var key in node) {\n const value = node[key];\n if (key !== 'props' && typeof value === 'object' && value != null) {\n nextNode(value as Record<string, unknown>);\n } else if (key === 'type' && value === 'react-component') {\n node.type = 'component';\n node.componentName = 'lm-react-component';\n }\n }\n };\n\n nextNode(config);\n\n if (config.settings?.hasHeaders === false) {\n config.dimensions.headerHeight = 0;\n }\n\n return config;\n }\n\n /**\n * This is executed when GoldenLayout detects that it is run\n * within a previously opened popout window.\n */\n _adjustToWindowMode() {\n var popInButton = $(\n '<div class=\"lm_popin\" title=\"' +\n this.config.labels.popin +\n '\">' +\n '<div class=\"lm_icon\"></div>' +\n '<div class=\"lm_bg\"></div>' +\n '</div>'\n );\n\n popInButton.click(() => {\n this.emit('popIn');\n });\n\n document.title = stripTags(this.config.content[0].title ?? '');\n\n $('head').append($('body link, body style, template, .gl_keep'));\n\n this.container = $('body')\n .html('')\n .css('visibility', 'visible')\n .append(popInButton);\n\n /*\n * This seems a bit pointless, but actually causes a reflow/re-evaluation getting around\n * slickgrid's \"Cannot find stylesheet.\" bug in chrome\n */\n var x = document.body.offsetHeight; // jshint ignore:line\n\n /*\n * Expose this instance on the window object\n * to allow the opening window to interact with\n * it\n */\n (\n window as Window & typeof globalThis & { __glInstance: LayoutManager }\n ).__glInstance = this;\n }\n\n /**\n * Creates Subwindows (if there are any). Throws an error\n * if popouts are blocked.\n */\n _createSubWindows() {\n if (!this.config.openPopouts) {\n return;\n }\n\n for (let i = 0; i < this.config.openPopouts.length; i++) {\n const popout = this.config.openPopouts[i];\n\n this.createPopout(\n popout.content,\n popout.dimensions,\n popout.parentId,\n popout.indexInParent\n );\n }\n }\n\n _getContainer() {\n const container = this._originalContainer\n ? $(this._originalContainer)\n : $('body');\n\n if (container.length === 0) {\n throw new Error('GoldenLayout container not found');\n }\n\n if (container.length > 1) {\n throw new Error('GoldenLayout more than one container element specified');\n }\n\n return container;\n }\n\n /**\n * Determines what element the layout will be created in\n */\n _setContainer() {\n const container = this._getContainer();\n\n if (container[0] === document.body) {\n this._isFullPage = true;\n\n $('html, body').css({\n height: '100%',\n margin: 0,\n padding: 0,\n overflow: 'hidden',\n });\n }\n\n this.container = container;\n }\n\n /**\n * Kicks of the initial, recursive creation chain\n *\n * @param config GoldenLayout Config\n */\n _create(config: Config) {\n var errorMsg;\n\n if (!(config.content instanceof Array)) {\n if (config.content === undefined) {\n errorMsg = \"Missing setting 'content' on top level of configuration\";\n } else {\n errorMsg = \"Configuration parameter 'content' must be an array\";\n }\n\n throw new ConfigurationError(errorMsg, config);\n }\n\n if (config.content.length > 1) {\n errorMsg = \"Top level content can't contain more then one element.\";\n throw new ConfigurationError(errorMsg, config);\n }\n\n this.root = new Root(this, { content: config.content }, this.container);\n this.root.callDownwards('_$init');\n\n if (config.maximisedItemId === '__glMaximised') {\n this.root.getItemsById(config.maximisedItemId)[0].toggleMaximise();\n }\n }\n\n /**\n * Called when the window is closed or the user navigates away\n * from the page\n */\n _onUnload() {\n if (this.config.settings.closePopoutsOnUnload === true) {\n for (var i = 0; i < this.openPopouts.length; i++) {\n this.openPopouts[i].close();\n }\n }\n }\n\n /**\n * Adjusts the number of columns to be lower to fit the screen and still maintain minItemWidth.\n */\n _adjustColumnsResponsive() {\n // If there is no min width set, or not content items, do nothing.\n if (\n !this._useResponsiveLayout() ||\n this._updatingColumnsResponsive ||\n !this.config.dimensions ||\n !this.config.dimensions.minItemWidth ||\n this.root.contentItems.length === 0 ||\n !this.root.contentItems[0].isRow\n ) {\n this._firstLoad = false;\n return;\n }\n\n this._firstLoad = false;\n\n // If there is only one column, do nothing.\n var columnCount = this.root.contentItems[0].contentItems.length;\n if (columnCount <= 1) {\n return;\n }\n\n // If they all still fit, do nothing.\n var minItemWidth = this.config.dimensions.minItemWidth;\n var totalMinWidth = columnCount * minItemWidth;\n if (this.width == null || totalMinWidth <= this.width) {\n return;\n }\n\n // Prevent updates while it is already happening.\n this._updatingColumnsResponsive = true;\n\n // Figure out how many columns to stack, and put them all in the first stack container.\n var finalColumnCount = Math.max(Math.floor(this.width / minItemWidth), 1);\n var stackColumnCount = columnCount - finalColumnCount;\n\n var rootContentItem = this.root.contentItems[0];\n var firstStackContainer = this._findAllStackContainers()[0];\n for (var i = 0; i < stackColumnCount; i++) {\n // Stack from right.\n var column =\n rootContentItem.contentItems[rootContentItem.contentItems.length - 1];\n this._addChildContentItemsToContainer(firstStackContainer, column);\n }\n\n this._updatingColumnsResponsive = false;\n }\n\n /**\n * Determines if responsive layout should be used.\n *\n * @returns True if responsive layout should be used; otherwise false.\n */\n _useResponsiveLayout() {\n return (\n this.config.settings &&\n (this.config.settings.responsiveMode == 'always' ||\n (this.config.settings.responsiveMode == 'onload' && this._firstLoad))\n );\n }\n\n /**\n * Adds all children of a node to another container recursively.\n * @param container - Container to add child content items to.\n * @param node - Node to search for content items.\n */\n _addChildContentItemsToContainer(\n container: AbstractContentItem,\n node: AbstractContentItem\n ) {\n if (node.type === 'stack') {\n node.contentItems.forEach(function (item) {\n container.addChild(item);\n node.removeChild(item, true);\n });\n } else {\n node.contentItems.forEach(item => {\n this._addChildContentItemsToContainer(container, item);\n });\n }\n }\n\n /**\n * Finds all the stack containers.\n * @returns The found stack containers.\n */\n _findAllStackContainers() {\n const stackContainers: Stack[] = [];\n this._findAllStackContainersRecursive(stackContainers, this.root);\n\n return stackContainers;\n }\n\n /**\n * Finds all the stack containers.\n *\n * @param stackContainers Set of containers to populate.\n * @param node Current node to process.\n */\n _findAllStackContainersRecursive(\n stackContainers: Stack[],\n node: AbstractContentItem\n ) {\n node.contentItems.forEach(item => {\n if (isStack(item)) {\n stackContainers.push(item);\n } else if (!item.isComponent) {\n this._findAllStackContainersRecursive(stackContainers, item);\n }\n });\n }\n}\n\nexport default LayoutManager;\n"],"mappings":";;;;;AAAA,OAAOA,CAAC,MAAM,QAAQ;AAAC,OAEhBC,EAAE;AAAA,SAGPC,aAAa;AAAA,SAcbC,aAAa,EACbC,UAAU,EACVC,mBAAmB,EACnBC,mBAAmB;AAAA,SAEZC,kBAAkB;AAAA,SAEzBC,mBAAmB,EAEnBC,OAAO,EACPC,SAAS,EACTC,IAAI,EACJC,WAAW,EACXC,KAAK;AAAA,SAGLC,YAAY,EACZC,cAAc,EACdC,YAAY,EACZC,QAAQ,EACRC,qBAAqB,EACrBC,mBAAmB,EACnBC,WAAW,EACXC,SAAS;AAUX;AACA;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,wBAAwB,GAAG,CAC/B,QAAQ,EACR,KAAK,EACL,OAAO,EACP,WAAW,CAC4C;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,SAASP,YAAY,CAAC;EAC9C;AACF;AACA;;EAGE;AACF;AACA;AACA;EACE,OAAOQ,kBAAkBA,CAACC,MAAkB,EAA8B;IACxE,OAAQH,wBAAwB,CAAwBI,QAAQ,CAC9DD,MAAM,CAACE,IACT,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;A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uBA,CAAA,EAAG;IACxB,IAAM+K,eAAwB,GAAG,EAAE;IACnC,IAAI,CAACC,gCAAgC,CAACD,eAAe,EAAE,IAAI,CAACnO,IAAI,CAAC;IAEjE,OAAOmO,eAAe;EACxB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEC,gCAAgCA,CAC9BD,eAAwB,EACxBrC,IAAyB,EACzB;IACAA,IAAI,CAACnL,YAAY,CAAC0C,OAAO,CAAC7C,IAAI,IAAI;MAChC,IAAIvD,OAAO,CAACuD,IAAI,CAAC,EAAE;QACjB2N,eAAe,CAACnN,IAAI,CAACR,IAAI,CAAC;MAC5B,CAAC,MAAM,IAAI,CAACA,IAAI,CAAC6N,WAAW,EAAE;QAC5B,IAAI,CAACD,gCAAgC,CAACD,eAAe,EAAE3N,IAAI,CAAC;MAC9D;IACF,CAAC,CAAC;EACJ;AACF;AAAClC,eAAA,CA1wCYP,aAAa,UAIVtB,EAAE;AAwwClB,eAAesB,aAAa"}
1
+ {"version":3,"file":"LayoutManager.js","names":["$","lm","defaultConfig","BrowserPopout","DragSource","DragSourceFromEvent","DropTargetIndicator","ConfigurationError","AbstractContentItem","isStack","Component","Root","RowOrColumn","Stack","minifyConfig","unminifyConfig","EventEmitter","EventHub","ReactComponentHandler","getQueryStringParam","getUniqueId","stripTags","LAYOUT_ITEM_CONFIG_TYPES","LayoutManager","isLayoutItemConfig","config","includes","type","constructor","container","_defineProperty","Map","_onResize","bind","_onUnload","_windowBlur","_windowFocus","_windowKeydown","_createConfig","_originalContainer","_getContainer","_initialHeaderHeight","dimensions","headerHeight","isSubWindow","css","registerComponent","name","render","Error","_components","undefined","cleanup","setFallbackComponent","_fallbackComponent","toConfig","root","isInitialised","settings","_objectSpread","labels","content","next","configNode","item","key","componentName","contentItems","length","i","_$reconcilePopoutWindows","openPopouts","push","maximisedItemId","_maximisedItem","getComponent","getFallbackComponent","init","_subWindowsCreated","_createSubWindows","document","readyState","body","ready","_creationTimeoutPassed","setTimeout","_adjustToWindowMode","_setContainer","dropTargetIndicator","updateSize","_create","_bindEvents","_adjustColumnsResponsive","emit","addReactChild","id","element","_reactChildMap","set","_reactChildren","values","removeReactChild","mapElem","get","delete","getReactChildren","enableHeaders","hasHeaders","_findAllStackContainers","forEach","stack","_header","show","header","toggle","disableHeaders","width","height","_ref","_ref2","callDownwards","_this$container$width","_this$container$heigh","destroy","_this$dropTargetIndic","window","off","tabDropPlaceholder","remove","eventHub","_dragSources","dragSource","_dragListener","createContentItem","parent","_config$id","typeErrorMsg","contentItem","join","createPopout","configOrContentItem","parentId","indexInParent","configArray","isItem","self","_parent3","child","_parent2","isRoot","addId","Number","isNaN","_parent4","indexOf","Array","_configOrContentItem$","_configOrContentItem$2","_configOrContentItem$3","windowLeft","screenX","screenLeft","windowTop","screenY","screenTop","offset","left","top","browserPopout","on","createDragSource","itemConfig","constrainDragToContainer","createDragSourceFromEvent","event","selectItem","_$silent","selectionEnabled","selectedItem","deselect","select","_$maximiseItem","_this$container$width2","_this$container$heigh2","_$minimiseItem","addClass","after","_maximisePlaceholder","prepend","_contentItem$parent","removeClass","removeId","_$closeWindow","close","_$getArea","x","y","smallestSurface","Infinity","mathingArea","_itemAreas","area","x1","x2","y1","y2","surface","_$createRootItemAreas","areaSize","rootArea","areas","side","_$calculateItemAreas","allContentItems","_getAllContentItems","concat","_area$contentItem$_co","_contentAreaDimensions","highlightArea","_$normalizeContentItem","contentItemOrConfig","isPlainObject","newContentItem","_this$openPopouts$i$g","getWindow","closed","addChildren","_isFullPage","resize","e","active","activeElement","tagName","isContentEditable","toggleMaximise","clearTimeout","_resizeTimeoutId","_config$settings","windowConfigKey","JSON","parse","localStorage","getItem","removeItem","extend","nextNode","node","value","_this$config$content$","popInButton","popin","click","title","append","html","offsetHeight","__glInstance","popout","margin","padding","overflow","errorMsg","getItemsById","closePopoutsOnUnload","_useResponsiveLayout","_updatingColumnsResponsive","minItemWidth","isRow","_firstLoad","columnCount","totalMinWidth","finalColumnCount","Math","max","floor","stackColumnCount","rootContentItem","firstStackContainer","column","_addChildContentItemsToContainer","responsiveMode","addChild","removeChild","stackContainers","_findAllStackContainersRecursive","isComponent"],"sources":["../src/LayoutManager.ts"],"sourcesContent":["import $ from 'jquery';\nimport React from 'react';\nimport lm from './base';\nimport {\n ColumnItemConfig,\n defaultConfig,\n DefaultItemConfig,\n RootItemConfig,\n RowItemConfig,\n StackItemConfig,\n} from './config';\nimport type {\n ItemConfig,\n Config,\n ComponentConfig,\n ReactComponentConfig,\n} from './config';\nimport type { ItemContainer } from './container';\nimport {\n BrowserPopout,\n DragSource,\n DragSourceFromEvent,\n DropTargetIndicator,\n} from './controls';\nimport { ConfigurationError } from './errors';\nimport {\n AbstractContentItem,\n ItemArea,\n isStack,\n Component,\n Root,\n RowOrColumn,\n Stack,\n} from './items';\nimport {\n minifyConfig,\n unminifyConfig,\n EventEmitter,\n EventHub,\n ReactComponentHandler,\n getQueryStringParam,\n getUniqueId,\n stripTags,\n} from './utils';\nimport { DragListenerEvent } from './utils/DragListener';\n\nexport type ComponentConstructor<\n C extends ComponentConfig | ReactComponentConfig = ComponentConfig,\n> = {\n new (container: ItemContainer<C>, state: unknown): unknown;\n};\n\n/**\n * Item configuration types that are supported inside of `createContentItem` to\n * create content items. Note that `ReactComponentConfig` is a valid input type,\n * but it gets converted to `ComponentConfig` inside the method before this\n * constraint comes into play.\n */\ntype LayoutItemConfig =\n | ColumnItemConfig\n | RowItemConfig\n | StackItemConfig\n | ComponentConfig;\n\n/**\n * Item configuration `type` values that are supported inside of\n * `createContentItem` to create content items. Note that `react-component`\n * is a valid input value, but it gets converted to `component` inside the\n * method before this constraint comes into play.\n */\nconst LAYOUT_ITEM_CONFIG_TYPES = [\n 'column',\n 'row',\n 'stack',\n 'component',\n] as const satisfies Readonly<LayoutItemConfig['type'][]>;\n\n/**\n * The main class that will be exposed as GoldenLayout.\n *\n * @param config\n * @param container Can be a jQuery selector string or a Dom element. Defaults to body\n */\nexport class LayoutManager extends EventEmitter {\n /**\n * Hook that allows to access private classes\n */\n static __lm = lm;\n\n /**\n * Returns true if the given item config can be used to create a layout item.\n * (Used internally by `createContentItem`).\n */\n static isLayoutItemConfig(config: ItemConfig): config is LayoutItemConfig {\n return (LAYOUT_ITEM_CONFIG_TYPES as Readonly<string[]>).includes(\n config.type\n );\n }\n\n /**\n * Takes a GoldenLayout configuration object and\n * replaces its keys and values recursively with\n * one letter codes\n *\n * @param config A GoldenLayout config object\n * @returns minified config\n */\n static minifyConfig(config: Config): Record<string, unknown> {\n return minifyConfig(config);\n }\n\n /**\n * Takes a configuration Object that was previously minified\n * using minifyConfig and returns its original version\n *\n * @param minifiedConfig\n * @returns the original configuration\n */\n static unminifyConfig(config: Record<string, unknown>): Config {\n return unminifyConfig(config);\n }\n\n isInitialised = false;\n private _isFullPage = false;\n private _resizeTimeoutId: number | undefined;\n\n private _components: {\n [name: string]:\n | ComponentConstructor\n | ComponentConstructor<ReactComponentConfig>\n | React.Component\n | React.ComponentType;\n } = { 'lm-react-component': ReactComponentHandler };\n\n private _fallbackComponent?:\n | ComponentConstructor\n | React.ForwardRefExoticComponent<any>;\n private _itemAreas: ItemArea[] = [];\n private _maximisedItem: AbstractContentItem | null = null;\n private _maximisePlaceholder = $('<div class=\"lm_maximise_place\"></div>');\n private _creationTimeoutPassed = false;\n private _subWindowsCreated = false;\n private _dragSources: DragSource[] = [];\n private _updatingColumnsResponsive = false;\n private _firstLoad = true;\n private _reactChildMap = new Map<string, React.ReactNode>();\n private _reactChildren: React.ReactNode = null;\n private _initialHeaderHeight: number;\n\n width: number | null = null;\n height: number | null = null;\n root!: Root; // This will be created after init is called.\n openPopouts: BrowserPopout[] = [];\n selectedItem: AbstractContentItem | null = null;\n isSubWindow = false;\n eventHub = new EventHub(this);\n config: Config;\n container: JQuery<HTMLElement>;\n private _originalContainer: JQuery<HTMLElement> | HTMLElement | undefined;\n dropTargetIndicator: DropTargetIndicator | null = null;\n tabDropPlaceholder = $('<div class=\"lm_drop_tab_placeholder\"></div>');\n\n constructor(\n config: Config,\n container: JQuery<HTMLElement> | HTMLElement | undefined\n ) {\n super();\n\n this._onResize = this._onResize.bind(this);\n this._onUnload = this._onUnload.bind(this);\n this._windowBlur = this._windowBlur.bind(this);\n this._windowFocus = this._windowFocus.bind(this);\n this._windowKeydown = this._windowKeydown.bind(this);\n\n this.config = this._createConfig(config);\n this._originalContainer = container;\n this.container = this._getContainer();\n this._initialHeaderHeight = this.config.dimensions.headerHeight;\n\n if (this.isSubWindow) {\n $('body').css('visibility', 'hidden');\n }\n }\n\n /**\n * Register a component with the layout manager. If a configuration node\n * of type component is reached it will look up componentName and create the\n * associated component\n *\n * {\n *\t\ttype: \"component\",\n *\t\tcomponentName: \"EquityNewsFeed\",\n *\t\tcomponentState: { \"feedTopic\": \"us-bluechips\" }\n * }\n *\n * @param name\n * @param constructor\n * @returns cleanup function to deregister component\n */\n registerComponent(\n name: string,\n constructor:\n | ComponentConstructor\n | React.Component\n | React.ComponentType<any>\n ) {\n if (\n typeof constructor !== 'function' &&\n (constructor == null ||\n constructor.render == null ||\n typeof constructor.render !== 'function')\n ) {\n throw new Error('Please register a constructor function');\n }\n\n if (this._components[name] !== undefined) {\n throw new Error('Component ' + name + ' is already registered');\n }\n\n this._components[name] = constructor;\n\n const cleanup = () => {\n if (this._components[name] === undefined) {\n throw new Error('Component ' + name + ' is not registered');\n }\n\n delete this._components[name];\n };\n\n return cleanup;\n }\n\n /**\n * Set a fallback component to be rendered in place of unregistered components\n * @param constructor\n */\n setFallbackComponent(\n constructor: ComponentConstructor | React.ForwardRefExoticComponent<any>\n ) {\n this._fallbackComponent = constructor;\n }\n\n /**\n * Creates a layout configuration object based on the the current state\n * @param root\n * @returns GoldenLayout configuration\n */\n toConfig(root?: AbstractContentItem) {\n if (this.isInitialised === false) {\n throw new Error(\"Can't create config, layout not yet initialised\");\n }\n\n if (root && !(root instanceof AbstractContentItem)) {\n throw new Error('Root must be a ContentItem');\n }\n\n /*\n * settings & labels\n */\n const config: Config = {\n settings: { ...this.config.settings },\n dimensions: { ...this.config.dimensions },\n labels: { ...this.config.labels },\n content: [],\n };\n\n /*\n * Content\n */\n const next = function (\n configNode: (ComponentConfig | ReactComponentConfig) & {\n [key: string]: unknown;\n },\n item: AbstractContentItem & {\n config: Record<string, unknown>;\n }\n ) {\n for (let key in item.config) {\n if (key !== 'content') {\n configNode[key] = item.config[key];\n }\n }\n\n if (configNode.componentName === 'lm-react-component') {\n // We change the type in `createContentItem`, so change it back here\n configNode.type = 'react-component';\n }\n\n if (item.contentItems.length) {\n configNode.content = [];\n\n for (let i = 0; i < item.contentItems.length; i++) {\n configNode.content[i] = {} as ItemConfig;\n next(\n configNode.content[i] as ComponentConfig & Record<string, unknown>,\n item.contentItems[i] as AbstractContentItem & {\n config: Record<string, unknown>;\n }\n );\n }\n }\n };\n\n if (root) {\n next(\n config as unknown as ComponentConfig & Record<string, unknown>,\n { contentItems: [root] } as AbstractContentItem & {\n config: Record<string, unknown>;\n }\n );\n } else {\n next(\n config as unknown as ComponentConfig & Record<string, unknown>,\n this.root as unknown as AbstractContentItem & {\n config: Record<string, unknown>;\n }\n );\n }\n\n /*\n * Retrieve config for subwindows\n */\n this._$reconcilePopoutWindows();\n config.openPopouts = [];\n for (let i = 0; i < this.openPopouts.length; i++) {\n config.openPopouts.push(this.openPopouts[i].toConfig());\n }\n\n /*\n * Add maximised item\n */\n config.maximisedItemId = this._maximisedItem ? '__glMaximised' : undefined;\n return config;\n }\n\n /**\n * Returns a previously registered component\n * @param name The name used\n */\n getComponent(name: string) {\n return this._components[name];\n }\n\n /**\n * Returns a fallback component to render in place of unregistered components\n *\n * @public\n *\n * @returns {Function}\n */\n getFallbackComponent() {\n return this._fallbackComponent;\n }\n\n /**\n * Creates the actual layout. Must be called after all initial components\n * are registered. Recurses through the configuration and sets up\n * the item tree.\n *\n * If called before the document is ready it adds itself as a listener\n * to the document.ready event\n */\n init() {\n /**\n * Create the popout windows straight away. If popouts are blocked\n * an error is thrown on the same 'thread' rather than a timeout and can\n * be caught. This also prevents any further initilisation from taking place.\n */\n if (this._subWindowsCreated === false) {\n this._createSubWindows();\n this._subWindowsCreated = true;\n }\n\n /**\n * If the document isn't ready yet, wait for it.\n */\n if (document.readyState === 'loading' || document.body === null) {\n $(document).ready(this.init.bind(this));\n return;\n }\n\n /**\n * If this is a subwindow, wait a few milliseconds for the original\n * page's js calls to be executed, then replace the bodies content\n * with GoldenLayout\n */\n if (this.isSubWindow === true && this._creationTimeoutPassed === false) {\n setTimeout(this.init.bind(this), 7);\n this._creationTimeoutPassed = true;\n return;\n }\n\n if (this.isSubWindow === true) {\n this._adjustToWindowMode();\n }\n\n this._setContainer();\n this.dropTargetIndicator = new DropTargetIndicator();\n this.updateSize();\n this._create(this.config);\n this._bindEvents();\n this.isInitialised = true;\n this._adjustColumnsResponsive();\n this.emit('initialised');\n }\n\n /**\n * Adds a react child to the layout manager\n * @param id Unique panel id\n * @param element The React element\n */\n addReactChild(id: string, element: React.ReactNode) {\n this._reactChildMap.set(id, element);\n this._reactChildren = [...this._reactChildMap.values()];\n this.emit('reactChildrenChanged');\n }\n\n /**\n * Removes a react child from the layout manager\n * Only removes if the elements for the panelId has not been replaced by a different element\n * @param id Unique panel id\n * @param element The React element\n */\n removeReactChild(id: string, element: React.ReactNode) {\n const mapElem = this._reactChildMap.get(id);\n if (mapElem === element) {\n // If an element was replaced it may be destroyed after the other is created\n // In that case, the new element would be removed\n // Make sure the element being removed is the current element associated with its id\n this._reactChildMap.delete(id);\n this._reactChildren = [...this._reactChildMap.values()];\n this.emit('reactChildrenChanged');\n }\n }\n\n /**\n * Gets the react children in the layout\n *\n * Used in @deephaven/dashboard to mount the react elements\n * inside the app's React tree\n *\n * @returns The react children to mount for this layout manager\n */\n getReactChildren() {\n return this._reactChildren;\n }\n\n enableHeaders() {\n this.config.settings.hasHeaders = true;\n this.config.dimensions.headerHeight = this._initialHeaderHeight;\n this._findAllStackContainers().forEach(stack => {\n stack._header.show = true;\n stack.header.element.toggle(true);\n });\n this.updateSize();\n }\n\n disableHeaders() {\n this.config.settings.hasHeaders = false;\n this.config.dimensions.headerHeight = 0;\n this._findAllStackContainers().forEach(stack => {\n stack._header.show = false;\n stack.header.element.toggle(false);\n });\n this.updateSize();\n }\n\n /**\n * Updates the layout managers size\n * @param width width in pixels\n * @param height height in pixels\n */\n updateSize(width?: number, height?: number) {\n this.width = width ?? this.container.width() ?? 0;\n this.height = height ?? this.container.height() ?? 0;\n\n if (this.isInitialised === true) {\n this.root.callDownwards('setSize', [this.width, this.height]);\n\n if (this._maximisedItem) {\n this._maximisedItem.element.width(this.container.width() ?? 0);\n this._maximisedItem.element.height(this.container.height() ?? 0);\n this._maximisedItem.callDownwards('setSize');\n }\n\n this._adjustColumnsResponsive();\n }\n }\n\n /**\n * Destroys the LayoutManager instance itself as well as every ContentItem\n * within it. After this is called nothing should be left of the LayoutManager.\n */\n destroy() {\n if (this.isInitialised === false || !this.root) {\n return;\n }\n this._onUnload();\n $(window).off('resize', this._onResize);\n $(window).off('unload beforeunload', this._onUnload);\n $(window).off('blur.lm').off('focus.lm');\n $(window).off('keydown', this._windowKeydown);\n this.root.callDownwards('_$destroy', [], true);\n this.root.contentItems = [];\n this.tabDropPlaceholder.remove();\n this.dropTargetIndicator?.destroy();\n this.eventHub.destroy();\n\n this._dragSources.forEach(function (dragSource) {\n dragSource._dragListener.destroy();\n });\n this._dragSources = [];\n }\n\n /**\n * Recursively creates new item tree structures based on a provided\n * ItemConfiguration object\n *\n * @public\n * @param config ItemConfig\n * @param parent The item the newly created item should be a child of\n *\n * @returns Created item\n */\n createContentItem(\n config: StackItemConfig,\n parent: AbstractContentItem | null\n ): Stack;\n createContentItem(\n config: ColumnItemConfig | RowItemConfig,\n parent: AbstractContentItem | null\n ): RowOrColumn;\n createContentItem(\n config: ComponentConfig | ReactComponentConfig,\n parent: AbstractContentItem | null\n ): Component | Stack;\n // Default and Root configs will throw an error hence the `never` return type\n createContentItem(\n config: DefaultItemConfig | RootItemConfig,\n parent: AbstractContentItem | null\n ): never;\n // This signature is necessary for this function to handle the broader\n // `ItemConfig` type since it won't be able to narrow the result in such cases.\n createContentItem(\n config: ItemConfig,\n parent: AbstractContentItem | null\n ): Component | RowOrColumn | Stack;\n createContentItem(\n config: ItemConfig,\n parent: AbstractContentItem | null\n ): Component | RowOrColumn | Stack {\n var typeErrorMsg, contentItem;\n\n if (typeof config.type !== 'string') {\n throw new ConfigurationError(\"Missing parameter 'type'\", config);\n }\n\n if (config.type === 'react-component') {\n (config as unknown as ComponentConfig).type = 'component';\n (config as unknown as ComponentConfig).componentName =\n 'lm-react-component';\n }\n\n if (!LayoutManager.isLayoutItemConfig(config)) {\n typeErrorMsg =\n \"Unknown type '\" +\n config.type +\n \"'. \" +\n 'Valid types are ' +\n LAYOUT_ITEM_CONFIG_TYPES.join(',');\n\n throw new ConfigurationError(typeErrorMsg);\n }\n\n /**\n * We add an additional stack around every component that's not within a stack anyways.\n */\n if (\n // If this is a component\n config.type === 'component' &&\n // and it's not already within a stack\n !(parent instanceof Stack) &&\n // and we have a parent\n !!parent &&\n // and it's not the topmost item in a new window\n !(this.isSubWindow === true && parent instanceof Root)\n ) {\n config = {\n type: 'stack',\n width: config.width,\n height: config.height,\n content: [config],\n };\n }\n\n config.id = config.id ?? getUniqueId();\n\n if (config.type === 'stack') {\n return new Stack(this, config, parent);\n }\n\n if (config.type === 'row') {\n return new RowOrColumn(false, this, config, parent);\n }\n\n if (config.type === 'column') {\n return new RowOrColumn(true, this, config, parent);\n }\n\n return new Component(this, config, parent);\n }\n\n /**\n\t * Creates a popout window with the specified content and dimensions\n\t *\n\t * @param configOrContentItem\n\t * @param dimensions A map with width, height, left and top\n\t * @param parentId the id of the element this item will be appended to\n\t * when popIn is called\n\t * @param indexInParent The position of this item within its parent element\n\n\t * @returns Created popout\n\t */\n createPopout(\n configOrContentItem: ItemConfig | AbstractContentItem | ItemConfig[],\n dimensions?: { width: number; height: number; left: number; top: number },\n parentId?: string,\n indexInParent?: number\n ): BrowserPopout | undefined {\n let config = configOrContentItem;\n let configArray: ItemConfig[] = [];\n const isItem = configOrContentItem instanceof AbstractContentItem;\n const self = this;\n\n if (isItem) {\n configArray = this.toConfig(configOrContentItem).content;\n parentId = getUniqueId();\n\n /**\n * If the item is the only component within a stack or for some\n * other reason the only child of its parent the parent will be destroyed\n * when the child is removed.\n *\n * In order to support this we move up the tree until we find something\n * that will remain after the item is being popped out\n */\n let parent = configOrContentItem.parent;\n let child = configOrContentItem;\n while (parent?.contentItems.length === 1 && !parent.isRoot) {\n child = parent;\n parent = parent.parent;\n }\n\n parent?.addId(parentId);\n if (indexInParent == undefined || Number.isNaN(indexInParent)) {\n indexInParent = parent?.contentItems.indexOf(child);\n }\n } else {\n if (!(configOrContentItem instanceof Array)) {\n configArray = [configOrContentItem];\n } else {\n configArray = configOrContentItem;\n }\n }\n\n if (!dimensions && isItem) {\n const windowLeft = window.screenX || window.screenLeft;\n const windowTop = window.screenY || window.screenTop;\n const offset = configOrContentItem.element.offset() ?? {\n left: 0,\n top: 0,\n };\n\n dimensions = {\n left: windowLeft + offset.left,\n top: windowTop + offset.top,\n width: configOrContentItem.element.width() ?? 0,\n height: configOrContentItem.element.height() ?? 0,\n };\n }\n\n if (!dimensions && !isItem) {\n dimensions = {\n left: window.screenX || window.screenLeft + 20,\n top: window.screenY || window.screenTop + 20,\n width: 500,\n height: 309,\n };\n }\n\n if (isItem) {\n configOrContentItem.remove();\n }\n\n if (!dimensions || !parentId || indexInParent === undefined) {\n return;\n }\n\n const browserPopout = new BrowserPopout(\n configArray,\n dimensions,\n parentId,\n indexInParent,\n this\n );\n\n browserPopout.on('initialised', function () {\n self.emit('windowOpened', browserPopout);\n });\n\n browserPopout.on('closed', function () {\n self._$reconcilePopoutWindows();\n });\n\n this.openPopouts.push(browserPopout);\n\n return browserPopout;\n }\n\n /**\n * Attaches DragListener to any given DOM element\n * and turns it into a way of creating new ContentItems\n * by 'dragging' the DOM element into the layout\n *\n * @param element\n * @param itemConfig for the new item to be created, or a function which will provide it\n */\n createDragSource(\n element: JQuery<HTMLElement>,\n itemConfig: ComponentConfig | (() => ComponentConfig)\n ) {\n this.config.settings.constrainDragToContainer = false;\n var dragSource = new DragSource(element, itemConfig, this);\n this._dragSources.push(dragSource);\n\n return dragSource;\n }\n\n /**\n * Create a new item in a dragging state, given a starting mouse event to act as the initial position\n *\n * @param itemConfig for the new item to be created, or a function which will provide it\n * @param event used as the starting position for the dragProxy\n */\n createDragSourceFromEvent(\n itemConfig: ItemConfig | (() => ItemConfig),\n event: DragListenerEvent\n ) {\n this.config.settings.constrainDragToContainer = false;\n return new DragSourceFromEvent(itemConfig, this, event);\n }\n\n /**\n * Programmatically selects an item. This deselects\n * the currently selected item, selects the specified item\n * and emits a selectionChanged event\n *\n * @param item\n * @param _$silent Wheather to notify the item of its selection\n */\n selectItem(item: AbstractContentItem, _$silent?: boolean) {\n if (this.config.settings.selectionEnabled !== true) {\n throw new Error(\n 'Please set selectionEnabled to true to use this feature'\n );\n }\n\n if (item === this.selectedItem) {\n return;\n }\n\n if (this.selectedItem !== null) {\n this.selectedItem.deselect();\n }\n\n if (item && _$silent !== true) {\n item.select();\n }\n\n this.selectedItem = item;\n\n this.emit('selectionChanged', item);\n }\n\n /*************************\n * PACKAGE PRIVATE\n *************************/\n _$maximiseItem(contentItem: AbstractContentItem) {\n if (this._maximisedItem !== null) {\n this._$minimiseItem(this._maximisedItem);\n }\n this._maximisedItem = contentItem;\n this._maximisedItem.addId('__glMaximised');\n contentItem.element.addClass('lm_maximised');\n contentItem.element.after(this._maximisePlaceholder);\n this.root.element.prepend(contentItem.element);\n contentItem.element.width(this.container.width() ?? 0);\n contentItem.element.height(this.container.height() ?? 0);\n contentItem.callDownwards('setSize');\n this._maximisedItem.emit('maximised');\n this.emit('stateChanged');\n }\n\n _$minimiseItem(contentItem: AbstractContentItem) {\n contentItem.element.removeClass('lm_maximised');\n contentItem.removeId('__glMaximised');\n this._maximisePlaceholder.after(contentItem.element);\n this._maximisePlaceholder.remove();\n contentItem.parent?.callDownwards('setSize');\n this._maximisedItem = null;\n contentItem.emit('minimised');\n this.emit('stateChanged');\n }\n\n /**\n * This method is used to get around sandboxed iframe restrictions.\n * If 'allow-top-navigation' is not specified in the iframe's 'sandbox' attribute\n * (as is the case with codepens) the parent window is forbidden from calling certain\n * methods on the child, such as window.close() or setting document.location.href.\n *\n * This prevented GoldenLayout popouts from popping in in codepens. The fix is to call\n * _$closeWindow on the child window's gl instance which (after a timeout to disconnect\n * the invoking method from the close call) closes itself.\n */\n _$closeWindow() {\n window.setTimeout(function () {\n window.close();\n }, 1);\n }\n\n _$getArea(x: number, y: number) {\n let smallestSurface = Infinity;\n let mathingArea: ItemArea | null = null;\n\n for (let i = 0; i < this._itemAreas.length; i++) {\n const area = this._itemAreas[i];\n\n if (\n x > area.x1 &&\n x < area.x2 &&\n y > area.y1 &&\n y < area.y2 &&\n smallestSurface > area.surface\n ) {\n smallestSurface = area.surface;\n mathingArea = area;\n }\n }\n\n return mathingArea;\n }\n\n /**\n * Creates the drop zones at the edges of the screen\n */\n _$createRootItemAreas() {\n const areaSize = 50;\n const rootArea = { ...this.root._$getArea() };\n\n const areas = [\n {\n ...rootArea,\n side: 'left' as const,\n x2: rootArea.x1 + areaSize,\n },\n {\n ...rootArea,\n side: 'right' as const,\n x1: rootArea.x2 - areaSize,\n },\n {\n ...rootArea,\n side: 'top' as const,\n y2: rootArea.y1 + areaSize,\n },\n {\n ...rootArea,\n side: 'bottom' as const,\n y1: rootArea.y2 - areaSize,\n },\n ];\n\n areas.forEach(area => {\n area.surface = (area.x2 - area.x1) * (area.y2 - area.y1);\n });\n\n this._itemAreas.push(...areas);\n }\n\n _$calculateItemAreas() {\n const allContentItems = this._getAllContentItems();\n this._itemAreas = [];\n\n /**\n * If the last item is dragged out, highlight the entire container size to\n * allow to re-drop it. allContentItems[ 0 ] === this.root at this point\n *\n * Don't include root into the possible drop areas though otherwise since it\n * will used for every gap in the layout, e.g. splitters\n */\n if (allContentItems.length === 1) {\n this._itemAreas.push(this.root._$getArea());\n return;\n }\n this._$createRootItemAreas();\n\n for (let i = 0; i < allContentItems.length; i++) {\n const item = allContentItems[i];\n if (!isStack(item)) {\n continue;\n }\n\n const area = item._$getArea();\n\n if (area === null) {\n continue;\n } else if (area instanceof Array) {\n this._itemAreas = this._itemAreas.concat(area);\n } else {\n this._itemAreas.push(area);\n let header = {\n ...area,\n ...area.contentItem._contentAreaDimensions?.header.highlightArea,\n };\n header.surface = (header.x2 - header.x1) * (header.y2 - header.y1);\n this._itemAreas.push(header);\n }\n }\n }\n\n /**\n * Takes a contentItem or a configuration and optionally a parent\n * item and returns an initialised instance of the contentItem.\n * If the contentItem is a function, it is first called\n *\n * @param contentItemOrConfig\n * @param parent Only necessary when passing in config\n */\n _$normalizeContentItem(\n contentItemOrConfig:\n | ItemConfig\n | AbstractContentItem\n | (() => AbstractContentItem),\n parent?: AbstractContentItem\n ) {\n if (!contentItemOrConfig) {\n throw new Error('No content item defined');\n }\n\n if (typeof contentItemOrConfig === 'function') {\n contentItemOrConfig = contentItemOrConfig();\n }\n\n if (contentItemOrConfig instanceof AbstractContentItem) {\n return contentItemOrConfig;\n }\n\n if ($.isPlainObject(contentItemOrConfig) && contentItemOrConfig.type) {\n const newContentItem = this.createContentItem(\n contentItemOrConfig,\n parent ?? null\n );\n newContentItem.callDownwards('_$init');\n return newContentItem;\n } else {\n throw new Error('Invalid contentItem');\n }\n }\n\n /**\n * Iterates through the array of open popout windows and removes the ones\n * that are effectively closed. This is necessary due to the lack of reliably\n * listening for window.close / unload events in a cross browser compatible fashion.\n */\n _$reconcilePopoutWindows() {\n const openPopouts: BrowserPopout[] = [];\n\n for (let i = 0; i < this.openPopouts.length; i++) {\n if (this.openPopouts[i].getWindow()?.closed === false) {\n openPopouts.push(this.openPopouts[i]);\n } else {\n this.emit('windowClosed', this.openPopouts[i]);\n }\n }\n\n if (this.openPopouts.length !== openPopouts.length) {\n this.emit('stateChanged');\n this.openPopouts = openPopouts;\n }\n }\n\n /***************************\n * PRIVATE\n ***************************/\n /**\n * Returns a flattened array of all content items,\n * regardles of level or type\n * @return Flattened array of content items\n */\n _getAllContentItems() {\n const allContentItems: AbstractContentItem[] = [];\n\n const addChildren = (contentItem: AbstractContentItem) => {\n allContentItems.push(contentItem);\n\n if (contentItem.contentItems instanceof Array) {\n for (let i = 0; i < contentItem.contentItems.length; i++) {\n addChildren(contentItem.contentItems[i]);\n }\n }\n };\n\n addChildren(this.root);\n\n return allContentItems;\n }\n\n /**\n * Binds to DOM/BOM events on init\n */\n _bindEvents() {\n if (this._isFullPage) {\n $(window).resize(this._onResize);\n }\n $(window)\n .on('unload beforeunload', this._onUnload)\n .on('blur.lm', this._windowBlur)\n .on('focus.lm', this._windowFocus)\n .on('keydown', this._windowKeydown);\n }\n\n /**\n * Handles setting a class based on window focus, useful for focus indicators\n */\n _windowBlur() {\n this.root.element.addClass('lm_window_blur');\n }\n\n _windowFocus() {\n this.root.element.removeClass('lm_window_blur');\n }\n\n /**\n * Handles the escape key to close maximized items, as long as the focus isn't within an input.\n * The escape key has local behaviors in inputs like the Monaco editor or search that we don't\n * want to react to as they are not captured.\n *\n * @private\n * @param e The keydown event\n */\n _windowKeydown(e: JQuery.KeyDownEvent) {\n if (e.key === 'Escape' && this._maximisedItem !== null) {\n const active = document.activeElement;\n if (\n active &&\n (active.tagName === 'INPUT' ||\n active.tagName === 'TEXTAREA' ||\n active.tagName === 'SELECT' ||\n (active as HTMLElement).isContentEditable)\n ) {\n return;\n }\n\n this._maximisedItem.toggleMaximise();\n }\n }\n\n /**\n * Debounces resize events\n */\n _onResize() {\n clearTimeout(this._resizeTimeoutId);\n this._resizeTimeoutId = window.setTimeout(this.updateSize.bind(this), 100);\n }\n\n /**\n * Extends the default config with the user specific settings and applies\n * derivations. Please note that there's a seperate method (AbstractContentItem._extendItemNode)\n * that deals with the extension of item configs\n *\n * @param config\n * @returns config\n */\n _createConfig(config: Config): Config {\n var windowConfigKey = getQueryStringParam('gl-window');\n\n if (windowConfigKey) {\n this.isSubWindow = true;\n config = JSON.parse(localStorage.getItem(windowConfigKey) || '{}');\n config = unminifyConfig(config);\n localStorage.removeItem(windowConfigKey);\n }\n\n config = $.extend(true, {}, defaultConfig, config);\n\n var nextNode = function (node: Record<string, unknown>) {\n for (var key in node) {\n const value = node[key];\n if (key !== 'props' && typeof value === 'object' && value != null) {\n nextNode(value as Record<string, unknown>);\n } else if (key === 'type' && value === 'react-component') {\n node.type = 'component';\n node.componentName = 'lm-react-component';\n }\n }\n };\n\n nextNode(config);\n\n if (config.settings?.hasHeaders === false) {\n config.dimensions.headerHeight = 0;\n }\n\n return config;\n }\n\n /**\n * This is executed when GoldenLayout detects that it is run\n * within a previously opened popout window.\n */\n _adjustToWindowMode() {\n var popInButton = $(\n '<div class=\"lm_popin\" title=\"' +\n this.config.labels.popin +\n '\">' +\n '<div class=\"lm_icon\"></div>' +\n '<div class=\"lm_bg\"></div>' +\n '</div>'\n );\n\n popInButton.click(() => {\n this.emit('popIn');\n });\n\n document.title = stripTags(this.config.content[0].title ?? '');\n\n $('head').append($('body link, body style, template, .gl_keep'));\n\n this.container = $('body')\n .html('')\n .css('visibility', 'visible')\n .append(popInButton);\n\n /*\n * This seems a bit pointless, but actually causes a reflow/re-evaluation getting around\n * slickgrid's \"Cannot find stylesheet.\" bug in chrome\n */\n var x = document.body.offsetHeight; // jshint ignore:line\n\n /*\n * Expose this instance on the window object\n * to allow the opening window to interact with\n * it\n */\n (\n window as Window & typeof globalThis & { __glInstance: LayoutManager }\n ).__glInstance = this;\n }\n\n /**\n * Creates Subwindows (if there are any). Throws an error\n * if popouts are blocked.\n */\n _createSubWindows() {\n if (!this.config.openPopouts) {\n return;\n }\n\n for (let i = 0; i < this.config.openPopouts.length; i++) {\n const popout = this.config.openPopouts[i];\n\n this.createPopout(\n popout.content,\n popout.dimensions,\n popout.parentId,\n popout.indexInParent\n );\n }\n }\n\n _getContainer() {\n const container = this._originalContainer\n ? $(this._originalContainer)\n : $('body');\n\n if (container.length === 0) {\n throw new Error('GoldenLayout container not found');\n }\n\n if (container.length > 1) {\n throw new Error('GoldenLayout more than one container element specified');\n }\n\n return container;\n }\n\n /**\n * Determines what element the layout will be created in\n */\n _setContainer() {\n const container = this._getContainer();\n\n if (container[0] === document.body) {\n this._isFullPage = true;\n\n $('html, body').css({\n height: '100%',\n margin: 0,\n padding: 0,\n overflow: 'hidden',\n });\n }\n\n this.container = container;\n }\n\n /**\n * Kicks of the initial, recursive creation chain\n *\n * @param config GoldenLayout Config\n */\n _create(config: Config) {\n var errorMsg;\n\n if (!(config.content instanceof Array)) {\n if (config.content === undefined) {\n errorMsg = \"Missing setting 'content' on top level of configuration\";\n } else {\n errorMsg = \"Configuration parameter 'content' must be an array\";\n }\n\n throw new ConfigurationError(errorMsg, config);\n }\n\n if (config.content.length > 1) {\n errorMsg = \"Top level content can't contain more then one element.\";\n throw new ConfigurationError(errorMsg, config);\n }\n\n this.root = new Root(this, { content: config.content }, this.container);\n this.root.callDownwards('_$init');\n\n if (config.maximisedItemId === '__glMaximised') {\n this.root.getItemsById(config.maximisedItemId)[0].toggleMaximise();\n }\n }\n\n /**\n * Called when the window is closed or the user navigates away\n * from the page\n */\n _onUnload() {\n if (this.config.settings.closePopoutsOnUnload === true) {\n for (var i = 0; i < this.openPopouts.length; i++) {\n this.openPopouts[i].close();\n }\n }\n }\n\n /**\n * Adjusts the number of columns to be lower to fit the screen and still maintain minItemWidth.\n */\n _adjustColumnsResponsive() {\n // If there is no min width set, or not content items, do nothing.\n if (\n !this._useResponsiveLayout() ||\n this._updatingColumnsResponsive ||\n !this.config.dimensions ||\n !this.config.dimensions.minItemWidth ||\n this.root.contentItems.length === 0 ||\n !this.root.contentItems[0].isRow\n ) {\n this._firstLoad = false;\n return;\n }\n\n this._firstLoad = false;\n\n // If there is only one column, do nothing.\n var columnCount = this.root.contentItems[0].contentItems.length;\n if (columnCount <= 1) {\n return;\n }\n\n // If they all still fit, do nothing.\n var minItemWidth = this.config.dimensions.minItemWidth;\n var totalMinWidth = columnCount * minItemWidth;\n if (this.width == null || totalMinWidth <= this.width) {\n return;\n }\n\n // Prevent updates while it is already happening.\n this._updatingColumnsResponsive = true;\n\n // Figure out how many columns to stack, and put them all in the first stack container.\n var finalColumnCount = Math.max(Math.floor(this.width / minItemWidth), 1);\n var stackColumnCount = columnCount - finalColumnCount;\n\n var rootContentItem = this.root.contentItems[0];\n var firstStackContainer = this._findAllStackContainers()[0];\n for (var i = 0; i < stackColumnCount; i++) {\n // Stack from right.\n var column =\n rootContentItem.contentItems[rootContentItem.contentItems.length - 1];\n this._addChildContentItemsToContainer(firstStackContainer, column);\n }\n\n this._updatingColumnsResponsive = false;\n }\n\n /**\n * Determines if responsive layout should be used.\n *\n * @returns True if responsive layout should be used; otherwise false.\n */\n _useResponsiveLayout() {\n return (\n this.config.settings &&\n (this.config.settings.responsiveMode == 'always' ||\n (this.config.settings.responsiveMode == 'onload' && this._firstLoad))\n );\n }\n\n /**\n * Adds all children of a node to another container recursively.\n * @param container - Container to add child content items to.\n * @param node - Node to search for content items.\n */\n _addChildContentItemsToContainer(\n container: AbstractContentItem,\n node: AbstractContentItem\n ) {\n if (node.type === 'stack') {\n node.contentItems.forEach(function (item) {\n container.addChild(item);\n node.removeChild(item, true);\n });\n } else {\n node.contentItems.forEach(item => {\n this._addChildContentItemsToContainer(container, item);\n });\n }\n }\n\n /**\n * Finds all the stack containers.\n * @returns The found stack containers.\n */\n _findAllStackContainers() {\n const stackContainers: Stack[] = [];\n this._findAllStackContainersRecursive(stackContainers, this.root);\n\n return stackContainers;\n }\n\n /**\n * Finds all the stack containers.\n *\n * @param stackContainers Set of containers to populate.\n * @param node Current node to process.\n */\n _findAllStackContainersRecursive(\n stackContainers: Stack[],\n node: AbstractContentItem\n ) {\n node.contentItems.forEach(item => {\n if (isStack(item)) {\n stackContainers.push(item);\n } else if (!item.isComponent) {\n this._findAllStackContainersRecursive(stackContainers, item);\n }\n });\n }\n}\n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AgC,CAACD,eAAe,EAAE3N,IAAI,CAAC;MAC9D;IACF,CAAC,CAAC;EACJ;AACF;AAzwCE;AACF;AACA;AAFElC,eAAA,CADWP,aAAa,UAIVtB,EAAE;AAwwClB,eAAesB,aAAa","ignoreList":[]}
package/dist/base.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","names":["config","container","controls","errors","items","utils","lm"],"sources":["../src/base.ts"],"sourcesContent":["import * as config from './config';\nimport * as container from './container';\nimport * as controls from './controls';\nimport * as errors from './errors';\nimport * as items from './items';\nimport * as utils from './utils';\n\nconst lm = {\n config,\n container,\n controls,\n errors,\n items,\n utils,\n};\n\nexport default lm;\n"],"mappings":"OAAO,KAAKA,MAAM;AAAA,OACX,KAAKC,SAAS;AAAA,OACd,KAAKC,QAAQ;AAAA,OACb,KAAKC,MAAM;AAAA,OACX,KAAKC,KAAK;AAAA,OACV,KAAKC,KAAK;AAEjB,IAAMC,EAAE,GAAG;EACTN,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,KAAK;EACLC;AACF,CAAC;AAED,eAAeC,EAAE"}
1
+ {"version":3,"file":"base.js","names":["config","container","controls","errors","items","utils","lm"],"sources":["../src/base.ts"],"sourcesContent":["import * as config from './config';\nimport * as container from './container';\nimport * as controls from './controls';\nimport * as errors from './errors';\nimport * as items from './items';\nimport * as utils from './utils';\n\nconst lm = {\n config,\n container,\n controls,\n errors,\n items,\n utils,\n};\n\nexport default lm;\n"],"mappings":"OAAO,KAAKA,MAAM;AAAA,OACX,KAAKC,SAAS;AAAA,OACd,KAAKC,QAAQ;AAAA,OACb,KAAKC,MAAM;AAAA,OACX,KAAKC,KAAK;AAAA,OACV,KAAKC,KAAK;AAEjB,IAAMC,EAAE,GAAG;EACTN,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,MAAM;EACNC,KAAK;EACLC;AACF,CAAC;AAED,eAAeC,EAAE","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Config.js","names":["defaultConfig","Object","freeze","openPopouts","settings","hasHeaders","constrainDragToContainer","reorderEnabled","selectionEnabled","popoutWholeStack","blockedPopoutsThrowError","closePopoutsOnUnload","showPopoutIcon","showMaximiseIcon","showCloseIcon","responsiveMode","tabOverlapAllowance","tabControlOffset","dimensions","borderWidth","borderGrabWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","popin","tabDropdown","tabNextLabel","tabPreviousLabel","content"],"sources":["../../src/config/Config.ts"],"sourcesContent":["import type { ItemConfig } from './ItemConfig';\n\nexport type Config = {\n settings: Partial<Settings>;\n dimensions: Dimensions;\n labels: Labels;\n content: ItemConfig[];\n maximisedItemId?: string;\n openPopouts?: PopoutConfig[];\n};\n\nexport type PopoutConfig = Config & {\n parentId: string;\n indexInParent: number;\n dimensions: Dimensions & {\n width: number;\n\n height: number;\n\n left: number;\n\n top: number;\n };\n};\n\nexport interface Settings {\n /**\n * Turns headers on or off. If false, the layout will be displayed with splitters only.\n * Default: true\n */\n hasHeaders: boolean;\n\n /**\n * Constrains the area in which items can be dragged to the layout's container. Will be set to false\n * automatically when layout.createDragSource() is called.\n * Default: true\n */\n constrainDragToContainer: boolean;\n\n /**\n * If true, the user can re-arrange the layout by dragging items by their tabs to the desired location.\n * Default: true\n */\n reorderEnabled: boolean;\n\n /**\n * If true, the user can select items by clicking on their header. This sets the value of layout.selectedItem to\n * the clicked item, highlights its header and the layout emits a 'selectionChanged' event.\n * Default: false\n */\n selectionEnabled: boolean;\n\n /**\n * Decides what will be opened in a new window if the user clicks the popout icon. If true the entire stack will\n * be transferred to the new window, if false only the active component will be opened.\n * Default: false\n */\n popoutWholeStack: boolean;\n\n /**\n * Specifies if an error is thrown when a popout is blocked by the browser (e.g. by opening it programmatically).\n * If false, the popout call will fail silently.\n * Default: true\n */\n blockedPopoutsThrowError: boolean;\n\n /**\n * Specifies if all popouts should be closed when the page that created them is closed. Popouts don't have a\n * strong dependency on their parent and can exist on their own, but can be quite annoying to close by hand. In\n * addition, any changes made to popouts won't be stored after the parent is closed.\n * Default: true\n */\n closePopoutsOnUnload: boolean;\n\n /**\n * Specifies if the popout icon should be displayed in the header-bar.\n * Default: true\n */\n showPopoutIcon: boolean;\n\n /**\n * Specifies if the maximise icon should be displayed in the header-bar.\n * Default: true\n */\n showMaximiseIcon: boolean;\n\n /**\n * Specifies if the close icon should be displayed in the header-bar.\n * Default: true\n */\n showCloseIcon: boolean;\n\n responsiveMode: 'onload' | 'always' | 'none'; // Can be onload, always, or none.\n\n /**\n * Maximum pixel overlap per tab\n */\n tabOverlapAllowance: number;\n\n tabControlOffset: number;\n\n /**\n * The default config to apply to Components\n */\n defaultComponentConfig: Partial<Omit<ItemConfig, 'type'>>;\n}\n\nexport interface Dimensions {\n /**\n * The width of the borders between the layout items in pixel. Please note: The actual draggable area is wider\n * than the visible one, making it safe to set this to small values without affecting usability.\n * Default: 5\n */\n borderWidth: number;\n\n borderGrabWidth: number;\n\n /**\n * The minimum height an item can be resized to (in pixel).\n * Default: 10\n */\n minItemHeight: number;\n\n /**\n * The minimum width an item can be resized to (in pixel).\n * Default: 10\n */\n minItemWidth: number;\n\n /**\n * The height of the header elements in pixel. This can be changed, but your theme's header css needs to be\n * adjusted accordingly.\n * Default: 20\n */\n headerHeight: number;\n\n /**\n * The width of the element that appears when an item is dragged (in pixel).\n * Default: 300\n */\n dragProxyWidth: number;\n\n /**\n * The height of the element that appears when an item is dragged (in pixel).\n * Default: 200\n */\n dragProxyHeight: number;\n}\n\nexport interface Labels {\n /**\n * The tooltip text that appears when hovering over the close icon.\n * Default: 'close'\n */\n close: string;\n\n /**\n * The tooltip text that appears when hovering over the maximise icon.\n * Default: 'maximise'\n */\n maximise: string;\n\n /**\n * The tooltip text that appears when hovering over the minimise icon.\n * Default: 'minimise'\n */\n minimise: string;\n\n /**\n * The tooltip text that appears when hovering over the popout icon.\n * Default: 'open in new window'\n */\n popout: string;\n\n tabDropdown: string;\n\n tabNextLabel: string;\n\n tabPreviousLabel: string;\n\n popin: string;\n}\n\nexport const defaultConfig: Config = Object.freeze({\n openPopouts: [],\n settings: {\n hasHeaders: true,\n constrainDragToContainer: true,\n reorderEnabled: true,\n selectionEnabled: false,\n popoutWholeStack: false,\n blockedPopoutsThrowError: true,\n closePopoutsOnUnload: true,\n showPopoutIcon: true,\n showMaximiseIcon: true,\n showCloseIcon: true,\n responsiveMode: 'onload' as const, // Can be onload, always, or none.\n tabOverlapAllowance: 0, // maximum pixel overlap per tab\n // reorderOnTabMenuClick: true, // Deephaven disabled\n tabControlOffset: 10,\n },\n dimensions: {\n borderWidth: 5,\n borderGrabWidth: 10,\n minItemHeight: 10,\n minItemWidth: 10,\n headerHeight: 20,\n dragProxyWidth: 300,\n dragProxyHeight: 200,\n },\n labels: {\n close: 'Close',\n maximise: 'Maximize',\n minimise: 'Minimize',\n popout: 'Open in new window',\n popin: 'Pop in',\n tabDropdown: 'Additional tabs',\n tabNextLabel: 'Next',\n tabPreviousLabel: 'Previous',\n },\n content: [],\n});\n"],"mappings":"AAuLA,OAAO,IAAMA,aAAqB,GAAGC,MAAM,CAACC,MAAM,CAAC;EACjDC,WAAW,EAAE,EAAE;EACfC,QAAQ,EAAE;IACRC,UAAU,EAAE,IAAI;IAChBC,wBAAwB,EAAE,IAAI;IAC9BC,cAAc,EAAE,IAAI;IACpBC,gBAAgB,EAAE,KAAK;IACvBC,gBAAgB,EAAE,KAAK;IACvBC,wBAAwB,EAAE,IAAI;IAC9BC,oBAAoB,EAAE,IAAI;IAC1BC,cAAc,EAAE,IAAI;IACpBC,gBAAgB,EAAE,IAAI;IACtBC,aAAa,EAAE,IAAI;IACnBC,cAAc,EAAE,QAAiB;IAAE;IACnCC,mBAAmB,EAAE,CAAC;IAAE;IACxB;IACAC,gBAAgB,EAAE;EACpB,CAAC;EACDC,UAAU,EAAE;IACVC,WAAW,EAAE,CAAC;IACdC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE,EAAE;IACjBC,YAAY,EAAE,EAAE;IAChBC,YAAY,EAAE,EAAE;IAChBC,cAAc,EAAE,GAAG;IACnBC,eAAe,EAAE;EACnB,CAAC;EACDC,MAAM,EAAE;IACNC,KAAK,EAAE,OAAO;IACdC,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,oBAAoB;IAC5BC,KAAK,EAAE,QAAQ;IACfC,WAAW,EAAE,iBAAiB;IAC9BC,YAAY,EAAE,MAAM;IACpBC,gBAAgB,EAAE;EACpB,CAAC;EACDC,OAAO,EAAE;AACX,CAAC,CAAC"}
1
+ {"version":3,"file":"Config.js","names":["defaultConfig","Object","freeze","openPopouts","settings","hasHeaders","constrainDragToContainer","reorderEnabled","selectionEnabled","popoutWholeStack","blockedPopoutsThrowError","closePopoutsOnUnload","showPopoutIcon","showMaximiseIcon","showCloseIcon","responsiveMode","tabOverlapAllowance","tabControlOffset","dimensions","borderWidth","borderGrabWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","popin","tabDropdown","tabNextLabel","tabPreviousLabel","content"],"sources":["../../src/config/Config.ts"],"sourcesContent":["import type { ItemConfig } from './ItemConfig';\n\nexport type Config = {\n settings: Partial<Settings>;\n dimensions: Dimensions;\n labels: Labels;\n content: ItemConfig[];\n maximisedItemId?: string;\n openPopouts?: PopoutConfig[];\n};\n\nexport type PopoutConfig = Config & {\n parentId: string;\n indexInParent: number;\n dimensions: Dimensions & {\n width: number;\n\n height: number;\n\n left: number;\n\n top: number;\n };\n};\n\nexport interface Settings {\n /**\n * Turns headers on or off. If false, the layout will be displayed with splitters only.\n * Default: true\n */\n hasHeaders: boolean;\n\n /**\n * Constrains the area in which items can be dragged to the layout's container. Will be set to false\n * automatically when layout.createDragSource() is called.\n * Default: true\n */\n constrainDragToContainer: boolean;\n\n /**\n * If true, the user can re-arrange the layout by dragging items by their tabs to the desired location.\n * Default: true\n */\n reorderEnabled: boolean;\n\n /**\n * If true, the user can select items by clicking on their header. This sets the value of layout.selectedItem to\n * the clicked item, highlights its header and the layout emits a 'selectionChanged' event.\n * Default: false\n */\n selectionEnabled: boolean;\n\n /**\n * Decides what will be opened in a new window if the user clicks the popout icon. If true the entire stack will\n * be transferred to the new window, if false only the active component will be opened.\n * Default: false\n */\n popoutWholeStack: boolean;\n\n /**\n * Specifies if an error is thrown when a popout is blocked by the browser (e.g. by opening it programmatically).\n * If false, the popout call will fail silently.\n * Default: true\n */\n blockedPopoutsThrowError: boolean;\n\n /**\n * Specifies if all popouts should be closed when the page that created them is closed. Popouts don't have a\n * strong dependency on their parent and can exist on their own, but can be quite annoying to close by hand. In\n * addition, any changes made to popouts won't be stored after the parent is closed.\n * Default: true\n */\n closePopoutsOnUnload: boolean;\n\n /**\n * Specifies if the popout icon should be displayed in the header-bar.\n * Default: true\n */\n showPopoutIcon: boolean;\n\n /**\n * Specifies if the maximise icon should be displayed in the header-bar.\n * Default: true\n */\n showMaximiseIcon: boolean;\n\n /**\n * Specifies if the close icon should be displayed in the header-bar.\n * Default: true\n */\n showCloseIcon: boolean;\n\n responsiveMode: 'onload' | 'always' | 'none'; // Can be onload, always, or none.\n\n /**\n * Maximum pixel overlap per tab\n */\n tabOverlapAllowance: number;\n\n tabControlOffset: number;\n\n /**\n * The default config to apply to Components\n */\n defaultComponentConfig: Partial<Omit<ItemConfig, 'type'>>;\n}\n\nexport interface Dimensions {\n /**\n * The width of the borders between the layout items in pixel. Please note: The actual draggable area is wider\n * than the visible one, making it safe to set this to small values without affecting usability.\n * Default: 5\n */\n borderWidth: number;\n\n borderGrabWidth: number;\n\n /**\n * The minimum height an item can be resized to (in pixel).\n * Default: 10\n */\n minItemHeight: number;\n\n /**\n * The minimum width an item can be resized to (in pixel).\n * Default: 10\n */\n minItemWidth: number;\n\n /**\n * The height of the header elements in pixel. This can be changed, but your theme's header css needs to be\n * adjusted accordingly.\n * Default: 20\n */\n headerHeight: number;\n\n /**\n * The width of the element that appears when an item is dragged (in pixel).\n * Default: 300\n */\n dragProxyWidth: number;\n\n /**\n * The height of the element that appears when an item is dragged (in pixel).\n * Default: 200\n */\n dragProxyHeight: number;\n}\n\nexport interface Labels {\n /**\n * The tooltip text that appears when hovering over the close icon.\n * Default: 'close'\n */\n close: string;\n\n /**\n * The tooltip text that appears when hovering over the maximise icon.\n * Default: 'maximise'\n */\n maximise: string;\n\n /**\n * The tooltip text that appears when hovering over the minimise icon.\n * Default: 'minimise'\n */\n minimise: string;\n\n /**\n * The tooltip text that appears when hovering over the popout icon.\n * Default: 'open in new window'\n */\n popout: string;\n\n tabDropdown: string;\n\n tabNextLabel: string;\n\n tabPreviousLabel: string;\n\n popin: string;\n}\n\nexport const defaultConfig: Config = Object.freeze({\n openPopouts: [],\n settings: {\n hasHeaders: true,\n constrainDragToContainer: true,\n reorderEnabled: true,\n selectionEnabled: false,\n popoutWholeStack: false,\n blockedPopoutsThrowError: true,\n closePopoutsOnUnload: true,\n showPopoutIcon: true,\n showMaximiseIcon: true,\n showCloseIcon: true,\n responsiveMode: 'onload' as const, // Can be onload, always, or none.\n tabOverlapAllowance: 0, // maximum pixel overlap per tab\n // reorderOnTabMenuClick: true, // Deephaven disabled\n tabControlOffset: 10,\n },\n dimensions: {\n borderWidth: 5,\n borderGrabWidth: 10,\n minItemHeight: 10,\n minItemWidth: 10,\n headerHeight: 20,\n dragProxyWidth: 300,\n dragProxyHeight: 200,\n },\n labels: {\n close: 'Close',\n maximise: 'Maximize',\n minimise: 'Minimize',\n popout: 'Open in new window',\n popin: 'Pop in',\n tabDropdown: 'Additional tabs',\n tabNextLabel: 'Next',\n tabPreviousLabel: 'Previous',\n },\n content: [],\n});\n"],"mappings":"AAuLA,OAAO,IAAMA,aAAqB,GAAGC,MAAM,CAACC,MAAM,CAAC;EACjDC,WAAW,EAAE,EAAE;EACfC,QAAQ,EAAE;IACRC,UAAU,EAAE,IAAI;IAChBC,wBAAwB,EAAE,IAAI;IAC9BC,cAAc,EAAE,IAAI;IACpBC,gBAAgB,EAAE,KAAK;IACvBC,gBAAgB,EAAE,KAAK;IACvBC,wBAAwB,EAAE,IAAI;IAC9BC,oBAAoB,EAAE,IAAI;IAC1BC,cAAc,EAAE,IAAI;IACpBC,gBAAgB,EAAE,IAAI;IACtBC,aAAa,EAAE,IAAI;IACnBC,cAAc,EAAE,QAAiB;IAAE;IACnCC,mBAAmB,EAAE,CAAC;IAAE;IACxB;IACAC,gBAAgB,EAAE;EACpB,CAAC;EACDC,UAAU,EAAE;IACVC,WAAW,EAAE,CAAC;IACdC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE,EAAE;IACjBC,YAAY,EAAE,EAAE;IAChBC,YAAY,EAAE,EAAE;IAChBC,cAAc,EAAE,GAAG;IACnBC,eAAe,EAAE;EACnB,CAAC;EACDC,MAAM,EAAE;IACNC,KAAK,EAAE,OAAO;IACdC,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,oBAAoB;IAC5BC,KAAK,EAAE,QAAQ;IACfC,WAAW,EAAE,iBAAiB;IAC9BC,YAAY,EAAE,MAAM;IACpBC,gBAAgB,EAAE;EACpB,CAAC;EACDC,OAAO,EAAE;AACX,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ItemConfig.js","names":["isGLComponentConfig","item","componentName","undefined","isReactComponentConfig","component","itemDefaultConfig","Object","freeze","type","isClosable","isFocusOnShow","reorderEnabled","title"],"sources":["../../src/config/ItemConfig.ts"],"sourcesContent":["/** @deprecated Use `ItemConfig` instead. */\nexport type ItemConfigType = ItemConfig;\n\nexport type ItemConfig =\n | ColumnItemConfig\n | ComponentConfig\n | DefaultItemConfig\n | ReactComponentConfig\n | RootItemConfig\n | RowItemConfig\n | StackItemConfig;\n\nexport interface ItemConfigAttributes {\n /**\n * An array of configurations for items that will be created as children of this item.\n */\n content?: ItemConfig[];\n\n /**\n * The width of this item, relative to the other children of its parent in percent\n */\n width?: number;\n\n minWidth?: number;\n\n /**\n * The height of this item, relative to the other children of its parent in percent\n */\n height?: number;\n\n minHeight?: number;\n\n /**\n * A String or an Array of Strings. Used to retrieve the item using item.getItemsById()\n */\n id?: string | string[];\n\n /**\n * Determines if the item is closable. If false, the x on the items tab will be hidden and container.close()\n * will return false\n * Default: true\n */\n isClosable?: boolean;\n\n /**\n * The title of the item as displayed on its tab and on popout windows\n * Default: componentName or ''\n */\n title?: string;\n\n isFocusOnShow?: boolean;\n\n reorderEnabled?: boolean;\n\n header?: StackItemHeaderConfig;\n}\n\nexport interface DefaultItemConfig extends ItemConfigAttributes {\n type: 'default';\n}\n\nexport interface RowItemConfig extends ItemConfigAttributes {\n type: 'row';\n}\n\nexport interface ColumnItemConfig extends ItemConfigAttributes {\n type: 'column';\n}\n\nexport interface RootItemConfig extends ItemConfigAttributes {\n type: 'root';\n}\n\nexport interface StackItemHeaderConfig {\n show?: boolean | 'top' | 'left' | 'right' | 'bottom';\n popout?: string;\n maximise?: string;\n close?: string;\n minimise?: string;\n}\n\nexport interface StackItemConfig extends ItemConfigAttributes {\n type: 'stack';\n activeItemIndex?: number;\n header?: StackItemHeaderConfig;\n hasHeaders?: boolean;\n}\n\nexport interface ComponentConfig extends ItemConfigAttributes {\n type: 'component';\n\n /**\n * The name of the component as specified in layout.registerComponent. Mandatory if type is 'component'.\n */\n componentName: string;\n\n /**\n * A serialisable object. Will be passed to the component constructor function and will be the value returned by\n * container.getState().\n */\n componentState: Record<string, unknown>;\n}\n\nexport interface ReactComponentConfig extends ItemConfigAttributes {\n type: 'react-component';\n\n componentName?: string;\n /**\n * The name of the component as specified in layout.registerComponent. Mandatory if type is 'react-component'\n */\n component: string;\n\n /**\n * Properties that will be passed to the component and accessible using this.props.\n */\n props?: any;\n}\n\nexport function isGLComponentConfig(item: ItemConfig): item is ComponentConfig {\n return (item as ComponentConfig).componentName !== undefined;\n}\n\nexport function isReactComponentConfig(\n item: ItemConfig\n): item is ReactComponentConfig {\n return (item as ReactComponentConfig).component !== undefined;\n}\n\nexport const itemDefaultConfig: DefaultItemConfig = Object.freeze({\n type: 'default',\n isClosable: true,\n isFocusOnShow: true,\n reorderEnabled: true,\n title: '',\n});\n"],"mappings":"AAAA;;AAsHA,OAAO,SAASA,mBAAmBA,CAACC,IAAgB,EAA2B;EAC7E,OAAQA,IAAI,CAAqBC,aAAa,KAAKC,SAAS;AAC9D;AAEA,OAAO,SAASC,sBAAsBA,CACpCH,IAAgB,EACc;EAC9B,OAAQA,IAAI,CAA0BI,SAAS,KAAKF,SAAS;AAC/D;AAEA,OAAO,IAAMG,iBAAoC,GAAGC,MAAM,CAACC,MAAM,CAAC;EAChEC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE,IAAI;EAChBC,aAAa,EAAE,IAAI;EACnBC,cAAc,EAAE,IAAI;EACpBC,KAAK,EAAE;AACT,CAAC,CAAC"}
1
+ {"version":3,"file":"ItemConfig.js","names":["isGLComponentConfig","item","componentName","undefined","isReactComponentConfig","component","itemDefaultConfig","Object","freeze","type","isClosable","isFocusOnShow","reorderEnabled","title"],"sources":["../../src/config/ItemConfig.ts"],"sourcesContent":["/** @deprecated Use `ItemConfig` instead. */\nexport type ItemConfigType = ItemConfig;\n\nexport type ItemConfig =\n | ColumnItemConfig\n | ComponentConfig\n | DefaultItemConfig\n | ReactComponentConfig\n | RootItemConfig\n | RowItemConfig\n | StackItemConfig;\n\nexport interface ItemConfigAttributes {\n /**\n * An array of configurations for items that will be created as children of this item.\n */\n content?: ItemConfig[];\n\n /**\n * The width of this item, relative to the other children of its parent in percent\n */\n width?: number;\n\n minWidth?: number;\n\n /**\n * The height of this item, relative to the other children of its parent in percent\n */\n height?: number;\n\n minHeight?: number;\n\n /**\n * A String or an Array of Strings. Used to retrieve the item using item.getItemsById()\n */\n id?: string | string[];\n\n /**\n * Determines if the item is closable. If false, the x on the items tab will be hidden and container.close()\n * will return false\n * Default: true\n */\n isClosable?: boolean;\n\n /**\n * The title of the item as displayed on its tab and on popout windows\n * Default: componentName or ''\n */\n title?: string;\n\n isFocusOnShow?: boolean;\n\n reorderEnabled?: boolean;\n\n header?: StackItemHeaderConfig;\n}\n\nexport interface DefaultItemConfig extends ItemConfigAttributes {\n type: 'default';\n}\n\nexport interface RowItemConfig extends ItemConfigAttributes {\n type: 'row';\n}\n\nexport interface ColumnItemConfig extends ItemConfigAttributes {\n type: 'column';\n}\n\nexport interface RootItemConfig extends ItemConfigAttributes {\n type: 'root';\n}\n\nexport interface StackItemHeaderConfig {\n show?: boolean | 'top' | 'left' | 'right' | 'bottom';\n popout?: string;\n maximise?: string;\n close?: string;\n minimise?: string;\n}\n\nexport interface StackItemConfig extends ItemConfigAttributes {\n type: 'stack';\n activeItemIndex?: number;\n header?: StackItemHeaderConfig;\n hasHeaders?: boolean;\n}\n\nexport interface ComponentConfig extends ItemConfigAttributes {\n type: 'component';\n\n /**\n * The name of the component as specified in layout.registerComponent. Mandatory if type is 'component'.\n */\n componentName: string;\n\n /**\n * A serialisable object. Will be passed to the component constructor function and will be the value returned by\n * container.getState().\n */\n componentState: Record<string, unknown>;\n}\n\nexport interface ReactComponentConfig extends ItemConfigAttributes {\n type: 'react-component';\n\n componentName?: string;\n /**\n * The name of the component as specified in layout.registerComponent. Mandatory if type is 'react-component'\n */\n component: string;\n\n /**\n * Properties that will be passed to the component and accessible using this.props.\n */\n props?: any;\n}\n\nexport function isGLComponentConfig(item: ItemConfig): item is ComponentConfig {\n return (item as ComponentConfig).componentName !== undefined;\n}\n\nexport function isReactComponentConfig(\n item: ItemConfig\n): item is ReactComponentConfig {\n return (item as ReactComponentConfig).component !== undefined;\n}\n\nexport const itemDefaultConfig: DefaultItemConfig = Object.freeze({\n type: 'default',\n isClosable: true,\n isFocusOnShow: true,\n reorderEnabled: true,\n title: '',\n});\n"],"mappings":"AAAA;;AAsHA,OAAO,SAASA,mBAAmBA,CAACC,IAAgB,EAA2B;EAC7E,OAAQA,IAAI,CAAqBC,aAAa,KAAKC,SAAS;AAC9D;AAEA,OAAO,SAASC,sBAAsBA,CACpCH,IAAgB,EACc;EAC9B,OAAQA,IAAI,CAA0BI,SAAS,KAAKF,SAAS;AAC/D;AAEA,OAAO,IAAMG,iBAAoC,GAAGC,MAAM,CAACC,MAAM,CAAC;EAChEC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE,IAAI;EAChBC,aAAa,EAAE,IAAI;EACnBC,cAAc,EAAE,IAAI;EACpBC,KAAK,EAAE;AACT,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/config/index.ts"],"sourcesContent":["export * from './Config';\nexport * from './ItemConfig';\n"],"mappings":""}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/config/index.ts"],"sourcesContent":["export * from './Config';\nexport * from './ItemConfig';\n"],"mappings":"","ignoreList":[]}
@@ -5,8 +5,6 @@ import $ from 'jquery';
5
5
  import { isGLComponentConfig } from "../config/index.js";
6
6
  import EventEmitter from "../utils/EventEmitter.js";
7
7
  export default class ItemContainer extends EventEmitter {
8
- // This type is to make TS happy and allow ReactComponentConfig passed to container generic
9
-
10
8
  constructor(config, parent, layoutManager) {
11
9
  super();
12
10
  _defineProperty(this, "width", void 0);
@@ -15,6 +13,7 @@ export default class ItemContainer extends EventEmitter {
15
13
  _defineProperty(this, "parent", void 0);
16
14
  _defineProperty(this, "layoutManager", void 0);
17
15
  _defineProperty(this, "tab", void 0);
16
+ // This type is to make TS happy and allow ReactComponentConfig passed to container generic
18
17
  _defineProperty(this, "_config", void 0);
19
18
  _defineProperty(this, "isHidden", false);
20
19
  _defineProperty(this, "beforeCloseHandler", void 0);