@deephaven/golden-layout 0.22.3-beta.18 → 0.22.3-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LayoutManager.js +60 -260
- package/dist/LayoutManager.js.map +1 -1
- package/dist/base.js.map +1 -1
- package/dist/config/Config.js.map +1 -1
- package/dist/config/ItemConfig.js.map +1 -1
- package/dist/container/ItemContainer.js +14 -50
- package/dist/container/ItemContainer.js.map +1 -1
- package/dist/container/index.js.map +1 -1
- package/dist/controls/BrowserPopout.js +17 -63
- package/dist/controls/BrowserPopout.js.map +1 -1
- package/dist/controls/DragProxy.js +13 -73
- package/dist/controls/DragProxy.js.map +1 -1
- package/dist/controls/DragSource.js +3 -19
- package/dist/controls/DragSource.js.map +1 -1
- package/dist/controls/DragSourceFromEvent.js +5 -24
- package/dist/controls/DragSourceFromEvent.js.map +1 -1
- package/dist/controls/DropTargetIndicator.js +0 -7
- package/dist/controls/DropTargetIndicator.js.map +1 -1
- package/dist/controls/Header.js +89 -233
- package/dist/controls/Header.js.map +1 -1
- package/dist/controls/HeaderButton.js +0 -9
- package/dist/controls/HeaderButton.js.map +1 -1
- package/dist/controls/Splitter.js +0 -14
- package/dist/controls/Splitter.js.map +1 -1
- package/dist/controls/Tab.js +21 -62
- package/dist/controls/Tab.js.map +1 -1
- package/dist/controls/TransitionIndicator.js +2 -21
- package/dist/controls/TransitionIndicator.js.map +1 -1
- package/dist/controls/index.js.map +1 -1
- package/dist/errors/ConfigurationError.js +0 -5
- package/dist/errors/ConfigurationError.js.map +1 -1
- package/dist/errors/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/items/AbstractContentItem.js +37 -133
- package/dist/items/AbstractContentItem.js.map +1 -1
- package/dist/items/Component.js +2 -27
- package/dist/items/Component.js.map +1 -1
- package/dist/items/Root.js +1 -26
- package/dist/items/Root.js.map +1 -1
- package/dist/items/RowOrColumn.js +32 -128
- package/dist/items/RowOrColumn.js.map +1 -1
- package/dist/items/Stack.js +27 -115
- package/dist/items/Stack.js.map +1 -1
- package/dist/items/index.js.map +1 -1
- package/dist/utils/BubblingEvent.js +0 -6
- package/dist/utils/BubblingEvent.js.map +1 -1
- package/dist/utils/ConfigMinifier.js +13 -26
- package/dist/utils/ConfigMinifier.js.map +1 -1
- package/dist/utils/DragListener.js +8 -47
- package/dist/utils/DragListener.js.map +1 -1
- package/dist/utils/EventEmitter.js +5 -25
- package/dist/utils/EventEmitter.js.map +1 -1
- package/dist/utils/EventHub.js +8 -27
- package/dist/utils/EventHub.js.map +1 -1
- package/dist/utils/ReactComponentHandler.js +6 -35
- package/dist/utils/ReactComponentHandler.js.map +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/utils.js +5 -11
- package/dist/utils/utils.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutManager.js","names":["$","lm","defaultConfig","BrowserPopout","DragSource","DragSourceFromEvent","DropTargetIndicator","TransitionIndicator","ConfigurationError","AbstractContentItem","isStack","Component","Root","RowOrColumn","Stack","minifyConfig","unminifyConfig","EventEmitter","EventHub","ReactComponentHandler","getQueryStringParam","getUniqueId","stripTags","LayoutManager","config","constructor","container","_onResize","bind","_onUnload","_windowBlur","_windowFocus","_createConfig","_originalContainer","_getContainer","isSubWindow","css","_typeToItem","column","row","stack","component","registerComponent","name","render","Error","_components","undefined","cleanup","setFallbackComponent","_fallbackComponent","toConfig","root","isInitialised","settings","dimensions","labels","content","next","configNode","item","key","componentName","type","contentItems","length","i","_$reconcilePopoutWindows","openPopouts","push","maximisedItemId","_maximisedItem","getComponent","getFallbackComponent","init","_subWindowsCreated","_createSubWindows","document","readyState","body","ready","_creationTimeoutPassed","setTimeout","_adjustToWindowMode","_setContainer","dropTargetIndicator","transitionIndicator","updateSize","_create","_bindEvents","_adjustColumnsResponsive","emit","width","height","callDownwards","element","destroy","window","off","tabDropPlaceholder","remove","eventHub","_dragSources","forEach","dragSource","_dragListener","createContentItem","parent","typeErrorMsg","contentItem","Object","keys","join","createPopout","configOrContentItem","parentId","indexInParent","configArray","isItem","self","child","isRoot","addId","Number","isNaN","indexOf","Array","windowLeft","screenX","screenLeft","windowTop","screenY","screenTop","offset","left","top","browserPopout","on","createDragSource","itemConfig","constrainDragToContainer","createDragSourceFromEvent","event","selectItem","_$silent","selectionEnabled","selectedItem","deselect","select","_$maximiseItem","_$minimiseItem","addClass","after","_maximisePlaceholder","prepend","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","header","_contentAreaDimensions","highlightArea","_$normalizeContentItem","contentItemOrConfig","isPlainObject","newContentItem","getWindow","closed","addChildren","_isFullPage","resize","clearTimeout","_resizeTimeoutId","windowConfigKey","JSON","parse","localStorage","getItem","removeItem","extend","nextNode","node","value","hasHeaders","headerHeight","popInButton","popin","click","title","append","html","offsetHeight","__glInstance","popout","margin","padding","overflow","errorMsg","getItemsById","toggleMaximise","closePopoutsOnUnload","_useResponsiveLayout","_updatingColumnsResponsive","minItemWidth","isRow","_firstLoad","columnCount","totalMinWidth","finalColumnCount","Math","max","floor","stackColumnCount","rootContentItem","firstStackContainer","_findAllStackContainers","_addChildContentItemsToContainer","responsiveMode","addChild","removeChild","stackContainers","_findAllStackContainersRecursive","isComponent"],"sources":["../src/LayoutManager.ts"],"sourcesContent":["import $ from 'jquery';\nimport React from 'react';\nimport lm from './base';\nimport { defaultConfig } from './config';\nimport type {\n ItemConfig,\n Config,\n ComponentConfig,\n ItemConfigType,\n ReactComponentConfig,\n} from './config';\nimport type { ItemContainer } from './container';\nimport {\n BrowserPopout,\n DragSource,\n DragSourceFromEvent,\n DropTargetIndicator,\n TransitionIndicator,\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';\n\nexport type ComponentConstructor<\n C extends ComponentConfig | ReactComponentConfig = ComponentConfig\n> = {\n new (container: ItemContainer<C>, state: unknown): unknown;\n};\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 default class LayoutManager extends EventEmitter {\n /**\n * Hook that allows to access private classes\n */\n static __lm = lm;\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.ForwardRefExoticComponent<any>;\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\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 transitionIndicator: TransitionIndicator | null = null;\n tabDropPlaceholder = $('<div class=\"lm_drop_tab_placeholder\"></div>');\n\n private _typeToItem: {\n [type: string]: new (...args: any[]) => AbstractContentItem;\n };\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\n this.config = this._createConfig(config);\n this._originalContainer = container;\n this.container = this._getContainer();\n\n if (this.isSubWindow) {\n $('body').css('visibility', 'hidden');\n }\n\n this._typeToItem = {\n column: RowOrColumn.bind(this, true),\n row: RowOrColumn.bind(this, false),\n stack: Stack,\n component: Component,\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.ForwardRefExoticComponent<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 & { [key: string]: unknown },\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 ItemConfigType;\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.transitionIndicator = new TransitionIndicator();\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 * 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 this.root.callDownwards('_$destroy', [], true);\n this.root.contentItems = [];\n this.tabDropPlaceholder.remove();\n this.dropTargetIndicator?.destroy();\n this.transitionIndicator?.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: Partial<ComponentConfig> & { type: ItemConfig['type'] },\n parent?: AbstractContentItem\n ) {\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.type = 'component';\n config.componentName = 'lm-react-component';\n }\n\n if (!this._typeToItem[config.type]) {\n typeErrorMsg =\n \"Unknown type '\" +\n config.type +\n \"'. \" +\n 'Valid types are ' +\n Object.keys(this._typeToItem).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 contentItem = new this._typeToItem[config.type](this, config, parent);\n return contentItem;\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:\n | ItemConfigType\n | AbstractContentItem\n | ItemConfigType[],\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: ItemConfigType[] = [];\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: JQuery.TriggeredEvent\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 | { type: ItemConfig['type'] }\n | ItemConfigType\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 var newContentItem = this.createContentItem(contentItemOrConfig, parent);\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 }\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 * 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 (window as Window &\n typeof globalThis & { __glInstance: LayoutManager }).__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"],"mappings":";;;;;;AAAA,OAAOA,CAAP,MAAc,QAAd;OAEOC,E;SACEC,a;SAUPC,a,EACAC,U,EACAC,mB,EACAC,mB,EACAC,mB;SAEOC,kB;SAEPC,mB,EAEAC,O,EACAC,S,EACAC,I,EACAC,W,EACAC,K;SAGAC,Y,EACAC,c,EACAC,Y,EACAC,Q,EACAC,qB,EACAC,mB,EACAC,W,EACAC,S;;AASF;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,aAAN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C,IAF8B,EAG9B;IACAA,IAAI,CAAC3I,YAAL,CAAkBuC,OAAlB,CAA0B3C,IAAI,IAAI;MAChC,IAAIlD,OAAO,CAACkD,IAAD,CAAX,EAAmB;QACjBsL,eAAe,CAAC7K,IAAhB,CAAqBT,IAArB;MACD,CAFD,MAEO,IAAI,CAACA,IAAI,CAACwL,WAAV,EAAuB;QAC5B,KAAKD,gCAAL,CAAsCD,eAAtC,EAAuDtL,IAAvD;MACD;IACF,CAND;EAOD;;AAzoCqD;;gBAAnCrC,a,UAILtB,E"}
|
|
1
|
+
{"version":3,"file":"LayoutManager.js","names":["$","lm","defaultConfig","BrowserPopout","DragSource","DragSourceFromEvent","DropTargetIndicator","TransitionIndicator","ConfigurationError","AbstractContentItem","isStack","Component","Root","RowOrColumn","Stack","minifyConfig","unminifyConfig","EventEmitter","EventHub","ReactComponentHandler","getQueryStringParam","getUniqueId","stripTags","LayoutManager","config","constructor","container","_onResize","bind","_onUnload","_windowBlur","_windowFocus","_createConfig","_originalContainer","_getContainer","isSubWindow","css","_typeToItem","column","row","stack","component","registerComponent","name","render","Error","_components","undefined","cleanup","setFallbackComponent","_fallbackComponent","toConfig","root","isInitialised","settings","dimensions","labels","content","next","configNode","item","key","componentName","type","contentItems","length","i","_$reconcilePopoutWindows","openPopouts","push","maximisedItemId","_maximisedItem","getComponent","getFallbackComponent","init","_subWindowsCreated","_createSubWindows","document","readyState","body","ready","_creationTimeoutPassed","setTimeout","_adjustToWindowMode","_setContainer","dropTargetIndicator","transitionIndicator","updateSize","_create","_bindEvents","_adjustColumnsResponsive","emit","width","height","callDownwards","element","destroy","window","off","tabDropPlaceholder","remove","eventHub","_dragSources","forEach","dragSource","_dragListener","createContentItem","parent","typeErrorMsg","contentItem","Object","keys","join","createPopout","configOrContentItem","parentId","indexInParent","configArray","isItem","self","child","isRoot","addId","Number","isNaN","indexOf","Array","windowLeft","screenX","screenLeft","windowTop","screenY","screenTop","offset","left","top","browserPopout","on","createDragSource","itemConfig","constrainDragToContainer","createDragSourceFromEvent","event","selectItem","_$silent","selectionEnabled","selectedItem","deselect","select","_$maximiseItem","_$minimiseItem","addClass","after","_maximisePlaceholder","prepend","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","header","_contentAreaDimensions","highlightArea","_$normalizeContentItem","contentItemOrConfig","isPlainObject","newContentItem","getWindow","closed","addChildren","_isFullPage","resize","clearTimeout","_resizeTimeoutId","windowConfigKey","JSON","parse","localStorage","getItem","removeItem","extend","nextNode","node","value","hasHeaders","headerHeight","popInButton","popin","click","title","append","html","offsetHeight","__glInstance","popout","margin","padding","overflow","errorMsg","getItemsById","toggleMaximise","closePopoutsOnUnload","_useResponsiveLayout","_updatingColumnsResponsive","minItemWidth","isRow","_firstLoad","columnCount","totalMinWidth","finalColumnCount","Math","max","floor","stackColumnCount","rootContentItem","firstStackContainer","_findAllStackContainers","_addChildContentItemsToContainer","responsiveMode","addChild","removeChild","stackContainers","_findAllStackContainersRecursive","isComponent"],"sources":["../src/LayoutManager.ts"],"sourcesContent":["import $ from 'jquery';\nimport React from 'react';\nimport lm from './base';\nimport { defaultConfig } from './config';\nimport type {\n ItemConfig,\n Config,\n ComponentConfig,\n ItemConfigType,\n ReactComponentConfig,\n} from './config';\nimport type { ItemContainer } from './container';\nimport {\n BrowserPopout,\n DragSource,\n DragSourceFromEvent,\n DropTargetIndicator,\n TransitionIndicator,\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';\n\nexport type ComponentConstructor<\n C extends ComponentConfig | ReactComponentConfig = ComponentConfig\n> = {\n new (container: ItemContainer<C>, state: unknown): unknown;\n};\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 default class LayoutManager extends EventEmitter {\n /**\n * Hook that allows to access private classes\n */\n static __lm = lm;\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.ForwardRefExoticComponent<any>;\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\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 transitionIndicator: TransitionIndicator | null = null;\n tabDropPlaceholder = $('<div class=\"lm_drop_tab_placeholder\"></div>');\n\n private _typeToItem: {\n [type: string]: new (...args: any[]) => AbstractContentItem;\n };\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\n this.config = this._createConfig(config);\n this._originalContainer = container;\n this.container = this._getContainer();\n\n if (this.isSubWindow) {\n $('body').css('visibility', 'hidden');\n }\n\n this._typeToItem = {\n column: RowOrColumn.bind(this, true),\n row: RowOrColumn.bind(this, false),\n stack: Stack,\n component: Component,\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.ForwardRefExoticComponent<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 & { [key: string]: unknown },\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 ItemConfigType;\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.transitionIndicator = new TransitionIndicator();\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 * 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 this.root.callDownwards('_$destroy', [], true);\n this.root.contentItems = [];\n this.tabDropPlaceholder.remove();\n this.dropTargetIndicator?.destroy();\n this.transitionIndicator?.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: Partial<ComponentConfig> & { type: ItemConfig['type'] },\n parent?: AbstractContentItem\n ) {\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.type = 'component';\n config.componentName = 'lm-react-component';\n }\n\n if (!this._typeToItem[config.type]) {\n typeErrorMsg =\n \"Unknown type '\" +\n config.type +\n \"'. \" +\n 'Valid types are ' +\n Object.keys(this._typeToItem).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 contentItem = new this._typeToItem[config.type](this, config, parent);\n return contentItem;\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:\n | ItemConfigType\n | AbstractContentItem\n | ItemConfigType[],\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: ItemConfigType[] = [];\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: JQuery.TriggeredEvent\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 | { type: ItemConfig['type'] }\n | ItemConfigType\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 var newContentItem = this.createContentItem(contentItemOrConfig, parent);\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 }\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 * 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 (window as Window &\n typeof globalThis & { __glInstance: LayoutManager }).__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"],"mappings":";;;AAAA,OAAOA,CAAC,MAAM,QAAQ;AAAC,OAEhBC,EAAE;AAAA,SACAC,aAAa;AAAA,SAUpBC,aAAa,EACbC,UAAU,EACVC,mBAAmB,EACnBC,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;AASX;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,aAAa,SAASN,YAAY,CAAC;EACtD;AACF;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;A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;EAE3E;;EAEA;AACF;AACA;AACA;AACA;EACEW,gCAAgC,CAC9BpN,SAA8B,EAC9BiL,IAAyB,EACzB;IACA,IAAIA,IAAI,CAAC5I,IAAI,KAAK,OAAO,EAAE;MACzB4I,IAAI,CAAC3I,YAAY,CAACuC,OAAO,CAAC,UAAU3C,IAAI,EAAE;QACxClC,SAAS,CAACsN,QAAQ,CAACpL,IAAI,CAAC;QACxB+I,IAAI,CAACsC,WAAW,CAACrL,IAAI,EAAE,IAAI,CAAC;MAC9B,CAAC,CAAC;IACJ,CAAC,MAAM;MACL+I,IAAI,CAAC3I,YAAY,CAACuC,OAAO,CAAC3C,IAAI,IAAI;QAChC,IAAI,CAACkL,gCAAgC,CAACpN,SAAS,EAAEkC,IAAI,CAAC;MACxD,CAAC,CAAC;IACJ;EACF;;EAEA;AACF;AACA;AACA;EACEiL,uBAAuB,GAAG;IACxB,IAAMK,eAAwB,GAAG,EAAE;IACnC,IAAI,CAACC,gCAAgC,CAACD,eAAe,EAAE,IAAI,CAAC9L,IAAI,CAAC;IAEjE,OAAO8L,eAAe;EACxB;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEC,gCAAgC,CAC9BD,eAAwB,EACxBvC,IAAyB,EACzB;IACAA,IAAI,CAAC3I,YAAY,CAACuC,OAAO,CAAC3C,IAAI,IAAI;MAChC,IAAIlD,OAAO,CAACkD,IAAI,CAAC,EAAE;QACjBsL,eAAe,CAAC7K,IAAI,CAACT,IAAI,CAAC;MAC5B,CAAC,MAAM,IAAI,CAACA,IAAI,CAACwL,WAAW,EAAE;QAC5B,IAAI,CAACD,gCAAgC,CAACD,eAAe,EAAEtL,IAAI,CAAC;MAC9D;IACF,CAAC,CAAC;EACJ;AACF;AAAC,gBA1oCoBrC,aAAa,UAIlBtB,EAAE"}
|
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,
|
|
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 +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 { ItemConfigType } from './ItemConfig';\n\nexport type Config = {\n settings: Partial<Settings>;\n dimensions: Dimensions;\n labels: Labels;\n content: ItemConfigType[];\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\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', // 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":"AAkLA,OAAO,IAAMA,aAAqB,GAAGC,MAAM,CAACC,
|
|
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 { ItemConfigType } from './ItemConfig';\n\nexport type Config = {\n settings: Partial<Settings>;\n dimensions: Dimensions;\n labels: Labels;\n content: ItemConfigType[];\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\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', // 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":"AAkLA,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,QAAQ;IAAE;IAC1BC,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 +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":["import type { StackHeaderConfig } from '../items/Stack';\n\nexport type ItemConfigType =\n | ItemConfig\n | ComponentConfig\n | ReactComponentConfig;\n\nexport interface ItemConfig {\n /**\n * The type of the item.\n */\n type:\n | 'default'\n | 'root'\n | 'row'\n | 'column'\n | 'stack'\n | 'component'\n | 'react-component';\n\n /**\n * An array of configurations for items that will be created as children of this item.\n */\n content?: (ItemConfig | ItemConfigType)[];\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?: StackHeaderConfig;\n}\n\nexport interface ComponentConfig extends ItemConfig {\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 ItemConfig {\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(\n item: ItemConfigType\n): item is ComponentConfig {\n return (item as ComponentConfig).componentName !== undefined;\n}\n\nexport function isReactComponentConfig(\n item: ItemConfigType\n): item is ReactComponentConfig {\n return (item as ReactComponentConfig).component !== undefined;\n}\n\nexport const itemDefaultConfig: ItemConfig = Object.freeze({\n type: 'default',\n isClosable: true,\n isFocusOnShow: true,\n reorderEnabled: true,\n title: '',\n});\n"],"mappings":"AA0FA,OAAO,SAASA,
|
|
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":["import type { StackHeaderConfig } from '../items/Stack';\n\nexport type ItemConfigType =\n | ItemConfig\n | ComponentConfig\n | ReactComponentConfig;\n\nexport interface ItemConfig {\n /**\n * The type of the item.\n */\n type:\n | 'default'\n | 'root'\n | 'row'\n | 'column'\n | 'stack'\n | 'component'\n | 'react-component';\n\n /**\n * An array of configurations for items that will be created as children of this item.\n */\n content?: (ItemConfig | ItemConfigType)[];\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?: StackHeaderConfig;\n}\n\nexport interface ComponentConfig extends ItemConfig {\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 ItemConfig {\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(\n item: ItemConfigType\n): item is ComponentConfig {\n return (item as ComponentConfig).componentName !== undefined;\n}\n\nexport function isReactComponentConfig(\n item: ItemConfigType\n): item is ReactComponentConfig {\n return (item as ReactComponentConfig).component !== undefined;\n}\n\nexport const itemDefaultConfig: ItemConfig = Object.freeze({\n type: 'default',\n isClosable: true,\n isFocusOnShow: true,\n reorderEnabled: true,\n title: '',\n});\n"],"mappings":"AA0FA,OAAO,SAASA,mBAAmB,CACjCC,IAAoB,EACK;EACzB,OAAQA,IAAI,CAAqBC,aAAa,KAAKC,SAAS;AAC9D;AAEA,OAAO,SAASC,sBAAsB,CACpCH,IAAoB,EACU;EAC9B,OAAQA,IAAI,CAA0BI,SAAS,KAAKF,SAAS;AAC/D;AAEA,OAAO,IAAMG,iBAA6B,GAAGC,MAAM,CAACC,MAAM,CAAC;EACzDC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE,IAAI;EAChBC,aAAa,EAAE,IAAI;EACnBC,cAAc,EAAE,IAAI;EACpBC,KAAK,EAAE;AACT,CAAC,CAAC"}
|
|
@@ -1,79 +1,63 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
2
|
import $ from 'jquery';
|
|
4
3
|
import { isGLComponentConfig } from "../config/index.js";
|
|
5
4
|
import EventEmitter from "../utils/EventEmitter.js";
|
|
6
5
|
export default class ItemContainer extends EventEmitter {
|
|
7
6
|
// This type is to make TS happy and allow ReactComponentConfig passed to container generic
|
|
7
|
+
|
|
8
8
|
constructor(config, parent, layoutManager) {
|
|
9
9
|
super();
|
|
10
|
-
|
|
11
10
|
_defineProperty(this, "width", void 0);
|
|
12
|
-
|
|
13
11
|
_defineProperty(this, "height", void 0);
|
|
14
|
-
|
|
15
12
|
_defineProperty(this, "title", void 0);
|
|
16
|
-
|
|
17
13
|
_defineProperty(this, "parent", void 0);
|
|
18
|
-
|
|
19
14
|
_defineProperty(this, "layoutManager", void 0);
|
|
20
|
-
|
|
21
15
|
_defineProperty(this, "tab", void 0);
|
|
22
|
-
|
|
23
16
|
_defineProperty(this, "_config", void 0);
|
|
24
|
-
|
|
25
17
|
_defineProperty(this, "isHidden", false);
|
|
26
|
-
|
|
27
18
|
_defineProperty(this, "_element", $(['<div class="lm_item_container">', '<div class="lm_content" tabindex="-1"></div>', '</div>'].join('')));
|
|
28
|
-
|
|
29
19
|
_defineProperty(this, "_contentElement", void 0);
|
|
30
|
-
|
|
31
20
|
this.title = isGLComponentConfig(config) ? config.componentName : '';
|
|
32
21
|
this.parent = parent;
|
|
33
22
|
this.layoutManager = layoutManager;
|
|
34
23
|
this._config = config;
|
|
35
24
|
this._contentElement = this._element.find('.lm_content');
|
|
36
25
|
}
|
|
26
|
+
|
|
37
27
|
/**
|
|
38
28
|
* Get the inner DOM element the container's content
|
|
39
29
|
* is intended to live in
|
|
40
30
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
31
|
getElement() {
|
|
44
32
|
return this._contentElement;
|
|
45
33
|
}
|
|
34
|
+
|
|
46
35
|
/**
|
|
47
36
|
* Hide the container. Notifies the containers content first
|
|
48
37
|
* and then hides the DOM node. If the container is already hidden
|
|
49
38
|
* this should have no effect
|
|
50
39
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
40
|
hide() {
|
|
54
41
|
this.emit('hide');
|
|
55
42
|
this.isHidden = true;
|
|
56
|
-
|
|
57
43
|
this._element.hide();
|
|
58
44
|
}
|
|
45
|
+
|
|
59
46
|
/**
|
|
60
47
|
* Shows a previously hidden container. Notifies the
|
|
61
48
|
* containers content first and then shows the DOM element.
|
|
62
49
|
* If the container is already visible this has no effect.
|
|
63
50
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
51
|
show() {
|
|
67
52
|
this.emit('show');
|
|
68
53
|
this.isHidden = false;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
54
|
+
this._element.show();
|
|
55
|
+
// call shown only if the container has a valid size
|
|
73
56
|
if (this.height != 0 || this.width != 0) {
|
|
74
57
|
this.emit('shown');
|
|
75
58
|
}
|
|
76
59
|
}
|
|
60
|
+
|
|
77
61
|
/**
|
|
78
62
|
* Set the size from within the container. Traverses up
|
|
79
63
|
* the item tree until it finds a row or column element
|
|
@@ -87,105 +71,91 @@ export default class ItemContainer extends EventEmitter {
|
|
|
87
71
|
*
|
|
88
72
|
* @returns resizeSuccesful
|
|
89
73
|
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
74
|
setSize(width, height) {
|
|
93
75
|
var _this$direction, _rowOrColumnChild$con, _rowOrColumnChild$con2;
|
|
94
|
-
|
|
95
76
|
var rowOrColumn = this.parent;
|
|
96
77
|
var rowOrColumnChild = null;
|
|
97
|
-
|
|
98
78
|
while (rowOrColumn && !rowOrColumn.isColumn && !rowOrColumn.isRow) {
|
|
99
79
|
var _rowOrColumn;
|
|
100
|
-
|
|
101
80
|
rowOrColumnChild = rowOrColumn;
|
|
102
81
|
rowOrColumn = rowOrColumn.parent;
|
|
82
|
+
|
|
103
83
|
/**
|
|
104
84
|
* No row or column has been found
|
|
105
85
|
*/
|
|
106
|
-
|
|
107
86
|
if ((_rowOrColumn = rowOrColumn) !== null && _rowOrColumn !== void 0 && _rowOrColumn.isRoot) {
|
|
108
87
|
return false;
|
|
109
88
|
}
|
|
110
89
|
}
|
|
111
|
-
|
|
112
90
|
if (!rowOrColumn || !rowOrColumnChild) {
|
|
113
91
|
return false;
|
|
114
92
|
}
|
|
115
|
-
|
|
116
93
|
var direction = rowOrColumn.isColumn ? 'height' : 'width';
|
|
117
94
|
var newSize = direction === 'height' ? height : width;
|
|
118
95
|
var totalPixel = ((_this$direction = this[direction]) !== null && _this$direction !== void 0 ? _this$direction : 0) * (1 / (((_rowOrColumnChild$con = rowOrColumnChild.config[direction]) !== null && _rowOrColumnChild$con !== void 0 ? _rowOrColumnChild$con : 0) / 100));
|
|
119
96
|
var percentage = newSize / totalPixel * 100;
|
|
120
97
|
var delta = (((_rowOrColumnChild$con2 = rowOrColumnChild.config[direction]) !== null && _rowOrColumnChild$con2 !== void 0 ? _rowOrColumnChild$con2 : 0) - percentage) / (rowOrColumn.contentItems.length - 1);
|
|
121
|
-
|
|
122
98
|
for (var i = 0; i < rowOrColumn.contentItems.length; i++) {
|
|
123
99
|
if (rowOrColumn.contentItems[i] === rowOrColumnChild) {
|
|
124
100
|
rowOrColumn.contentItems[i].config[direction] = percentage;
|
|
125
101
|
} else {
|
|
126
102
|
var _rowOrColumn$contentI;
|
|
127
|
-
|
|
128
103
|
rowOrColumn.contentItems[i].config[direction] = ((_rowOrColumn$contentI = rowOrColumn.contentItems[i].config[direction]) !== null && _rowOrColumn$contentI !== void 0 ? _rowOrColumn$contentI : 0) + delta;
|
|
129
104
|
}
|
|
130
105
|
}
|
|
131
|
-
|
|
132
106
|
rowOrColumn.callDownwards('setSize');
|
|
133
107
|
return true;
|
|
134
108
|
}
|
|
109
|
+
|
|
135
110
|
/**
|
|
136
111
|
* Closes the container if it is closable. Can be called by
|
|
137
112
|
* both the component within at as well as the contentItem containing
|
|
138
113
|
* it. Emits a close event before the container itself is closed.
|
|
139
114
|
*/
|
|
140
|
-
|
|
141
|
-
|
|
142
115
|
close() {
|
|
143
116
|
if (this._config.isClosable) {
|
|
144
117
|
this.emit('close');
|
|
145
118
|
this.parent.close();
|
|
146
119
|
}
|
|
147
120
|
}
|
|
121
|
+
|
|
148
122
|
/**
|
|
149
123
|
* Returns the current state object
|
|
150
124
|
*
|
|
151
125
|
* @returns state
|
|
152
126
|
*/
|
|
153
|
-
|
|
154
|
-
|
|
155
127
|
getState() {
|
|
156
128
|
return this._config.componentState;
|
|
157
129
|
}
|
|
130
|
+
|
|
158
131
|
/**
|
|
159
132
|
* Merges the provided state into the current one
|
|
160
133
|
*
|
|
161
134
|
* @param state
|
|
162
135
|
*/
|
|
163
|
-
|
|
164
|
-
|
|
165
136
|
extendState(state) {
|
|
166
137
|
this.setState($.extend(true, this.getState(), state));
|
|
167
138
|
}
|
|
139
|
+
|
|
168
140
|
/**
|
|
169
141
|
* Notifies the layout manager of a stateupdate
|
|
170
142
|
*
|
|
171
143
|
* @param state
|
|
172
144
|
*/
|
|
173
|
-
|
|
174
|
-
|
|
175
145
|
setState(state) {
|
|
176
146
|
this._config.componentState = state;
|
|
177
147
|
this.parent.emitBubblingEvent('stateChanged');
|
|
178
148
|
}
|
|
149
|
+
|
|
179
150
|
/**
|
|
180
151
|
* Set's the components title
|
|
181
152
|
*
|
|
182
153
|
* @param title
|
|
183
154
|
*/
|
|
184
|
-
|
|
185
|
-
|
|
186
155
|
setTitle(title) {
|
|
187
156
|
this.parent.setTitle(title);
|
|
188
157
|
}
|
|
158
|
+
|
|
189
159
|
/**
|
|
190
160
|
* Set's the containers size. Called by the container's component.
|
|
191
161
|
* To set the size programmatically from within the container please
|
|
@@ -194,24 +164,18 @@ export default class ItemContainer extends EventEmitter {
|
|
|
194
164
|
* @param width in px
|
|
195
165
|
* @param height in px
|
|
196
166
|
*/
|
|
197
|
-
|
|
198
|
-
|
|
199
167
|
_$setSize() {
|
|
200
168
|
var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
201
169
|
var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
202
|
-
|
|
203
170
|
if (width !== this.width || height !== this.height) {
|
|
204
171
|
this.width = width;
|
|
205
172
|
this.height = height;
|
|
206
173
|
var cl = this._contentElement[0];
|
|
207
174
|
var hdelta = cl.offsetWidth - cl.clientWidth;
|
|
208
175
|
var vdelta = cl.offsetHeight - cl.clientHeight;
|
|
209
|
-
|
|
210
176
|
this._contentElement.width(this.width - hdelta).height(this.height - vdelta);
|
|
211
|
-
|
|
212
177
|
this.emit('resize');
|
|
213
178
|
}
|
|
214
179
|
}
|
|
215
|
-
|
|
216
180
|
}
|
|
217
181
|
//# sourceMappingURL=ItemContainer.js.map
|