@deephaven/dashboard 0.11.2-beta.9 → 0.11.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutUtils.d.ts","sourceRoot":"","sources":["../../src/layout/LayoutUtils.js"],"names":[],"mappings":";AAQA;IACE,sCAAkE;IAElE,iDASC;IAED;;;;;OAKG;IACH,8CAHW,MAAM,GACJ,OAAO,CAYnB;IAED;;;;OAIG;IACH,6DAuCC;IAED;;;;OAIG;IACH,6FA4BC;IAED;;;;;;OAMG;IACH,sEAJW,OAAO,uBACP,OAAO,oBACP,OAAO,OAuBjB;IAED;;;;;;;OAOG;IACH,oFAJW,OAAO,uBACP,OAAO,oBACP,OAAO,OAwBjB;IAED;;;;;OAKG;IACH,8EAUC;IAED;;;;;OAKG;IACH,4EAgCC;IAED,4CAQC;IAED;;;;;;;;;;OAUG;IACH,qCATW,MAAM,QA0BhB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,WACN,MAAM,UACN,OAAO,WAWjB;IAED,qCAEC;IAED;;;;;OAKG;IACH,iFAHkB,MAAM,4CA2CvB;IAED;;;;;;;;;;;OAWG;IACH,kJAmEC;IAED;;;;;;OAMG;IACH,iGAwBC;IAED;;;;OAIG;IACH,+DA2BC;IAED,oEASC;IAED;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"LayoutUtils.d.ts","sourceRoot":"","sources":["../../src/layout/LayoutUtils.js"],"names":[],"mappings":";AAQA;IACE,sCAAkE;IAElE,iDASC;IAED;;;;;OAKG;IACH,8CAHW,MAAM,GACJ,OAAO,CAYnB;IAED;;;;OAIG;IACH,6DAuCC;IAED;;;;OAIG;IACH,6FA4BC;IAED;;;;;;OAMG;IACH,sEAJW,OAAO,uBACP,OAAO,oBACP,OAAO,OAuBjB;IAED;;;;;;;OAOG;IACH,oFAJW,OAAO,uBACP,OAAO,oBACP,OAAO,OAwBjB;IAED;;;;;OAKG;IACH,8EAUC;IAED;;;;;OAKG;IACH,4EAgCC;IAED,4CAQC;IAED;;;;;;;;;;OAUG;IACH,qCATW,MAAM,QA0BhB;IAED;;;;;OAKG;IACH,wBAJW,MAAM,WACN,MAAM,UACN,OAAO,WAWjB;IAED,qCAEC;IAED;;;;;OAKG;IACH,iFAHkB,MAAM,4CA2CvB;IAED;;;;;;;;;;;OAWG;IACH,kJAmEC;IAED;;;;;;OAMG;IACH,iGAwBC;IAED;;;;OAIG;IACH,+DA2BC;IAED,oEASC;IAED;;;;;OAKG;IACH,iEAoBC;IAED;;;;OAIG;IACH,sCAHW,MAAM,GACJ,MAAM,CAOlB;IAED;;;;;;;;;;;MAaC;IAED;;;OAGG;IACH,yDAEC;IAED;;;OAGG;IACH,oEAYC;IAED,kDAKC;IAED,sCAKC;IAED;;;;OAIG;IACH,qDAFa,MAAM,GAAC,IAAI,CAQvB;IAED;;;;OAIG;IACH,yCAFa,MAAM,GAAC,IAAI,CAKvB;IAED;;;;OAIG;IACH,oDAFa,MAAM,CAMlB;IAED;;;;;OAKG;IACH,+CAHa,MAAM,CAUlB;IAED;;;;;;OAMG;IACH,wEAWC;IAED;;;;OAIG;IACH,yDAYC;CACF"}
|
|
@@ -355,7 +355,7 @@ class LayoutUtils {
|
|
|
355
355
|
var {
|
|
356
356
|
component,
|
|
357
357
|
content,
|
|
358
|
-
props,
|
|
358
|
+
props = {},
|
|
359
359
|
type
|
|
360
360
|
} = itemConfig;
|
|
361
361
|
|
|
@@ -552,11 +552,14 @@ class LayoutUtils {
|
|
|
552
552
|
return null;
|
|
553
553
|
}
|
|
554
554
|
|
|
555
|
+
var {
|
|
556
|
+
props = {}
|
|
557
|
+
} = config;
|
|
555
558
|
var panelState = LayoutUtils.getPanelComponentState(config);
|
|
556
559
|
var cloneConfig = {
|
|
557
560
|
type: 'react-component',
|
|
558
561
|
component: config.component,
|
|
559
|
-
props: _objectSpread(_objectSpread({},
|
|
562
|
+
props: _objectSpread(_objectSpread({}, props), {}, {
|
|
560
563
|
panelState
|
|
561
564
|
}),
|
|
562
565
|
title: "".concat(config.title, " Copy"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/layout/LayoutUtils.js"],"names":["deepEqual","shortid","isMatch","Log","GoldenLayoutThemeExport","log","module","LayoutUtils","activateTab","root","config","stack","getStackForRoot","error","contentItem","getContentItemInStack","setActiveContentItem","isActiveTab","activeItem","getActiveContentItem","addStack","parent","columnPreferred","type","isRoot","contentItems","length","addChild","child","isCorrectType","isColumn","isRow","removeChild","maintainFocusElement","document","activeElement","focus","newParent","getStackForConfig","item","allowEmptyStack","isStack","i","isComponent","createIfNecessary","matchComponentType","component","getStackForComponentTypes","types","isLastType","dehydrateLayoutConfig","dehydrateComponent","dehydratedConfig","itemConfig","content","dehydratedComponent","push","debug2","layoutItemConfig","getTabPoint","glContainer","tab","Error","tabRect","element","getBoundingClientRect","left","width","bottom","dropLayoutMinorChange","activeItemIndex","props","panelState","id","irisGridState","sorts","quickFilters","isEqual","layout1","layout2","major","layout1Clone","cloneLayout","layout2Clone","layout","JSON","parse","stringify","hydrateLayoutConfig","hydrateComponent","hydratedConfig","contentConfig","warn","openComponent","configParam","replaceExisting","replaceConfig","createNewStack","focusElement","dragEvent","generate","layoutManager","createDragSourceFromEvent","searchConfig","oldContentItem","onComponentCreated","event","debug","off","origin","requestAnimationFrame","on","index","indexOf","openComponentInStack","closeComponent","container","close","contains","renameComponent","newTitle","setTitle","cloneComponent","getPanelComponentState","cloneConfig","title","componentState","makeDefaultLayout","dimensions","headerHeight","tabHeight","borderWidth","dragBorderWidth","borderGrabWidth","settings","showPopoutIcon","showCloseIcon","constrainDragToContainer","getRootFromContainer","getComponentConfigFromContainer","_config","getTitleFromContainer","getTitleFromTab","getIdFromContainer","getIdFromPanel","panel","getComponentNameFromPanel","getComponentName","name","WrappedComponent","displayName","selector","DEFAULT_FOCUS_SELECTOR","querySelector","onInitialized","Promise","resolve","isInitialised","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AAAA;;AACjC,QAAMsG,IAAI,sDACRtG,SAAS,CAACuG,gBADF,2DACR,uBAA4BC,WADpB,yEACmCxG,SAAS,CAACwG,WADvD;;AAEA,QAAIF,IAAI,IAAI,IAAZ,EAAkB;AAChB,YAAM,IAAItF,KAAJ,CAAU,mCAAV,EAA+ChB,SAA/C,CAAN;AACD;;AACD,WAAOsG,IAAP;AACD;AAED;AACF;AACA;AACA;AACA;AACA;AACA;;;AACqB,SAAZlD,YAAY,CAAClC,OAAD,EAAyD;AAAA,QAA/CuF,QAA+C,uEAApChJ,WAAW,CAACiJ,sBAAwB;;AAC1E,QAAIxF,OAAO,IAAI,IAAf,EAAqB;AACnB,aAAO,IAAP;AACD;;AACD,QAAMkC,YAAY,GAAGlC,OAAO,CAACyF,aAAR,CAAsBF,QAAtB,CAArB;;AACA,QAAIrD,YAAY,IAAI,IAApB,EAA0B;AACxB,aAAO,IAAP;AACD;;AAEDA,IAAAA,YAAY,CAAC9D,KAAb;AACA,WAAO8D,YAAP;AACD;AAED;AACF;AACA;AACA;AACA;;;AACsB,SAAbwD,aAAa,CAACtE,MAAD,EAAS;AAC3B,WAAO,IAAIuE,OAAJ,CAAYC,OAAO,IAAI;AAC5B,UAAIxE,MAAM,CAACyE,aAAX,EAA0B;AACxBD,QAAAA,OAAO;AACP;AACD;;AACD,UAAME,MAAM,GAAG,MAAM;AACnB1E,QAAAA,MAAM,CAACwB,GAAP,CAAW,aAAX,EAA0BkD,MAA1B;AACAF,QAAAA,OAAO;AACR,OAHD;;AAIAxE,MAAAA,MAAM,CAAC2B,EAAP,CAAU,aAAV,EAAyB+C,MAAzB;AACD,KAVM,CAAP;AAWD;;AAzqBe;;gBAAZvJ,W,4BAC4B,iC;;AA2qBlC,eAAeA,WAAf","sourcesContent":["import deepEqual from 'deep-equal';\nimport shortid from 'shortid';\nimport isMatch from 'lodash.ismatch';\nimport Log from '@deephaven/log';\nimport GoldenLayoutThemeExport from './GoldenLayoutThemeExport';\n\nconst log = Log.module('LayoutUtils');\n\nclass LayoutUtils {\n static DEFAULT_FOCUS_SELECTOR = 'input, select, textarea, button';\n\n static activateTab(root, config) {\n const stack = LayoutUtils.getStackForRoot(root, config, false);\n if (!stack) {\n log.error('Could not find stack for config', config);\n return;\n }\n // Find the tab with the specified table and activate it\n const contentItem = LayoutUtils.getContentItemInStack(stack, config);\n stack.setActiveContentItem(contentItem);\n }\n\n /**\n * Is the tab with the given config active\n * @param {ContentItem} root A GoldenLayout content item with the tab\n * @param {Object} config Tab config to match\n * @returns {boolean} True if the tab is active\n */\n static isActiveTab(root, config) {\n const stack = LayoutUtils.getStackForRoot(root, config, false);\n if (!stack) {\n log.error('Could not find stack for config', config);\n return false;\n }\n // Find the item with the specified config and compare with active item\n const contentItem = LayoutUtils.getContentItemInStack(stack, config);\n const activeItem = stack.getActiveContentItem();\n return activeItem === contentItem;\n }\n\n /**\n * Adds a stack to the root layout specified. Adds to the first row/column with only one item\n * @param {ContentItem} root A GoldenLayout content item to add the stack to\n * @returns The newly created stack.\n */\n static addStack(parent, columnPreferred = true) {\n const type = columnPreferred ? 'column' : 'row';\n if (parent.isRoot) {\n if (!parent.contentItems || parent.contentItems.length === 0) {\n parent.addChild({ type });\n }\n\n const child = parent.contentItems[0];\n const isCorrectType = columnPreferred ? child.isColumn : child.isRow;\n if (!isCorrectType) {\n parent.removeChild(child, true);\n parent.addChild({ type });\n\n // The addChild may cause the element that has focus to be removed from the DOM, which changes focus to the body\n // Try and maintain the focus as best we can. The unfocused element may still send a blur/focus event so that needs to be handled correctly.\n const maintainFocusElement = document.activeElement;\n parent.contentItems[0].addChild(child);\n maintainFocusElement?.focus();\n }\n\n return this.addStack(parent.contentItems[0], columnPreferred);\n }\n\n if (parent.contentItems.length < 2) {\n parent.addChild({ type: 'stack' });\n return parent.contentItems[parent.contentItems.length - 1];\n }\n let newParent = parent.contentItems[parent.contentItems.length - 1];\n const isCorrectType = !columnPreferred\n ? newParent.isColumn\n : newParent.isRow;\n if (!isCorrectType) {\n parent.addChild({ type: !columnPreferred ? 'column' : 'row' });\n parent.removeChild(newParent, true);\n parent.contentItems[parent.contentItems.length - 1].addChild(newParent);\n newParent = parent.contentItems[parent.contentItems.length - 1];\n }\n\n return this.addStack(newParent, !columnPreferred);\n }\n\n /**\n * Gets the first stack which contains a contentItem with the given config values\n * @param {ContentItem} item Golden layout content item to search for the stack\n * @param {Config} config The item properties to match\n */\n static getStackForConfig(item, config = {}, allowEmptyStack = false) {\n if (allowEmptyStack && item.isStack && item.contentItems.length === 0) {\n return item;\n }\n\n if (!item.contentItems) {\n return null;\n }\n\n for (let i = 0; i < item.contentItems.length; i += 1) {\n const contentItem = item.contentItems[i];\n if (contentItem.isComponent && contentItem.config) {\n if (isMatch(contentItem.config, config)) {\n return item;\n }\n }\n\n const stack = this.getStackForConfig(\n contentItem,\n config,\n allowEmptyStack\n );\n if (stack) {\n return stack;\n }\n }\n\n return null;\n }\n\n /**\n * Gets a stack matching the specified config\n * @param {Config} config The item config type to match, eg. { component: 'IrisGridPanel', title: 'Table Name' }\n * @param {boolean} createIfNecessary Whether to create the stack if it does not exist.\n * @param {boolean} matchComponentType If the config doesn't match exactly, just find another one of the same component type\n * @param {boolean} allowEmptyStack If no configs match, search for an empty stack that can be used\n */\n static getStackForRoot(\n root,\n config,\n createIfNecessary = true,\n matchComponentType = true,\n allowEmptyStack = true\n ) {\n let stack = this.getStackForConfig(root, config);\n if (!stack && matchComponentType) {\n stack = this.getStackForConfig(\n root,\n { component: config.component },\n allowEmptyStack\n );\n }\n\n if (!stack && createIfNecessary) {\n stack = this.addStack(root);\n }\n\n return stack;\n }\n\n /**\n * Gets a stack matching one of the specified types, creates new stack if necessary\n * @param {ContentItem} root The GoldenLayout root to find or create the stack in\n * @param {Array[string]} types The array of component types to match\n * @param {boolean} createIfNecessary Whether to create the stack if it does not exist\n * @param {boolean} matchComponentType If the config doesn't match exactly, just find another one of the same component type\n * @param {boolean} allowEmptyStack If no configs match, search for an empty stack that can be used\n */\n static getStackForComponentTypes(\n root,\n types,\n createIfNecessary = true,\n matchComponentType = true,\n allowEmptyStack = true\n ) {\n for (let i = 0; i < types.length; i += 1) {\n const component = types[i];\n const isLastType = i === types.length - 1;\n const stack = LayoutUtils.getStackForRoot(\n root,\n { component },\n createIfNecessary && isLastType,\n matchComponentType,\n allowEmptyStack\n );\n if (stack) {\n return stack;\n }\n }\n return null;\n }\n\n /**\n * Gets first content item with the specified config in stack.\n * @param {ContentItem} stack The stack to search for the item\n * @param {Config} config The item config type to match, eg. { component: 'IrisGridPanel', title: 'Table Name' }\n * @returns {ContentItem} Returns the found content item, null if not found.\n */\n static getContentItemInStack(stack, config) {\n for (let i = 0; i < stack.contentItems.length; i += 1) {\n const contentItem = stack.contentItems[i];\n if (contentItem.isComponent && contentItem.config) {\n if (isMatch(contentItem.config, config)) {\n return contentItem;\n }\n }\n }\n return null;\n }\n\n /**\n * Removes dynamic props from components in the given config so this config could be serialized\n * @param {Array} config Config object\n * @param {(name: string, config: PanelConfig) => PanelConfig | null}\n * @returns {Array} Dehydrated config\n */\n static dehydrateLayoutConfig(config, dehydrateComponent) {\n if (!config || !config.length) {\n return [];\n }\n const dehydratedConfig = [];\n\n for (let i = 0; i < config.length; i += 1) {\n const itemConfig = config[i];\n const { component, content } = itemConfig;\n if (component) {\n const dehydratedComponent = dehydrateComponent(component, itemConfig);\n if (dehydratedComponent) {\n dehydratedConfig.push(dehydratedComponent);\n } else {\n log.debug2(\n `dehydrateLayoutConfig: skipping unmapped component \"${component}\"`\n );\n }\n } else if (content) {\n const layoutItemConfig = {\n ...itemConfig,\n content: LayoutUtils.dehydrateLayoutConfig(\n content,\n dehydrateComponent\n ),\n };\n dehydratedConfig.push(layoutItemConfig);\n } else {\n dehydratedConfig.push(itemConfig);\n }\n }\n return dehydratedConfig;\n }\n\n static getTabPoint(glContainer) {\n const { tab } = glContainer;\n if (tab == null) {\n throw new Error('Cannot get tab for panel container', glContainer);\n }\n const tabRect = tab.element[0].getBoundingClientRect();\n\n return [tabRect.left + tabRect.width * 0.5, tabRect.bottom - 8];\n }\n\n /**\n * Drop minor changes in Layout Configuration for deep comparison\n * @param {Object} config Layout Configuration\n *\n * minor changes:\n * 1. sorts in grid\n * 2. quick filters in grid\n * 3. active item\n *\n * item id is also removed\n */\n static dropLayoutMinorChange(config) {\n for (let i = 0; i < config.length; i += 1) {\n const itemConfig = config[i];\n const { component, content, activeItemIndex } = itemConfig;\n if (content) {\n if (activeItemIndex || activeItemIndex === 0) {\n delete itemConfig.activeItemIndex;\n }\n LayoutUtils.dropLayoutMinorChange(content);\n } else if (component === 'IrisGridPanel') {\n if (itemConfig.props.panelState) {\n delete itemConfig.id;\n itemConfig.props.panelState.irisGridState.sorts = [];\n itemConfig.props.panelState.irisGridState.quickFilters = [];\n }\n }\n }\n }\n\n /**\n * Compare two layouts to see if they are equivalent\n * @param {object} layout1 A Golden Layout config object\n * @param {object} layout2 Another Golden layout config object\n * @param {boolean} major When true, will ignore \"minor\" property differences (eg. sorts)\n */\n static isEqual(layout1, layout2, major = false) {\n if (major) {\n const layout1Clone = LayoutUtils.cloneLayout(layout1);\n const layout2Clone = LayoutUtils.cloneLayout(layout2);\n LayoutUtils.dropLayoutMinorChange(layout1Clone);\n LayoutUtils.dropLayoutMinorChange(layout2Clone);\n return deepEqual(layout1Clone, layout2Clone);\n }\n return deepEqual(layout1, layout2);\n }\n\n static cloneLayout(layout) {\n return JSON.parse(JSON.stringify(layout));\n }\n\n /**\n * Adds dynamic props to components in the given config so this config could be used to initialize a layout\n * @param {GoldenLayout.Config} config Dehydrated config object\n * @param {(name: string, config: PanelProps) => PanelProps} hydrateComponent Function to hydrate the component\n * @returns {Array} Hydrated config\n */\n static hydrateLayoutConfig(config, hydrateComponent) {\n if (!config || !config.length) {\n return [];\n }\n const hydratedConfig = [];\n\n for (let i = 0; i < config.length; i += 1) {\n const itemConfig = config[i];\n const { component, content, props, type } = itemConfig;\n if (type === 'react-component') {\n hydratedConfig.push({\n ...itemConfig,\n id: itemConfig?.id ?? shortid(),\n props: hydrateComponent(component, props),\n });\n } else if (content) {\n const contentConfig = LayoutUtils.hydrateLayoutConfig(\n content,\n hydrateComponent\n );\n if (\n itemConfig.activeItemIndex != null &&\n itemConfig.activeItemIndex >= contentConfig.length\n ) {\n log.warn(\n 'Fixing bad activeItemIndex!',\n itemConfig.activeItemIndex,\n itemConfig\n );\n itemConfig.activeItemIndex = 0;\n }\n hydratedConfig.push({\n ...itemConfig,\n content: contentConfig,\n });\n } else {\n hydratedConfig.push(itemConfig);\n }\n }\n return hydratedConfig;\n }\n\n /**\n * Opens a component. It will try and open the component in an existing stack of the same component.\n * If `replaceExisting` is true and there is a component found with the same `config.id`, it will replace that component with this one.\n * If `allowStack` is true and there is a component of the same type found, it will open in that stack (potentially covering up a panel).\n * @param {ContentItem} root The GoldenLayout root to open the component in\n * @param {Config} config The component config definition to open\n * @param {Boolean} replaceExisting Whether it should replace the existing one matching component type and id, or open a new one\n * @param {Config} replaceConfig The component config to replace\n * @param {Boolean} createNewStack True to force opening in a new stack, false to try and open in a stack with the same type of component.\n * @param {String} focusElement The element to focus on\n * @param {MouseEvent} dragEvent Whether component is being created with a drag, mouse event is initial position for drag proxy\n */\n static openComponent({\n root,\n config: configParam,\n replaceExisting = true,\n replaceConfig = null,\n createNewStack = false,\n focusElement = null,\n dragEvent = null,\n } = {}) {\n // attempt to retain focus after dom manipulation, which can break focus\n const maintainFocusElement = document.activeElement;\n const config = { ...configParam };\n\n if (!config.id) {\n config.id = shortid.generate();\n }\n\n if (dragEvent) {\n root.layoutManager.createDragSourceFromEvent(config, dragEvent);\n return;\n }\n\n const searchConfig = replaceConfig || {\n id: config.id,\n component: config.component,\n };\n const stack = createNewStack\n ? LayoutUtils.addStack(root)\n : LayoutUtils.getStackForRoot(root, searchConfig);\n\n const oldContentItem = LayoutUtils.getContentItemInStack(\n stack,\n searchConfig\n );\n\n if (focusElement) {\n // We need to listen for when the stack is created\n const onComponentCreated = event => {\n log.debug('Component created, focusing element', focusElement);\n\n stack.off('componentCreated', onComponentCreated);\n\n const { element } = event.origin;\n\n // Need to wait until the component actually renders.\n requestAnimationFrame(() => {\n LayoutUtils.focusElement(element[0], focusElement);\n });\n };\n stack.on('componentCreated', onComponentCreated);\n }\n if (replaceExisting && oldContentItem) {\n const index = stack.contentItems.indexOf(oldContentItem);\n\n // Using remove/add here instead of replaceChild because I was getting errors with replaceChild... should be the same.\n // Add first so that the stack doesn't get screwed up\n stack.addChild(config, index + 1);\n stack.removeChild(oldContentItem);\n\n stack.setActiveContentItem(stack.contentItems[index]);\n } else {\n stack.addChild(config);\n }\n\n if (!focusElement && maintainFocusElement) {\n maintainFocusElement.focus();\n }\n }\n\n /**\n * Opens a component in an given stack.\n * If `replaceExisting` is true and there is a component found with the same `config.id`, it will replace that component with this one\n * @param {ContentItem} stack The GoldenLayout stack to open the component in\n * @param {Config} config The component config definition to open\n * @param {Boolean} replaceExisting Whether it should replace the existing one matching component type and id, or open a new one\n */\n static openComponentInStack(stack, config, replaceExisting = true) {\n const maintainFocusElement = document.activeElement; // attempt to retain focus after dom manipulation, which can break focus\n\n const searchConfig = { id: config.id };\n\n const oldContentItem = LayoutUtils.getContentItemInStack(\n stack,\n searchConfig\n );\n\n if (replaceExisting && oldContentItem) {\n const index = stack.contentItems.indexOf(oldContentItem);\n\n // Using remove/add here instead of replaceChild because I was getting errors with replaceChild... should be the same.\n // Add first so that the stack doesn't get screwed up\n stack.addChild(config, index + 1);\n stack.removeChild(oldContentItem);\n\n stack.setActiveContentItem(stack.contentItems[index]);\n } else {\n stack.addChild(config);\n }\n\n if (maintainFocusElement) maintainFocusElement.focus();\n }\n\n /**\n * Close the specified component and remove it from the stack it's currently in\n * @param {ContentItem} root The GoldenLayout root to search and close the component in\n * @param {Config} config The GoldenLayout component config definition to close, eg. { component: 'IrisGridPanel', id: 'table-t' }\n */\n static closeComponent(root, config) {\n const stack = LayoutUtils.getStackForRoot(\n root,\n config,\n false,\n false,\n false\n );\n\n if (!stack) {\n log.warn('Cannot find stack for component, ignoring close', config);\n return;\n }\n\n // Find the tab with the specified config and remove it\n // Same component was used to get the stack above, so getContentItemInStack shouldn't return null\n const oldContentItem = LayoutUtils.getContentItemInStack(stack, config);\n const maintainFocusElement = document.activeElement; // attempt to retain focus after dom manipulation, which can break focus\n if (oldContentItem.isComponent) {\n oldContentItem.container.close();\n } else {\n stack.removeChild(oldContentItem);\n }\n // if focused element is still in dom restore focus, note it could have been in the removed panel so check first\n if (maintainFocusElement && document.contains(maintainFocusElement)) {\n maintainFocusElement.focus();\n }\n }\n\n static renameComponent(root, config, newTitle) {\n const stack = LayoutUtils.getStackForRoot(root, config, false);\n if (!stack) {\n log.error('Could not find stack for config', config);\n return;\n }\n // Find the tab with the specified config and rename it\n const contentItem = LayoutUtils.getContentItemInStack(stack, config);\n contentItem.setTitle(newTitle);\n }\n\n /**\n * Create a component clone based on the given config\n * @param {ContentItem} root The GoldenLayout root to clone the component in\n * @param {Config} config The config to clone\n * @returns {Config} Clone config\n */\n static cloneComponent(root, config) {\n const stack = LayoutUtils.getStackForRoot(root, config, false);\n if (!stack) {\n log.error('Could not find stack for config', config);\n return null;\n }\n const panelState = LayoutUtils.getPanelComponentState(config);\n const cloneConfig = {\n type: 'react-component',\n component: config.component,\n props: {\n ...config.props,\n panelState,\n },\n title: `${config.title} Copy`,\n id: shortid.generate(),\n };\n LayoutUtils.openComponentInStack(stack, cloneConfig);\n return cloneConfig;\n }\n\n /**\n * Get panel component state for the given config\n * @param {Object} config Panel config\n * @returns {Object} Panel state\n */\n static getPanelComponentState(config) {\n return (\n // Fallback to props.panelState for uninitialized panels\n config.componentState?.panelState ?? config.props?.panelState ?? null\n );\n }\n\n static makeDefaultLayout() {\n return {\n dimensions: {\n headerHeight: GoldenLayoutThemeExport.tabHeight,\n borderWidth: GoldenLayoutThemeExport.dragBorderWidth,\n borderGrabWidth: 10,\n },\n settings: {\n showPopoutIcon: false,\n showCloseIcon: false,\n constrainDragToContainer: false,\n },\n };\n }\n\n /**\n * Gets a containers root node\n * @param {GlContainer} container The Golden Layout container to get the root for\n */\n static getRootFromContainer(container) {\n return container.layoutManager.root;\n }\n\n /**\n * Gets the config for the panel component given a glContainer\n * @param {GlContainer} container The Golden Layout container to get the config for\n */\n static getComponentConfigFromContainer(container) {\n if (container) {\n if (container.tab && container.tab.contentItem) {\n return container.tab.contentItem.config;\n }\n\n // If the container hasn't populated the tab yet, just get the config directly from the container\n // eslint-disable-next-line no-underscore-dangle\n return container._config;\n }\n\n return null;\n }\n\n static getTitleFromContainer(container) {\n if (container && container.tab && container.tab.contentItem) {\n return container.tab.contentItem.config.title;\n }\n return null;\n }\n\n static getTitleFromTab(tab) {\n if (tab && tab.contentItem) {\n return tab.contentItem.config.title;\n }\n return null;\n }\n\n /**\n * Retrieve the panel ID for the provided golden layout container\n * @param {GlContainer} glContainer The container to get the panel ID for\n * @returns {string|null} Panel ID\n */\n static getIdFromContainer(glContainer) {\n const config = LayoutUtils.getComponentConfigFromContainer(glContainer);\n if (config) {\n return config.id;\n }\n return null;\n }\n\n /**\n * Retrieve the ID of the panel provided\n * @param {Component} panel The panel to get the ID for\n * @returns {string|null} Panel ID\n */\n static getIdFromPanel(panel) {\n const { glContainer } = panel.props;\n return LayoutUtils.getIdFromContainer(glContainer);\n }\n\n /**\n * Get component name from the panel instance\n * @param {Component} panel Panel to get component name for\n * @returns {string} Component name or null if unable to retrieve name\n */\n static getComponentNameFromPanel(panel) {\n const { glContainer } = panel.props;\n const config = LayoutUtils.getComponentConfigFromContainer(glContainer);\n return config?.component ?? null;\n }\n\n /**\n * Get component name for wrapped and un-wrapped components\n * @param {Component} component Component to get name for\n * @returns {string} Component name\n * @throws If displayName for the component is not defined\n */\n static getComponentName(component) {\n const name =\n component.WrappedComponent?.displayName ?? component.displayName;\n if (name == null) {\n throw new Error('Component displayName not defined', component);\n }\n return name;\n }\n\n /**\n * Put focus on the first \"input\" element (input, button, select, textarea) within an element\n * If element is null or input element not found, does nothing\n * @param {DOMElement} element The element to put focus in.\n * @param {String} selector The first element matching this selector will be focused.\n * @returns {DOMElement} The element that was focused, null if not focused\n */\n static focusElement(element, selector = LayoutUtils.DEFAULT_FOCUS_SELECTOR) {\n if (element == null) {\n return null;\n }\n const focusElement = element.querySelector(selector);\n if (focusElement == null) {\n return null;\n }\n\n focusElement.focus();\n return focusElement;\n }\n\n /**\n * Get a promise that initializes when layout is initialized\n * @param {GoldenLayout} layout The layout to await initialization on\n * @returns Promise that resolves when layout is initialized\n */\n static onInitialized(layout) {\n return new Promise(resolve => {\n if (layout.isInitialised) {\n resolve();\n return;\n }\n const onInit = () => {\n layout.off('initialised', onInit);\n resolve();\n };\n layout.on('initialised', onInit);\n });\n }\n}\n\nexport default LayoutUtils;\n"],"file":"LayoutUtils.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/layout/LayoutUtils.js"],"names":["deepEqual","shortid","isMatch","Log","GoldenLayoutThemeExport","log","module","LayoutUtils","activateTab","root","config","stack","getStackForRoot","error","contentItem","getContentItemInStack","setActiveContentItem","isActiveTab","activeItem","getActiveContentItem","addStack","parent","columnPreferred","type","isRoot","contentItems","length","addChild","child","isCorrectType","isColumn","isRow","removeChild","maintainFocusElement","document","activeElement","focus","newParent","getStackForConfig","item","allowEmptyStack","isStack","i","isComponent","createIfNecessary","matchComponentType","component","getStackForComponentTypes","types","isLastType","dehydrateLayoutConfig","dehydrateComponent","dehydratedConfig","itemConfig","content","dehydratedComponent","push","debug2","layoutItemConfig","getTabPoint","glContainer","tab","Error","tabRect","element","getBoundingClientRect","left","width","bottom","dropLayoutMinorChange","activeItemIndex","props","panelState","id","irisGridState","sorts","quickFilters","isEqual","layout1","layout2","major","layout1Clone","cloneLayout","layout2Clone","layout","JSON","parse","stringify","hydrateLayoutConfig","hydrateComponent","hydratedConfig","contentConfig","warn","openComponent","configParam","replaceExisting","replaceConfig","createNewStack","focusElement","dragEvent","generate","layoutManager","createDragSourceFromEvent","searchConfig","oldContentItem","onComponentCreated","event","debug","off","origin","requestAnimationFrame","on","index","indexOf","openComponentInStack","closeComponent","container","close","contains","renameComponent","newTitle","setTitle","cloneComponent","getPanelComponentState","cloneConfig","title","componentState","makeDefaultLayout","dimensions","headerHeight","tabHeight","borderWidth","dragBorderWidth","borderGrabWidth","settings","showPopoutIcon","showCloseIcon","constrainDragToContainer","getRootFromContainer","getComponentConfigFromContainer","_config","getTitleFromContainer","getTitleFromTab","getIdFromContainer","getIdFromPanel","panel","getComponentNameFromPanel","getComponentName","name","WrappedComponent","displayName","selector","DEFAULT_FOCUS_SELECTOR","querySelector","onInitialized","Promise","resolve","isInitialised","onInit"],"mappings":";;;;;;AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,OAAP,MAAoB,SAApB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,GAAP,MAAgB,gBAAhB;OACOC,uB;AAEP,IAAMC,GAAG,GAAGF,GAAG,CAACG,MAAJ,CAAW,aAAX,CAAZ;;AAEA,MAAMC,WAAN,CAAkB;AAGE,SAAXC,WAAW,CAACC,IAAD,EAAOC,MAAP,EAAe;AAC/B,QAAMC,KAAK,GAAGJ,WAAW,CAACK,eAAZ,CAA4BH,IAA5B,EAAkCC,MAAlC,EAA0C,KAA1C,CAAd;;AACA,QAAI,CAACC,KAAL,EAAY;AACVN,MAAAA,GAAG,CAACQ,KAAJ,CAAU,iCAAV,EAA6CH,MAA7C;AACA;AACD,KAL8B,CAM/B;;;AACA,QAAMI,WAAW,GAAGP,WAAW,CAACQ,qBAAZ,CAAkCJ,KAAlC,EAAyCD,MAAzC,CAApB;AACAC,IAAAA,KAAK,CAACK,oBAAN,CAA2BF,WAA3B;AACD;AAED;AACF;AACA;AACA;AACA;AACA;;;AACoB,SAAXG,WAAW,CAACR,IAAD,EAAOC,MAAP,EAAe;AAC/B,QAAMC,KAAK,GAAGJ,WAAW,CAACK,eAAZ,CAA4BH,IAA5B,EAAkCC,MAAlC,EAA0C,KAA1C,CAAd;;AACA,QAAI,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A,OAAO;AACP;AACD;;AACD,UAAME,MAAM,GAAG,MAAM;AACnB1E,QAAAA,MAAM,CAACwB,GAAP,CAAW,aAAX,EAA0BkD,MAA1B;AACAF,QAAAA,OAAO;AACR,OAHD;;AAIAxE,MAAAA,MAAM,CAAC2B,EAAP,CAAU,aAAV,EAAyB+C,MAAzB;AACD,KAVM,CAAP;AAWD;;AA1qBe;;gBAAZvJ,W,4BAC4B,iC;;AA4qBlC,eAAeA,WAAf","sourcesContent":["import deepEqual from 'deep-equal';\nimport shortid from 'shortid';\nimport isMatch from 'lodash.ismatch';\nimport Log from '@deephaven/log';\nimport GoldenLayoutThemeExport from './GoldenLayoutThemeExport';\n\nconst log = Log.module('LayoutUtils');\n\nclass LayoutUtils {\n static DEFAULT_FOCUS_SELECTOR = 'input, select, textarea, button';\n\n static activateTab(root, config) {\n const stack = LayoutUtils.getStackForRoot(root, config, false);\n if (!stack) {\n log.error('Could not find stack for config', config);\n return;\n }\n // Find the tab with the specified table and activate it\n const contentItem = LayoutUtils.getContentItemInStack(stack, config);\n stack.setActiveContentItem(contentItem);\n }\n\n /**\n * Is the tab with the given config active\n * @param {ContentItem} root A GoldenLayout content item with the tab\n * @param {Object} config Tab config to match\n * @returns {boolean} True if the tab is active\n */\n static isActiveTab(root, config) {\n const stack = LayoutUtils.getStackForRoot(root, config, false);\n if (!stack) {\n log.error('Could not find stack for config', config);\n return false;\n }\n // Find the item with the specified config and compare with active item\n const contentItem = LayoutUtils.getContentItemInStack(stack, config);\n const activeItem = stack.getActiveContentItem();\n return activeItem === contentItem;\n }\n\n /**\n * Adds a stack to the root layout specified. Adds to the first row/column with only one item\n * @param {ContentItem} root A GoldenLayout content item to add the stack to\n * @returns The newly created stack.\n */\n static addStack(parent, columnPreferred = true) {\n const type = columnPreferred ? 'column' : 'row';\n if (parent.isRoot) {\n if (!parent.contentItems || parent.contentItems.length === 0) {\n parent.addChild({ type });\n }\n\n const child = parent.contentItems[0];\n const isCorrectType = columnPreferred ? child.isColumn : child.isRow;\n if (!isCorrectType) {\n parent.removeChild(child, true);\n parent.addChild({ type });\n\n // The addChild may cause the element that has focus to be removed from the DOM, which changes focus to the body\n // Try and maintain the focus as best we can. The unfocused element may still send a blur/focus event so that needs to be handled correctly.\n const maintainFocusElement = document.activeElement;\n parent.contentItems[0].addChild(child);\n maintainFocusElement?.focus();\n }\n\n return this.addStack(parent.contentItems[0], columnPreferred);\n }\n\n if (parent.contentItems.length < 2) {\n parent.addChild({ type: 'stack' });\n return parent.contentItems[parent.contentItems.length - 1];\n }\n let newParent = parent.contentItems[parent.contentItems.length - 1];\n const isCorrectType = !columnPreferred\n ? newParent.isColumn\n : newParent.isRow;\n if (!isCorrectType) {\n parent.addChild({ type: !columnPreferred ? 'column' : 'row' });\n parent.removeChild(newParent, true);\n parent.contentItems[parent.contentItems.length - 1].addChild(newParent);\n newParent = parent.contentItems[parent.contentItems.length - 1];\n }\n\n return this.addStack(newParent, !columnPreferred);\n }\n\n /**\n * Gets the first stack which contains a contentItem with the given config values\n * @param {ContentItem} item Golden layout content item to search for the stack\n * @param {Config} config The item properties to match\n */\n static getStackForConfig(item, config = {}, allowEmptyStack = false) {\n if (allowEmptyStack && item.isStack && item.contentItems.length === 0) {\n return item;\n }\n\n if (!item.contentItems) {\n return null;\n }\n\n for (let i = 0; i < item.contentItems.length; i += 1) {\n const contentItem = item.contentItems[i];\n if (contentItem.isComponent && contentItem.config) {\n if (isMatch(contentItem.config, config)) {\n return item;\n }\n }\n\n const stack = this.getStackForConfig(\n contentItem,\n config,\n allowEmptyStack\n );\n if (stack) {\n return stack;\n }\n }\n\n return null;\n }\n\n /**\n * Gets a stack matching the specified config\n * @param {Config} config The item config type to match, eg. { component: 'IrisGridPanel', title: 'Table Name' }\n * @param {boolean} createIfNecessary Whether to create the stack if it does not exist.\n * @param {boolean} matchComponentType If the config doesn't match exactly, just find another one of the same component type\n * @param {boolean} allowEmptyStack If no configs match, search for an empty stack that can be used\n */\n static getStackForRoot(\n root,\n config,\n createIfNecessary = true,\n matchComponentType = true,\n allowEmptyStack = true\n ) {\n let stack = this.getStackForConfig(root, config);\n if (!stack && matchComponentType) {\n stack = this.getStackForConfig(\n root,\n { component: config.component },\n allowEmptyStack\n );\n }\n\n if (!stack && createIfNecessary) {\n stack = this.addStack(root);\n }\n\n return stack;\n }\n\n /**\n * Gets a stack matching one of the specified types, creates new stack if necessary\n * @param {ContentItem} root The GoldenLayout root to find or create the stack in\n * @param {Array[string]} types The array of component types to match\n * @param {boolean} createIfNecessary Whether to create the stack if it does not exist\n * @param {boolean} matchComponentType If the config doesn't match exactly, just find another one of the same component type\n * @param {boolean} allowEmptyStack If no configs match, search for an empty stack that can be used\n */\n static getStackForComponentTypes(\n root,\n types,\n createIfNecessary = true,\n matchComponentType = true,\n allowEmptyStack = true\n ) {\n for (let i = 0; i < types.length; i += 1) {\n const component = types[i];\n const isLastType = i === types.length - 1;\n const stack = LayoutUtils.getStackForRoot(\n root,\n { component },\n createIfNecessary && isLastType,\n matchComponentType,\n allowEmptyStack\n );\n if (stack) {\n return stack;\n }\n }\n return null;\n }\n\n /**\n * Gets first content item with the specified config in stack.\n * @param {ContentItem} stack The stack to search for the item\n * @param {Config} config The item config type to match, eg. { component: 'IrisGridPanel', title: 'Table Name' }\n * @returns {ContentItem} Returns the found content item, null if not found.\n */\n static getContentItemInStack(stack, config) {\n for (let i = 0; i < stack.contentItems.length; i += 1) {\n const contentItem = stack.contentItems[i];\n if (contentItem.isComponent && contentItem.config) {\n if (isMatch(contentItem.config, config)) {\n return contentItem;\n }\n }\n }\n return null;\n }\n\n /**\n * Removes dynamic props from components in the given config so this config could be serialized\n * @param {Array} config Config object\n * @param {(name: string, config: PanelConfig) => PanelConfig | null}\n * @returns {Array} Dehydrated config\n */\n static dehydrateLayoutConfig(config, dehydrateComponent) {\n if (!config || !config.length) {\n return [];\n }\n const dehydratedConfig = [];\n\n for (let i = 0; i < config.length; i += 1) {\n const itemConfig = config[i];\n const { component, content } = itemConfig;\n if (component) {\n const dehydratedComponent = dehydrateComponent(component, itemConfig);\n if (dehydratedComponent) {\n dehydratedConfig.push(dehydratedComponent);\n } else {\n log.debug2(\n `dehydrateLayoutConfig: skipping unmapped component \"${component}\"`\n );\n }\n } else if (content) {\n const layoutItemConfig = {\n ...itemConfig,\n content: LayoutUtils.dehydrateLayoutConfig(\n content,\n dehydrateComponent\n ),\n };\n dehydratedConfig.push(layoutItemConfig);\n } else {\n dehydratedConfig.push(itemConfig);\n }\n }\n return dehydratedConfig;\n }\n\n static getTabPoint(glContainer) {\n const { tab } = glContainer;\n if (tab == null) {\n throw new Error('Cannot get tab for panel container', glContainer);\n }\n const tabRect = tab.element[0].getBoundingClientRect();\n\n return [tabRect.left + tabRect.width * 0.5, tabRect.bottom - 8];\n }\n\n /**\n * Drop minor changes in Layout Configuration for deep comparison\n * @param {Object} config Layout Configuration\n *\n * minor changes:\n * 1. sorts in grid\n * 2. quick filters in grid\n * 3. active item\n *\n * item id is also removed\n */\n static dropLayoutMinorChange(config) {\n for (let i = 0; i < config.length; i += 1) {\n const itemConfig = config[i];\n const { component, content, activeItemIndex } = itemConfig;\n if (content) {\n if (activeItemIndex || activeItemIndex === 0) {\n delete itemConfig.activeItemIndex;\n }\n LayoutUtils.dropLayoutMinorChange(content);\n } else if (component === 'IrisGridPanel') {\n if (itemConfig.props.panelState) {\n delete itemConfig.id;\n itemConfig.props.panelState.irisGridState.sorts = [];\n itemConfig.props.panelState.irisGridState.quickFilters = [];\n }\n }\n }\n }\n\n /**\n * Compare two layouts to see if they are equivalent\n * @param {object} layout1 A Golden Layout config object\n * @param {object} layout2 Another Golden layout config object\n * @param {boolean} major When true, will ignore \"minor\" property differences (eg. sorts)\n */\n static isEqual(layout1, layout2, major = false) {\n if (major) {\n const layout1Clone = LayoutUtils.cloneLayout(layout1);\n const layout2Clone = LayoutUtils.cloneLayout(layout2);\n LayoutUtils.dropLayoutMinorChange(layout1Clone);\n LayoutUtils.dropLayoutMinorChange(layout2Clone);\n return deepEqual(layout1Clone, layout2Clone);\n }\n return deepEqual(layout1, layout2);\n }\n\n static cloneLayout(layout) {\n return JSON.parse(JSON.stringify(layout));\n }\n\n /**\n * Adds dynamic props to components in the given config so this config could be used to initialize a layout\n * @param {GoldenLayout.Config} config Dehydrated config object\n * @param {(name: string, config: PanelProps) => PanelProps} hydrateComponent Function to hydrate the component\n * @returns {Array} Hydrated config\n */\n static hydrateLayoutConfig(config, hydrateComponent) {\n if (!config || !config.length) {\n return [];\n }\n const hydratedConfig = [];\n\n for (let i = 0; i < config.length; i += 1) {\n const itemConfig = config[i];\n const { component, content, props = {}, type } = itemConfig;\n if (type === 'react-component') {\n hydratedConfig.push({\n ...itemConfig,\n id: itemConfig?.id ?? shortid(),\n props: hydrateComponent(component, props),\n });\n } else if (content) {\n const contentConfig = LayoutUtils.hydrateLayoutConfig(\n content,\n hydrateComponent\n );\n if (\n itemConfig.activeItemIndex != null &&\n itemConfig.activeItemIndex >= contentConfig.length\n ) {\n log.warn(\n 'Fixing bad activeItemIndex!',\n itemConfig.activeItemIndex,\n itemConfig\n );\n itemConfig.activeItemIndex = 0;\n }\n hydratedConfig.push({\n ...itemConfig,\n content: contentConfig,\n });\n } else {\n hydratedConfig.push(itemConfig);\n }\n }\n return hydratedConfig;\n }\n\n /**\n * Opens a component. It will try and open the component in an existing stack of the same component.\n * If `replaceExisting` is true and there is a component found with the same `config.id`, it will replace that component with this one.\n * If `allowStack` is true and there is a component of the same type found, it will open in that stack (potentially covering up a panel).\n * @param {ContentItem} root The GoldenLayout root to open the component in\n * @param {Config} config The component config definition to open\n * @param {Boolean} replaceExisting Whether it should replace the existing one matching component type and id, or open a new one\n * @param {Config} replaceConfig The component config to replace\n * @param {Boolean} createNewStack True to force opening in a new stack, false to try and open in a stack with the same type of component.\n * @param {String} focusElement The element to focus on\n * @param {MouseEvent} dragEvent Whether component is being created with a drag, mouse event is initial position for drag proxy\n */\n static openComponent({\n root,\n config: configParam,\n replaceExisting = true,\n replaceConfig = null,\n createNewStack = false,\n focusElement = null,\n dragEvent = null,\n } = {}) {\n // attempt to retain focus after dom manipulation, which can break focus\n const maintainFocusElement = document.activeElement;\n const config = { ...configParam };\n\n if (!config.id) {\n config.id = shortid.generate();\n }\n\n if (dragEvent) {\n root.layoutManager.createDragSourceFromEvent(config, dragEvent);\n return;\n }\n\n const searchConfig = replaceConfig || {\n id: config.id,\n component: config.component,\n };\n const stack = createNewStack\n ? LayoutUtils.addStack(root)\n : LayoutUtils.getStackForRoot(root, searchConfig);\n\n const oldContentItem = LayoutUtils.getContentItemInStack(\n stack,\n searchConfig\n );\n\n if (focusElement) {\n // We need to listen for when the stack is created\n const onComponentCreated = event => {\n log.debug('Component created, focusing element', focusElement);\n\n stack.off('componentCreated', onComponentCreated);\n\n const { element } = event.origin;\n\n // Need to wait until the component actually renders.\n requestAnimationFrame(() => {\n LayoutUtils.focusElement(element[0], focusElement);\n });\n };\n stack.on('componentCreated', onComponentCreated);\n }\n if (replaceExisting && oldContentItem) {\n const index = stack.contentItems.indexOf(oldContentItem);\n\n // Using remove/add here instead of replaceChild because I was getting errors with replaceChild... should be the same.\n // Add first so that the stack doesn't get screwed up\n stack.addChild(config, index + 1);\n stack.removeChild(oldContentItem);\n\n stack.setActiveContentItem(stack.contentItems[index]);\n } else {\n stack.addChild(config);\n }\n\n if (!focusElement && maintainFocusElement) {\n maintainFocusElement.focus();\n }\n }\n\n /**\n * Opens a component in an given stack.\n * If `replaceExisting` is true and there is a component found with the same `config.id`, it will replace that component with this one\n * @param {ContentItem} stack The GoldenLayout stack to open the component in\n * @param {Config} config The component config definition to open\n * @param {Boolean} replaceExisting Whether it should replace the existing one matching component type and id, or open a new one\n */\n static openComponentInStack(stack, config, replaceExisting = true) {\n const maintainFocusElement = document.activeElement; // attempt to retain focus after dom manipulation, which can break focus\n\n const searchConfig = { id: config.id };\n\n const oldContentItem = LayoutUtils.getContentItemInStack(\n stack,\n searchConfig\n );\n\n if (replaceExisting && oldContentItem) {\n const index = stack.contentItems.indexOf(oldContentItem);\n\n // Using remove/add here instead of replaceChild because I was getting errors with replaceChild... should be the same.\n // Add first so that the stack doesn't get screwed up\n stack.addChild(config, index + 1);\n stack.removeChild(oldContentItem);\n\n stack.setActiveContentItem(stack.contentItems[index]);\n } else {\n stack.addChild(config);\n }\n\n if (maintainFocusElement) maintainFocusElement.focus();\n }\n\n /**\n * Close the specified component and remove it from the stack it's currently in\n * @param {ContentItem} root The GoldenLayout root to search and close the component in\n * @param {Config} config The GoldenLayout component config definition to close, eg. { component: 'IrisGridPanel', id: 'table-t' }\n */\n static closeComponent(root, config) {\n const stack = LayoutUtils.getStackForRoot(\n root,\n config,\n false,\n false,\n false\n );\n\n if (!stack) {\n log.warn('Cannot find stack for component, ignoring close', config);\n return;\n }\n\n // Find the tab with the specified config and remove it\n // Same component was used to get the stack above, so getContentItemInStack shouldn't return null\n const oldContentItem = LayoutUtils.getContentItemInStack(stack, config);\n const maintainFocusElement = document.activeElement; // attempt to retain focus after dom manipulation, which can break focus\n if (oldContentItem.isComponent) {\n oldContentItem.container.close();\n } else {\n stack.removeChild(oldContentItem);\n }\n // if focused element is still in dom restore focus, note it could have been in the removed panel so check first\n if (maintainFocusElement && document.contains(maintainFocusElement)) {\n maintainFocusElement.focus();\n }\n }\n\n static renameComponent(root, config, newTitle) {\n const stack = LayoutUtils.getStackForRoot(root, config, false);\n if (!stack) {\n log.error('Could not find stack for config', config);\n return;\n }\n // Find the tab with the specified config and rename it\n const contentItem = LayoutUtils.getContentItemInStack(stack, config);\n contentItem.setTitle(newTitle);\n }\n\n /**\n * Create a component clone based on the given config\n * @param {ContentItem} root The GoldenLayout root to clone the component in\n * @param {Config} config The config to clone\n * @returns {Config} Clone config\n */\n static cloneComponent(root, config) {\n const stack = LayoutUtils.getStackForRoot(root, config, false);\n if (!stack) {\n log.error('Could not find stack for config', config);\n return null;\n }\n const { props = {} } = config;\n const panelState = LayoutUtils.getPanelComponentState(config);\n const cloneConfig = {\n type: 'react-component',\n component: config.component,\n props: {\n ...props,\n panelState,\n },\n title: `${config.title} Copy`,\n id: shortid.generate(),\n };\n LayoutUtils.openComponentInStack(stack, cloneConfig);\n return cloneConfig;\n }\n\n /**\n * Get panel component state for the given config\n * @param {Object} config Panel config\n * @returns {Object} Panel state\n */\n static getPanelComponentState(config) {\n return (\n // Fallback to props.panelState for uninitialized panels\n config.componentState?.panelState ?? config.props?.panelState ?? null\n );\n }\n\n static makeDefaultLayout() {\n return {\n dimensions: {\n headerHeight: GoldenLayoutThemeExport.tabHeight,\n borderWidth: GoldenLayoutThemeExport.dragBorderWidth,\n borderGrabWidth: 10,\n },\n settings: {\n showPopoutIcon: false,\n showCloseIcon: false,\n constrainDragToContainer: false,\n },\n };\n }\n\n /**\n * Gets a containers root node\n * @param {GlContainer} container The Golden Layout container to get the root for\n */\n static getRootFromContainer(container) {\n return container.layoutManager.root;\n }\n\n /**\n * Gets the config for the panel component given a glContainer\n * @param {GlContainer} container The Golden Layout container to get the config for\n */\n static getComponentConfigFromContainer(container) {\n if (container) {\n if (container.tab && container.tab.contentItem) {\n return container.tab.contentItem.config;\n }\n\n // If the container hasn't populated the tab yet, just get the config directly from the container\n // eslint-disable-next-line no-underscore-dangle\n return container._config;\n }\n\n return null;\n }\n\n static getTitleFromContainer(container) {\n if (container && container.tab && container.tab.contentItem) {\n return container.tab.contentItem.config.title;\n }\n return null;\n }\n\n static getTitleFromTab(tab) {\n if (tab && tab.contentItem) {\n return tab.contentItem.config.title;\n }\n return null;\n }\n\n /**\n * Retrieve the panel ID for the provided golden layout container\n * @param {GlContainer} glContainer The container to get the panel ID for\n * @returns {string|null} Panel ID\n */\n static getIdFromContainer(glContainer) {\n const config = LayoutUtils.getComponentConfigFromContainer(glContainer);\n if (config) {\n return config.id;\n }\n return null;\n }\n\n /**\n * Retrieve the ID of the panel provided\n * @param {Component} panel The panel to get the ID for\n * @returns {string|null} Panel ID\n */\n static getIdFromPanel(panel) {\n const { glContainer } = panel.props;\n return LayoutUtils.getIdFromContainer(glContainer);\n }\n\n /**\n * Get component name from the panel instance\n * @param {Component} panel Panel to get component name for\n * @returns {string} Component name or null if unable to retrieve name\n */\n static getComponentNameFromPanel(panel) {\n const { glContainer } = panel.props;\n const config = LayoutUtils.getComponentConfigFromContainer(glContainer);\n return config?.component ?? null;\n }\n\n /**\n * Get component name for wrapped and un-wrapped components\n * @param {Component} component Component to get name for\n * @returns {string} Component name\n * @throws If displayName for the component is not defined\n */\n static getComponentName(component) {\n const name =\n component.WrappedComponent?.displayName ?? component.displayName;\n if (name == null) {\n throw new Error('Component displayName not defined', component);\n }\n return name;\n }\n\n /**\n * Put focus on the first \"input\" element (input, button, select, textarea) within an element\n * If element is null or input element not found, does nothing\n * @param {DOMElement} element The element to put focus in.\n * @param {String} selector The first element matching this selector will be focused.\n * @returns {DOMElement} The element that was focused, null if not focused\n */\n static focusElement(element, selector = LayoutUtils.DEFAULT_FOCUS_SELECTOR) {\n if (element == null) {\n return null;\n }\n const focusElement = element.querySelector(selector);\n if (focusElement == null) {\n return null;\n }\n\n focusElement.focus();\n return focusElement;\n }\n\n /**\n * Get a promise that initializes when layout is initialized\n * @param {GoldenLayout} layout The layout to await initialization on\n * @returns Promise that resolves when layout is initialized\n */\n static onInitialized(layout) {\n return new Promise(resolve => {\n if (layout.isInitialised) {\n resolve();\n return;\n }\n const onInit = () => {\n layout.off('initialised', onInit);\n resolve();\n };\n layout.on('initialised', onInit);\n });\n }\n}\n\nexport default LayoutUtils;\n"],"file":"LayoutUtils.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/dashboard",
|
|
3
|
-
"version": "0.11.2
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "Deephaven Dashboard",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"start": "cross-env NODE_ENV=development npm run watch"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@deephaven/golden-layout": "^0.11.2
|
|
34
|
-
"@deephaven/react-hooks": "^0.11.2
|
|
33
|
+
"@deephaven/golden-layout": "^0.11.2",
|
|
34
|
+
"@deephaven/react-hooks": "^0.11.2",
|
|
35
35
|
"deep-equal": "^2.0.4",
|
|
36
36
|
"jquery": "^3.5.1",
|
|
37
37
|
"lodash.ismatch": "^4.1.1",
|
|
@@ -49,15 +49,11 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@babel/cli": "^7.16.0",
|
|
52
|
-
"@deephaven/components": "^0.11.2
|
|
53
|
-
"@deephaven/log": "^0.11.2
|
|
54
|
-
"@deephaven/mocks": "^0.11.2
|
|
55
|
-
"@deephaven/redux": "^0.11.2
|
|
56
|
-
"@deephaven/tsconfig": "^0.11.2
|
|
57
|
-
"@storybook/addon-actions": "^6.2.3",
|
|
58
|
-
"@storybook/addon-essentials": "^6.2.3",
|
|
59
|
-
"@storybook/addon-links": "^6.2.3",
|
|
60
|
-
"@storybook/react": "^6.2.3",
|
|
52
|
+
"@deephaven/components": "^0.11.2",
|
|
53
|
+
"@deephaven/log": "^0.11.2",
|
|
54
|
+
"@deephaven/mocks": "^0.11.2",
|
|
55
|
+
"@deephaven/redux": "^0.11.2",
|
|
56
|
+
"@deephaven/tsconfig": "^0.11.2",
|
|
61
57
|
"@types/react": "^17.0.2",
|
|
62
58
|
"cross-env": "^7.0.2",
|
|
63
59
|
"identity-obj-proxy": "^3.0.0",
|
|
@@ -74,5 +70,5 @@
|
|
|
74
70
|
"publishConfig": {
|
|
75
71
|
"access": "public"
|
|
76
72
|
},
|
|
77
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "548192a2271314cce046487728c4ba18291d3dcd"
|
|
78
74
|
}
|