@deephaven/dashboard 0.5.2-beta.0 → 0.6.1-demo.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/Dashboard.d.ts +2 -1
  2. package/dist/Dashboard.d.ts.map +1 -1
  3. package/dist/Dashboard.js +37 -61
  4. package/dist/Dashboard.js.map +1 -1
  5. package/dist/DashboardLayout.d.ts +3 -1
  6. package/dist/DashboardLayout.d.ts.map +1 -1
  7. package/dist/DashboardLayout.js +63 -93
  8. package/dist/DashboardLayout.js.map +1 -1
  9. package/dist/DashboardUtils.js +16 -9
  10. package/dist/DashboardUtils.js.map +1 -1
  11. package/dist/PanelErrorBoundary.js +41 -73
  12. package/dist/PanelErrorBoundary.js.map +1 -1
  13. package/dist/PanelManager.js +216 -259
  14. package/dist/PanelManager.js.map +1 -1
  15. package/dist/PanelPlaceholder.js +3 -3
  16. package/dist/PanelPlaceholder.js.map +1 -1
  17. package/dist/index.js +13 -13
  18. package/dist/index.js.map +1 -1
  19. package/dist/layout/GLPropTypes.js +3 -3
  20. package/dist/layout/GLPropTypes.js.map +1 -1
  21. package/dist/layout/GoldenLayoutThemeExport.js.map +1 -1
  22. package/dist/layout/LayoutUtils.d.ts +8 -1
  23. package/dist/layout/LayoutUtils.d.ts.map +1 -1
  24. package/dist/layout/LayoutUtils.js +632 -677
  25. package/dist/layout/LayoutUtils.js.map +1 -1
  26. package/dist/layout/golden-layout.js +2 -2
  27. package/dist/layout/golden-layout.js.map +1 -1
  28. package/dist/layout/hooks.js +7 -9
  29. package/dist/layout/hooks.js.map +1 -1
  30. package/dist/layout/index.js +4 -4
  31. package/dist/layout/index.js.map +1 -1
  32. package/dist/redux/actions.js +8 -14
  33. package/dist/redux/actions.js.map +1 -1
  34. package/dist/redux/index.js +6 -21
  35. package/dist/redux/index.js.map +1 -1
  36. package/dist/redux/reducers/dashboardData.js +1 -1
  37. package/dist/redux/reducers/dashboardData.js.map +1 -1
  38. package/dist/redux/reducers/index.js +2 -2
  39. package/dist/redux/reducers/index.js.map +1 -1
  40. package/dist/redux/selectors.js +4 -6
  41. package/dist/redux/selectors.js.map +1 -1
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +19 -24
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/layout/LayoutUtils.js"],"names":["deepEqual","shortid","Log","GoldenLayoutThemeExport","log","module","LayoutUtils","root","config","stack","getStackForRoot","error","contentItem","getContentItemInStack","setActiveContentItem","activeItem","getActiveContentItem","parent","columnPreferred","type","isRoot","contentItems","length","addChild","child","isCorrectType","isColumn","isRow","removeChild","addStack","newParent","item","allowEmptyStack","isStack","i","isComponent","isMatch","keys","Object","k","key","getStackForConfig","createIfNecessary","matchComponentType","component","types","isLastType","dehydrateComponent","dehydratedConfig","itemConfig","content","dehydratedComponent","push","debug2","layoutItemConfig","dehydrateLayoutConfig","glContainer","tab","Error","tabRect","element","getBoundingClientRect","left","width","bottom","activeItemIndex","dropLayoutMinorChange","props","panelState","id","irisGridState","sorts","quickFilters","layout1","layout2","major","layout1Clone","cloneLayout","layout2Clone","layout","JSON","parse","stringify","hydrateComponent","hydratedConfig","contentConfig","hydrateLayoutConfig","warn","configParam","replaceExisting","replaceConfig","createNewStack","focusElement","dragEvent","maintainFocusElement","document","activeElement","generate","layoutManager","createDragSourceFromEvent","searchConfig","oldContentItem","onComponentCreated","event","debug","off","origin","requestAnimationFrame","on","index","indexOf","focus","container","close","contains","newTitle","setTitle","componentState","cloneConfig","title","openComponentInStack","dimensions","headerHeight","tabHeight","borderWidth","dragBorderWidth","borderGrabWidth","settings","showPopoutIcon","showCloseIcon","constrainDragToContainer","_config","getComponentConfigFromContainer","panel","getIdFromContainer","name","WrappedComponent","displayName","selector","DEFAULT_FOCUS_SELECTOR","querySelector","Promise","resolve","isInitialised","onInit"],"mappings":";;;;;;;;;;;;AAAA,OAAOA,SAAP,MAAsB,YAAtB;AACA,OAAOC,OAAP,MAAo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AACxBD,UAAAA,OAAO;AACP;AACD;;AACD,YAAME,MAAM,GAAG,SAATA,MAAS,GAAM;AACnBjE,UAAAA,MAAM,CAAC0B,GAAP,CAAW,aAAX,EAA0BuC,MAA1B;AACAF,UAAAA,OAAO;AACR,SAHD;;AAIA/D,QAAAA,MAAM,CAAC6B,EAAP,CAAU,aAAV,EAAyBoC,MAAzB;AACD,OAVM,CAAP;AAWD;;;;;;gBAhrBG1I,W,4BAC4B,iC;;AAkrBlC,eAAeA,WAAf","sourcesContent":["import deepEqual from 'deep-equal';\nimport shortid from 'shortid';\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 parent.contentItems[0].addChild(child);\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 * @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 let isMatch = true;\n const keys = Object.keys(config);\n for (let k = 0; k < keys.length; k += 1) {\n const key = keys[k];\n if (config[key] !== contentItem.config[key]) {\n isMatch = false;\n break;\n }\n }\n if (isMatch) {\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 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 let isMatch = true;\n const keys = Object.keys(config);\n for (let k = 0; k < keys.length; k += 1) {\n const key = keys[k];\n if (config[key] !== contentItem.config[key]) {\n isMatch = false;\n break;\n }\n }\n if (isMatch) {\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 = {\n id: config.id,\n component: config.component,\n };\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 let { panelState = null } = config.props;\n const { componentState } = config;\n if (componentState) {\n ({ panelState } = componentState);\n }\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 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,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sBF,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,5 +1,5 @@
1
- import './jquery';
2
- import './ReactDOM';
1
+ import "./jquery.js";
2
+ import "./ReactDOM.js";
3
3
  import '@deephaven/golden-layout';
4
4
  import '@deephaven/golden-layout/dist/css/goldenlayout-base.css';
5
5
  import '@deephaven/golden-layout/dist/css/goldenlayout-dark-theme.css';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/layout/golden-layout.js"],"names":[],"mappings":"AAAA,OAAO,UAAP;AACA,OAAO,YAAP;AAEA,OAAO,0BAAP;AACA,OAAO,yDAAP;AACA,OAAO,+DAAP;AACA","sourcesContent":["import './jquery';\nimport './ReactDOM';\n\nimport '@deephaven/golden-layout';\nimport '@deephaven/golden-layout/dist/css/goldenlayout-base.css';\nimport '@deephaven/golden-layout/dist/css/goldenlayout-dark-theme.css';\nimport './GoldenLayout.scss';\n"],"file":"golden-layout.js"}
1
+ {"version":3,"sources":["../../src/layout/golden-layout.js"],"names":[],"mappings":";;AAGA,OAAO,0BAAP;AACA,OAAO,yDAAP;AACA,OAAO,+DAAP","sourcesContent":["import './jquery';\nimport './ReactDOM';\n\nimport '@deephaven/golden-layout';\nimport '@deephaven/golden-layout/dist/css/goldenlayout-base.css';\nimport '@deephaven/golden-layout/dist/css/goldenlayout-dark-theme.css';\nimport './GoldenLayout.scss';\n"],"file":"golden-layout.js"}
@@ -1,13 +1,11 @@
1
1
  import { useEffect } from 'react';
2
- export var useListener = function useListener(eventEmitter, eventName, callback) {
3
- return useEffect(function () {
4
- eventEmitter.on(eventName, callback);
5
- return function () {
6
- eventEmitter.off(eventName, callback);
7
- };
8
- }, [eventEmitter, eventName, callback]);
9
- };
2
+ export var useListener = (eventEmitter, eventName, callback) => useEffect(() => {
3
+ eventEmitter.on(eventName, callback);
4
+ return () => {
5
+ eventEmitter.off(eventName, callback);
6
+ };
7
+ }, [eventEmitter, eventName, callback]);
10
8
  export default {
11
- useListener: useListener
9
+ useListener
12
10
  };
13
11
  //# sourceMappingURL=hooks.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/layout/hooks.ts"],"names":["useEffect","useListener","eventEmitter","eventName","callback","on","off"],"mappings":"AAAA,SAASA,SAAT,QAA0B,OAA1B;AAGA,OAAO,IAAMC,WAAW,GAAG,SAAdA,WAAc,CACzBC,YADyB,EAEzBC,SAFyB,EAIzBC,QAJyB;AAAA,SAMzBJ,SAAS,CAAC,YAAM;AACdE,IAAAA,YAAY,CAACG,EAAb,CAAgBF,SAAhB,EAA2BC,QAA3B;AAEA,WAAO,YAAM;AACXF,MAAAA,YAAY,CAACI,GAAb,CAAiBH,SAAjB,EAA4BC,QAA5B;AACD,KAFD;AAGD,GANQ,EAMN,CAACF,YAAD,EAAeC,SAAf,EAA0BC,QAA1B,CANM,CANgB;AAAA,CAApB;AAcP,eAAe;AAAEH,EAAAA,WAAW,EAAXA;AAAF,CAAf","sourcesContent":["import { useEffect } from 'react';\nimport GoldenLayout from '@deephaven/golden-layout';\n\nexport const useListener = (\n eventEmitter: GoldenLayout.EventEmitter,\n eventName: string,\n // eslint-disable-next-line @typescript-eslint/ban-types\n callback: Function\n): void =>\n useEffect(() => {\n eventEmitter.on(eventName, callback);\n\n return () => {\n eventEmitter.off(eventName, callback);\n };\n }, [eventEmitter, eventName, callback]);\n\nexport default { useListener };\n"],"file":"hooks.js"}
1
+ {"version":3,"sources":["../../src/layout/hooks.ts"],"names":["useEffect","useListener","eventEmitter","eventName","callback","on","off"],"mappings":"AAAA,SAASA,SAAT,QAA0B,OAA1B;AAGA,OAAO,IAAMC,WAAW,GAAG,CACzBC,YADyB,EAEzBC,SAFyB,EAIzBC,QAJyB,KAMzBJ,SAAS,CAAC,MAAM;AACdE,EAAAA,YAAY,CAACG,EAAb,CAAgBF,SAAhB,EAA2BC,QAA3B;AAEA,SAAO,MAAM;AACXF,IAAAA,YAAY,CAACI,GAAb,CAAiBH,SAAjB,EAA4BC,QAA5B;AACD,GAFD;AAGD,CANQ,EAMN,CAACF,YAAD,EAAeC,SAAf,EAA0BC,QAA1B,CANM,CANJ;AAcP,eAAe;AAAEH,EAAAA;AAAF,CAAf","sourcesContent":["import { useEffect } from 'react';\nimport GoldenLayout from '@deephaven/golden-layout';\n\nexport const useListener = (\n eventEmitter: GoldenLayout.EventEmitter,\n eventName: string,\n // eslint-disable-next-line @typescript-eslint/ban-types\n callback: Function\n): void =>\n useEffect(() => {\n eventEmitter.on(eventName, callback);\n\n return () => {\n eventEmitter.off(eventName, callback);\n };\n }, [eventEmitter, eventName, callback]);\n\nexport default { useListener };\n"],"file":"hooks.js"}
@@ -1,5 +1,5 @@
1
- export { default as GoldenLayoutThemeExport } from './GoldenLayoutThemeExport';
2
- export { default as LayoutUtils } from './LayoutUtils';
3
- export { default as GLPropTypes } from './GLPropTypes';
4
- export * from './hooks';
1
+ export { default as GoldenLayoutThemeExport } from "./GoldenLayoutThemeExport.js";
2
+ export { default as LayoutUtils } from "./LayoutUtils.js";
3
+ export { default as GLPropTypes } from "./GLPropTypes.js";
4
+ export * from "./hooks.js";
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/layout/index.ts"],"names":["default","GoldenLayoutThemeExport","LayoutUtils","GLPropTypes"],"mappings":"AAAA,SAASA,OAAO,IAAIC,uBAApB,QAAmD,2BAAnD;AACA,SAASD,OAAO,IAAIE,WAApB,QAAuC,eAAvC;AACA,SAASF,OAAO,IAAIG,WAApB,QAAuC,eAAvC;AAEA,cAAc,SAAd","sourcesContent":["export { default as GoldenLayoutThemeExport } from './GoldenLayoutThemeExport';\nexport { default as LayoutUtils } from './LayoutUtils';\nexport { default as GLPropTypes } from './GLPropTypes';\n\nexport * from './hooks';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/layout/index.ts"],"names":["default","GoldenLayoutThemeExport","LayoutUtils","GLPropTypes"],"mappings":"SAASA,OAAO,IAAIC,uB;SACXD,OAAO,IAAIE,W;SACXF,OAAO,IAAIG,W","sourcesContent":["export { default as GoldenLayoutThemeExport } from './GoldenLayoutThemeExport';\nexport { default as LayoutUtils } from './LayoutUtils';\nexport { default as GLPropTypes } from './GLPropTypes';\n\nexport * from './hooks';\n"],"file":"index.js"}
@@ -4,8 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  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; }
6
6
 
7
- import { SET_DASHBOARD_DATA } from './actionTypes';
8
- import { getDashboardData } from './selectors';
7
+ import { SET_DASHBOARD_DATA } from "./actionTypes.js";
8
+ import { getDashboardData } from "./selectors.js";
9
9
  /**
10
10
  * Action to replace the dashboard data for a dashboard
11
11
  * @param {string} id The ID of the dashboard to set the data on
@@ -13,13 +13,11 @@ import { getDashboardData } from './selectors';
13
13
  * @returns The action to get dispatched
14
14
  */
15
15
 
16
- export var setDashboardData = function setDashboardData(id, data) {
17
- return {
18
- type: SET_DASHBOARD_DATA,
19
- id: id,
20
- payload: data
21
- };
22
- };
16
+ export var setDashboardData = (id, data) => ({
17
+ type: SET_DASHBOARD_DATA,
18
+ id,
19
+ payload: data
20
+ });
23
21
  /**
24
22
  * Action to update the dashboard data. Will combine the update with any existing dashboard data.
25
23
  * @param {string} id The id of the dashboard to update the data on
@@ -27,9 +25,5 @@ export var setDashboardData = function setDashboardData(id, data) {
27
25
  * @returns
28
26
  */
29
27
 
30
- export var updateDashboardData = function updateDashboardData(id, data) {
31
- return function (dispatch, getState) {
32
- return dispatch(setDashboardData(id, _objectSpread(_objectSpread({}, getDashboardData(getState(), id)), data)));
33
- };
34
- };
28
+ export var updateDashboardData = (id, data) => (dispatch, getState) => dispatch(setDashboardData(id, _objectSpread(_objectSpread({}, getDashboardData(getState(), id)), data)));
35
29
  //# sourceMappingURL=actions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/redux/actions.js"],"names":["SET_DASHBOARD_DATA","getDashboardData","setDashboardData","id","data","type","payload","updateDashboardData","dispatch","getState"],"mappings":";;;;;;AAAA,SAASA,kBAAT,QAAmC,eAAnC;AACA,SAASC,gBAAT,QAAiC,aAAjC;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,EAAD,EAAKC,IAAL;AAAA,SAAe;AAC7CC,IAAAA,IAAI,EAAEL,kBADuC;AAE7CG,IAAAA,EAAE,EAAFA,EAF6C;AAG7CG,IAAAA,OAAO,EAAEF;AAHoC,GAAf;AAAA,CAAzB;AAMP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMG,mBAAmB,GAAG,SAAtBA,mBAAsB,CAACJ,EAAD,EAAKC,IAAL;AAAA,SAAc,UAACI,QAAD,EAAWC,QAAX;AAAA,WAC/CD,QAAQ,CACNN,gBAAgB,CAACC,EAAD,kCACXF,gBAAgB,CAACQ,QAAQ,EAAT,EAAaN,EAAb,CADL,GAEXC,IAFW,EADV,CADuC;AAAA,GAAd;AAAA,CAA5B","sourcesContent":["import { SET_DASHBOARD_DATA } from './actionTypes';\nimport { getDashboardData } from './selectors';\n\n/**\n * Action to replace the dashboard data for a dashboard\n * @param {string} id The ID of the dashboard to set the data on\n * @param {Record<string, unknown>} data Data for the dashboard\n * @returns The action to get dispatched\n */\nexport const setDashboardData = (id, data) => ({\n type: SET_DASHBOARD_DATA,\n id,\n payload: data,\n});\n\n/**\n * Action to update the dashboard data. Will combine the update with any existing dashboard data.\n * @param {string} id The id of the dashboard to update the data on\n * @param {Record<string, unknown>} updateData The data to combine with the existing dashboard data\n * @returns\n */\nexport const updateDashboardData = (id, data) => (dispatch, getState) =>\n dispatch(\n setDashboardData(id, {\n ...getDashboardData(getState(), id),\n ...data,\n })\n );\n"],"file":"actions.js"}
1
+ {"version":3,"sources":["../../src/redux/actions.js"],"names":["SET_DASHBOARD_DATA","getDashboardData","setDashboardData","id","data","type","payload","updateDashboardData","dispatch","getState"],"mappings":";;;;;;SAASA,kB;SACAC,gB;AAET;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMC,gBAAgB,GAAG,CAACC,EAAD,EAAKC,IAAL,MAAe;AAC7CC,EAAAA,IAAI,EAAEL,kBADuC;AAE7CG,EAAAA,EAF6C;AAG7CG,EAAAA,OAAO,EAAEF;AAHoC,CAAf,CAAzB;AAMP;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMG,mBAAmB,GAAG,CAACJ,EAAD,EAAKC,IAAL,KAAc,CAACI,QAAD,EAAWC,QAAX,KAC/CD,QAAQ,CACNN,gBAAgB,CAACC,EAAD,kCACXF,gBAAgB,CAACQ,QAAQ,EAAT,EAAaN,EAAb,CADL,GAEXC,IAFW,EADV,CADH","sourcesContent":["import { SET_DASHBOARD_DATA } from './actionTypes';\nimport { getDashboardData } from './selectors';\n\n/**\n * Action to replace the dashboard data for a dashboard\n * @param {string} id The ID of the dashboard to set the data on\n * @param {Record<string, unknown>} data Data for the dashboard\n * @returns The action to get dispatched\n */\nexport const setDashboardData = (id, data) => ({\n type: SET_DASHBOARD_DATA,\n id,\n payload: data,\n});\n\n/**\n * Action to update the dashboard data. Will combine the update with any existing dashboard data.\n * @param {string} id The id of the dashboard to update the data on\n * @param {Record<string, unknown>} updateData The data to combine with the existing dashboard data\n * @returns\n */\nexport const updateDashboardData = (id, data) => (dispatch, getState) =>\n dispatch(\n setDashboardData(id, {\n ...getDashboardData(getState(), id),\n ...data,\n })\n );\n"],"file":"actions.js"}
@@ -1,25 +1,10 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
-
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
1
  import { reducerRegistry } from '@deephaven/redux';
14
- import reducers from './reducers';
15
- Object.entries(reducers).map(function (_ref) {
16
- var _ref2 = _slicedToArray(_ref, 2),
17
- name = _ref2[0],
18
- reducer = _ref2[1];
19
-
2
+ import reducers from "./reducers/index.js";
3
+ Object.entries(reducers).map((_ref) => {
4
+ var [name, reducer] = _ref;
20
5
  return reducerRegistry.register(name, reducer);
21
6
  });
22
- export * from './actions';
23
- export * from './actionTypes';
24
- export * from './selectors';
7
+ export * from "./actions.js";
8
+ export * from "./actionTypes.js";
9
+ export * from "./selectors.js";
25
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/redux/index.ts"],"names":["reducerRegistry","reducers","Object","entries","map","name","reducer","register"],"mappings":";;;;;;;;;;;;AAAA,SAASA,eAAT,QAAgC,kBAAhC;AACA,OAAOC,QAAP,MAAqB,YAArB;AAEAC,MAAM,CAACC,OAAP,CAAeF,QAAf,EAAyBG,GAAzB,CAA6B;AAAA;AAAA,MAAEC,IAAF;AAAA,MAAQC,OAAR;;AAAA,SAC3BN,eAAe,CAACO,QAAhB,CAAyBF,IAAzB,EAA+BC,OAA/B,CAD2B;AAAA,CAA7B;AAIA,cAAc,WAAd;AACA,cAAc,eAAd;AACA,cAAc,aAAd","sourcesContent":["import { reducerRegistry } from '@deephaven/redux';\nimport reducers from './reducers';\n\nObject.entries(reducers).map(([name, reducer]) =>\n reducerRegistry.register(name, reducer)\n);\n\nexport * from './actions';\nexport * from './actionTypes';\nexport * from './selectors';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../src/redux/index.ts"],"names":["reducerRegistry","reducers","Object","entries","map","name","reducer","register"],"mappings":"AAAA,SAASA,eAAT,QAAgC,kBAAhC;OACOC,Q;AAEPC,MAAM,CAACC,OAAP,CAAeF,QAAf,EAAyBG,GAAzB,CAA6B;AAAA,MAAC,CAACC,IAAD,EAAOC,OAAP,CAAD;AAAA,SAC3BN,eAAe,CAACO,QAAhB,CAAyBF,IAAzB,EAA+BC,OAA/B,CAD2B;AAAA,CAA7B","sourcesContent":["import { reducerRegistry } from '@deephaven/redux';\nimport reducers from './reducers';\n\nObject.entries(reducers).map(([name, reducer]) =>\n reducerRegistry.register(name, reducer)\n);\n\nexport * from './actions';\nexport * from './actionTypes';\nexport * from './selectors';\n"],"file":"index.js"}
@@ -2,6 +2,6 @@
2
2
  * Store information about input filters set in a dashboard
3
3
  */
4
4
  import { replaceByIdReducer } from '@deephaven/redux';
5
- import { SET_DASHBOARD_DATA } from '../actionTypes';
5
+ import { SET_DASHBOARD_DATA } from "../actionTypes.js";
6
6
  export default replaceByIdReducer(SET_DASHBOARD_DATA, {}, false);
7
7
  //# sourceMappingURL=dashboardData.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/redux/reducers/dashboardData.js"],"names":["replaceByIdReducer","SET_DASHBOARD_DATA"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,kBAAT,QAAmC,kBAAnC;AACA,SAASC,kBAAT,QAAmC,gBAAnC;AAEA,eAAeD,kBAAkB,CAACC,kBAAD,EAAqB,EAArB,EAAyB,KAAzB,CAAjC","sourcesContent":["/**\n * Store information about input filters set in a dashboard\n */\nimport { replaceByIdReducer } from '@deephaven/redux';\nimport { SET_DASHBOARD_DATA } from '../actionTypes';\n\nexport default replaceByIdReducer(SET_DASHBOARD_DATA, {}, false);\n"],"file":"dashboardData.js"}
1
+ {"version":3,"sources":["../../../src/redux/reducers/dashboardData.js"],"names":["replaceByIdReducer","SET_DASHBOARD_DATA"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,kBAAT,QAAmC,kBAAnC;SACSC,kB;AAET,eAAeD,kBAAkB,CAACC,kBAAD,EAAqB,EAArB,EAAyB,KAAzB,CAAjC","sourcesContent":["/**\n * Store information about input filters set in a dashboard\n */\nimport { replaceByIdReducer } from '@deephaven/redux';\nimport { SET_DASHBOARD_DATA } from '../actionTypes';\n\nexport default replaceByIdReducer(SET_DASHBOARD_DATA, {}, false);\n"],"file":"dashboardData.js"}
@@ -1,5 +1,5 @@
1
- import dashboardData from './dashboardData';
1
+ import dashboardData from "./dashboardData.js";
2
2
  export default {
3
- dashboardData: dashboardData
3
+ dashboardData
4
4
  };
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/redux/reducers/index.js"],"names":["dashboardData"],"mappings":"AAAA,OAAOA,aAAP,MAA0B,iBAA1B;AAEA,eAAe;AAAEA,EAAAA,aAAa,EAAbA;AAAF,CAAf","sourcesContent":["import dashboardData from './dashboardData';\n\nexport default { dashboardData };\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/redux/reducers/index.js"],"names":["dashboardData"],"mappings":"OAAOA,a;AAEP,eAAe;AAAEA,EAAAA;AAAF,CAAf","sourcesContent":["import dashboardData from './dashboardData';\n\nexport default { dashboardData };\n"],"file":"index.js"}
@@ -7,16 +7,14 @@ var EMPTY_ARRAY = Object.freeze([]);
7
7
  * @returns Property mapping dashboard ID to data for that dashboard
8
8
  */
9
9
 
10
- export var getAllDashboardsData = function getAllDashboardsData(store) {
11
- return store.dashboardData;
12
- };
10
+ export var getAllDashboardsData = store => store.dashboardData;
13
11
  /**
14
12
  * @param {Store} store The redux store
15
13
  * @param {string} dashboardId The dashboard ID to get data for
16
14
  * @returns The data object for the dashboard with the specified ID
17
15
  */
18
16
 
19
- export var getDashboardData = function getDashboardData(store, dashboardId) {
17
+ export var getDashboardData = (store, dashboardId) => {
20
18
  var _getAllDashboardsData;
21
19
 
22
20
  return (_getAllDashboardsData = getAllDashboardsData(store)[dashboardId]) !== null && _getAllDashboardsData !== void 0 ? _getAllDashboardsData : EMPTY_OBJECT;
@@ -27,7 +25,7 @@ export var getDashboardData = function getDashboardData(store, dashboardId) {
27
25
  * @returns {ClosedPanels} The ClosedPanel array of panels that were previously closed/dehydrated
28
26
  */
29
27
 
30
- export var getClosedPanelsForDashboard = function getClosedPanelsForDashboard(store, dashboardId) {
28
+ export var getClosedPanelsForDashboard = (store, dashboardId) => {
31
29
  var _getDashboardData$clo;
32
30
 
33
31
  return (_getDashboardData$clo = getDashboardData(store, dashboardId).closed) !== null && _getDashboardData$clo !== void 0 ? _getDashboardData$clo : EMPTY_ARRAY;
@@ -38,7 +36,7 @@ export var getClosedPanelsForDashboard = function getClosedPanelsForDashboard(st
38
36
  * @returns {OpenedPanelMap} The map of panel IDs to components of all currently open components
39
37
  */
40
38
 
41
- export var getOpenedPanelMapForDashboard = function getOpenedPanelMapForDashboard(store, dashboardId) {
39
+ export var getOpenedPanelMapForDashboard = (store, dashboardId) => {
42
40
  var _getDashboardData$ope;
43
41
 
44
42
  return (_getDashboardData$ope = getDashboardData(store, dashboardId).openedMap) !== null && _getDashboardData$ope !== void 0 ? _getDashboardData$ope : EMPTY_MAP;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/redux/selectors.js"],"names":["EMPTY_MAP","Map","EMPTY_OBJECT","Object","freeze","EMPTY_ARRAY","getAllDashboardsData","store","dashboardData","getDashboardData","dashboardId","getClosedPanelsForDashboard","closed","getOpenedPanelMapForDashboard","openedMap"],"mappings":"AAAA,IAAMA,SAAS,GAAG,IAAIC,GAAJ,EAAlB;AAEA,IAAMC,YAAY,GAAGC,MAAM,CAACC,MAAP,CAAc,EAAd,CAArB;AAEA,IAAMC,WAAW,GAAGF,MAAM,CAACC,MAAP,CAAc,EAAd,CAApB;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAME,oBAAoB,GAAG,SAAvBA,oBAAuB,CAAAC,KAAK;AAAA,SAAIA,KAAK,CAACC,aAAV;AAAA,CAAlC;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACF,KAAD,EAAQG,WAAR;AAAA;;AAAA,kCAC9BJ,oBAAoB,CAACC,KAAD,CAApB,CAA4BG,WAA5B,CAD8B,yEACcR,YADd;AAAA,CAAzB;AAGP;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMS,2BAA2B,GAAG,SAA9BA,2BAA8B,CAACJ,KAAD,EAAQG,WAAR;AAAA;;AAAA,kCACzCD,gBAAgB,CAACF,KAAD,EAAQG,WAAR,CAAhB,CAAqCE,MADI,yEACMP,WADN;AAAA,CAApC;AAGP;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMQ,6BAA6B,GAAG,SAAhCA,6BAAgC,CAACN,KAAD,EAAQG,WAAR;AAAA;;AAAA,kCAC3CD,gBAAgB,CAACF,KAAD,EAAQG,WAAR,CAAhB,CAAqCI,SADM,yEACOd,SADP;AAAA,CAAtC","sourcesContent":["const EMPTY_MAP = new Map();\n\nconst EMPTY_OBJECT = Object.freeze({});\n\nconst EMPTY_ARRAY = Object.freeze([]);\n\n/**\n * Retrieve the data for all dashboards\n * @param {Store} store The redux store\n * @returns Property mapping dashboard ID to data for that dashboard\n */\nexport const getAllDashboardsData = store => store.dashboardData;\n\n/**\n * @param {Store} store The redux store\n * @param {string} dashboardId The dashboard ID to get data for\n * @returns The data object for the dashboard with the specified ID\n */\nexport const getDashboardData = (store, dashboardId) =>\n getAllDashboardsData(store)[dashboardId] ?? EMPTY_OBJECT;\n\n/**\n * @param {Store} store The redux store\n * @param {string} dashboardId The dashboard ID to get data for\n * @returns {ClosedPanels} The ClosedPanel array of panels that were previously closed/dehydrated\n */\nexport const getClosedPanelsForDashboard = (store, dashboardId) =>\n getDashboardData(store, dashboardId).closed ?? EMPTY_ARRAY;\n\n/**\n * @param {Store} store The redux store\n * @param {string} dashboardId The dashboard ID to get data for\n * @returns {OpenedPanelMap} The map of panel IDs to components of all currently open components\n */\nexport const getOpenedPanelMapForDashboard = (store, dashboardId) =>\n getDashboardData(store, dashboardId).openedMap ?? EMPTY_MAP;\n"],"file":"selectors.js"}
1
+ {"version":3,"sources":["../../src/redux/selectors.js"],"names":["EMPTY_MAP","Map","EMPTY_OBJECT","Object","freeze","EMPTY_ARRAY","getAllDashboardsData","store","dashboardData","getDashboardData","dashboardId","getClosedPanelsForDashboard","closed","getOpenedPanelMapForDashboard","openedMap"],"mappings":"AAAA,IAAMA,SAAS,GAAG,IAAIC,GAAJ,EAAlB;AAEA,IAAMC,YAAY,GAAGC,MAAM,CAACC,MAAP,CAAc,EAAd,CAArB;AAEA,IAAMC,WAAW,GAAGF,MAAM,CAACC,MAAP,CAAc,EAAd,CAApB;AAEA;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAME,oBAAoB,GAAGC,KAAK,IAAIA,KAAK,CAACC,aAA5C;AAEP;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMC,gBAAgB,GAAG,CAACF,KAAD,EAAQG,WAAR;AAAA;;AAAA,kCAC9BJ,oBAAoB,CAACC,KAAD,CAApB,CAA4BG,WAA5B,CAD8B,yEACcR,YADd;AAAA,CAAzB;AAGP;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMS,2BAA2B,GAAG,CAACJ,KAAD,EAAQG,WAAR;AAAA;;AAAA,kCACzCD,gBAAgB,CAACF,KAAD,EAAQG,WAAR,CAAhB,CAAqCE,MADI,yEACMP,WADN;AAAA,CAApC;AAGP;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMQ,6BAA6B,GAAG,CAACN,KAAD,EAAQG,WAAR;AAAA;;AAAA,kCAC3CD,gBAAgB,CAACF,KAAD,EAAQG,WAAR,CAAhB,CAAqCI,SADM,yEACOd,SADP;AAAA,CAAtC","sourcesContent":["const EMPTY_MAP = new Map();\n\nconst EMPTY_OBJECT = Object.freeze({});\n\nconst EMPTY_ARRAY = Object.freeze([]);\n\n/**\n * Retrieve the data for all dashboards\n * @param {Store} store The redux store\n * @returns Property mapping dashboard ID to data for that dashboard\n */\nexport const getAllDashboardsData = store => store.dashboardData;\n\n/**\n * @param {Store} store The redux store\n * @param {string} dashboardId The dashboard ID to get data for\n * @returns The data object for the dashboard with the specified ID\n */\nexport const getDashboardData = (store, dashboardId) =>\n getAllDashboardsData(store)[dashboardId] ?? EMPTY_OBJECT;\n\n/**\n * @param {Store} store The redux store\n * @param {string} dashboardId The dashboard ID to get data for\n * @returns {ClosedPanels} The ClosedPanel array of panels that were previously closed/dehydrated\n */\nexport const getClosedPanelsForDashboard = (store, dashboardId) =>\n getDashboardData(store, dashboardId).closed ?? EMPTY_ARRAY;\n\n/**\n * @param {Store} store The redux store\n * @param {string} dashboardId The dashboard ID to get data for\n * @returns {OpenedPanelMap} The map of panel IDs to components of all currently open components\n */\nexport const getOpenedPanelMapForDashboard = (store, dashboardId) =>\n getDashboardData(store, dashboardId).openedMap ?? EMPTY_MAP;\n"],"file":"selectors.js"}