@deephaven/golden-layout 1.10.2 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LayoutManager.d.ts +1 -1
- package/dist/container/ItemContainer.d.ts +8 -5
- package/dist/container/ItemContainer.d.ts.map +1 -1
- package/dist/container/ItemContainer.js +9 -7
- package/dist/container/ItemContainer.js.map +1 -1
- package/dist/utils/ReactComponentHandler.d.ts +2 -2
- package/dist/utils/ReactComponentHandler.d.ts.map +1 -1
- package/dist/utils/ReactComponentHandler.js +13 -9
- package/dist/utils/ReactComponentHandler.js.map +1 -1
- package/package.json +3 -3
package/dist/LayoutManager.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ export declare class LayoutManager extends EventEmitter {
|
|
|
116
116
|
* Returns a previously registered component
|
|
117
117
|
* @param name The name used
|
|
118
118
|
*/
|
|
119
|
-
getComponent(name: string): React.Component<{}, {}, any> |
|
|
119
|
+
getComponent(name: string): ComponentConstructor<ComponentConfig> | ComponentConstructor<ReactComponentConfig> | React.Component<{}, {}, any> | React.ComponentType<{}>;
|
|
120
120
|
/**
|
|
121
121
|
* Returns a fallback component to render in place of unregistered components
|
|
122
122
|
*
|
|
@@ -15,6 +15,7 @@ export default class ItemContainer<C extends ComponentConfig | ReactComponentCon
|
|
|
15
15
|
tab?: Tab;
|
|
16
16
|
_config: C & {
|
|
17
17
|
componentState: Record<string, unknown>;
|
|
18
|
+
persistedState?: unknown;
|
|
18
19
|
};
|
|
19
20
|
isHidden: boolean;
|
|
20
21
|
beforeCloseHandler: ((options?: CloseOptions) => boolean) | null;
|
|
@@ -77,19 +78,21 @@ export default class ItemContainer<C extends ComponentConfig | ReactComponentCon
|
|
|
77
78
|
*/
|
|
78
79
|
getConfig(): C & {
|
|
79
80
|
componentState: Record<string, unknown>;
|
|
81
|
+
persistedState?: unknown;
|
|
80
82
|
};
|
|
81
83
|
/**
|
|
82
|
-
*
|
|
84
|
+
* Notifies the layout manager of a stateupdate
|
|
83
85
|
*
|
|
84
86
|
* @param state
|
|
85
87
|
*/
|
|
86
|
-
|
|
88
|
+
setState(state: Record<string, unknown>): void;
|
|
87
89
|
/**
|
|
88
|
-
*
|
|
90
|
+
* Sets persisted state for functional components
|
|
91
|
+
* which do not have lifecycle methods to hook into.
|
|
89
92
|
*
|
|
90
|
-
* @param state
|
|
93
|
+
* @param state The state to persist
|
|
91
94
|
*/
|
|
92
|
-
|
|
95
|
+
setPersistedState(state: unknown): void;
|
|
93
96
|
/**
|
|
94
97
|
* Set's the components title
|
|
95
98
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemContainer.d.ts","sourceRoot":"","sources":["../../src/container/ItemContainer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EAEpB,eAAe,EAChB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,GAAG,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAAuB,SAAS,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,aAAa,MAAM,kBAAkB,CAAC;AAClD,OAAO,YAAY,MAAM,uBAAuB,CAAC;AAEjD,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/C,MAAM,CAAC,OAAO,OAAO,aAAa,CAChC,CAAC,SAAS,eAAe,GAAG,oBAAoB,GAAG,eAAe,CAClE,SAAQ,YAAY;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM,EAAE,SAAS,CAAC;IAElB,aAAa,EAAE,aAAa,CAAC;IAE7B,GAAG,CAAC,EAAE,GAAG,CAAC;IAGV,OAAO,EAAE,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"ItemContainer.d.ts","sourceRoot":"","sources":["../../src/container/ItemContainer.ts"],"names":[],"mappings":"AAC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AAO,CAAC,EAAE,YAAY;IAW5B;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,GAAG,IAAI;IAIlE;;;;OAIG;IACH,QAAQ;IAIR;;;;OAIG;IACH,SAAS;wBAnKS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;yBACtB,OAAO;;IAsK1B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAKvC;;;;;OAKG;IACH,iBAAiB,CAAC,KAAK,EAAE,OAAO;IAKhC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM;IAItB;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,SAAI,EAAE,MAAM,SAAI;CAahC"}
|
|
@@ -155,21 +155,23 @@ export default class ItemContainer extends EventEmitter {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
|
-
*
|
|
158
|
+
* Notifies the layout manager of a stateupdate
|
|
159
159
|
*
|
|
160
160
|
* @param state
|
|
161
161
|
*/
|
|
162
|
-
|
|
163
|
-
this.
|
|
162
|
+
setState(state) {
|
|
163
|
+
this._config.componentState = state;
|
|
164
|
+
this.parent.emitBubblingEvent('stateChanged');
|
|
164
165
|
}
|
|
165
166
|
|
|
166
167
|
/**
|
|
167
|
-
*
|
|
168
|
+
* Sets persisted state for functional components
|
|
169
|
+
* which do not have lifecycle methods to hook into.
|
|
168
170
|
*
|
|
169
|
-
* @param state
|
|
171
|
+
* @param state The state to persist
|
|
170
172
|
*/
|
|
171
|
-
|
|
172
|
-
this._config.
|
|
173
|
+
setPersistedState(state) {
|
|
174
|
+
this._config.persistedState = state;
|
|
173
175
|
this.parent.emitBubblingEvent('stateChanged');
|
|
174
176
|
}
|
|
175
177
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemContainer.js","names":["$","isGLComponentConfig","EventEmitter","ItemContainer","constructor","config","parent","layoutManager","_defineProperty","join","title","componentName","_config","_contentElement","_element","find","beforeCloseHandler","getElement","hide","emit","isHidden","show","height","width","setSize","_this$direction","_rowOrColumnChild$con","_rowOrColumnChild$con2","rowOrColumn","rowOrColumnChild","isColumn","isRow","_rowOrColumn","isRoot","direction","newSize","totalPixel","percentage","delta","contentItems","length","i","_rowOrColumn$contentI","callDownwards","close","options","_this$beforeCloseHand","_this$beforeCloseHand2","isClosable","call","beforeClose","callback","getState","componentState","getConfig","extendState","state","setState","extend","emitBubblingEvent","setTitle","_$setSize","arguments","undefined","cl","hdelta","offsetWidth","clientWidth","vdelta","offsetHeight","clientHeight"],"sources":["../../src/container/ItemContainer.ts"],"sourcesContent":["import $ from 'jquery';\nimport {\n ReactComponentConfig,\n isGLComponentConfig,\n ComponentConfig,\n} from '../config';\nimport type Tab from '../controls/Tab';\nimport type { AbstractContentItem, Component } from '../items';\nimport type LayoutManager from '../LayoutManager';\nimport EventEmitter from '../utils/EventEmitter';\n\nexport type CloseOptions = { force?: boolean };\n\nexport default class ItemContainer<\n C extends ComponentConfig | ReactComponentConfig = ComponentConfig,\n> extends EventEmitter {\n width?: number;\n height?: number;\n\n title?: string;\n\n parent: Component;\n\n layoutManager: LayoutManager;\n\n tab?: Tab;\n\n // This type is to make TS happy and allow ReactComponentConfig passed to container generic\n _config: C & { componentState: Record<string, unknown> };\n\n isHidden = false;\n\n beforeCloseHandler: ((options?: CloseOptions) => boolean) | null;\n\n _element = $(\n [\n '<div class=\"lm_item_container\">',\n '<div class=\"lm_content\" tabindex=\"-1\"></div>',\n '</div>',\n ].join('')\n );\n\n _contentElement: JQuery<HTMLElement>;\n\n constructor(config: C, parent: Component, layoutManager: LayoutManager) {\n super();\n\n this.title = isGLComponentConfig(config) ? config.componentName : '';\n this.parent = parent;\n this.layoutManager = layoutManager;\n\n this._config = config as C & { componentState: Record<string, unknown> };\n\n this._contentElement = this._element.find('.lm_content');\n\n this.beforeCloseHandler = null;\n }\n\n /**\n * Get the inner DOM element the container's content\n * is intended to live in\n */\n getElement() {\n return this._contentElement;\n }\n\n /**\n * Hide the container. Notifies the containers content first\n * and then hides the DOM node. If the container is already hidden\n * this should have no effect\n */\n hide() {\n this.emit('hide');\n this.isHidden = true;\n this._element.hide();\n }\n\n /**\n * Shows a previously hidden container. Notifies the\n * containers content first and then shows the DOM element.\n * If the container is already visible this has no effect.\n */\n show() {\n this.emit('show');\n this.isHidden = false;\n this._element.show();\n // call shown only if the container has a valid size\n if (this.height != 0 || this.width != 0) {\n this.emit('shown');\n }\n }\n\n /**\n * Set the size from within the container. Traverses up\n * the item tree until it finds a row or column element\n * and resizes its items accordingly.\n *\n * If this container isn't a descendant of a row or column\n * it returns false\n * @todo Rework!!!\n * @param width The new width in pixel\n * @param height The new height in pixel\n *\n * @returns resizeSuccesful\n */\n setSize(width: number, height: number) {\n let rowOrColumn: AbstractContentItem | null = this.parent;\n let rowOrColumnChild: AbstractContentItem | null = null;\n\n while (rowOrColumn && !rowOrColumn.isColumn && !rowOrColumn.isRow) {\n rowOrColumnChild = rowOrColumn;\n rowOrColumn = rowOrColumn.parent;\n\n /**\n * No row or column has been found\n */\n if (rowOrColumn?.isRoot) {\n return false;\n }\n }\n\n if (!rowOrColumn || !rowOrColumnChild) {\n return false;\n }\n\n const direction = rowOrColumn.isColumn ? 'height' : 'width';\n const newSize = direction === 'height' ? height : width;\n\n const totalPixel =\n (this[direction] ?? 0) *\n (1 / ((rowOrColumnChild.config[direction] ?? 0) / 100));\n const percentage = (newSize / totalPixel) * 100;\n const delta =\n ((rowOrColumnChild.config[direction] ?? 0) - percentage) /\n (rowOrColumn.contentItems.length - 1);\n\n for (let i = 0; i < rowOrColumn.contentItems.length; i++) {\n if (rowOrColumn.contentItems[i] === rowOrColumnChild) {\n rowOrColumn.contentItems[i].config[direction] = percentage;\n } else {\n rowOrColumn.contentItems[i].config[direction] =\n (rowOrColumn.contentItems[i].config[direction] ?? 0) + delta;\n }\n }\n\n rowOrColumn.callDownwards('setSize');\n\n return true;\n }\n\n /**\n * Closes the container if it is closable. Can be called by\n * both the component within at as well as the contentItem containing\n * it. Emits a close event before the container itself is closed.\n * @param options Options to pass into the beforeClose handler\n */\n close(options?: CloseOptions) {\n // Not closable, don't do anything\n if (!this._config.isClosable) return;\n\n // If beforeCloseHandler returns true or if the handler doesn't exist, close\n if (this.beforeCloseHandler?.(options) ?? true) {\n this.emit('close');\n this.parent.close();\n }\n }\n\n /**\n * Sets the beforeCloseHandler to callback\n * @param callback Callback function to call before closing\n */\n beforeClose(callback: ((options?: CloseOptions) => boolean) | null) {\n this.beforeCloseHandler = callback;\n }\n\n /**\n * Returns the current state object\n *\n * @returns state\n */\n getState() {\n return this._config.componentState;\n }\n\n /**\n * Returns the object's config\n *\n * @returns id\n */\n getConfig() {\n return this._config;\n }\n\n /**\n * Merges the provided state into the current one\n *\n * @param state\n */\n extendState(state: string) {\n this.setState($.extend(true, this.getState(), state));\n }\n\n /**\n * Notifies the layout manager of a stateupdate\n *\n * @param state\n */\n setState(state: Record<string, unknown>) {\n this._config.componentState = state;\n this.parent.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Set's the components title\n *\n * @param title\n */\n setTitle(title: string) {\n this.parent.setTitle(title);\n }\n\n /**\n * Set's the containers size. Called by the container's component.\n * To set the size programmatically from within the container please\n * use the public setSize method\n *\n * @param width in px\n * @param height in px\n */\n _$setSize(width = 0, height = 0) {\n if (width !== this.width || height !== this.height) {\n this.width = width;\n this.height = height;\n var cl = this._contentElement[0];\n var hdelta = cl.offsetWidth - cl.clientWidth;\n var vdelta = cl.offsetHeight - cl.clientHeight;\n this._contentElement\n .width(this.width - hdelta)\n .height(this.height - vdelta);\n this.emit('resize');\n }\n }\n}\n"],"mappings":";;;AAAA,OAAOA,CAAC,MAAM,QAAQ;AAAC,SAGrBC,mBAAmB;AAAA,OAMdC,YAAY;AAInB,eAAe,MAAMC,aAAa,SAExBD,YAAY,CAAC;EA6BrBE,WAAWA,CA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AAE,CAACE,WAAW,GAAGF,EAAE,CAACG,WAAW;MAC5C,IAAIC,MAAM,GAAGJ,EAAE,CAACK,YAAY,GAAGL,EAAE,CAACM,YAAY;MAC9C,IAAI,CAACzD,eAAe,CACjBU,KAAK,CAAC,IAAI,CAACA,KAAK,GAAG0C,MAAM,CAAC,CAC1B3C,MAAM,CAAC,IAAI,CAACA,MAAM,GAAG8C,MAAM,CAAC;MAC/B,IAAI,CAACjD,IAAI,CAAC,QAAQ,CAAC;IACrB;EACF;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ItemContainer.js","names":["$","isGLComponentConfig","EventEmitter","ItemContainer","constructor","config","parent","layoutManager","_defineProperty","join","title","componentName","_config","_contentElement","_element","find","beforeCloseHandler","getElement","hide","emit","isHidden","show","height","width","setSize","_this$direction","_rowOrColumnChild$con","_rowOrColumnChild$con2","rowOrColumn","rowOrColumnChild","isColumn","isRow","_rowOrColumn","isRoot","direction","newSize","totalPixel","percentage","delta","contentItems","length","i","_rowOrColumn$contentI","callDownwards","close","options","_this$beforeCloseHand","_this$beforeCloseHand2","isClosable","call","beforeClose","callback","getState","componentState","getConfig","setState","state","emitBubblingEvent","setPersistedState","persistedState","setTitle","_$setSize","arguments","undefined","cl","hdelta","offsetWidth","clientWidth","vdelta","offsetHeight","clientHeight"],"sources":["../../src/container/ItemContainer.ts"],"sourcesContent":["import $ from 'jquery';\nimport {\n ReactComponentConfig,\n isGLComponentConfig,\n ComponentConfig,\n} from '../config';\nimport type Tab from '../controls/Tab';\nimport type { AbstractContentItem, Component } from '../items';\nimport type LayoutManager from '../LayoutManager';\nimport EventEmitter from '../utils/EventEmitter';\n\nexport type CloseOptions = { force?: boolean };\n\nexport default class ItemContainer<\n C extends ComponentConfig | ReactComponentConfig = ComponentConfig,\n> extends EventEmitter {\n width?: number;\n height?: number;\n\n title?: string;\n\n parent: Component;\n\n layoutManager: LayoutManager;\n\n tab?: Tab;\n\n // This type is to make TS happy and allow ReactComponentConfig passed to container generic\n _config: C & {\n componentState: Record<string, unknown>;\n persistedState?: unknown;\n };\n\n isHidden = false;\n\n beforeCloseHandler: ((options?: CloseOptions) => boolean) | null;\n\n _element = $(\n [\n '<div class=\"lm_item_container\">',\n '<div class=\"lm_content\" tabindex=\"-1\"></div>',\n '</div>',\n ].join('')\n );\n\n _contentElement: JQuery<HTMLElement>;\n\n constructor(config: C, parent: Component, layoutManager: LayoutManager) {\n super();\n\n this.title = isGLComponentConfig(config) ? config.componentName : '';\n this.parent = parent;\n this.layoutManager = layoutManager;\n\n this._config = config as C & { componentState: Record<string, unknown> };\n\n this._contentElement = this._element.find('.lm_content');\n\n this.beforeCloseHandler = null;\n }\n\n /**\n * Get the inner DOM element the container's content\n * is intended to live in\n */\n getElement() {\n return this._contentElement;\n }\n\n /**\n * Hide the container. Notifies the containers content first\n * and then hides the DOM node. If the container is already hidden\n * this should have no effect\n */\n hide() {\n this.emit('hide');\n this.isHidden = true;\n this._element.hide();\n }\n\n /**\n * Shows a previously hidden container. Notifies the\n * containers content first and then shows the DOM element.\n * If the container is already visible this has no effect.\n */\n show() {\n this.emit('show');\n this.isHidden = false;\n this._element.show();\n // call shown only if the container has a valid size\n if (this.height != 0 || this.width != 0) {\n this.emit('shown');\n }\n }\n\n /**\n * Set the size from within the container. Traverses up\n * the item tree until it finds a row or column element\n * and resizes its items accordingly.\n *\n * If this container isn't a descendant of a row or column\n * it returns false\n * @todo Rework!!!\n * @param width The new width in pixel\n * @param height The new height in pixel\n *\n * @returns resizeSuccesful\n */\n setSize(width: number, height: number) {\n let rowOrColumn: AbstractContentItem | null = this.parent;\n let rowOrColumnChild: AbstractContentItem | null = null;\n\n while (rowOrColumn && !rowOrColumn.isColumn && !rowOrColumn.isRow) {\n rowOrColumnChild = rowOrColumn;\n rowOrColumn = rowOrColumn.parent;\n\n /**\n * No row or column has been found\n */\n if (rowOrColumn?.isRoot) {\n return false;\n }\n }\n\n if (!rowOrColumn || !rowOrColumnChild) {\n return false;\n }\n\n const direction = rowOrColumn.isColumn ? 'height' : 'width';\n const newSize = direction === 'height' ? height : width;\n\n const totalPixel =\n (this[direction] ?? 0) *\n (1 / ((rowOrColumnChild.config[direction] ?? 0) / 100));\n const percentage = (newSize / totalPixel) * 100;\n const delta =\n ((rowOrColumnChild.config[direction] ?? 0) - percentage) /\n (rowOrColumn.contentItems.length - 1);\n\n for (let i = 0; i < rowOrColumn.contentItems.length; i++) {\n if (rowOrColumn.contentItems[i] === rowOrColumnChild) {\n rowOrColumn.contentItems[i].config[direction] = percentage;\n } else {\n rowOrColumn.contentItems[i].config[direction] =\n (rowOrColumn.contentItems[i].config[direction] ?? 0) + delta;\n }\n }\n\n rowOrColumn.callDownwards('setSize');\n\n return true;\n }\n\n /**\n * Closes the container if it is closable. Can be called by\n * both the component within at as well as the contentItem containing\n * it. Emits a close event before the container itself is closed.\n * @param options Options to pass into the beforeClose handler\n */\n close(options?: CloseOptions) {\n // Not closable, don't do anything\n if (!this._config.isClosable) return;\n\n // If beforeCloseHandler returns true or if the handler doesn't exist, close\n if (this.beforeCloseHandler?.(options) ?? true) {\n this.emit('close');\n this.parent.close();\n }\n }\n\n /**\n * Sets the beforeCloseHandler to callback\n * @param callback Callback function to call before closing\n */\n beforeClose(callback: ((options?: CloseOptions) => boolean) | null) {\n this.beforeCloseHandler = callback;\n }\n\n /**\n * Returns the current state object\n *\n * @returns state\n */\n getState() {\n return this._config.componentState;\n }\n\n /**\n * Returns the object's config\n *\n * @returns id\n */\n getConfig() {\n return this._config;\n }\n\n /**\n * Notifies the layout manager of a stateupdate\n *\n * @param state\n */\n setState(state: Record<string, unknown>) {\n this._config.componentState = state;\n this.parent.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Sets persisted state for functional components\n * which do not have lifecycle methods to hook into.\n *\n * @param state The state to persist\n */\n setPersistedState(state: unknown) {\n this._config.persistedState = state;\n this.parent.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Set's the components title\n *\n * @param title\n */\n setTitle(title: string) {\n this.parent.setTitle(title);\n }\n\n /**\n * Set's the containers size. Called by the container's component.\n * To set the size programmatically from within the container please\n * use the public setSize method\n *\n * @param width in px\n * @param height in px\n */\n _$setSize(width = 0, height = 0) {\n if (width !== this.width || height !== this.height) {\n this.width = width;\n this.height = height;\n var cl = this._contentElement[0];\n var hdelta = cl.offsetWidth - cl.clientWidth;\n var vdelta = cl.offsetHeight - cl.clientHeight;\n this._contentElement\n .width(this.width - hdelta)\n .height(this.height - vdelta);\n this.emit('resize');\n }\n }\n}\n"],"mappings":";;;AAAA,OAAOA,CAAC,MAAM,QAAQ;AAAC,SAGrBC,mBAAmB;AAAA,OAMdC,YAAY;AAInB,eAAe,MAAMC,aAAa,SAExBD,YAAY,CAAC;EAgCrBE,WAAWA,CAACC,MAAS,EAAEC,MAAiB,EAAEC,aAA4B,EAAE;IACtE,KAAK,CAAC,CAAC;IAACC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IArBV;IAAAA,eAAA;IAAAA,eAAA,mBAMW,KAAK;IAAAA,eAAA;IAAAA,eAAA,mBAILR,CAAC,CACV,CACE,iCAAiC,EACjC,8CAA8C,EAC9C,QAAQ,CACT,CAACS,IAAI,CAAC,EAAE,CACX,CAAC;IAAAD,eAAA;IAOC,IAAI,CAACE,KAAK,GAAGT,mBAAmB,CAACI,MAAM,CAAC,GAAGA,MAAM,CAACM,aAAa,GAAG,EAAE;IACpE,IAAI,CAACL,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,aAAa,GAAGA,aAAa;IAElC,IAAI,CAACK,OAAO,GAAGP,MAAyD;IAExE,IAAI,CAACQ,eAAe,GAAG,IAAI,CAACC,QAAQ,CAACC,IAAI,CAAC,aAAa,CAAC;IAExD,IAAI,CAACC,kBAAkB,GAAG,IAAI;EAChC;;EAEA;AACF;AACA;AACA;EACEC,UAAUA,CAAA,EAAG;IACX,OAAO,IAAI,CAACJ,eAAe;EAC7B;;EAEA;AACF;A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B;IAAA,IAAvBtC,KAAK,GAAAuC,SAAA,CAAAtB,MAAA,QAAAsB,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAG,CAAC;IAAA,IAAExC,MAAM,GAAAwC,SAAA,CAAAtB,MAAA,QAAAsB,SAAA,QAAAC,SAAA,GAAAD,SAAA,MAAG,CAAC;IAC7B,IAAIvC,KAAK,KAAK,IAAI,CAACA,KAAK,IAAID,MAAM,KAAK,IAAI,CAACA,MAAM,EAAE;MAClD,IAAI,CAACC,KAAK,GAAGA,KAAK;MAClB,IAAI,CAACD,MAAM,GAAGA,MAAM;MACpB,IAAI0C,EAAE,GAAG,IAAI,CAACnD,eAAe,CAAC,CAAC,CAAC;MAChC,IAAIoD,MAAM,GAAGD,EAAE,CAACE,WAAW,GAAGF,EAAE,CAACG,WAAW;MAC5C,IAAIC,MAAM,GAAGJ,EAAE,CAACK,YAAY,GAAGL,EAAE,CAACM,YAAY;MAC9C,IAAI,CAACzD,eAAe,CACjBU,KAAK,CAAC,IAAI,CAACA,KAAK,GAAG0C,MAAM,CAAC,CAC1B3C,MAAM,CAAC,IAAI,CAACA,MAAM,GAAG8C,MAAM,CAAC;MAC/B,IAAI,CAACjD,IAAI,CAAC,QAAQ,CAAC;IACrB;EACF;AACF","ignoreList":[]}
|
|
@@ -47,7 +47,7 @@ export default class ReactComponentHandler {
|
|
|
47
47
|
*
|
|
48
48
|
* @param component The component instance created by the `ReactDOM.render` call in the `_render` method.
|
|
49
49
|
*/
|
|
50
|
-
_gotReactComponent(component: React.
|
|
50
|
+
_gotReactComponent(component: React.ReactInstance): void;
|
|
51
51
|
/**
|
|
52
52
|
* Removes the component from the DOM and thus invokes React's unmount lifecycle
|
|
53
53
|
*/
|
|
@@ -56,7 +56,7 @@ export default class ReactComponentHandler {
|
|
|
56
56
|
* Hooks into React's state management and applies the componentstate
|
|
57
57
|
* to GoldenLayout
|
|
58
58
|
*/
|
|
59
|
-
_onUpdate(nextProps: unknown
|
|
59
|
+
_onUpdate(nextProps: Readonly<unknown>, nextState: Record<string, unknown>): void;
|
|
60
60
|
/**
|
|
61
61
|
* Retrieves the react class from GoldenLayout's registry
|
|
62
62
|
* @returns react class
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactComponentHandler.d.ts","sourceRoot":"","sources":["../../src/utils/ReactComponentHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ReactComponentHandler.d.ts","sourceRoot":"","sources":["../../src/utils/ReactComponentHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAGzC,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,SAAS,CAAC;IACvB,UAAU,EAAE,YAAY,CAAC;CAC1B,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IACxC,OAAO,CAAC,UAAU,CAAsC;IAExD,OAAO,CAAC,eAAe,CAAoC;IAC3D,OAAO,CAAC,gBAAgB,CAAkC;IAC1D,OAAO,CAAC,4BAA4B,CAMV;IAC1B,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,WAAW,CAAuB;gBAE9B,SAAS,EAAE,aAAa,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,OAAO;IAW3E;;;OAGG;IACH,IAAI,IAAI,MAAM;IAed;;;;;;;;;OASG;IACH,OAAO;IAWP;;;;;;;;OAQG;IACH,kBAAkB,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa;IAmBjD;;OAEG;IACH,QAAQ;IASR;;;OAGG;IACH,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAU1E;;;OAGG;IACH,cAAc;IA0Bd;;OAEG;IACH,kBAAkB;CAmBnB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
|
-
import React from 'react';
|
|
4
|
+
import React, { Component } from 'react';
|
|
5
5
|
import ReactDOM from 'react-dom';
|
|
6
6
|
import $ from 'jquery';
|
|
7
7
|
/**
|
|
@@ -16,12 +16,12 @@ export default class ReactComponentHandler {
|
|
|
16
16
|
_defineProperty(this, "_container", void 0);
|
|
17
17
|
_defineProperty(this, "_reactComponent", null);
|
|
18
18
|
_defineProperty(this, "_portalComponent", null);
|
|
19
|
-
_defineProperty(this, "_originalComponentWillUpdate",
|
|
19
|
+
_defineProperty(this, "_originalComponentWillUpdate", undefined);
|
|
20
20
|
_defineProperty(this, "_initialState", void 0);
|
|
21
21
|
_defineProperty(this, "_reactClass", void 0);
|
|
22
22
|
this._reactComponent = null;
|
|
23
23
|
this._portalComponent = null;
|
|
24
|
-
this._originalComponentWillUpdate =
|
|
24
|
+
this._originalComponentWillUpdate = undefined;
|
|
25
25
|
this._container = container;
|
|
26
26
|
this._initialState = state;
|
|
27
27
|
this._reactClass = this._getReactClass();
|
|
@@ -77,11 +77,15 @@ export default class ReactComponentHandler {
|
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
this._reactComponent = component;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this._reactComponent.
|
|
80
|
+
// Class components manipulate the lifecycle to hook into state changes
|
|
81
|
+
// Functional components can save data with the usePersistentState hook
|
|
82
|
+
if (this._reactComponent instanceof Component) {
|
|
83
|
+
this._originalComponentWillUpdate = this._reactComponent.componentWillUpdate;
|
|
84
|
+
this._reactComponent.componentWillUpdate = this._onUpdate.bind(this);
|
|
85
|
+
var state = this._container.getState();
|
|
86
|
+
if (state) {
|
|
87
|
+
this._reactComponent.setState(state);
|
|
88
|
+
}
|
|
85
89
|
}
|
|
86
90
|
}
|
|
87
91
|
|
|
@@ -101,7 +105,7 @@ export default class ReactComponentHandler {
|
|
|
101
105
|
_onUpdate(nextProps, nextState) {
|
|
102
106
|
var _this$_originalCompon;
|
|
103
107
|
this._container.setState(nextState);
|
|
104
|
-
(_this$_originalCompon = this._originalComponentWillUpdate) === null || _this$_originalCompon === void 0 || _this$_originalCompon.call(this._reactComponent, nextProps, nextState);
|
|
108
|
+
(_this$_originalCompon = this._originalComponentWillUpdate) === null || _this$_originalCompon === void 0 || _this$_originalCompon.call(this._reactComponent, nextProps, nextState, undefined);
|
|
105
109
|
}
|
|
106
110
|
|
|
107
111
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactComponentHandler.js","names":["React","ReactDOM","$","ReactComponentHandler","constructor","container","state","_defineProperty","_reactComponent","_portalComponent","_originalComponentWillUpdate","_container","_initialState","_reactClass","_getReactClass","on","_render","_destroy","_key","id","_config","Error","Array","isArray","join","key","createPortal","_getReactComponent","getElement","layoutManager","addReactChild","_gotReactComponent","component","componentWillUpdate","_onUpdate","bind","getState","setState","removeReactChild","off","nextProps","nextState","_this$_originalCompon","call","componentName","reactClass","getComponent","getFallbackComponent","defaultProps","glEventHub","eventHub","glContainer","ref","props","extend","createElement"],"sources":["../../src/utils/ReactComponentHandler.tsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport $ from 'jquery';\nimport type ItemContainer from '../container/ItemContainer';\nimport type { ReactComponentConfig } from '../config/ItemConfig';\nimport { Container } from '../container';\nimport EventEmitter from './EventEmitter';\n\nexport type GLPanelProps = {\n glContainer: Container;\n glEventHub: EventEmitter;\n};\n\n/**\n * A specialised GoldenLayout component that binds GoldenLayout container\n * lifecycle events to react components\n *\n * @param container\n * @param state state is not required for react components\n */\nexport default class ReactComponentHandler {\n private _container: ItemContainer<ReactComponentConfig>;\n\n private _reactComponent: React.Component | null = null;\n private _portalComponent: React.ReactPortal | null = null;\n private _originalComponentWillUpdate: Function | null = null;\n private _initialState: unknown;\n private _reactClass: React.ComponentClass;\n\n constructor(container: ItemContainer<ReactComponentConfig>, state?: unknown) {\n this._reactComponent = null;\n this._portalComponent = null;\n this._originalComponentWillUpdate = null;\n this._container = container;\n this._initialState = state;\n this._reactClass = this._getReactClass();\n this._container.on('open', this._render, this);\n this._container.on('destroy', this._destroy, this);\n }\n\n /**\n * Gets the unique key to use for the react component\n * @returns Unique key for the component\n */\n _key(): string {\n const id = this._container._config.id;\n if (!id) {\n throw new Error('Cannot mount panel without id');\n }\n\n // If addId is called multiple times, an element can have multiple IDs in golden-layout\n // We don't use it, but changing the type requires many changes and a separate PR\n if (Array.isArray(id)) {\n return id.join(',');\n }\n\n return id;\n }\n\n /**\n * Creates the react class and component and hydrates it with\n * the initial state - if one is present\n *\n * By default, react's getInitialState will be used\n *\n * Creates a portal so the non-react golden-layout code still works,\n * but also allows us to mount the React components in the app's tree\n * instead of separate sibling root trees\n */\n _render() {\n const key = this._key();\n this._portalComponent = ReactDOM.createPortal(\n this._getReactComponent(),\n this._container.getElement()[0],\n key\n );\n\n this._container.layoutManager.addReactChild(key, this._portalComponent);\n }\n\n /**\n * Fired by react when the component is created.\n * <p>\n * Note: This callback is used instead of the return from `ReactDOM.render` because\n *\t of https://github.com/facebook/react/issues/10309.\n * </p>\n *\n * @param component The component instance created by the `ReactDOM.render` call in the `_render` method.\n */\n _gotReactComponent(component: React.Component) {\n if (!component) {\n return;\n }\n\n this._reactComponent = component;\n this._originalComponentWillUpdate =\n this._reactComponent.componentWillUpdate || function () {};\n this._reactComponent.componentWillUpdate = this._onUpdate.bind(this);\n const state = this._container.getState();\n if (state) {\n this._reactComponent.setState(state);\n }\n }\n\n /**\n * Removes the component from the DOM and thus invokes React's unmount lifecycle\n */\n _destroy() {\n this._container.layoutManager.removeReactChild(\n this._key(),\n this._portalComponent\n );\n this._container.off('open', this._render, this);\n this._container.off('destroy', this._destroy, this);\n }\n\n /**\n * Hooks into React's state management and applies the componentstate\n * to GoldenLayout\n */\n _onUpdate(nextProps: unknown, nextState: Record<string, unknown>) {\n this._container.setState(nextState);\n this._originalComponentWillUpdate?.call(\n this._reactComponent,\n nextProps,\n nextState\n );\n }\n\n /**\n * Retrieves the react class from GoldenLayout's registry\n * @returns react class\n */\n _getReactClass() {\n var componentName = this._container._config.component;\n\n if (!componentName) {\n throw new Error(\n 'No react component name. type: react-component needs a field `component`'\n );\n }\n\n const reactClass = (this._container.layoutManager.getComponent(\n componentName\n ) ||\n this._container.layoutManager.getFallbackComponent()) as unknown as React.ComponentClass;\n\n if (!reactClass) {\n throw new Error(\n 'React component \"' +\n componentName +\n '\" not found. ' +\n 'Please register all components with GoldenLayout using `registerComponent(name, component)`'\n );\n }\n\n return reactClass;\n }\n\n /**\n * Copies and extends the properties array and returns the React element\n */\n _getReactComponent() {\n var defaultProps = {\n glEventHub: this._container.layoutManager.eventHub,\n glContainer: this._container,\n /**\n * This ref assignment makes use of callback refs which is a legacy ref style in React.\n * It uses the callback to inject GoldenLayout _onUpdate into the React componentWillUpdate lifecycle.\n * This allows GoldenLayout to track the internal state of class components.\n * We then emit this state change and somewhere furter up, serialize it.\n * Specifically we look for state.panelState changes.\n * We should not do this going forward as it's quite unclear where/why your component's state might be saved.\n * This ref cannot be removed unless we refactor all existing panels to not rely on the magic of panelState.\n * DashboardUtils#dehydrate is where the panelState gets read/saved.\n */\n ref: this._gotReactComponent.bind(this),\n };\n var props = $.extend(defaultProps, this._container._config.props);\n return React.createElement(this._reactClass, props);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,WAAW;AAChC,OAAOC,CAAC,MAAM,QAAQ;AAWtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,qBAAqB,CAAC;EASzCC,WAAWA,CAACC,SAA8C,EAAEC,KAAe,EAAE;IAAAC,eAAA;IAAAA,eAAA,0BAN3B,IAAI;IAAAA,eAAA,2BACD,IAAI;IAAAA,eAAA,uCACD,IAAI;IAAAA,eAAA;IAAAA,eAAA;IAK1D,IAAI,CAACC,eAAe,GAAG,IAAI;IAC3B,IAAI,CAACC,gBAAgB,GAAG,IAAI;IAC5B,IAAI,CAACC,4BAA4B,GAAG,IAAI;IACxC,IAAI,CAACC,UAAU,GAAGN,SAAS;IAC3B,IAAI,CAACO,aAAa,GAAGN,KAAK;IAC1B,IAAI,CAACO,WAAW,GAAG,IAAI,CAACC,cAAc,CAAC,CAAC;IACxC,IAAI,CAACH,UAAU,CAACI,EAAE,CAAC,MAAM,EAAE,IAAI,CAACC,OAAO,EAAE,IAAI,CAAC;IAC9C,IAAI,CAACL,UAAU,CAACI,EAAE,CAAC,SAAS,EAAE,IAAI,CAACE,QAAQ,EAAE,IAAI,CAAC;EACpD;;EAEA;AACF;AACA;AACA;EACEC,IAAIA,CAAA,EAAW;IACb,IAAMC,EAAE,GAAG,IAAI,CAACR,UAAU,CAACS,OAAO,CAACD,EAAE;IACrC,IAAI,CAACA,EAAE,EAAE;MACP,MAAM,IAAIE,KAAK,CAAC,+BAA+B,CAAC;IAClD;;IAEA;IACA;IACA,IAAIC,KAAK,CAACC,OAAO,CAACJ,EAAE,CAAC,EAAE;MACrB,OAAOA,EAAE,CAACK,IAAI,CAAC,GAAG,CAAC;IACrB;IAEA,OAAOL,EAAE;EACX;;EAEA;AACF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AAO,CAACiC,KAAK,CAAC;IACjE,oBAAOrD,KAAK,CAACuD,aAAa,CAAC,IAAI,CAAC1C,WAAW,EAAEwC,KAAK,CAAC;EACrD;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ReactComponentHandler.js","names":["React","Component","ReactDOM","$","ReactComponentHandler","constructor","container","state","_defineProperty","undefined","_reactComponent","_portalComponent","_originalComponentWillUpdate","_container","_initialState","_reactClass","_getReactClass","on","_render","_destroy","_key","id","_config","Error","Array","isArray","join","key","createPortal","_getReactComponent","getElement","layoutManager","addReactChild","_gotReactComponent","component","componentWillUpdate","_onUpdate","bind","getState","setState","removeReactChild","off","nextProps","nextState","_this$_originalCompon","call","componentName","reactClass","getComponent","getFallbackComponent","defaultProps","glEventHub","eventHub","glContainer","ref","props","extend","createElement"],"sources":["../../src/utils/ReactComponentHandler.tsx"],"sourcesContent":["import React, { Component } from 'react';\nimport ReactDOM from 'react-dom';\nimport $ from 'jquery';\nimport type ItemContainer from '../container/ItemContainer';\nimport type { ReactComponentConfig } from '../config/ItemConfig';\nimport { Container } from '../container';\nimport EventEmitter from './EventEmitter';\n\nexport type GLPanelProps = {\n glContainer: Container;\n glEventHub: EventEmitter;\n};\n\n/**\n * A specialised GoldenLayout component that binds GoldenLayout container\n * lifecycle events to react components\n *\n * @param container\n * @param state state is not required for react components\n */\nexport default class ReactComponentHandler {\n private _container: ItemContainer<ReactComponentConfig>;\n\n private _reactComponent: React.ReactInstance | null = null;\n private _portalComponent: React.ReactPortal | null = null;\n private _originalComponentWillUpdate:\n | ((\n nextProps: Readonly<any>,\n nextState: Readonly<{}>,\n nextContext: any\n ) => void)\n | undefined = undefined;\n private _initialState: unknown;\n private _reactClass: React.ComponentClass;\n\n constructor(container: ItemContainer<ReactComponentConfig>, state?: unknown) {\n this._reactComponent = null;\n this._portalComponent = null;\n this._originalComponentWillUpdate = undefined;\n this._container = container;\n this._initialState = state;\n this._reactClass = this._getReactClass();\n this._container.on('open', this._render, this);\n this._container.on('destroy', this._destroy, this);\n }\n\n /**\n * Gets the unique key to use for the react component\n * @returns Unique key for the component\n */\n _key(): string {\n const id = this._container._config.id;\n if (!id) {\n throw new Error('Cannot mount panel without id');\n }\n\n // If addId is called multiple times, an element can have multiple IDs in golden-layout\n // We don't use it, but changing the type requires many changes and a separate PR\n if (Array.isArray(id)) {\n return id.join(',');\n }\n\n return id;\n }\n\n /**\n * Creates the react class and component and hydrates it with\n * the initial state - if one is present\n *\n * By default, react's getInitialState will be used\n *\n * Creates a portal so the non-react golden-layout code still works,\n * but also allows us to mount the React components in the app's tree\n * instead of separate sibling root trees\n */\n _render() {\n const key = this._key();\n this._portalComponent = ReactDOM.createPortal(\n this._getReactComponent(),\n this._container.getElement()[0],\n key\n );\n\n this._container.layoutManager.addReactChild(key, this._portalComponent);\n }\n\n /**\n * Fired by react when the component is created.\n * <p>\n * Note: This callback is used instead of the return from `ReactDOM.render` because\n *\t of https://github.com/facebook/react/issues/10309.\n * </p>\n *\n * @param component The component instance created by the `ReactDOM.render` call in the `_render` method.\n */\n _gotReactComponent(component: React.ReactInstance) {\n if (!component) {\n return;\n }\n\n this._reactComponent = component;\n // Class components manipulate the lifecycle to hook into state changes\n // Functional components can save data with the usePersistentState hook\n if (this._reactComponent instanceof Component) {\n this._originalComponentWillUpdate =\n this._reactComponent.componentWillUpdate;\n this._reactComponent.componentWillUpdate = this._onUpdate.bind(this);\n const state = this._container.getState();\n if (state) {\n this._reactComponent.setState(state);\n }\n }\n }\n\n /**\n * Removes the component from the DOM and thus invokes React's unmount lifecycle\n */\n _destroy() {\n this._container.layoutManager.removeReactChild(\n this._key(),\n this._portalComponent\n );\n this._container.off('open', this._render, this);\n this._container.off('destroy', this._destroy, this);\n }\n\n /**\n * Hooks into React's state management and applies the componentstate\n * to GoldenLayout\n */\n _onUpdate(nextProps: Readonly<unknown>, nextState: Record<string, unknown>) {\n this._container.setState(nextState);\n this._originalComponentWillUpdate?.call(\n this._reactComponent,\n nextProps,\n nextState,\n undefined\n );\n }\n\n /**\n * Retrieves the react class from GoldenLayout's registry\n * @returns react class\n */\n _getReactClass() {\n var componentName = this._container._config.component;\n\n if (!componentName) {\n throw new Error(\n 'No react component name. type: react-component needs a field `component`'\n );\n }\n\n const reactClass = (this._container.layoutManager.getComponent(\n componentName\n ) ||\n this._container.layoutManager.getFallbackComponent()) as unknown as React.ComponentClass;\n\n if (!reactClass) {\n throw new Error(\n 'React component \"' +\n componentName +\n '\" not found. ' +\n 'Please register all components with GoldenLayout using `registerComponent(name, component)`'\n );\n }\n\n return reactClass;\n }\n\n /**\n * Copies and extends the properties array and returns the React element\n */\n _getReactComponent() {\n var defaultProps = {\n glEventHub: this._container.layoutManager.eventHub,\n glContainer: this._container,\n /**\n * This ref assignment makes use of callback refs which is a legacy ref style in React.\n * It uses the callback to inject GoldenLayout _onUpdate into the React componentWillUpdate lifecycle.\n * This allows GoldenLayout to track the internal state of class components.\n * We then emit this state change and somewhere furter up, serialize it.\n * Specifically we look for state.panelState changes.\n * We should not do this going forward as it's quite unclear where/why your component's state might be saved.\n * This ref cannot be removed unless we refactor all existing panels to not rely on the magic of panelState.\n * DashboardUtils#dehydrate is where the panelState gets read/saved.\n */\n ref: this._gotReactComponent.bind(this),\n };\n var props = $.extend(defaultProps, this._container._config.props);\n return React.createElement(this._reactClass, props);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,QAAQ,MAAM,WAAW;AAChC,OAAOC,CAAC,MAAM,QAAQ;AAWtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,qBAAqB,CAAC;EAezCC,WAAWA,CAACC,SAA8C,EAAEC,KAAe,EAAE;IAAAC,eAAA;IAAAA,eAAA,0BAZvB,IAAI;IAAAA,eAAA,2BACL,IAAI;IAAAA,eAAA,uCAOzCC,SAAS;IAAAD,eAAA;IAAAA,eAAA;IAKvB,IAAI,CAACE,eAAe,GAAG,IAAI;IAC3B,I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C,UAAU,CAACS,OAAO,CAACY,SAAS;IAErD,IAAI,CAACY,aAAa,EAAE;MAClB,MAAM,IAAIvB,KAAK,CACb,0EACF,CAAC;IACH;IAEA,IAAMwB,UAAU,GAAI,IAAI,CAAClC,UAAU,CAACkB,aAAa,CAACiB,YAAY,CAC5DF,aACF,CAAC,IACC,IAAI,CAACjC,UAAU,CAACkB,aAAa,CAACkB,oBAAoB,CAAC,CAAqC;IAE1F,IAAI,CAACF,UAAU,EAAE;MACf,MAAM,IAAIxB,KAAK,CACb,mBAAmB,GACjBuB,aAAa,GACb,eAAe,GACf,6FACJ,CAAC;IACH;IAEA,OAAOC,UAAU;EACnB;;EAEA;AACF;AACA;EACElB,kBAAkBA,CAAA,EAAG;IACnB,IAAIqB,YAAY,GAAG;MACjBC,UAAU,EAAE,IAAI,CAACtC,UAAU,CAACkB,aAAa,CAACqB,QAAQ;MAClDC,WAAW,EAAE,IAAI,CAACxC,UAAU;MAC5B;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACMyC,GAAG,EAAE,IAAI,CAACrB,kBAAkB,CAACI,IAAI,CAAC,IAAI;IACxC,CAAC;IACD,IAAIkB,KAAK,GAAGpD,CAAC,CAACqD,MAAM,CAACN,YAAY,EAAE,IAAI,CAACrC,UAAU,CAACS,OAAO,CAACiC,KAAK,CAAC;IACjE,oBAAOvD,KAAK,CAACyD,aAAa,CAAC,IAAI,CAAC1C,WAAW,EAAEwC,KAAK,CAAC;EACrD;AACF","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/golden-layout",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"author": "Deephaven Data Labs LLC",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "A multi-screen javascript Layout manager",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"source": "src/index.ts",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@deephaven/components": "^1.
|
|
13
|
+
"@deephaven/components": "^1.11.0",
|
|
14
14
|
"jquery": "^3.6.0",
|
|
15
15
|
"nanoid": "^5.0.7"
|
|
16
16
|
},
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"karma-browserify": "^8.1.0",
|
|
57
57
|
"watchify": "^4.0.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "7b2a23ea3b33c11f136e7b9d44a204880c674866"
|
|
60
60
|
}
|