@deephaven/dashboard 0.15.1 → 0.15.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.
Files changed (60) hide show
  1. package/dist/Dashboard.d.ts +2 -2
  2. package/dist/Dashboard.d.ts.map +1 -1
  3. package/dist/Dashboard.js.map +1 -1
  4. package/dist/DashboardLayout.d.ts.map +1 -1
  5. package/dist/DashboardLayout.js +2 -2
  6. package/dist/DashboardLayout.js.map +1 -1
  7. package/dist/PanelErrorBoundary.d.ts +17 -30
  8. package/dist/PanelErrorBoundary.d.ts.map +1 -1
  9. package/dist/PanelErrorBoundary.js +1 -8
  10. package/dist/PanelErrorBoundary.js.map +1 -1
  11. package/dist/PanelEvent.d.ts +4 -1
  12. package/dist/PanelEvent.d.ts.map +1 -1
  13. package/dist/PanelEvent.js.map +1 -1
  14. package/dist/PanelManager.d.ts +9 -9
  15. package/dist/PanelManager.d.ts.map +1 -1
  16. package/dist/PanelManager.js +6 -7
  17. package/dist/PanelManager.js.map +1 -1
  18. package/dist/PanelPlaceholder.d.ts +5 -3
  19. package/dist/PanelPlaceholder.d.ts.map +1 -1
  20. package/dist/PanelPlaceholder.js +1 -1
  21. package/dist/PanelPlaceholder.js.map +1 -1
  22. package/dist/declaration.d.js +2 -0
  23. package/dist/declaration.d.js.map +1 -0
  24. package/dist/layout/GLPropTypes.d.ts +2 -2
  25. package/dist/layout/GLPropTypes.d.ts.map +1 -1
  26. package/dist/layout/GLPropTypes.js.map +1 -1
  27. package/dist/layout/GoldenLayoutThemeExport.d.ts +1 -1
  28. package/dist/layout/GoldenLayoutThemeExport.d.ts.map +1 -1
  29. package/dist/layout/GoldenLayoutThemeExport.js.map +1 -1
  30. package/dist/layout/LayoutUtils.d.ts +121 -103
  31. package/dist/layout/LayoutUtils.d.ts.map +1 -1
  32. package/dist/layout/LayoutUtils.js +159 -102
  33. package/dist/layout/LayoutUtils.js.map +1 -1
  34. package/dist/layout/ReactDOM.d.ts.map +1 -1
  35. package/dist/layout/ReactDOM.js.map +1 -1
  36. package/dist/layout/golden-layout.d.ts +6 -1
  37. package/dist/layout/golden-layout.d.ts.map +1 -1
  38. package/dist/layout/golden-layout.js.map +1 -1
  39. package/dist/layout/hooks.d.ts +0 -1
  40. package/dist/layout/hooks.d.ts.map +1 -1
  41. package/dist/layout/jquery.d.ts.map +1 -1
  42. package/dist/layout/jquery.js.map +1 -1
  43. package/dist/redux/actionTypes.d.ts +1 -1
  44. package/dist/redux/actionTypes.d.ts.map +1 -1
  45. package/dist/redux/actionTypes.js.map +1 -1
  46. package/dist/redux/actions.d.ts +17 -2
  47. package/dist/redux/actions.d.ts.map +1 -1
  48. package/dist/redux/actions.js +4 -4
  49. package/dist/redux/actions.js.map +1 -1
  50. package/dist/redux/reducers/dashboardData.d.ts +1 -1
  51. package/dist/redux/reducers/dashboardData.d.ts.map +1 -1
  52. package/dist/redux/reducers/dashboardData.js.map +1 -1
  53. package/dist/redux/reducers/index.d.ts +3 -4
  54. package/dist/redux/reducers/index.d.ts.map +1 -1
  55. package/dist/redux/reducers/index.js.map +1 -1
  56. package/dist/redux/selectors.d.ts +28 -4
  57. package/dist/redux/selectors.d.ts.map +1 -1
  58. package/dist/redux/selectors.js +10 -10
  59. package/dist/redux/selectors.js.map +1 -1
  60. package/package.json +10 -8
@@ -1 +1 @@
1
- {"version":3,"file":"GLPropTypes.d.ts","sourceRoot":"","sources":["../../src/layout/GLPropTypes.js"],"names":[],"mappings":";AAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAmE"}
1
+ {"version":3,"file":"GLPropTypes.d.ts","sourceRoot":"","sources":["../../src/layout/GLPropTypes.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAkCnC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiD,CAAC;AAEnE,eAAe,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/layout/GLPropTypes.js"],"names":["PropTypes","Container","shape","on","func","off","isHidden","bool","tab","header","tabs","arrayOf","contentItem","title","string","setTitle","close","EventHub","emit","Layout","registerComponent","root","addChild","eventHub","GLPropTypes","Object","freeze"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,IAAMC,SAAS,GAAGD,SAAS,CAACE,KAAV,CAAgB;AAChCC,EAAAA,EAAE,EAAEH,SAAS,CAACI,IADkB;AAEhCC,EAAAA,GAAG,EAAEL,SAAS,CAACI,IAFiB;AAGhCE,EAAAA,QAAQ,EAAEN,SAAS,CAACO,IAHY;AAIhCC,EAAAA,GAAG,EAAER,SAAS,CAACE,KAAV,CAAgB;AACnBO,IAAAA,MAAM,EAAET,SAAS,CAACE,KAAV,CAAgB;AACtBQ,MAAAA,IAAI,EAAEV,SAAS,CAACW,OAAV,CACJX,SAAS,CAACE,KAAV,CAAgB;AACdU,QAAAA,WAAW,EAAEZ,SAAS,CAACE,KAAV,CAAgB,EAAhB;AADC,OAAhB,CADI;AADgB,KAAhB;AADW,GAAhB,CAJ2B;AAahCW,EAAAA,KAAK,EAAEb,SAAS,CAACc,MAbe;AAchCC,EAAAA,QAAQ,EAAEf,SAAS,CAACI,IAdY;AAehCY,EAAAA,KAAK,EAAEhB,SAAS,CAACI;AAfe,CAAhB,CAAlB;AAkBA,IAAMa,QAAQ,GAAGjB,SAAS,CAACE,KAAV,CAAgB;AAC/BC,EAAAA,EAAE,EAAEH,SAAS,CAACI,IADiB;AAE/BC,EAAAA,GAAG,EAAEL,SAAS,CAACI,IAFgB;AAG/Bc,EAAAA,IAAI,EAAElB,SAAS,CAACI;AAHe,CAAhB,CAAjB;AAMA,IAAMe,MAAM,GAAGnB,SAAS,CAACE,KAAV,CAAgB;AAC7BkB,EAAAA,iBAAiB,EAAEpB,SAAS,CAACI,IADA;AAE7BiB,EAAAA,IAAI,EAAErB,SAAS,CAACE,KAAV,CAAgB;AAAEoB,IAAAA,QAAQ,EAAEtB,SAAS,CAACI;AAAtB,GAAhB,CAFuB;AAG7BD,EAAAA,EAAE,EAAEH,SAAS,CAACI,IAHe;AAI7BC,EAAAA,GAAG,EAAEL,SAAS,CAACI,IAJc;AAK7BmB,EAAAA,QAAQ,EAAEN;AALmB,CAAhB,CAAf;AAQA,IAAMO,WAAW,GAAGC,MAAM,CAACC,MAAP,CAAc;AAAEzB,EAAAA,SAAF;AAAagB,EAAAA,QAAb;AAAuBE,EAAAA;AAAvB,CAAd,CAApB;AAEA,eAAeK,WAAf","sourcesContent":["import PropTypes from 'prop-types';\n\nconst Container = PropTypes.shape({\n on: PropTypes.func,\n off: PropTypes.func,\n isHidden: PropTypes.bool,\n tab: PropTypes.shape({\n header: PropTypes.shape({\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n contentItem: PropTypes.shape({}),\n })\n ),\n }),\n }),\n title: PropTypes.string,\n setTitle: PropTypes.func,\n close: PropTypes.func,\n});\n\nconst EventHub = PropTypes.shape({\n on: PropTypes.func,\n off: PropTypes.func,\n emit: PropTypes.func,\n});\n\nconst Layout = PropTypes.shape({\n registerComponent: PropTypes.func,\n root: PropTypes.shape({ addChild: PropTypes.func }),\n on: PropTypes.func,\n off: PropTypes.func,\n eventHub: EventHub,\n});\n\nconst GLPropTypes = Object.freeze({ Container, EventHub, Layout });\n\nexport default GLPropTypes;\n"],"file":"GLPropTypes.js"}
1
+ {"version":3,"sources":["../../src/layout/GLPropTypes.ts"],"names":["PropTypes","Container","shape","on","func","off","isHidden","bool","tab","header","tabs","arrayOf","contentItem","title","string","setTitle","close","EventHub","emit","Layout","registerComponent","root","addChild","eventHub","GLPropTypes","Object","freeze"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,YAAtB;AAEA,IAAMC,SAAS,GAAGD,SAAS,CAACE,KAAV,CAAgB;AAChCC,EAAAA,EAAE,EAAEH,SAAS,CAACI,IADkB;AAEhCC,EAAAA,GAAG,EAAEL,SAAS,CAACI,IAFiB;AAGhCE,EAAAA,QAA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n\nconst Container = PropTypes.shape({\n on: PropTypes.func,\n off: PropTypes.func,\n isHidden: PropTypes.bool,\n tab: PropTypes.shape({\n header: PropTypes.shape({\n tabs: PropTypes.arrayOf(\n PropTypes.shape({\n contentItem: PropTypes.shape({}),\n })\n ),\n }),\n }),\n title: PropTypes.string,\n setTitle: PropTypes.func,\n close: PropTypes.func,\n});\n\nconst EventHub = PropTypes.shape({\n on: PropTypes.func,\n off: PropTypes.func,\n emit: PropTypes.func,\n});\n\nconst Layout = PropTypes.shape({\n registerComponent: PropTypes.func,\n root: PropTypes.shape({ addChild: PropTypes.func }),\n on: PropTypes.func,\n off: PropTypes.func,\n eventHub: EventHub,\n});\n\nconst GLPropTypes = Object.freeze({ Container, EventHub, Layout });\n\nexport default GLPropTypes;\n"],"file":"GLPropTypes.js"}
@@ -1,4 +1,4 @@
1
- declare var _default: Readonly<{
1
+ declare const _default: Readonly<{
2
2
  tabHeight: number;
3
3
  dragBorderWidth: number;
4
4
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"GoldenLayoutThemeExport.d.ts","sourceRoot":"","sources":["../../src/layout/GoldenLayoutThemeExport.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"GoldenLayoutThemeExport.d.ts","sourceRoot":"","sources":["../../src/layout/GoldenLayoutThemeExport.ts"],"names":[],"mappings":";;;;AAGA,wBAGG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/layout/GoldenLayoutThemeExport.js"],"names":["GoldenLayout","Object","freeze","tabHeight","parseInt","dragBorderWidth"],"mappings":"OAAOA,Y,mCAEP;;AACA,eAAeC,MAAM,CAACC,MAAP,CAAc;AAC3BC,EAAAA,SAAS,EAAEC,QAAQ,CAACJ,YAAY,CAAC,YAAD,CAAb,EAA6B,EAA7B,CADQ;AAE3BK,EAAAA,eAAe,EAAED,QAAQ,CAACJ,YAAY,CAAC,mBAAD,CAAb,EAAoC,EAApC;AAFE,CAAd,CAAf","sourcesContent":["import GoldenLayout from './GoldenLayout.module.scss';\n\n// parseInt for unitless values, stripping \"px\"\nexport default Object.freeze({\n tabHeight: parseInt(GoldenLayout['tab-height'], 10),\n dragBorderWidth: parseInt(GoldenLayout['drag-border-width'], 10),\n});\n"],"file":"GoldenLayoutThemeExport.js"}
1
+ {"version":3,"sources":["../../src/layout/GoldenLayoutThemeExport.ts"],"names":["GoldenLayout","Object","freeze","tabHeight","parseInt","dragBorderWidth"],"mappings":"OAAOA,Y,mCAEP;;AACA,eAAeC,MAAM,CAACC,MAAP,CAAc;AAC3BC,EAAAA,SAAS,EAAEC,QAAQ,CAACJ,YAAY,CAAC,YAAD,CAAb,EAA6B,EAA7B,CADQ;AAE3BK,EAAAA,eAAe,EAAED,QAAQ,CAACJ,YAAY,CAAC,mBAAD,CAAb,EAAoC,EAApC;AAFE,CAAd,CAAf","sourcesContent":["import GoldenLayout from './GoldenLayout.module.scss';\n\n// parseInt for unitless values, stripping \"px\"\nexport default Object.freeze({\n tabHeight: parseInt(GoldenLayout['tab-height'], 10),\n dragBorderWidth: parseInt(GoldenLayout['drag-border-width'], 10),\n});\n"],"file":"GoldenLayoutThemeExport.js"}
@@ -1,61 +1,72 @@
1
- export default LayoutUtils;
1
+ import { DragEvent } from 'react';
2
+ import GoldenLayout, { Config, Container, ContentItem, ItemConfig, ItemConfigType, ReactComponentConfig, Tab } from '@deephaven/golden-layout';
3
+ import { DashboardLayoutConfig } from '../DashboardLayout';
4
+ import { PanelComponent, PanelConfig } from '../DashboardPlugin';
5
+ declare type LayoutConfig = {
6
+ id?: string;
7
+ component?: string;
8
+ };
9
+ export declare type StackItemConfig = ItemConfig & {
10
+ activeItemIndex?: number;
11
+ };
12
+ export declare function isReactComponentConfig(config: ItemConfigType): config is ReactComponentConfig;
2
13
  declare class LayoutUtils {
3
14
  static DEFAULT_FOCUS_SELECTOR: string;
4
- static activateTab(root: any, config: any): void;
15
+ static activateTab(root: ContentItem, config: Partial<ItemConfigType>): void;
5
16
  /**
6
17
  * Is the tab with the given config active
7
- * @param {ContentItem} root A GoldenLayout content item with the tab
8
- * @param {Object} config Tab config to match
9
- * @returns {boolean} True if the tab is active
18
+ * @param root A GoldenLayout content item with the tab
19
+ * @param config Tab config to match
20
+ * @returns True if the tab is active
10
21
  */
11
- static isActiveTab(root: ContentItem, config: Object): boolean;
22
+ static isActiveTab(root: ContentItem, config: Config): boolean;
12
23
  /**
13
24
  * Adds a stack to the root layout specified. Adds to the first row/column with only one item
14
- * @param {ContentItem} root A GoldenLayout content item to add the stack to
25
+ * @param parent A GoldenLayout content item to add the stack to
15
26
  * @returns The newly created stack.
16
27
  */
17
- static addStack(parent: any, columnPreferred?: boolean): any;
28
+ static addStack(parent: ContentItem, columnPreferred?: boolean): ContentItem;
18
29
  /**
19
30
  * Gets the first stack which contains a contentItem with the given config values
20
- * @param {ContentItem} item Golden layout content item to search for the stack
21
- * @param {Config} config The item properties to match
31
+ * @param item Golden layout content item to search for the stack
32
+ * @param config The item properties to match
22
33
  */
23
- static getStackForConfig(item: ContentItem, config?: Config, allowEmptyStack?: boolean): any;
34
+ static getStackForConfig(item: ContentItem, config?: Partial<ItemConfigType>, allowEmptyStack?: boolean): ContentItem | null;
24
35
  /**
25
36
  * Gets a stack matching the specified config
26
- * @param {Config} config The item config type to match, eg. { component: 'IrisGridPanel', title: 'Table Name' }
27
- * @param {boolean} createIfNecessary Whether to create the stack if it does not exist.
28
- * @param {boolean} matchComponentType If the config doesn't match exactly, just find another one of the same component type
29
- * @param {boolean} allowEmptyStack If no configs match, search for an empty stack that can be used
37
+ * @param root The root GoldenLayout element
38
+ * @param config The item config type to match, eg. { component: 'IrisGridPanel', title: 'Table Name' }
39
+ * @param createIfNecessary Whether to create the stack if it does not exist.
40
+ * @param matchComponentType If the config doesn't match exactly, just find another one of the same component type
41
+ * @param allowEmptyStack If no configs match, search for an empty stack that can be used
30
42
  */
31
- static getStackForRoot(root: any, config: Config, createIfNecessary?: boolean, matchComponentType?: boolean, allowEmptyStack?: boolean): any;
43
+ static getStackForRoot(root: ContentItem, config: Partial<ReactComponentConfig>, createIfNecessary?: boolean, matchComponentType?: boolean, allowEmptyStack?: boolean): ContentItem | null;
32
44
  /**
33
45
  * Gets a stack matching one of the specified types, creates new stack if necessary
34
- * @param {ContentItem} root The GoldenLayout root to find or create the stack in
35
- * @param {Array[string]} types The array of component types to match
36
- * @param {boolean} createIfNecessary Whether to create the stack if it does not exist
37
- * @param {boolean} matchComponentType If the config doesn't match exactly, just find another one of the same component type
38
- * @param {boolean} allowEmptyStack If no configs match, search for an empty stack that can be used
46
+ * @param root The GoldenLayout root to find or create the stack in
47
+ * @param types The array of component types to match
48
+ * @param createIfNecessary Whether to create the stack if it does not exist
49
+ * @param matchComponentType If the config doesn't match exactly, just find another one of the same component type
50
+ * @param allowEmptyStack If no configs match, search for an empty stack that can be used
39
51
  */
40
- static getStackForComponentTypes(root: ContentItem, types: any, createIfNecessary?: boolean, matchComponentType?: boolean, allowEmptyStack?: boolean): any;
52
+ static getStackForComponentTypes(root: ContentItem, types: string[], createIfNecessary?: boolean, matchComponentType?: boolean, allowEmptyStack?: boolean): ContentItem | null;
41
53
  /**
42
54
  * Gets first content item with the specified config in stack.
43
- * @param {ContentItem} stack The stack to search for the item
44
- * @param {Config} config The item config type to match, eg. { component: 'IrisGridPanel', title: 'Table Name' }
45
- * @returns {ContentItem} Returns the found content item, null if not found.
55
+ * @param stack The stack to search for the item
56
+ * @param config The item config type to match, eg. { component: 'IrisGridPanel', title: 'Table Name' }
57
+ * @returns Returns the found content item, null if not found.
46
58
  */
47
- static getContentItemInStack(stack: ContentItem, config: Config): ContentItem;
59
+ static getContentItemInStack(stack: ContentItem | null, config: Partial<ItemConfigType>): ContentItem | null;
48
60
  /**
49
61
  * Removes dynamic props from components in the given config so this config could be serialized
50
- * @param {Array} config Config object
51
- * @param {(name: string, config: PanelConfig) => PanelConfig | null}
52
- * @returns {Array} Dehydrated config
62
+ * @param config Config objec
63
+ * @returns Dehydrated config
53
64
  */
54
- static dehydrateLayoutConfig(config: any[], dehydrateComponent: any): any[];
55
- static getTabPoint(glContainer: any): any[];
65
+ static dehydrateLayoutConfig(config: ItemConfigType[], dehydrateComponent: (componentName: string, config: ItemConfigType) => PanelConfig): (PanelConfig | ItemConfig)[];
66
+ static getTabPoint(glContainer: Container): [number, number];
56
67
  /**
57
68
  * Drop minor changes in Layout Configuration for deep comparison
58
- * @param {Object} config Layout Configuration
69
+ * @param config Layout Configuration
59
70
  *
60
71
  * minor changes:
61
72
  * 1. sorts in grid
@@ -64,125 +75,132 @@ declare class LayoutUtils {
64
75
  *
65
76
  * item id is also removed
66
77
  */
67
- static dropLayoutMinorChange(config: Object): void;
78
+ static dropLayoutMinorChange(config: DashboardLayoutConfig): void;
68
79
  /**
69
80
  * Compare two layouts to see if they are equivalent
70
- * @param {object} layout1 A Golden Layout config object
71
- * @param {object} layout2 Another Golden layout config object
72
- * @param {boolean} major When true, will ignore "minor" property differences (eg. sorts)
81
+ * @param layout1 A Golden Layout config object
82
+ * @param layout2 Another Golden layout config object
83
+ * @param major When true, will ignore "minor" property differences (eg. sorts)
73
84
  */
74
- static isEqual(layout1: object, layout2: object, major?: boolean): boolean;
75
- static cloneLayout(layout: any): any;
85
+ static isEqual(layout1: DashboardLayoutConfig, layout2: DashboardLayoutConfig, major?: boolean): boolean;
86
+ static cloneLayout(layout: DashboardLayoutConfig): DashboardLayoutConfig;
76
87
  /**
77
88
  * Adds dynamic props to components in the given config so this config could be used to initialize a layout
78
- * @param {GoldenLayout.Config} config Dehydrated config object
79
- * @param {(name: string, config: PanelProps) => PanelProps} hydrateComponent Function to hydrate the component
80
- * @returns {Array} Hydrated config
89
+ * @param config Dehydrated config object
90
+ * @param hydrateComponent Function to hydrate the component
91
+ * @returns Hydrated config
81
92
  */
82
- static hydrateLayoutConfig(config: GoldenLayout.Config, hydrateComponent: (name: string, config: PanelProps) => PanelProps): any[];
93
+ static hydrateLayoutConfig(config: (PanelConfig | ItemConfig)[], hydrateComponent: (componentName: string, config: PanelConfig | ItemConfig) => ReactComponentConfig): DashboardLayoutConfig;
83
94
  /**
84
95
  * Opens a component. It will try and open the component in an existing stack of the same component.
85
96
  * If `replaceExisting` is true and there is a component found with the same `config.id`, it will replace that component with this one.
86
97
  * 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).
87
- * @param {ContentItem} root The GoldenLayout root to open the component in
88
- * @param {Config} config The component config definition to open
89
- * @param {Boolean} replaceExisting Whether it should replace the existing one matching component type and id, or open a new one
90
- * @param {Config} replaceConfig The component config to replace
91
- * @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.
92
- * @param {String} focusElement The element to focus on
93
- * @param {MouseEvent} dragEvent Whether component is being created with a drag, mouse event is initial position for drag proxy
94
- */
95
- static openComponent({ root, config: configParam, replaceExisting, replaceConfig, createNewStack, focusElement, dragEvent, }?: ContentItem): void;
98
+ * @param root The GoldenLayout root to open the component in
99
+ * @param config The component config definition to open
100
+ * @param replaceExisting Whether it should replace the existing one matching component type and id, or open a new one
101
+ * @param replaceConfig The component config to replace
102
+ * @param createNewStack True to force opening in a new stack, false to try and open in a stack with the same type of component.
103
+ * @param focusElement The element to focus on
104
+ * @param dragEvent Whether component is being created with a drag, mouse event is initial position for drag proxy
105
+ */
106
+ static openComponent({ root, config: configParam, replaceExisting, replaceConfig, createNewStack, focusElement, dragEvent, }?: {
107
+ root?: ContentItem;
108
+ config?: ReactComponentConfig;
109
+ replaceExisting?: boolean;
110
+ replaceConfig?: Partial<ItemConfigType>;
111
+ createNewStack?: boolean;
112
+ focusElement?: string;
113
+ dragEvent?: DragEvent;
114
+ }): void;
96
115
  /**
97
116
  * Opens a component in an given stack.
98
117
  * If `replaceExisting` is true and there is a component found with the same `config.id`, it will replace that component with this one
99
- * @param {ContentItem} stack The GoldenLayout stack to open the component in
100
- * @param {Config} config The component config definition to open
101
- * @param {Boolean} replaceExisting Whether it should replace the existing one matching component type and id, or open a new one
118
+ * @param stack The GoldenLayout stack to open the component in
119
+ * @param config The component config definition to open
120
+ * @param replaceExisting Whether it should replace the existing one matching component type and id, or open a new one
102
121
  */
103
- static openComponentInStack(stack: ContentItem, config: Config, replaceExisting?: boolean): void;
122
+ static openComponentInStack(stack: ContentItem | null, config: ItemConfigType, replaceExisting?: boolean): void;
104
123
  /**
105
124
  * Close the specified component and remove it from the stack it's currently in
106
- * @param {ContentItem} root The GoldenLayout root to search and close the component in
107
- * @param {Config} config The GoldenLayout component config definition to close, eg. { component: 'IrisGridPanel', id: 'table-t' }
125
+ * @param root The GoldenLayout root to search and close the component in
126
+ * @param config The GoldenLayout component config definition to close, eg. { component: 'IrisGridPanel', id: 'table-t' }
108
127
  */
109
- static closeComponent(root: ContentItem, config: Config): void;
110
- static renameComponent(root: any, config: any, newTitle: any): void;
128
+ static closeComponent(root: ContentItem, config: LayoutConfig): void;
129
+ static renameComponent(root: ContentItem, config: Partial<ItemConfigType>, newTitle: string): void;
111
130
  /**
112
131
  * Create a component clone based on the given config
113
- * @param {ContentItem} root The GoldenLayout root to clone the component in
114
- * @param {Config} config The config to clone
115
- * @returns {Config} Clone config
132
+ * @param root The GoldenLayout root to clone the component in
133
+ * @param config The config to clone
134
+ * @returns Clone config
116
135
  */
117
- static cloneComponent(root: ContentItem, config: Config): Config;
136
+ static cloneComponent(root: ContentItem, config: ReactComponentConfig): ReactComponentConfig | null;
118
137
  /**
119
138
  * Get panel component state for the given config
120
- * @param {Object} config Panel config
121
- * @returns {Object} Panel state
122
- */
123
- static getPanelComponentState(config: Object): Object;
124
- static makeDefaultLayout(): {
125
- dimensions: {
126
- headerHeight: number;
127
- borderWidth: number;
128
- borderGrabWidth: number;
129
- };
130
- settings: {
131
- showPopoutIcon: boolean;
132
- showCloseIcon: boolean;
133
- constrainDragToContainer: boolean;
134
- };
135
- };
139
+ * @param config Panel config
140
+ * @returns Panel state
141
+ */
142
+ static getPanelComponentState(config: ItemConfigType): unknown;
143
+ static makeDefaultLayout(): Config;
136
144
  /**
137
145
  * Gets a containers root node
138
- * @param {GlContainer} container The Golden Layout container to get the root for
146
+ * @param container The Golden Layout container to get the root for
139
147
  */
140
- static getRootFromContainer(container: GlContainer): any;
148
+ static getRootFromContainer(container: Container): ContentItem;
141
149
  /**
142
150
  * Gets the config for the panel component given a glContainer
143
- * @param {GlContainer} container The Golden Layout container to get the config for
151
+ * @param container The Golden Layout container to get the config for
144
152
  */
145
- static getComponentConfigFromContainer(container: GlContainer): any;
146
- static getTitleFromContainer(container: any): any;
147
- static getTitleFromTab(tab: any): any;
153
+ static getComponentConfigFromContainer(container?: Container): ItemConfigType | null;
154
+ static getTitleFromContainer(container: Container): string | null | undefined;
155
+ static getTitleFromTab(tab: Tab): string | null | undefined;
148
156
  /**
149
157
  * Retrieve the panel ID for the provided golden layout container
150
- * @param {GlContainer} glContainer The container to get the panel ID for
151
- * @returns {string|null} Panel ID
158
+ * @param glContainer The container to get the panel ID for
159
+ * @returns Panel ID
152
160
  */
153
- static getIdFromContainer(glContainer: GlContainer): string | null;
161
+ static getIdFromContainer(glContainer: Container): string | string[] | null | undefined;
154
162
  /**
155
163
  * Retrieve the ID of the panel provided
156
- * @param {Component} panel The panel to get the ID for
157
- * @returns {string|null} Panel ID
164
+ * @param panel The panel to get the ID for
165
+ * @returns Panel ID
158
166
  */
159
- static getIdFromPanel(panel: Component): string | null;
167
+ static getIdFromPanel(panel: PanelComponent): string | string[] | null | undefined;
160
168
  /**
161
169
  * Get component name from the panel instance
162
- * @param {Component} panel Panel to get component name for
163
- * @returns {string} Component name or null if unable to retrieve name
170
+ * @param panel Panel to get component name for
171
+ * @returns Component name or null if unable to retrieve name
164
172
  */
165
- static getComponentNameFromPanel(panel: Component): string;
173
+ static getComponentNameFromPanel(panel: {
174
+ props: {
175
+ glContainer: GoldenLayout.Container;
176
+ };
177
+ }): string | null;
166
178
  /**
167
179
  * Get component name for wrapped and un-wrapped components
168
- * @param {Component} component Component to get name for
169
- * @returns {string} Component name
180
+ * @param component Component to get name for
181
+ * @returns Component name
170
182
  * @throws If displayName for the component is not defined
171
183
  */
172
- static getComponentName(component: Component): string;
184
+ static getComponentName(component: {
185
+ displayName?: string;
186
+ WrappedComponent?: {
187
+ displayName: string;
188
+ };
189
+ }): string;
173
190
  /**
174
191
  * Put focus on the first "input" element (input, button, select, textarea) within an element
175
192
  * If element is null or input element not found, does nothing
176
- * @param {DOMElement} element The element to put focus in.
177
- * @param {String} selector The first element matching this selector will be focused.
178
- * @returns {DOMElement} The element that was focused, null if not focused
193
+ * @param element The element to put focus in.
194
+ * @param selector The first element matching this selector will be focused.
195
+ * @returns The element that was focused, null if not focused
179
196
  */
180
- static focusElement(element: DOMElement, selector?: string): DOMElement;
197
+ static focusElement(element: Element, selector?: string): Element | null;
181
198
  /**
182
199
  * Get a promise that initializes when layout is initialized
183
- * @param {GoldenLayout} layout The layout to await initialization on
200
+ * @param layout The layout to await initialization on
184
201
  * @returns Promise that resolves when layout is initialized
185
202
  */
186
- static onInitialized(layout: GoldenLayout): Promise<any>;
203
+ static onInitialized(layout: GoldenLayout): Promise<void>;
187
204
  }
205
+ export default LayoutUtils;
188
206
  //# sourceMappingURL=LayoutUtils.d.ts.map
@@ -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,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"}
1
+ {"version":3,"file":"LayoutUtils.d.ts","sourceRoot":"","sources":["../../src/layout/LayoutUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,YAAY,EAAE,EAEnB,MAAM,EACN,SAAS,EACT,WAAW,EACX,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,GAAG,EACJ,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjE,aAAK,YAAY,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,oBAAY,eAAe,GAAG,UAAU,GAAG;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,cAAc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