@deephaven/golden-layout 1.12.0 → 1.12.1
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/README.md +0 -6
- package/dist/LayoutManager.d.ts +11 -6
- package/dist/LayoutManager.d.ts.map +1 -1
- package/dist/LayoutManager.js +10 -4
- package/dist/LayoutManager.js.map +1 -1
- package/dist/__tests__/component-creation-events.test.d.ts +2 -0
- package/dist/__tests__/component-creation-events.test.d.ts.map +1 -0
- package/dist/__tests__/component-state-save.test.d.ts +2 -0
- package/dist/__tests__/component-state-save.test.d.ts.map +1 -0
- package/dist/__tests__/create-config.test.d.ts +2 -0
- package/dist/__tests__/create-config.test.d.ts.map +1 -0
- package/dist/__tests__/create-from-config.test.d.ts +2 -0
- package/dist/__tests__/create-from-config.test.d.ts.map +1 -0
- package/dist/__tests__/deferred-create-drag.test.d.ts +2 -0
- package/dist/__tests__/deferred-create-drag.test.d.ts.map +1 -0
- package/dist/__tests__/disabled-selection.test.d.ts +2 -0
- package/dist/__tests__/disabled-selection.test.d.ts.map +1 -0
- package/dist/__tests__/drag.test.d.ts +2 -0
- package/dist/__tests__/drag.test.d.ts.map +1 -0
- package/dist/__tests__/empty-item.test.d.ts +2 -0
- package/dist/__tests__/empty-item.test.d.ts.map +1 -0
- package/dist/__tests__/enabled-selection.test.d.ts +2 -0
- package/dist/__tests__/enabled-selection.test.d.ts.map +1 -0
- package/dist/__tests__/event-bubble.test.d.ts +2 -0
- package/dist/__tests__/event-bubble.test.d.ts.map +1 -0
- package/dist/__tests__/event-emitter.test.d.ts +2 -0
- package/dist/__tests__/event-emitter.test.d.ts.map +1 -0
- package/dist/__tests__/id.test.d.ts +2 -0
- package/dist/__tests__/id.test.d.ts.map +1 -0
- package/dist/__tests__/initialisation.test.d.ts +2 -0
- package/dist/__tests__/initialisation.test.d.ts.map +1 -0
- package/dist/__tests__/item-creation-events.test.d.ts +2 -0
- package/dist/__tests__/item-creation-events.test.d.ts.map +1 -0
- package/dist/__tests__/minifier.test.d.ts +2 -0
- package/dist/__tests__/minifier.test.d.ts.map +1 -0
- package/dist/__tests__/popout.test.d.ts +2 -0
- package/dist/__tests__/popout.test.d.ts.map +1 -0
- package/dist/__tests__/selector.test.d.ts +2 -0
- package/dist/__tests__/selector.test.d.ts.map +1 -0
- package/dist/__tests__/tab.test.d.ts +2 -0
- package/dist/__tests__/tab.test.d.ts.map +1 -0
- package/dist/__tests__/title.test.d.ts +2 -0
- package/dist/__tests__/title.test.d.ts.map +1 -0
- package/dist/__tests__/tree-manipulation.test.d.ts +2 -0
- package/dist/__tests__/tree-manipulation.test.d.ts.map +1 -0
- package/dist/__tests__/xss.test.d.ts +2 -0
- package/dist/__tests__/xss.test.d.ts.map +1 -0
- package/dist/config/Config.d.ts +17 -0
- package/dist/config/Config.d.ts.map +1 -1
- package/dist/config/Config.js +11 -0
- package/dist/config/Config.js.map +1 -1
- package/dist/config/ItemConfig.d.ts +2 -1
- package/dist/config/ItemConfig.d.ts.map +1 -1
- package/dist/config/ItemConfig.js.map +1 -1
- package/dist/controls/Tab.d.ts +6 -0
- package/dist/controls/Tab.d.ts.map +1 -1
- package/dist/controls/Tab.js +26 -0
- package/dist/controls/Tab.js.map +1 -1
- package/dist/items/AbstractContentItem.d.ts +1 -1
- package/dist/items/AbstractContentItem.d.ts.map +1 -1
- package/dist/items/AbstractContentItem.js +2 -2
- package/dist/items/AbstractContentItem.js.map +1 -1
- package/dist/test-utils/testUtils.d.ts +40 -0
- package/dist/test-utils/testUtils.d.ts.map +1 -0
- package/dist/test-utils/testUtils.js +119 -0
- package/dist/test-utils/testUtils.js.map +1 -0
- package/dist/utils/ConfigMinifier.d.ts +2 -2
- package/dist/utils/ConfigMinifier.d.ts.map +1 -1
- package/dist/utils/ConfigMinifier.js.map +1 -1
- package/package.json +4 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialisation.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/initialisation.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-creation-events.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/item-creation-events.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minifier.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/minifier.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popout.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/popout.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/selector.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/tab.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/title.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-manipulation.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/tree-manipulation.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xss.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/xss.test.ts"],"names":[],"mappings":""}
|
package/dist/config/Config.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { ItemConfig } from './ItemConfig';
|
|
2
|
+
/**
|
|
3
|
+
* The resolved configuration type with all required fields populated.
|
|
4
|
+
* This is the type returned by `_createConfig` and used internally.
|
|
5
|
+
*/
|
|
2
6
|
export type Config = {
|
|
3
7
|
settings: Partial<Settings>;
|
|
4
8
|
dimensions: Dimensions;
|
|
@@ -7,6 +11,19 @@ export type Config = {
|
|
|
7
11
|
maximisedItemId?: string;
|
|
8
12
|
openPopouts?: PopoutConfig[];
|
|
9
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Input configuration type that allows partial configs.
|
|
16
|
+
* Users can provide any subset of the configuration, and defaults will be applied.
|
|
17
|
+
* This is the type accepted by the LayoutManager constructor.
|
|
18
|
+
*/
|
|
19
|
+
export type PartialConfig = {
|
|
20
|
+
settings?: Partial<Settings>;
|
|
21
|
+
dimensions?: Partial<Dimensions>;
|
|
22
|
+
labels?: Partial<Labels>;
|
|
23
|
+
content?: ItemConfig[];
|
|
24
|
+
maximisedItemId?: string;
|
|
25
|
+
openPopouts?: PopoutConfig[];
|
|
26
|
+
};
|
|
10
27
|
export type PopoutConfig = Config & {
|
|
11
28
|
parentId: string;
|
|
12
29
|
indexInParent: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/config/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,UAAU,GAAG;QACvB,KAAK,EAAE,MAAM,CAAC;QAEd,MAAM,EAAE,MAAM,CAAC;QAEf,IAAI,EAAE,MAAM,CAAC;QAEb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH,CAAC;AAEF,MAAM,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AC;IAEf,WAAW,EAAE,MAAM,CAAC;IAEpB,YAAY,EAAE,MAAM,CAAC;IAErB,gBAAgB,EAAE,MAAM,CAAC;IAEzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,aAAa,EAAE,MAsC1B,CAAC"}
|
package/dist/config/Config.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The resolved configuration type with all required fields populated.
|
|
3
|
+
* This is the type returned by `_createConfig` and used internally.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Input configuration type that allows partial configs.
|
|
8
|
+
* Users can provide any subset of the configuration, and defaults will be applied.
|
|
9
|
+
* This is the type accepted by the LayoutManager constructor.
|
|
10
|
+
*/
|
|
11
|
+
|
|
1
12
|
export var defaultConfig = Object.freeze({
|
|
2
13
|
openPopouts: [],
|
|
3
14
|
settings: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","names":["defaultConfig","Object","freeze","openPopouts","settings","hasHeaders","constrainDragToContainer","reorderEnabled","selectionEnabled","popoutWholeStack","blockedPopoutsThrowError","closePopoutsOnUnload","showPopoutIcon","showMaximiseIcon","showCloseIcon","responsiveMode","tabOverlapAllowance","tabControlOffset","dimensions","borderWidth","borderGrabWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","popin","tabDropdown","tabNextLabel","tabPreviousLabel","content"],"sources":["../../src/config/Config.ts"],"sourcesContent":["import type { ItemConfig } from './ItemConfig';\n\nexport type Config = {\n settings: Partial<Settings>;\n dimensions: Dimensions;\n labels: Labels;\n content: ItemConfig[];\n maximisedItemId?: string;\n openPopouts?: PopoutConfig[];\n};\n\nexport type PopoutConfig = Config & {\n parentId: string;\n indexInParent: number;\n dimensions: Dimensions & {\n width: number;\n\n height: number;\n\n left: number;\n\n top: number;\n };\n};\n\nexport interface Settings {\n /**\n * Turns headers on or off. If false, the layout will be displayed with splitters only.\n * Default: true\n */\n hasHeaders: boolean;\n\n /**\n * Constrains the area in which items can be dragged to the layout's container. Will be set to false\n * automatically when layout.createDragSource() is called.\n * Default: true\n */\n constrainDragToContainer: boolean;\n\n /**\n * If true, the user can re-arrange the layout by dragging items by their tabs to the desired location.\n * Default: true\n */\n reorderEnabled: boolean;\n\n /**\n * If true, the user can select items by clicking on their header. This sets the value of layout.selectedItem to\n * the clicked item, highlights its header and the layout emits a 'selectionChanged' event.\n * Default: false\n */\n selectionEnabled: boolean;\n\n /**\n * Decides what will be opened in a new window if the user clicks the popout icon. If true the entire stack will\n * be transferred to the new window, if false only the active component will be opened.\n * Default: false\n */\n popoutWholeStack: boolean;\n\n /**\n * Specifies if an error is thrown when a popout is blocked by the browser (e.g. by opening it programmatically).\n * If false, the popout call will fail silently.\n * Default: true\n */\n blockedPopoutsThrowError: boolean;\n\n /**\n * Specifies if all popouts should be closed when the page that created them is closed. Popouts don't have a\n * strong dependency on their parent and can exist on their own, but can be quite annoying to close by hand. In\n * addition, any changes made to popouts won't be stored after the parent is closed.\n * Default: true\n */\n closePopoutsOnUnload: boolean;\n\n /**\n * Specifies if the popout icon should be displayed in the header-bar.\n * Default: true\n */\n showPopoutIcon: boolean;\n\n /**\n * Specifies if the maximise icon should be displayed in the header-bar.\n * Default: true\n */\n showMaximiseIcon: boolean;\n\n /**\n * Specifies if the close icon should be displayed in the header-bar.\n * Default: true\n */\n showCloseIcon: boolean;\n\n responsiveMode: 'onload' | 'always' | 'none'; // Can be onload, always, or none.\n\n /**\n * Maximum pixel overlap per tab\n */\n tabOverlapAllowance: number;\n\n tabControlOffset: number;\n\n /**\n * The default config to apply to Components\n */\n defaultComponentConfig: Partial<Omit<ItemConfig, 'type'>>;\n}\n\nexport interface Dimensions {\n /**\n * The width of the borders between the layout items in pixel. Please note: The actual draggable area is wider\n * than the visible one, making it safe to set this to small values without affecting usability.\n * Default: 5\n */\n borderWidth: number;\n\n borderGrabWidth: number;\n\n /**\n * The minimum height an item can be resized to (in pixel).\n * Default: 10\n */\n minItemHeight: number;\n\n /**\n * The minimum width an item can be resized to (in pixel).\n * Default: 10\n */\n minItemWidth: number;\n\n /**\n * The height of the header elements in pixel. This can be changed, but your theme's header css needs to be\n * adjusted accordingly.\n * Default: 20\n */\n headerHeight: number;\n\n /**\n * The width of the element that appears when an item is dragged (in pixel).\n * Default: 300\n */\n dragProxyWidth: number;\n\n /**\n * The height of the element that appears when an item is dragged (in pixel).\n * Default: 200\n */\n dragProxyHeight: number;\n}\n\nexport interface Labels {\n /**\n * The tooltip text that appears when hovering over the close icon.\n * Default: 'close'\n */\n close: string;\n\n /**\n * The tooltip text that appears when hovering over the maximise icon.\n * Default: 'maximise'\n */\n maximise: string;\n\n /**\n * The tooltip text that appears when hovering over the minimise icon.\n * Default: 'minimise'\n */\n minimise: string;\n\n /**\n * The tooltip text that appears when hovering over the popout icon.\n * Default: 'open in new window'\n */\n popout: string;\n\n tabDropdown: string;\n\n tabNextLabel: string;\n\n tabPreviousLabel: string;\n\n popin: string;\n}\n\nexport const defaultConfig: Config = Object.freeze({\n openPopouts: [],\n settings: {\n hasHeaders: true,\n constrainDragToContainer: true,\n reorderEnabled: true,\n selectionEnabled: false,\n popoutWholeStack: false,\n blockedPopoutsThrowError: true,\n closePopoutsOnUnload: true,\n showPopoutIcon: true,\n showMaximiseIcon: true,\n showCloseIcon: true,\n responsiveMode: 'onload' as const, // Can be onload, always, or none.\n tabOverlapAllowance: 0, // maximum pixel overlap per tab\n // reorderOnTabMenuClick: true, // Deephaven disabled\n tabControlOffset: 10,\n },\n dimensions: {\n borderWidth: 5,\n borderGrabWidth: 10,\n minItemHeight: 10,\n minItemWidth: 10,\n headerHeight: 20,\n dragProxyWidth: 300,\n dragProxyHeight: 200,\n },\n labels: {\n close: 'Close',\n maximise: 'Maximize',\n minimise: 'Minimize',\n popout: 'Open in new window',\n popin: 'Pop in',\n tabDropdown: 'Additional tabs',\n tabNextLabel: 'Next',\n tabPreviousLabel: 'Previous',\n },\n content: [],\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Config.js","names":["defaultConfig","Object","freeze","openPopouts","settings","hasHeaders","constrainDragToContainer","reorderEnabled","selectionEnabled","popoutWholeStack","blockedPopoutsThrowError","closePopoutsOnUnload","showPopoutIcon","showMaximiseIcon","showCloseIcon","responsiveMode","tabOverlapAllowance","tabControlOffset","dimensions","borderWidth","borderGrabWidth","minItemHeight","minItemWidth","headerHeight","dragProxyWidth","dragProxyHeight","labels","close","maximise","minimise","popout","popin","tabDropdown","tabNextLabel","tabPreviousLabel","content"],"sources":["../../src/config/Config.ts"],"sourcesContent":["import type { ItemConfig } from './ItemConfig';\n\n/**\n * The resolved configuration type with all required fields populated.\n * This is the type returned by `_createConfig` and used internally.\n */\nexport type Config = {\n settings: Partial<Settings>;\n dimensions: Dimensions;\n labels: Labels;\n content: ItemConfig[];\n maximisedItemId?: string;\n openPopouts?: PopoutConfig[];\n};\n\n/**\n * Input configuration type that allows partial configs.\n * Users can provide any subset of the configuration, and defaults will be applied.\n * This is the type accepted by the LayoutManager constructor.\n */\nexport type PartialConfig = {\n settings?: Partial<Settings>;\n dimensions?: Partial<Dimensions>;\n labels?: Partial<Labels>;\n content?: ItemConfig[];\n maximisedItemId?: string;\n openPopouts?: PopoutConfig[];\n};\n\nexport type PopoutConfig = Config & {\n parentId: string;\n indexInParent: number;\n dimensions: Dimensions & {\n width: number;\n\n height: number;\n\n left: number;\n\n top: number;\n };\n};\n\nexport interface Settings {\n /**\n * Turns headers on or off. If false, the layout will be displayed with splitters only.\n * Default: true\n */\n hasHeaders: boolean;\n\n /**\n * Constrains the area in which items can be dragged to the layout's container. Will be set to false\n * automatically when layout.createDragSource() is called.\n * Default: true\n */\n constrainDragToContainer: boolean;\n\n /**\n * If true, the user can re-arrange the layout by dragging items by their tabs to the desired location.\n * Default: true\n */\n reorderEnabled: boolean;\n\n /**\n * If true, the user can select items by clicking on their header. This sets the value of layout.selectedItem to\n * the clicked item, highlights its header and the layout emits a 'selectionChanged' event.\n * Default: false\n */\n selectionEnabled: boolean;\n\n /**\n * Decides what will be opened in a new window if the user clicks the popout icon. If true the entire stack will\n * be transferred to the new window, if false only the active component will be opened.\n * Default: false\n */\n popoutWholeStack: boolean;\n\n /**\n * Specifies if an error is thrown when a popout is blocked by the browser (e.g. by opening it programmatically).\n * If false, the popout call will fail silently.\n * Default: true\n */\n blockedPopoutsThrowError: boolean;\n\n /**\n * Specifies if all popouts should be closed when the page that created them is closed. Popouts don't have a\n * strong dependency on their parent and can exist on their own, but can be quite annoying to close by hand. In\n * addition, any changes made to popouts won't be stored after the parent is closed.\n * Default: true\n */\n closePopoutsOnUnload: boolean;\n\n /**\n * Specifies if the popout icon should be displayed in the header-bar.\n * Default: true\n */\n showPopoutIcon: boolean;\n\n /**\n * Specifies if the maximise icon should be displayed in the header-bar.\n * Default: true\n */\n showMaximiseIcon: boolean;\n\n /**\n * Specifies if the close icon should be displayed in the header-bar.\n * Default: true\n */\n showCloseIcon: boolean;\n\n responsiveMode: 'onload' | 'always' | 'none'; // Can be onload, always, or none.\n\n /**\n * Maximum pixel overlap per tab\n */\n tabOverlapAllowance: number;\n\n tabControlOffset: number;\n\n /**\n * The default config to apply to Components\n */\n defaultComponentConfig: Partial<Omit<ItemConfig, 'type'>>;\n}\n\nexport interface Dimensions {\n /**\n * The width of the borders between the layout items in pixel. Please note: The actual draggable area is wider\n * than the visible one, making it safe to set this to small values without affecting usability.\n * Default: 5\n */\n borderWidth: number;\n\n borderGrabWidth: number;\n\n /**\n * The minimum height an item can be resized to (in pixel).\n * Default: 10\n */\n minItemHeight: number;\n\n /**\n * The minimum width an item can be resized to (in pixel).\n * Default: 10\n */\n minItemWidth: number;\n\n /**\n * The height of the header elements in pixel. This can be changed, but your theme's header css needs to be\n * adjusted accordingly.\n * Default: 20\n */\n headerHeight: number;\n\n /**\n * The width of the element that appears when an item is dragged (in pixel).\n * Default: 300\n */\n dragProxyWidth: number;\n\n /**\n * The height of the element that appears when an item is dragged (in pixel).\n * Default: 200\n */\n dragProxyHeight: number;\n}\n\nexport interface Labels {\n /**\n * The tooltip text that appears when hovering over the close icon.\n * Default: 'close'\n */\n close: string;\n\n /**\n * The tooltip text that appears when hovering over the maximise icon.\n * Default: 'maximise'\n */\n maximise: string;\n\n /**\n * The tooltip text that appears when hovering over the minimise icon.\n * Default: 'minimise'\n */\n minimise: string;\n\n /**\n * The tooltip text that appears when hovering over the popout icon.\n * Default: 'open in new window'\n */\n popout: string;\n\n tabDropdown: string;\n\n tabNextLabel: string;\n\n tabPreviousLabel: string;\n\n popin: string;\n}\n\nexport const defaultConfig: Config = Object.freeze({\n openPopouts: [],\n settings: {\n hasHeaders: true,\n constrainDragToContainer: true,\n reorderEnabled: true,\n selectionEnabled: false,\n popoutWholeStack: false,\n blockedPopoutsThrowError: true,\n closePopoutsOnUnload: true,\n showPopoutIcon: true,\n showMaximiseIcon: true,\n showCloseIcon: true,\n responsiveMode: 'onload' as const, // Can be onload, always, or none.\n tabOverlapAllowance: 0, // maximum pixel overlap per tab\n // reorderOnTabMenuClick: true, // Deephaven disabled\n tabControlOffset: 10,\n },\n dimensions: {\n borderWidth: 5,\n borderGrabWidth: 10,\n minItemHeight: 10,\n minItemWidth: 10,\n headerHeight: 20,\n dragProxyWidth: 300,\n dragProxyHeight: 200,\n },\n labels: {\n close: 'Close',\n maximise: 'Maximize',\n minimise: 'Minimize',\n popout: 'Open in new window',\n popin: 'Pop in',\n tabDropdown: 'Additional tabs',\n tabNextLabel: 'Next',\n tabPreviousLabel: 'Previous',\n },\n content: [],\n});\n"],"mappings":"AAEA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;AACA;;AAsLA,OAAO,IAAMA,aAAqB,GAAGC,MAAM,CAACC,MAAM,CAAC;EACjDC,WAAW,EAAE,EAAE;EACfC,QAAQ,EAAE;IACRC,UAAU,EAAE,IAAI;IAChBC,wBAAwB,EAAE,IAAI;IAC9BC,cAAc,EAAE,IAAI;IACpBC,gBAAgB,EAAE,KAAK;IACvBC,gBAAgB,EAAE,KAAK;IACvBC,wBAAwB,EAAE,IAAI;IAC9BC,oBAAoB,EAAE,IAAI;IAC1BC,cAAc,EAAE,IAAI;IACpBC,gBAAgB,EAAE,IAAI;IACtBC,aAAa,EAAE,IAAI;IACnBC,cAAc,EAAE,QAAiB;IAAE;IACnCC,mBAAmB,EAAE,CAAC;IAAE;IACxB;IACAC,gBAAgB,EAAE;EACpB,CAAC;EACDC,UAAU,EAAE;IACVC,WAAW,EAAE,CAAC;IACdC,eAAe,EAAE,EAAE;IACnBC,aAAa,EAAE,EAAE;IACjBC,YAAY,EAAE,EAAE;IAChBC,YAAY,EAAE,EAAE;IAChBC,cAAc,EAAE,GAAG;IACnBC,eAAe,EAAE;EACnB,CAAC;EACDC,MAAM,EAAE;IACNC,KAAK,EAAE,OAAO;IACdC,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,oBAAoB;IAC5BC,KAAK,EAAE,QAAQ;IACfC,WAAW,EAAE,iBAAiB;IAC9BC,YAAY,EAAE,MAAM;IACpBC,gBAAgB,EAAE;EACpB,CAAC;EACDC,OAAO,EAAE;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -69,8 +69,9 @@ export interface ComponentConfig extends ItemConfigAttributes {
|
|
|
69
69
|
/**
|
|
70
70
|
* A serialisable object. Will be passed to the component constructor function and will be the value returned by
|
|
71
71
|
* container.getState().
|
|
72
|
+
* Default: {}
|
|
72
73
|
*/
|
|
73
|
-
componentState
|
|
74
|
+
componentState?: Record<string, unknown>;
|
|
74
75
|
}
|
|
75
76
|
export interface ReactComponentConfig extends ItemConfigAttributes {
|
|
76
77
|
type: 'react-component';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemConfig.d.ts","sourceRoot":"","sources":["../../src/config/ItemConfig.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GA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EAAE,iBAM9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemConfig.js","names":["isGLComponentConfig","item","componentName","undefined","isReactComponentConfig","component","itemDefaultConfig","Object","freeze","type","isClosable","isFocusOnShow","reorderEnabled","title"],"sources":["../../src/config/ItemConfig.ts"],"sourcesContent":["/** @deprecated Use `ItemConfig` instead. */\nexport type ItemConfigType = ItemConfig;\n\nexport type ItemConfig =\n | ColumnItemConfig\n | ComponentConfig\n | DefaultItemConfig\n | ReactComponentConfig\n | RootItemConfig\n | RowItemConfig\n | StackItemConfig;\n\nexport interface ItemConfigAttributes {\n /**\n * An array of configurations for items that will be created as children of this item.\n */\n content?: ItemConfig[];\n\n /**\n * The width of this item, relative to the other children of its parent in percent\n */\n width?: number;\n\n minWidth?: number;\n\n /**\n * The height of this item, relative to the other children of its parent in percent\n */\n height?: number;\n\n minHeight?: number;\n\n /**\n * A String or an Array of Strings. Used to retrieve the item using item.getItemsById()\n */\n id?: string | string[];\n\n /**\n * Determines if the item is closable. If false, the x on the items tab will be hidden and container.close()\n * will return false\n * Default: true\n */\n isClosable?: boolean;\n\n /**\n * The title of the item as displayed on its tab and on popout windows\n * Default: componentName or ''\n */\n title?: string;\n\n isFocusOnShow?: boolean;\n\n reorderEnabled?: boolean;\n\n header?: StackItemHeaderConfig;\n}\n\nexport interface DefaultItemConfig extends ItemConfigAttributes {\n type: 'default';\n}\n\nexport interface RowItemConfig extends ItemConfigAttributes {\n type: 'row';\n}\n\nexport interface ColumnItemConfig extends ItemConfigAttributes {\n type: 'column';\n}\n\nexport interface RootItemConfig extends ItemConfigAttributes {\n type: 'root';\n}\n\nexport interface StackItemHeaderConfig {\n show?: boolean | 'top' | 'left' | 'right' | 'bottom';\n popout?: string;\n maximise?: string;\n close?: string;\n minimise?: string;\n}\n\nexport interface StackItemConfig extends ItemConfigAttributes {\n type: 'stack';\n activeItemIndex?: number;\n header?: StackItemHeaderConfig;\n hasHeaders?: boolean;\n}\n\nexport interface ComponentConfig extends ItemConfigAttributes {\n type: 'component';\n\n /**\n * The name of the component as specified in layout.registerComponent. Mandatory if type is 'component'.\n */\n componentName: string;\n\n /**\n * A serialisable object. Will be passed to the component constructor function and will be the value returned by\n * container.getState().\n */\n componentState
|
|
1
|
+
{"version":3,"file":"ItemConfig.js","names":["isGLComponentConfig","item","componentName","undefined","isReactComponentConfig","component","itemDefaultConfig","Object","freeze","type","isClosable","isFocusOnShow","reorderEnabled","title"],"sources":["../../src/config/ItemConfig.ts"],"sourcesContent":["/** @deprecated Use `ItemConfig` instead. */\nexport type ItemConfigType = ItemConfig;\n\nexport type ItemConfig =\n | ColumnItemConfig\n | ComponentConfig\n | DefaultItemConfig\n | ReactComponentConfig\n | RootItemConfig\n | RowItemConfig\n | StackItemConfig;\n\nexport interface ItemConfigAttributes {\n /**\n * An array of configurations for items that will be created as children of this item.\n */\n content?: ItemConfig[];\n\n /**\n * The width of this item, relative to the other children of its parent in percent\n */\n width?: number;\n\n minWidth?: number;\n\n /**\n * The height of this item, relative to the other children of its parent in percent\n */\n height?: number;\n\n minHeight?: number;\n\n /**\n * A String or an Array of Strings. Used to retrieve the item using item.getItemsById()\n */\n id?: string | string[];\n\n /**\n * Determines if the item is closable. If false, the x on the items tab will be hidden and container.close()\n * will return false\n * Default: true\n */\n isClosable?: boolean;\n\n /**\n * The title of the item as displayed on its tab and on popout windows\n * Default: componentName or ''\n */\n title?: string;\n\n isFocusOnShow?: boolean;\n\n reorderEnabled?: boolean;\n\n header?: StackItemHeaderConfig;\n}\n\nexport interface DefaultItemConfig extends ItemConfigAttributes {\n type: 'default';\n}\n\nexport interface RowItemConfig extends ItemConfigAttributes {\n type: 'row';\n}\n\nexport interface ColumnItemConfig extends ItemConfigAttributes {\n type: 'column';\n}\n\nexport interface RootItemConfig extends ItemConfigAttributes {\n type: 'root';\n}\n\nexport interface StackItemHeaderConfig {\n show?: boolean | 'top' | 'left' | 'right' | 'bottom';\n popout?: string;\n maximise?: string;\n close?: string;\n minimise?: string;\n}\n\nexport interface StackItemConfig extends ItemConfigAttributes {\n type: 'stack';\n activeItemIndex?: number;\n header?: StackItemHeaderConfig;\n hasHeaders?: boolean;\n}\n\nexport interface ComponentConfig extends ItemConfigAttributes {\n type: 'component';\n\n /**\n * The name of the component as specified in layout.registerComponent. Mandatory if type is 'component'.\n */\n componentName: string;\n\n /**\n * A serialisable object. Will be passed to the component constructor function and will be the value returned by\n * container.getState().\n * Default: {}\n */\n componentState?: Record<string, unknown>;\n}\n\nexport interface ReactComponentConfig extends ItemConfigAttributes {\n type: 'react-component';\n\n componentName?: string;\n /**\n * The name of the component as specified in layout.registerComponent. Mandatory if type is 'react-component'\n */\n component: string;\n\n /**\n * Properties that will be passed to the component and accessible using this.props.\n */\n props?: any;\n}\n\nexport function isGLComponentConfig(item: ItemConfig): item is ComponentConfig {\n return (item as ComponentConfig).componentName !== undefined;\n}\n\nexport function isReactComponentConfig(\n item: ItemConfig\n): item is ReactComponentConfig {\n return (item as ReactComponentConfig).component !== undefined;\n}\n\nexport const itemDefaultConfig: DefaultItemConfig = Object.freeze({\n type: 'default',\n isClosable: true,\n isFocusOnShow: true,\n reorderEnabled: true,\n title: '',\n});\n"],"mappings":"AAAA;;AAuHA,OAAO,SAASA,mBAAmBA,CAACC,IAAgB,EAA2B;EAC7E,OAAQA,IAAI,CAAqBC,aAAa,KAAKC,SAAS;AAC9D;AAEA,OAAO,SAASC,sBAAsBA,CACpCH,IAAgB,EACc;EAC9B,OAAQA,IAAI,CAA0BI,SAAS,KAAKF,SAAS;AAC/D;AAEA,OAAO,IAAMG,iBAAoC,GAAGC,MAAM,CAACC,MAAM,CAAC;EAChEC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE,IAAI;EAChBC,aAAa,EAAE,IAAI;EACnBC,cAAc,EAAE,IAAI;EACpBC,KAAK,EAAE;AACT,CAAC,CAAC","ignoreList":[]}
|
package/dist/controls/Tab.d.ts
CHANGED
|
@@ -27,6 +27,12 @@ export default class Tab {
|
|
|
27
27
|
* @param title can contain html
|
|
28
28
|
*/
|
|
29
29
|
setTitle(title?: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Updates the content item this tab is associated with.
|
|
32
|
+
* Properly transfers event listeners from the old content item to the new one.
|
|
33
|
+
* @param newContentItem The new content item
|
|
34
|
+
*/
|
|
35
|
+
setContentItem(newContentItem: AbstractContentItem): void;
|
|
30
36
|
/**
|
|
31
37
|
* Sets this tab's active state. To programmatically
|
|
32
38
|
* switch tabs, use header.setActiveContentItem( item ) instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../src/controls/Tab.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAKpD,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,GAAG;IACtB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS,CAMb;IAEX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,mBAAmB,CAAC;IACjC,OAAO,sBAAoB;IAC3B,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;IAClC,QAAQ,UAAS;IAEjB,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,aAAa,CAAC,CAAe;gBAEzB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,mBAAmB;IA2D5D;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,SAAK;IAMnB;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,OAAO;IAa3B;;;;;OAKG;IACH,SAAS;IAyBT;;;;;OAKG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAmBjC;;OAEG;IACH,oBAAoB;IAcpB;;;;;;;OAOG;IACH,qBA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AAC,KAAK,CAAC,EAAE,MAAM,CAAC,cAAc;IAwCzC;;;;;OAKG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,cAAc;IAS1C;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,cAAc;IAOvC;;;;;OAKG;IACH,iBAAiB,CAAC,KAAK,EAAE,KAAK;CAG/B"}
|
package/dist/controls/Tab.js
CHANGED
|
@@ -72,6 +72,32 @@ export default class Tab {
|
|
|
72
72
|
this.titleElement.text(title);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Updates the content item this tab is associated with.
|
|
77
|
+
* Properly transfers event listeners from the old content item to the new one.
|
|
78
|
+
* @param newContentItem The new content item
|
|
79
|
+
*/
|
|
80
|
+
setContentItem(newContentItem) {
|
|
81
|
+
var oldContentItem = this.contentItem;
|
|
82
|
+
|
|
83
|
+
// Transfer the 'destroy' listener if dragListener exists
|
|
84
|
+
if (this._dragListener) {
|
|
85
|
+
oldContentItem.off('destroy', this._dragListener.destroy, this._dragListener);
|
|
86
|
+
newContentItem.on('destroy', this._dragListener.destroy, this._dragListener);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Transfer 'titleChanged' listener
|
|
90
|
+
oldContentItem.off('titleChanged', this.setTitle, this);
|
|
91
|
+
newContentItem.on('titleChanged', this.setTitle, this);
|
|
92
|
+
|
|
93
|
+
// Update the reference
|
|
94
|
+
this.contentItem = newContentItem;
|
|
95
|
+
newContentItem.tab = this;
|
|
96
|
+
|
|
97
|
+
// Update title
|
|
98
|
+
this.setTitle(newContentItem.config.title);
|
|
99
|
+
}
|
|
100
|
+
|
|
75
101
|
/**
|
|
76
102
|
* Sets this tab's active state. To programmatically
|
|
77
103
|
* switch tabs, use header.setActiveContentItem( item ) instead.
|
package/dist/controls/Tab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tab.js","names":["$","isComponent","DragListener","DragProxy","Tab","constructor","header","contentItem","_this$_layoutManager$","_defineProperty","_template","titleElement","element","find","closeElement","config","isClosable","setTitle","title","on","_layoutManager","layoutManager","settings","reorderEnabled","_dragListener","root","_onDragStart","destroy","_onTabClick","bind","_onCloseClick","_onTabContentFocusIn","_onTabContentFocusOut","_onMouseUp","_onCloseMousedown","remove","tab","emit","container","_contentElement","arguments","length","undefined","text","setActive","isActive","addClass","removeClass","_$destroy","off","removeEventListener","x","y","_this$contentItem$par","parent","isMaximised","toggleMaximise","contains","document","activeElement","event","button","_this$element$get","activeContentItem","getActiveContentItem","setActiveContentItem","focus","_hideAdditionalTabsDropdown","get","scrollIntoView","inline","stopPropagation","close","removeChild","preventDefault","join"],"sources":["../../src/controls/Tab.ts"],"sourcesContent":["import $ from 'jquery';\nimport type { AbstractContentItem } from '../items';\nimport { isComponent } from '../items';\nimport type LayoutManager from '../LayoutManager';\nimport { DragListener } from '../utils';\nimport DragProxy from './DragProxy';\nimport type Header from './Header';\n\n/**\n * Represents an individual tab within a Stack's header\n *\n * @param header\n * @param contentItem\n */\nexport default class Tab {\n /**\n * The tab's html template\n */\n private static _template = [\n '<li class=\"lm_tab\">',\n '<span class=\"lm_title_before\"></span>',\n '<span class=\"lm_title\"></span>',\n '<div class=\"lm_close_tab\" aria-label=\"Close tab\"></div>',\n '</li>',\n ].join('');\n\n header: Header;\n contentItem: AbstractContentItem;\n element = $(Tab._template);\n titleElement: JQuery<HTMLElement>;\n closeElement: JQuery<HTMLElement>;\n isActive = false;\n\n private _layoutManager: LayoutManager;\n private _dragListener?: DragListener;\n\n constructor(header: Header, contentItem: AbstractContentItem) {\n this.header = header;\n this.contentItem = contentItem;\n this.titleElement = this.element.find('.lm_title');\n this.closeElement = this.element.find('.lm_close_tab');\n this.closeElement[contentItem.config.isClosable ? 'show' : 'hide']();\n\n this.setTitle(contentItem.config.title);\n this.contentItem.on('titleChanged', this.setTitle, this);\n\n this._layoutManager = this.contentItem.layoutManager;\n\n if (\n this._layoutManager.config.settings?.reorderEnabled &&\n contentItem.config.reorderEnabled\n ) {\n this._dragListener = new DragListener(\n this.element,\n this._layoutManager.root\n );\n this._dragListener.on('dragStart', this._onDragStart, this);\n this.contentItem.on(\n 'destroy',\n this._dragListener.destroy,\n this._dragListener\n );\n }\n\n this._onTabClick = this._onTabClick.bind(this);\n this._onCloseClick = this._onCloseClick.bind(this);\n this._onTabContentFocusIn = this._onTabContentFocusIn.bind(this);\n this._onTabContentFocusOut = this._onTabContentFocusOut.bind(this);\n\n this.element.on('click', this._onTabClick);\n this.element.on('auxclick', this._onTabClick);\n this.element.on('mouseup', this._onMouseUp);\n\n if (this.contentItem.config.isClosable) {\n this.closeElement.on('click', this._onCloseClick);\n this.closeElement.on('mousedown', this._onCloseMousedown);\n } else {\n this.closeElement.remove();\n }\n\n this.contentItem.tab = this;\n this.contentItem.emit('tab', this);\n this.contentItem.layoutManager.emit('tabCreated', this);\n\n if (isComponent(this.contentItem)) {\n // add focus class to tab when content\n this.contentItem.container._contentElement\n .on('focusin', this._onTabContentFocusIn)\n .on('focusout', this._onTabContentFocusOut);\n\n this.contentItem.container.tab = this;\n this.contentItem.container.emit('tab', this);\n }\n }\n\n /**\n * Sets the tab's title to the provided string and sets\n * its title attribute to a pure text representation (without\n * html tags) of the same string.\n * @param title can contain html\n */\n setTitle(title = '') {\n // Disabling for illumon project, we want to manage our own tooltips\n // this.element.attr( 'title', lm.utils.stripTags( title ) );\n this.titleElement.text(title);\n }\n\n /**\n * Sets this tab's active state. To programmatically\n * switch tabs, use header.setActiveContentItem( item ) instead.\n * @param isActive\n */\n setActive(isActive: boolean) {\n if (isActive === this.isActive) {\n return;\n }\n this.isActive = isActive;\n\n if (isActive) {\n this.element.addClass('lm_active');\n } else {\n this.element.removeClass('lm_active');\n }\n }\n\n /**\n * Destroys the tab\n *\n * @private\n * @returns {void}\n */\n _$destroy() {\n this.element.off('click', this._onTabClick);\n this.element.off('auxclick', this._onTabClick);\n this.element.off('mouseup', this._onMouseUp);\n this.closeElement.off('click', this._onCloseClick);\n if (isComponent(this.contentItem)) {\n this.contentItem.container._contentElement.off();\n this.contentItem.container._contentElement[0].removeEventListener(\n 'click',\n this._onTabContentFocusIn,\n true\n );\n }\n if (this._dragListener) {\n this.contentItem.off(\n 'destroy',\n this._dragListener.destroy,\n this._dragListener\n );\n this._dragListener.off('dragStart', this._onDragStart);\n this._dragListener = undefined;\n }\n this.element.remove();\n }\n\n /**\n * Callback for the DragListener\n *\n * @param x The tabs absolute x position\n * @param y The tabs absolute y position\n */\n _onDragStart(x: number, y: number) {\n if (this.contentItem.parent?.isMaximised) {\n this.contentItem.parent.toggleMaximise();\n }\n\n if (!this._dragListener) {\n return;\n }\n\n new DragProxy(\n x,\n y,\n this._dragListener,\n this._layoutManager,\n this.contentItem,\n this.header.parent\n );\n }\n\n /**\n * Callback when the contentItem is focused in\n */\n _onTabContentFocusIn() {\n // Ensure only one tab is marked as having focus at a time.\n // In Firefox, if the focused element is removed from the DOM,\n // the focusout event won't trigger. This can result in two tabs\n // being erroneously marked as focused if the user's DOM element\n // is removed and they click another tab. To prevent this, we\n // remove existing \"lm_focusin\" classes first.\n $('.lm_focusin', this._layoutManager.root.element).removeClass(\n 'lm_focusin'\n );\n\n this.element.addClass('lm_focusin');\n }\n\n /**\n * Callback when the contentItem is focused out\n *\n * @param {jQuery DOM event} event\n *\n * @private\n * @returns {void}\n */\n _onTabContentFocusOut() {\n if (\n isComponent(this.contentItem) &&\n !this.contentItem.container._contentElement[0].contains(\n document.activeElement\n )\n ) {\n this.element.removeClass('lm_focusin');\n }\n }\n\n /**\n * Callback when the tab is clicked\n *\n * @param event\n */\n _onTabClick(event?: JQuery.TriggeredEvent) {\n // left mouse button or tap\n if (!event || event.button === 0) {\n var activeContentItem = this.header.parent.getActiveContentItem();\n if (\n this.contentItem !== activeContentItem &&\n isComponent(this.contentItem)\n ) {\n this.header.parent.setActiveContentItem(this.contentItem);\n } else if (\n isComponent(this.contentItem) &&\n !this.contentItem.container._contentElement[0].contains(\n document.activeElement\n )\n ) {\n // if no focus inside put focus onto the container\n // so focusin always fires for tabclicks\n this.contentItem.container._contentElement.focus();\n }\n\n if (isComponent(this.contentItem)) {\n this.contentItem.container.emit('tabClicked', event);\n }\n\n // might have been called from the dropdown\n this.header._hideAdditionalTabsDropdown();\n\n // makes sure clicked tabs scrollintoview (either those partially offscreen or in dropdown)\n this.element.get(0)?.scrollIntoView({\n inline: 'nearest',\n // behaviour smooth is not possible here, as when a tab becomes active it may attempt to take focus\n // which interupts any scroll behaviour from completeting\n });\n\n // middle mouse button\n } else if (event.button === 1 && this.contentItem.config.isClosable) {\n this._onCloseClick(event);\n }\n }\n\n /**\n * Callback when the tab's close button is\n * clicked\n *\n * @param event\n */\n _onCloseClick(event: JQuery.TriggeredEvent) {\n event.stopPropagation();\n if (isComponent(this.contentItem)) {\n this.contentItem.container.close();\n } else {\n this.header.parent.removeChild(this.contentItem);\n }\n }\n\n /**\n * Callback to prevent paste into active input on Linux\n * when closing a tab via middle click.\n * @param event\n */\n _onMouseUp(event: JQuery.TriggeredEvent) {\n if (event.button === 1) {\n event.preventDefault(); // This seems to prevent the paste event from firing\n event.stopPropagation(); // Stop propagation just in case\n }\n }\n\n /**\n * Callback to capture tab close button mousedown\n * to prevent tab from activating.\n *\n * @param event\n */\n _onCloseMousedown(event: Event) {\n event.stopPropagation();\n }\n}\n"],"mappings":";;;AAAA,OAAOA,CAAC,MAAM,QAAQ;AAAC,SAEdC,WAAW;AAAA,SAEXC,YAAY;AAAA,OACdC,SAAS;AAGhB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,GAAG,CAAC;EAsBvBC,WAAWA,CAACC,MAAc,EAAEC,WAAgC,EAAE;IAAA,IAAAC,qBAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA,kBARpDT,CAAC,CAACI,GAAG,CAACM,SAAS,CAAC;IAAAD,eAAA;IAAAA,eAAA;IAAAA,eAAA,mBAGf,KAAK;IAAAA,eAAA;IAAAA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CAAC;QAClCC,MAAM,EAAE;QACR;QACA;MACF,CAAC,CAAC;;MAEF;IACF,CAAC,MAAM,IAAIV,KAAK,CAACC,MAAM,KAAK,CAAC,IAAI,IAAI,CAACtD,WAAW,CAACQ,MAAM,CAACC,UAAU,EAAE;MACnE,IAAI,CAACc,aAAa,CAAC8B,KAAK,CAAC;IAC3B;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE9B,aAAaA,CAAC8B,KAA4B,EAAE;IAC1CA,KAAK,CAACW,eAAe,CAAC,CAAC;IACvB,IAAItE,WAAW,CAAC,IAAI,CAACM,WAAW,CAAC,EAAE;MACjC,IAAI,CAACA,WAAW,CAAC+B,SAAS,CAACkC,KAAK,CAAC,CAAC;IACpC,CAAC,MAAM;MACL,IAAI,CAAClE,MAAM,CAACgD,MAAM,CAACmB,WAAW,CAAC,IAAI,CAAClE,WAAW,CAAC;IAClD;EACF;;EAEA;AACF;AACA;AACA;AACA;EACE0B,UAAUA,CAAC2B,KAA4B,EAAE;IACvC,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;MACtBD,KAAK,CAACc,cAAc,CAAC,CAAC,CAAC,CAAC;MACxBd,KAAK,CAACW,eAAe,CAAC,CAAC,CAAC,CAAC;IAC3B;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;EACErC,iBAAiBA,CAAC0B,KAAY,EAAE;IAC9BA,KAAK,CAACW,eAAe,CAAC,CAAC;EACzB;AACF;AA3RE;AACF;AACA;AAFE9D,eAAA,CADmBL,GAAG,eAIK,CACzB,qBAAqB,EACrB,uCAAuC,EACvC,gCAAgC,EAChC,yDAAyD,EACzD,OAAO,CACR,CAACuE,IAAI,CAAC,EAAE,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Tab.js","names":["$","isComponent","DragListener","DragProxy","Tab","constructor","header","contentItem","_this$_layoutManager$","_defineProperty","_template","titleElement","element","find","closeElement","config","isClosable","setTitle","title","on","_layoutManager","layoutManager","settings","reorderEnabled","_dragListener","root","_onDragStart","destroy","_onTabClick","bind","_onCloseClick","_onTabContentFocusIn","_onTabContentFocusOut","_onMouseUp","_onCloseMousedown","remove","tab","emit","container","_contentElement","arguments","length","undefined","text","setContentItem","newContentItem","oldContentItem","off","setActive","isActive","addClass","removeClass","_$destroy","removeEventListener","x","y","_this$contentItem$par","parent","isMaximised","toggleMaximise","contains","document","activeElement","event","button","_this$element$get","activeContentItem","getActiveContentItem","setActiveContentItem","focus","_hideAdditionalTabsDropdown","get","scrollIntoView","inline","stopPropagation","close","removeChild","preventDefault","join"],"sources":["../../src/controls/Tab.ts"],"sourcesContent":["import $ from 'jquery';\nimport type { AbstractContentItem } from '../items';\nimport { isComponent } from '../items';\nimport type LayoutManager from '../LayoutManager';\nimport { DragListener } from '../utils';\nimport DragProxy from './DragProxy';\nimport type Header from './Header';\n\n/**\n * Represents an individual tab within a Stack's header\n *\n * @param header\n * @param contentItem\n */\nexport default class Tab {\n /**\n * The tab's html template\n */\n private static _template = [\n '<li class=\"lm_tab\">',\n '<span class=\"lm_title_before\"></span>',\n '<span class=\"lm_title\"></span>',\n '<div class=\"lm_close_tab\" aria-label=\"Close tab\"></div>',\n '</li>',\n ].join('');\n\n header: Header;\n contentItem: AbstractContentItem;\n element = $(Tab._template);\n titleElement: JQuery<HTMLElement>;\n closeElement: JQuery<HTMLElement>;\n isActive = false;\n\n private _layoutManager: LayoutManager;\n private _dragListener?: DragListener;\n\n constructor(header: Header, contentItem: AbstractContentItem) {\n this.header = header;\n this.contentItem = contentItem;\n this.titleElement = this.element.find('.lm_title');\n this.closeElement = this.element.find('.lm_close_tab');\n this.closeElement[contentItem.config.isClosable ? 'show' : 'hide']();\n\n this.setTitle(contentItem.config.title);\n this.contentItem.on('titleChanged', this.setTitle, this);\n\n this._layoutManager = this.contentItem.layoutManager;\n\n if (\n this._layoutManager.config.settings?.reorderEnabled &&\n contentItem.config.reorderEnabled\n ) {\n this._dragListener = new DragListener(\n this.element,\n this._layoutManager.root\n );\n this._dragListener.on('dragStart', this._onDragStart, this);\n this.contentItem.on(\n 'destroy',\n this._dragListener.destroy,\n this._dragListener\n );\n }\n\n this._onTabClick = this._onTabClick.bind(this);\n this._onCloseClick = this._onCloseClick.bind(this);\n this._onTabContentFocusIn = this._onTabContentFocusIn.bind(this);\n this._onTabContentFocusOut = this._onTabContentFocusOut.bind(this);\n\n this.element.on('click', this._onTabClick);\n this.element.on('auxclick', this._onTabClick);\n this.element.on('mouseup', this._onMouseUp);\n\n if (this.contentItem.config.isClosable) {\n this.closeElement.on('click', this._onCloseClick);\n this.closeElement.on('mousedown', this._onCloseMousedown);\n } else {\n this.closeElement.remove();\n }\n\n this.contentItem.tab = this;\n this.contentItem.emit('tab', this);\n this.contentItem.layoutManager.emit('tabCreated', this);\n\n if (isComponent(this.contentItem)) {\n // add focus class to tab when content\n this.contentItem.container._contentElement\n .on('focusin', this._onTabContentFocusIn)\n .on('focusout', this._onTabContentFocusOut);\n\n this.contentItem.container.tab = this;\n this.contentItem.container.emit('tab', this);\n }\n }\n\n /**\n * Sets the tab's title to the provided string and sets\n * its title attribute to a pure text representation (without\n * html tags) of the same string.\n * @param title can contain html\n */\n setTitle(title = '') {\n // Disabling for illumon project, we want to manage our own tooltips\n // this.element.attr( 'title', lm.utils.stripTags( title ) );\n this.titleElement.text(title);\n }\n\n /**\n * Updates the content item this tab is associated with.\n * Properly transfers event listeners from the old content item to the new one.\n * @param newContentItem The new content item\n */\n setContentItem(newContentItem: AbstractContentItem) {\n const oldContentItem = this.contentItem;\n\n // Transfer the 'destroy' listener if dragListener exists\n if (this._dragListener) {\n oldContentItem.off(\n 'destroy',\n this._dragListener.destroy,\n this._dragListener\n );\n newContentItem.on(\n 'destroy',\n this._dragListener.destroy,\n this._dragListener\n );\n }\n\n // Transfer 'titleChanged' listener\n oldContentItem.off('titleChanged', this.setTitle, this);\n newContentItem.on('titleChanged', this.setTitle, this);\n\n // Update the reference\n this.contentItem = newContentItem;\n newContentItem.tab = this;\n\n // Update title\n this.setTitle(newContentItem.config.title);\n }\n\n /**\n * Sets this tab's active state. To programmatically\n * switch tabs, use header.setActiveContentItem( item ) instead.\n * @param isActive\n */\n setActive(isActive: boolean) {\n if (isActive === this.isActive) {\n return;\n }\n this.isActive = isActive;\n\n if (isActive) {\n this.element.addClass('lm_active');\n } else {\n this.element.removeClass('lm_active');\n }\n }\n\n /**\n * Destroys the tab\n *\n * @private\n * @returns {void}\n */\n _$destroy() {\n this.element.off('click', this._onTabClick);\n this.element.off('auxclick', this._onTabClick);\n this.element.off('mouseup', this._onMouseUp);\n this.closeElement.off('click', this._onCloseClick);\n if (isComponent(this.contentItem)) {\n this.contentItem.container._contentElement.off();\n this.contentItem.container._contentElement[0].removeEventListener(\n 'click',\n this._onTabContentFocusIn,\n true\n );\n }\n if (this._dragListener) {\n this.contentItem.off(\n 'destroy',\n this._dragListener.destroy,\n this._dragListener\n );\n this._dragListener.off('dragStart', this._onDragStart);\n this._dragListener = undefined;\n }\n this.element.remove();\n }\n\n /**\n * Callback for the DragListener\n *\n * @param x The tabs absolute x position\n * @param y The tabs absolute y position\n */\n _onDragStart(x: number, y: number) {\n if (this.contentItem.parent?.isMaximised) {\n this.contentItem.parent.toggleMaximise();\n }\n\n if (!this._dragListener) {\n return;\n }\n\n new DragProxy(\n x,\n y,\n this._dragListener,\n this._layoutManager,\n this.contentItem,\n this.header.parent\n );\n }\n\n /**\n * Callback when the contentItem is focused in\n */\n _onTabContentFocusIn() {\n // Ensure only one tab is marked as having focus at a time.\n // In Firefox, if the focused element is removed from the DOM,\n // the focusout event won't trigger. This can result in two tabs\n // being erroneously marked as focused if the user's DOM element\n // is removed and they click another tab. To prevent this, we\n // remove existing \"lm_focusin\" classes first.\n $('.lm_focusin', this._layoutManager.root.element).removeClass(\n 'lm_focusin'\n );\n\n this.element.addClass('lm_focusin');\n }\n\n /**\n * Callback when the contentItem is focused out\n *\n * @param {jQuery DOM event} event\n *\n * @private\n * @returns {void}\n */\n _onTabContentFocusOut() {\n if (\n isComponent(this.contentItem) &&\n !this.contentItem.container._contentElement[0].contains(\n document.activeElement\n )\n ) {\n this.element.removeClass('lm_focusin');\n }\n }\n\n /**\n * Callback when the tab is clicked\n *\n * @param event\n */\n _onTabClick(event?: JQuery.TriggeredEvent) {\n // left mouse button or tap\n if (!event || event.button === 0) {\n var activeContentItem = this.header.parent.getActiveContentItem();\n if (\n this.contentItem !== activeContentItem &&\n isComponent(this.contentItem)\n ) {\n this.header.parent.setActiveContentItem(this.contentItem);\n } else if (\n isComponent(this.contentItem) &&\n !this.contentItem.container._contentElement[0].contains(\n document.activeElement\n )\n ) {\n // if no focus inside put focus onto the container\n // so focusin always fires for tabclicks\n this.contentItem.container._contentElement.focus();\n }\n\n if (isComponent(this.contentItem)) {\n this.contentItem.container.emit('tabClicked', event);\n }\n\n // might have been called from the dropdown\n this.header._hideAdditionalTabsDropdown();\n\n // makes sure clicked tabs scrollintoview (either those partially offscreen or in dropdown)\n this.element.get(0)?.scrollIntoView({\n inline: 'nearest',\n // behaviour smooth is not possible here, as when a tab becomes active it may attempt to take focus\n // which interupts any scroll behaviour from completeting\n });\n\n // middle mouse button\n } else if (event.button === 1 && this.contentItem.config.isClosable) {\n this._onCloseClick(event);\n }\n }\n\n /**\n * Callback when the tab's close button is\n * clicked\n *\n * @param event\n */\n _onCloseClick(event: JQuery.TriggeredEvent) {\n event.stopPropagation();\n if (isComponent(this.contentItem)) {\n this.contentItem.container.close();\n } else {\n this.header.parent.removeChild(this.contentItem);\n }\n }\n\n /**\n * Callback to prevent paste into active input on Linux\n * when closing a tab via middle click.\n * @param event\n */\n _onMouseUp(event: JQuery.TriggeredEvent) {\n if (event.button === 1) {\n event.preventDefault(); // This seems to prevent the paste event from firing\n event.stopPropagation(); // Stop propagation just in case\n }\n }\n\n /**\n * Callback to capture tab close button mousedown\n * to prevent tab from activating.\n *\n * @param event\n */\n _onCloseMousedown(event: Event) {\n event.stopPropagation();\n }\n}\n"],"mappings":";;;AAAA,OAAOA,C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AE;MACnE,IAAI,CAACc,aAAa,CAACiC,KAAK,CAAC;IAC3B;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEjC,aAAaA,CAACiC,KAA4B,EAAE;IAC1CA,KAAK,CAACW,eAAe,CAAC,CAAC;IACvB,IAAIzE,WAAW,CAAC,IAAI,CAACM,WAAW,CAAC,EAAE;MACjC,IAAI,CAACA,WAAW,CAAC+B,SAAS,CAACqC,KAAK,CAAC,CAAC;IACpC,CAAC,MAAM;MACL,IAAI,CAACrE,MAAM,CAACmD,MAAM,CAACmB,WAAW,CAAC,IAAI,CAACrE,WAAW,CAAC;IAClD;EACF;;EAEA;AACF;AACA;AACA;AACA;EACE0B,UAAUA,CAAC8B,KAA4B,EAAE;IACvC,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;MACtBD,KAAK,CAACc,cAAc,CAAC,CAAC,CAAC,CAAC;MACxBd,KAAK,CAACW,eAAe,CAAC,CAAC,CAAC,CAAC;IAC3B;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;EACExC,iBAAiBA,CAAC6B,KAAY,EAAE;IAC9BA,KAAK,CAACW,eAAe,CAAC,CAAC;EACzB;AACF;AA7TE;AACF;AACA;AAFEjE,eAAA,CADmBL,GAAG,eAIK,CACzB,qBAAqB,EACrB,uCAAuC,EACvC,gCAAgC,EAChC,yDAAyD,EACzD,OAAO,CACR,CAAC0E,IAAI,CAAC,EAAE,CAAC","ignoreList":[]}
|
|
@@ -95,7 +95,7 @@ export default abstract class AbstractContentItem extends EventEmitter {
|
|
|
95
95
|
* @param oldChild
|
|
96
96
|
* @param newChild
|
|
97
97
|
*/
|
|
98
|
-
replaceChild(oldChild: AbstractContentItem, newChild: AbstractContentItem, _$destroyOldChild?: boolean): void;
|
|
98
|
+
replaceChild(oldChild: AbstractContentItem, newChild: AbstractContentItem | ItemConfig, _$destroyOldChild?: boolean): void;
|
|
99
99
|
/**
|
|
100
100
|
* Convenience method.
|
|
101
101
|
* Shorthand for this.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E,KAAK,EAAE,aAAa;IAoBlD;;;;;;OAMG;IACH,wCAAwC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa;IAW3E;;;;OAIG;IACH,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa;CAIlE"}
|
|
@@ -208,10 +208,10 @@ export default class AbstractContentItem extends EventEmitter {
|
|
|
208
208
|
newChild.parent = this;
|
|
209
209
|
|
|
210
210
|
/*
|
|
211
|
-
* Update tab reference
|
|
211
|
+
* Update tab reference - use setContentItem to properly transfer event listeners
|
|
212
212
|
*/
|
|
213
213
|
if (isStack(this)) {
|
|
214
|
-
this.header.tabs[index].
|
|
214
|
+
this.header.tabs[index].setContentItem(newChild);
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
//TODO This doesn't update the config... refactor to leave item nodes untouched after creation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractContentItem.js","names":["animFrame","BubblingEvent","EventEmitter","ConfigurationError","itemDefaultConfig","isStack","item","isComponent","isRoot","AbstractContentItem","constructor","layoutManager","config","parent","element","_defineProperty","_extendItemNode","type","contentItems","_pendingEventPropagations","_throttledEvents","on","ALL_EVENT","_propagateEvent","content","_createContentItems","callDownwards","functionName","functionArguments","arguments","length","undefined","bottomUp","skipSelf","apply","i","removeChild","contentItem","_this$config$content","keepChild","index","indexOf","Error","_$destroy","splice","isClosable","_this$parent","addChild","_$normalizeContentItem","isInitialised","_$init","replaceChild","oldChild","newChild","_$destroyOldChild","parentNode","header","tabs","remove","_this$parent2","popout","browserPopout","createPopout","emitBubblingEvent","toggleMaximise","e","preventDefault","isMaximised","_$minimiseItem","_$maximiseItem","select","selectedItem","selectItem","addClass","deselect","removeClass","setTitle","title","emit","hasId","id","Array","addId","push","removeId","getItemsByFilter","filter","result","next","getItemsById","getItemsByType","_$getItemsByProperty","getComponentsByName","componentName","components","instances","instance","key","value","_$setParent","_$highlightDropZone","x","y","area","_this$layoutManager$d","dropTargetIndicator","highlightArea","_$onDrop","_$hide","_callOnActiveComponents","hide","updateSize","_$show","show","methodName","stacks","activeContentItem","getActiveContentItem","container","_$getArea","_element$offset","_element$width","_element$height","offset","left","top","width","height","x1","y1","x2","y2","surface","side","setSize","_this$childElementCon","childElementContainer","append","name","event","oContentItem","createContentItem","Object","entries","k","isPropagationStopped","_scheduleEventPropagationToLayoutManager","origin","_propagateEventToLayoutManager","bind"],"sources":["../../src/items/AbstractContentItem.ts"],"sourcesContent":["import { animFrame, BubblingEvent, EventEmitter } from '../utils';\nimport { ConfigurationError } from '../errors';\nimport { itemDefaultConfig } from '../config';\nimport type { ItemConfig } from '../config';\nimport type LayoutManager from '../LayoutManager';\nimport type Tab from '../controls/Tab';\nimport type Stack from './Stack';\nimport type Component from './Component';\nimport type Root from './Root';\n\nexport function isStack(item: AbstractContentItem): item is Stack {\n return item.isStack;\n}\n\nexport function isComponent(item: AbstractContentItem): item is Component {\n return item.isComponent;\n}\n\nexport function isRoot(item: AbstractContentItem): item is Root {\n return item.isRoot;\n}\n\nexport type ItemArea<C = AbstractContentItem> = {\n x1: number;\n x2: number;\n y1: number;\n y2: number;\n surface: number;\n side: 'left' | 'right' | 'top' | 'bottom' | '';\n contentItem: C;\n};\n\n/**\n * This is the baseclass that all content items inherit from.\n * Most methods provide a subset of what the sub-classes do.\n *\n * It also provides a number of functions for tree traversal\n *\n * @param {lm.LayoutManager} layoutManager\n * @param {item node configuration} config\n * @param {lm.item} parent\n *\n * @event stateChanged\n * @event beforeItemDestroyed\n * @event itemDestroyed\n * @event itemCreated\n * @event componentCreated\n * @event rowCreated\n * @event columnCreated\n * @event stackCreated\n *\n * @constructor\n */\nexport default abstract class AbstractContentItem extends EventEmitter {\n config: ItemConfig;\n type: string;\n contentItems: AbstractContentItem[];\n parent: AbstractContentItem | null;\n layoutManager: LayoutManager;\n element: JQuery<HTMLElement>;\n childElementContainer?: JQuery<HTMLElement>;\n componentName?: string;\n\n isInitialised = false;\n isMaximised = false;\n isRoot = false;\n isRow = false;\n isColumn = false;\n isStack = false;\n isComponent = false;\n\n tab?: Tab;\n\n private _pendingEventPropagations: Record<string, boolean>;\n private _throttledEvents: string[];\n\n constructor(\n layoutManager: LayoutManager,\n config: ItemConfig,\n parent: AbstractContentItem | null,\n element: JQuery<HTMLElement>\n ) {\n super();\n this.element = element;\n\n // Some GL things expect this config to not change\n this.config = this._extendItemNode(config);\n this.type = config.type;\n this.contentItems = [];\n this.parent = parent;\n\n this.layoutManager = layoutManager;\n this._pendingEventPropagations = {};\n this._throttledEvents = ['stateChanged'];\n\n this.on(EventEmitter.ALL_EVENT, this._propagateEvent, this);\n\n if (config.content) {\n this._createContentItems(config);\n }\n }\n\n /**\n * Set the size of the component and its children, called recursively\n *\n * @abstract\n */\n abstract setSize(width?: number, height?: number): void;\n\n /**\n * Calls a method recursively downwards on the tree\n *\n * @param functionName the name of the function to be called\n * @param functionArguments optional arguments that are passed to every function\n * @param bottomUp Call methods from bottom to top, defaults to false\n * @param skipSelf Don't invoke the method on the class that calls it, defaults to false\n */\n callDownwards<N extends 'setSize' | '_$destroy' | '_$init' | '_$show'>(\n functionName: N,\n functionArguments = [] as Parameters<AbstractContentItem[N]>,\n bottomUp = false,\n skipSelf = false\n ) {\n if (bottomUp !== true && skipSelf !== true) {\n this[functionName].apply(this, functionArguments);\n }\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].callDownwards(\n functionName,\n functionArguments,\n bottomUp\n );\n }\n if (bottomUp === true && skipSelf !== true) {\n this[functionName].apply(this, functionArguments);\n }\n }\n\n /**\n * Removes a child node (and its children) from the tree\n *\n * @param contentItem\n */\n removeChild(contentItem: AbstractContentItem, keepChild = false) {\n /*\n * Get the position of the item that's to be removed within all content items this node contains\n */\n const index = this.contentItems.indexOf(contentItem);\n\n /*\n * Make sure the content item to be removed is actually a child of this item\n */\n if (index === -1) {\n throw new Error(\"Can't remove child item. Unknown content item\");\n }\n\n /**\n * Call ._$destroy on the content item. This also calls ._$destroy on all its children\n */\n if (keepChild !== true) {\n this.contentItems[index]._$destroy();\n }\n\n /**\n * Remove the content item from this nodes array of children\n */\n this.contentItems.splice(index, 1);\n\n /**\n * Remove the item from the configuration\n */\n this.config.content?.splice(index, 1);\n\n /**\n * If this node still contains other content items, adjust their size\n */\n if (this.contentItems.length > 0) {\n this.callDownwards('setSize');\n\n /**\n * If this was the last content item, remove this node as well\n */\n } else if (this.type !== 'root' && this.config.isClosable) {\n this.parent?.removeChild(this);\n }\n }\n\n /**\n * Sets up the tree structure for the newly added child\n * The responsibility for the actual DOM manipulations lies\n * with the concrete item\n *\n * @param contentItem\n * @param index If omitted item will be appended\n */\n addChild(contentItem: AbstractContentItem | ItemConfig, index?: number) {\n contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n if (index === undefined) {\n index = this.contentItems.length;\n }\n\n this.contentItems.splice(index, 0, contentItem);\n\n if (this.config.content === undefined) {\n this.config.content = [];\n }\n\n this.config.content.splice(index, 0, contentItem.config);\n contentItem.parent = this;\n\n if (\n contentItem.parent.isInitialised === true &&\n contentItem.isInitialised === false\n ) {\n contentItem._$init();\n }\n }\n\n /**\n * Replaces oldChild with newChild. This used to use jQuery.replaceWith... which for\n * some reason removes all event listeners, so isn't really an option.\n *\n * @param oldChild\n * @param newChild\n */\n replaceChild(\n oldChild: AbstractContentItem,\n newChild: AbstractContentItem,\n _$destroyOldChild = false\n ) {\n newChild = this.layoutManager._$normalizeContentItem(newChild);\n\n const index = this.contentItems.indexOf(oldChild);\n const parentNode = oldChild.element[0].parentNode;\n\n if (index === -1) {\n throw new Error(\"Can't replace child. oldChild is not child of this\");\n }\n\n parentNode?.replaceChild(newChild.element[0], oldChild.element[0]);\n\n /*\n * Optionally destroy the old content item\n */\n if (_$destroyOldChild === true) {\n oldChild.parent = null;\n oldChild._$destroy();\n }\n\n /*\n * Wire the new contentItem into the tree\n */\n this.contentItems[index] = newChild;\n newChild.parent = this;\n\n /*\n * Update tab reference\n */\n if (isStack(this)) {\n this.header.tabs[index].contentItem = newChild;\n }\n\n //TODO This doesn't update the config... refactor to leave item nodes untouched after creation\n if (\n newChild.parent.isInitialised === true &&\n newChild.isInitialised === false\n ) {\n newChild._$init();\n }\n\n this.callDownwards('setSize');\n }\n\n /**\n * Convenience method.\n * Shorthand for this.parent.removeChild( this )\n */\n remove() {\n this.parent?.removeChild(this);\n }\n\n /**\n * Removes the component from the layout and creates a new\n * browser window with the component and its children inside\n */\n popout() {\n var browserPopout = this.layoutManager.createPopout(this);\n this.emitBubblingEvent('stateChanged');\n return browserPopout;\n }\n\n /**\n * Maximises the Item or minimises it if it is already maximised\n */\n toggleMaximise(e?: Event) {\n e && e.preventDefault();\n if (this.isMaximised === true) {\n this.layoutManager._$minimiseItem(this);\n } else {\n this.layoutManager._$maximiseItem(this);\n }\n\n this.isMaximised = !this.isMaximised;\n this.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Selects the item if it is not already selected\n */\n select() {\n if (this.layoutManager.selectedItem !== this) {\n this.layoutManager.selectItem(this, true);\n this.element.addClass('lm_selected');\n }\n }\n\n /**\n * De-selects the item if it is selected\n */\n deselect() {\n if (this.layoutManager.selectedItem === this) {\n this.layoutManager.selectedItem = null;\n this.element.removeClass('lm_selected');\n }\n }\n\n /**\n * Set this component's title\n * @param title\n */\n setTitle(title: string) {\n this.config.title = title;\n this.emit('titleChanged', title);\n this.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Checks whether a provided id is present\n * @param id\n * @returns isPresent\n */\n hasId(id: string) {\n if (!this.config.id) {\n return false;\n } else if (typeof this.config.id === 'string') {\n return this.config.id === id;\n } else if (this.config.id instanceof Array) {\n return this.config.id.indexOf(id) !== -1;\n }\n }\n\n /**\n * Adds an id. Adds it as a string if the component doesn't\n * have an id yet or creates/uses an array\n * @param id\n */\n addId(id: string) {\n if (this.hasId(id)) {\n return;\n }\n\n if (!this.config.id) {\n this.config.id = id;\n } else if (typeof this.config.id === 'string') {\n this.config.id = [this.config.id, id];\n } else if (this.config.id instanceof Array) {\n this.config.id.push(id);\n }\n }\n\n /**\n * Removes an existing id. Throws an error\n * if the id is not present\n * @param id\n */\n removeId(id: string) {\n if (!this.hasId(id)) {\n throw new Error('Id not found');\n }\n\n if (typeof this.config.id === 'string') {\n delete this.config.id;\n } else if (this.config.id instanceof Array) {\n var index = this.config.id.indexOf(id);\n this.config.id.splice(index, 1);\n }\n }\n\n /****************************************\n * SELECTOR\n ****************************************/\n getItemsByFilter(filter: (item: AbstractContentItem) => boolean) {\n const result: AbstractContentItem[] = [];\n const next = function (contentItem: AbstractContentItem) {\n for (let i = 0; i < contentItem.contentItems.length; i++) {\n if (filter(contentItem.contentItems[i]) === true) {\n result.push(contentItem.contentItems[i]);\n }\n\n next(contentItem.contentItems[i]);\n }\n };\n\n next(this);\n return result;\n }\n\n getItemsById(id: string) {\n return this.getItemsByFilter(function (item) {\n if (item.config.id instanceof Array) {\n return item.config.id.indexOf(id) !== -1;\n } else {\n return item.config.id === id;\n }\n });\n }\n\n getItemsByType(type: string) {\n return this._$getItemsByProperty('type', type);\n }\n\n getComponentsByName(componentName: string) {\n const components = this._$getItemsByProperty(\n 'componentName',\n componentName\n ) as Component[];\n const instances: unknown[] = [];\n\n for (let i = 0; i < components.length; i++) {\n instances.push(components[i].instance);\n }\n\n return instances;\n }\n\n /****************************************\n * PACKAGE PRIVATE\n ****************************************/\n _$getItemsByProperty(key: keyof AbstractContentItem, value: string) {\n return this.getItemsByFilter(function (item) {\n return item[key] === value;\n });\n }\n\n _$setParent(parent: AbstractContentItem | null) {\n this.parent = parent;\n }\n\n _$highlightDropZone(x: number, y: number, area: ItemArea) {\n this.layoutManager.dropTargetIndicator?.highlightArea(area);\n }\n\n _$onDrop(contentItem: AbstractContentItem, area: ItemArea) {\n this.addChild(contentItem);\n }\n\n _$hide() {\n this._callOnActiveComponents('hide');\n this.element.hide();\n this.layoutManager.updateSize();\n }\n\n _$show() {\n this._callOnActiveComponents('show');\n this.element.show();\n this.layoutManager.updateSize();\n }\n\n _callOnActiveComponents(methodName: 'hide' | 'show') {\n const stacks = this.getItemsByType('stack') as unknown as Stack[];\n let activeContentItem: AbstractContentItem | null = null;\n\n for (let i = 0; i < stacks.length; i++) {\n activeContentItem = stacks[i].getActiveContentItem();\n\n if (activeContentItem && isComponent(activeContentItem)) {\n activeContentItem.container[methodName]();\n }\n }\n }\n\n /**\n * Destroys this item ands its children\n */\n _$destroy() {\n this.emitBubblingEvent('beforeItemDestroyed');\n this.callDownwards('_$destroy', [], true, true);\n this.element.remove();\n this.emitBubblingEvent('itemDestroyed');\n }\n\n /**\n * Returns the area the component currently occupies in the format\n *\n * {\n *\t\tx1: int\n *\t\tx2: int\n *\t\ty1: int\n *\t\ty2: int\n *\t\tcontentItem: contentItem\n * }\n */\n _$getArea(element?: JQuery<HTMLElement>): ItemArea<this> | null {\n element = element || this.element;\n\n const offset = element.offset() ?? { left: 0, top: 0 };\n const width = element.width() ?? 0;\n const height = element.height() ?? 0;\n\n return {\n x1: offset.left,\n y1: offset.top,\n x2: offset.left + width,\n y2: offset.top + height,\n surface: width * height,\n contentItem: this,\n side: '',\n };\n }\n\n /**\n * The tree of content items is created in two steps: First all content items are instantiated,\n * then init is called recursively from top to bottem. This is the basic init function,\n * it can be used, extended or overwritten by the content items\n *\n * Its behaviour depends on the content item\n */\n _$init() {\n this.setSize();\n\n for (let i = 0; i < this.contentItems.length; i++) {\n this.childElementContainer?.append(this.contentItems[i].element);\n }\n\n this.isInitialised = true;\n this.emitBubblingEvent('itemCreated');\n this.emitBubblingEvent(this.type + 'Created');\n }\n\n /**\n * Emit an event that bubbles up the item tree.\n *\n * @param name The name of the event\n */\n emitBubblingEvent(name: string) {\n var event = new BubblingEvent(name, this);\n this.emit(name, event);\n }\n\n /**\n * Private method, creates all content items for this node at initialisation time\n * PLEASE NOTE, please see addChild for adding contentItems add runtime\n * @param {configuration item node} config\n */\n _createContentItems(config: ItemConfig) {\n var oContentItem;\n\n if (!(config.content instanceof Array)) {\n throw new ConfigurationError('content must be an Array', config);\n }\n\n for (let i = 0; i < config.content.length; i++) {\n oContentItem = this.layoutManager.createContentItem(\n config.content[i],\n this\n );\n this.contentItems.push(oContentItem);\n }\n }\n\n /**\n * Extends an item configuration node with default settings\n * @param config\n * @returns extended config\n */\n _extendItemNode<TConfig extends ItemConfig>(config: TConfig) {\n for (let [key, value] of Object.entries(itemDefaultConfig)) {\n // This just appeases TS\n const k = key as keyof TConfig;\n if (config[k] === undefined) {\n config[k] = value;\n }\n }\n\n return config;\n }\n\n /**\n * Called for every event on the item tree. Decides whether the event is a bubbling\n * event and propagates it to its parent\n *\n * @param name the name of the event\n * @param event\n */\n _propagateEvent(name: string, event: BubblingEvent) {\n if (\n event instanceof BubblingEvent &&\n event.isPropagationStopped === false &&\n this.isInitialised === true\n ) {\n /**\n * In some cases (e.g. if an element is created from a DragSource) it\n * doesn't have a parent and is not below root. If that's the case\n * propagate the bubbling event from the top level of the substree directly\n * to the layoutManager\n */\n if (this.isRoot === false && this.parent) {\n this.parent.emit.apply(this.parent, [name, event]);\n } else {\n this._scheduleEventPropagationToLayoutManager(name, event);\n }\n }\n }\n\n /**\n * All raw events bubble up to the root element. Some events that\n * are propagated to - and emitted by - the layoutManager however are\n * only string-based, batched and sanitized to make them more usable\n *\n * @param name the name of the event\n */\n _scheduleEventPropagationToLayoutManager(name: string, event: BubblingEvent) {\n if (this._throttledEvents.indexOf(name) === -1) {\n this.layoutManager.emit(name, event.origin);\n } else {\n if (this._pendingEventPropagations[name] !== true) {\n this._pendingEventPropagations[name] = true;\n animFrame(this._propagateEventToLayoutManager.bind(this, name, event));\n }\n }\n }\n\n /**\n * Callback for events scheduled by _scheduleEventPropagationToLayoutManager\n *\n * @param name the name of the event\n */\n _propagateEventToLayoutManager(name: string, event: BubblingEvent) {\n this._pendingEventPropagations[name] = false;\n this.layoutManager.emit(name, event);\n }\n}\n"],"mappings":";;;SAASA,SAAS,EAAEC,aAAa,EAAEC,YAAY;AAAA,SACtCC,k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AC,CAAC,EAAE;MAC9C,IAAI,CAAC/H,aAAa,CAACmE,IAAI,CAAC4D,IAAI,EAAEC,KAAK,CAACQ,MAAM,CAAC;IAC7C,CAAC,MAAM;MACL,IAAI,IAAI,CAAChI,yBAAyB,CAACuH,IAAI,CAAC,KAAK,IAAI,EAAE;QACjD,IAAI,CAACvH,yBAAyB,CAACuH,IAAI,CAAC,GAAG,IAAI;QAC3C1I,SAAS,CAAC,IAAI,CAACoJ,8BAA8B,CAACC,IAAI,CAAC,IAAI,EAAEX,IAAI,EAAEC,KAAK,CAAC,CAAC;MACxE;IACF;EACF;;EAEA;AACF;AACA;AACA;AACA;EACES,8BAA8BA,CAACV,IAAY,EAAEC,KAAoB,EAAE;IACjE,IAAI,CAACxH,yBAAyB,CAACuH,IAAI,CAAC,GAAG,KAAK;IAC5C,IAAI,CAAC/H,aAAa,CAACmE,IAAI,CAAC4D,IAAI,EAAEC,KAAK,CAAC;EACtC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"AbstractContentItem.js","names":["animFrame","BubblingEvent","EventEmitter","ConfigurationError","itemDefaultConfig","isStack","item","isComponent","isRoot","AbstractContentItem","constructor","layoutManager","config","parent","element","_defineProperty","_extendItemNode","type","contentItems","_pendingEventPropagations","_throttledEvents","on","ALL_EVENT","_propagateEvent","content","_createContentItems","callDownwards","functionName","functionArguments","arguments","length","undefined","bottomUp","skipSelf","apply","i","removeChild","contentItem","_this$config$content","keepChild","index","indexOf","Error","_$destroy","splice","isClosable","_this$parent","addChild","_$normalizeContentItem","isInitialised","_$init","replaceChild","oldChild","newChild","_$destroyOldChild","parentNode","header","tabs","setContentItem","remove","_this$parent2","popout","browserPopout","createPopout","emitBubblingEvent","toggleMaximise","e","preventDefault","isMaximised","_$minimiseItem","_$maximiseItem","select","selectedItem","selectItem","addClass","deselect","removeClass","setTitle","title","emit","hasId","id","Array","addId","push","removeId","getItemsByFilter","filter","result","next","getItemsById","getItemsByType","_$getItemsByProperty","getComponentsByName","componentName","components","instances","instance","key","value","_$setParent","_$highlightDropZone","x","y","area","_this$layoutManager$d","dropTargetIndicator","highlightArea","_$onDrop","_$hide","_callOnActiveComponents","hide","updateSize","_$show","show","methodName","stacks","activeContentItem","getActiveContentItem","container","_$getArea","_element$offset","_element$width","_element$height","offset","left","top","width","height","x1","y1","x2","y2","surface","side","setSize","_this$childElementCon","childElementContainer","append","name","event","oContentItem","createContentItem","Object","entries","k","isPropagationStopped","_scheduleEventPropagationToLayoutManager","origin","_propagateEventToLayoutManager","bind"],"sources":["../../src/items/AbstractContentItem.ts"],"sourcesContent":["import { animFrame, BubblingEvent, EventEmitter } from '../utils';\nimport { ConfigurationError } from '../errors';\nimport { itemDefaultConfig } from '../config';\nimport type { ItemConfig } from '../config';\nimport type LayoutManager from '../LayoutManager';\nimport type Tab from '../controls/Tab';\nimport type Stack from './Stack';\nimport type Component from './Component';\nimport type Root from './Root';\n\nexport function isStack(item: AbstractContentItem): item is Stack {\n return item.isStack;\n}\n\nexport function isComponent(item: AbstractContentItem): item is Component {\n return item.isComponent;\n}\n\nexport function isRoot(item: AbstractContentItem): item is Root {\n return item.isRoot;\n}\n\nexport type ItemArea<C = AbstractContentItem> = {\n x1: number;\n x2: number;\n y1: number;\n y2: number;\n surface: number;\n side: 'left' | 'right' | 'top' | 'bottom' | '';\n contentItem: C;\n};\n\n/**\n * This is the baseclass that all content items inherit from.\n * Most methods provide a subset of what the sub-classes do.\n *\n * It also provides a number of functions for tree traversal\n *\n * @param {lm.LayoutManager} layoutManager\n * @param {item node configuration} config\n * @param {lm.item} parent\n *\n * @event stateChanged\n * @event beforeItemDestroyed\n * @event itemDestroyed\n * @event itemCreated\n * @event componentCreated\n * @event rowCreated\n * @event columnCreated\n * @event stackCreated\n *\n * @constructor\n */\nexport default abstract class AbstractContentItem extends EventEmitter {\n config: ItemConfig;\n type: string;\n contentItems: AbstractContentItem[];\n parent: AbstractContentItem | null;\n layoutManager: LayoutManager;\n element: JQuery<HTMLElement>;\n childElementContainer?: JQuery<HTMLElement>;\n componentName?: string;\n\n isInitialised = false;\n isMaximised = false;\n isRoot = false;\n isRow = false;\n isColumn = false;\n isStack = false;\n isComponent = false;\n\n tab?: Tab;\n\n private _pendingEventPropagations: Record<string, boolean>;\n private _throttledEvents: string[];\n\n constructor(\n layoutManager: LayoutManager,\n config: ItemConfig,\n parent: AbstractContentItem | null,\n element: JQuery<HTMLElement>\n ) {\n super();\n this.element = element;\n\n // Some GL things expect this config to not change\n this.config = this._extendItemNode(config);\n this.type = config.type;\n this.contentItems = [];\n this.parent = parent;\n\n this.layoutManager = layoutManager;\n this._pendingEventPropagations = {};\n this._throttledEvents = ['stateChanged'];\n\n this.on(EventEmitter.ALL_EVENT, this._propagateEvent, this);\n\n if (config.content) {\n this._createContentItems(config);\n }\n }\n\n /**\n * Set the size of the component and its children, called recursively\n *\n * @abstract\n */\n abstract setSize(width?: number, height?: number): void;\n\n /**\n * Calls a method recursively downwards on the tree\n *\n * @param functionName the name of the function to be called\n * @param functionArguments optional arguments that are passed to every function\n * @param bottomUp Call methods from bottom to top, defaults to false\n * @param skipSelf Don't invoke the method on the class that calls it, defaults to false\n */\n callDownwards<N extends 'setSize' | '_$destroy' | '_$init' | '_$show'>(\n functionName: N,\n functionArguments = [] as Parameters<AbstractContentItem[N]>,\n bottomUp = false,\n skipSelf = false\n ) {\n if (bottomUp !== true && skipSelf !== true) {\n this[functionName].apply(this, functionArguments);\n }\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].callDownwards(\n functionName,\n functionArguments,\n bottomUp\n );\n }\n if (bottomUp === true && skipSelf !== true) {\n this[functionName].apply(this, functionArguments);\n }\n }\n\n /**\n * Removes a child node (and its children) from the tree\n *\n * @param contentItem\n */\n removeChild(contentItem: AbstractContentItem, keepChild = false) {\n /*\n * Get the position of the item that's to be removed within all content items this node contains\n */\n const index = this.contentItems.indexOf(contentItem);\n\n /*\n * Make sure the content item to be removed is actually a child of this item\n */\n if (index === -1) {\n throw new Error(\"Can't remove child item. Unknown content item\");\n }\n\n /**\n * Call ._$destroy on the content item. This also calls ._$destroy on all its children\n */\n if (keepChild !== true) {\n this.contentItems[index]._$destroy();\n }\n\n /**\n * Remove the content item from this nodes array of children\n */\n this.contentItems.splice(index, 1);\n\n /**\n * Remove the item from the configuration\n */\n this.config.content?.splice(index, 1);\n\n /**\n * If this node still contains other content items, adjust their size\n */\n if (this.contentItems.length > 0) {\n this.callDownwards('setSize');\n\n /**\n * If this was the last content item, remove this node as well\n */\n } else if (this.type !== 'root' && this.config.isClosable) {\n this.parent?.removeChild(this);\n }\n }\n\n /**\n * Sets up the tree structure for the newly added child\n * The responsibility for the actual DOM manipulations lies\n * with the concrete item\n *\n * @param contentItem\n * @param index If omitted item will be appended\n */\n addChild(contentItem: AbstractContentItem | ItemConfig, index?: number) {\n contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n if (index === undefined) {\n index = this.contentItems.length;\n }\n\n this.contentItems.splice(index, 0, contentItem);\n\n if (this.config.content === undefined) {\n this.config.content = [];\n }\n\n this.config.content.splice(index, 0, contentItem.config);\n contentItem.parent = this;\n\n if (\n contentItem.parent.isInitialised === true &&\n contentItem.isInitialised === false\n ) {\n contentItem._$init();\n }\n }\n\n /**\n * Replaces oldChild with newChild. This used to use jQuery.replaceWith... which for\n * some reason removes all event listeners, so isn't really an option.\n *\n * @param oldChild\n * @param newChild\n */\n replaceChild(\n oldChild: AbstractContentItem,\n newChild: AbstractContentItem | ItemConfig,\n _$destroyOldChild = false\n ) {\n newChild = this.layoutManager._$normalizeContentItem(newChild);\n\n const index = this.contentItems.indexOf(oldChild);\n const parentNode = oldChild.element[0].parentNode;\n\n if (index === -1) {\n throw new Error(\"Can't replace child. oldChild is not child of this\");\n }\n\n parentNode?.replaceChild(newChild.element[0], oldChild.element[0]);\n\n /*\n * Optionally destroy the old content item\n */\n if (_$destroyOldChild === true) {\n oldChild.parent = null;\n oldChild._$destroy();\n }\n\n /*\n * Wire the new contentItem into the tree\n */\n this.contentItems[index] = newChild;\n newChild.parent = this;\n\n /*\n * Update tab reference - use setContentItem to properly transfer event listeners\n */\n if (isStack(this)) {\n this.header.tabs[index].setContentItem(newChild);\n }\n\n //TODO This doesn't update the config... refactor to leave item nodes untouched after creation\n if (\n newChild.parent.isInitialised === true &&\n newChild.isInitialised === false\n ) {\n newChild._$init();\n }\n\n this.callDownwards('setSize');\n }\n\n /**\n * Convenience method.\n * Shorthand for this.parent.removeChild( this )\n */\n remove() {\n this.parent?.removeChild(this);\n }\n\n /**\n * Removes the component from the layout and creates a new\n * browser window with the component and its children inside\n */\n popout() {\n var browserPopout = this.layoutManager.createPopout(this);\n this.emitBubblingEvent('stateChanged');\n return browserPopout;\n }\n\n /**\n * Maximises the Item or minimises it if it is already maximised\n */\n toggleMaximise(e?: Event) {\n e && e.preventDefault();\n if (this.isMaximised === true) {\n this.layoutManager._$minimiseItem(this);\n } else {\n this.layoutManager._$maximiseItem(this);\n }\n\n this.isMaximised = !this.isMaximised;\n this.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Selects the item if it is not already selected\n */\n select() {\n if (this.layoutManager.selectedItem !== this) {\n this.layoutManager.selectItem(this, true);\n this.element.addClass('lm_selected');\n }\n }\n\n /**\n * De-selects the item if it is selected\n */\n deselect() {\n if (this.layoutManager.selectedItem === this) {\n this.layoutManager.selectedItem = null;\n this.element.removeClass('lm_selected');\n }\n }\n\n /**\n * Set this component's title\n * @param title\n */\n setTitle(title: string) {\n this.config.title = title;\n this.emit('titleChanged', title);\n this.emitBubblingEvent('stateChanged');\n }\n\n /**\n * Checks whether a provided id is present\n * @param id\n * @returns isPresent\n */\n hasId(id: string) {\n if (!this.config.id) {\n return false;\n } else if (typeof this.config.id === 'string') {\n return this.config.id === id;\n } else if (this.config.id instanceof Array) {\n return this.config.id.indexOf(id) !== -1;\n }\n }\n\n /**\n * Adds an id. Adds it as a string if the component doesn't\n * have an id yet or creates/uses an array\n * @param id\n */\n addId(id: string) {\n if (this.hasId(id)) {\n return;\n }\n\n if (!this.config.id) {\n this.config.id = id;\n } else if (typeof this.config.id === 'string') {\n this.config.id = [this.config.id, id];\n } else if (this.config.id instanceof Array) {\n this.config.id.push(id);\n }\n }\n\n /**\n * Removes an existing id. Throws an error\n * if the id is not present\n * @param id\n */\n removeId(id: string) {\n if (!this.hasId(id)) {\n throw new Error('Id not found');\n }\n\n if (typeof this.config.id === 'string') {\n delete this.config.id;\n } else if (this.config.id instanceof Array) {\n var index = this.config.id.indexOf(id);\n this.config.id.splice(index, 1);\n }\n }\n\n /****************************************\n * SELECTOR\n ****************************************/\n getItemsByFilter(filter: (item: AbstractContentItem) => boolean) {\n const result: AbstractContentItem[] = [];\n const next = function (contentItem: AbstractContentItem) {\n for (let i = 0; i < contentItem.contentItems.length; i++) {\n if (filter(contentItem.contentItems[i]) === true) {\n result.push(contentItem.contentItems[i]);\n }\n\n next(contentItem.contentItems[i]);\n }\n };\n\n next(this);\n return result;\n }\n\n getItemsById(id: string) {\n return this.getItemsByFilter(function (item) {\n if (item.config.id instanceof Array) {\n return item.config.id.indexOf(id) !== -1;\n } else {\n return item.config.id === id;\n }\n });\n }\n\n getItemsByType(type: string) {\n return this._$getItemsByProperty('type', type);\n }\n\n getComponentsByName(componentName: string) {\n const components = this._$getItemsByProperty(\n 'componentName',\n componentName\n ) as Component[];\n const instances: unknown[] = [];\n\n for (let i = 0; i < components.length; i++) {\n instances.push(components[i].instance);\n }\n\n return instances;\n }\n\n /****************************************\n * PACKAGE PRIVATE\n ****************************************/\n _$getItemsByProperty(key: keyof AbstractContentItem, value: string) {\n return this.getItemsByFilter(function (item) {\n return item[key] === value;\n });\n }\n\n _$setParent(parent: AbstractContentItem | null) {\n this.parent = parent;\n }\n\n _$highlightDropZone(x: number, y: number, area: ItemArea) {\n this.layoutManager.dropTargetIndicator?.highlightArea(area);\n }\n\n _$onDrop(contentItem: AbstractContentItem, area: ItemArea) {\n this.addChild(contentItem);\n }\n\n _$hide() {\n this._callOnActiveComponents('hide');\n this.element.hide();\n this.layoutManager.updateSize();\n }\n\n _$show() {\n this._callOnActiveComponents('show');\n this.element.show();\n this.layoutManager.updateSize();\n }\n\n _callOnActiveComponents(methodName: 'hide' | 'show') {\n const stacks = this.getItemsByType('stack') as unknown as Stack[];\n let activeContentItem: AbstractContentItem | null = null;\n\n for (let i = 0; i < stacks.length; i++) {\n activeContentItem = stacks[i].getActiveContentItem();\n\n if (activeContentItem && isComponent(activeContentItem)) {\n activeContentItem.container[methodName]();\n }\n }\n }\n\n /**\n * Destroys this item ands its children\n */\n _$destroy() {\n this.emitBubblingEvent('beforeItemDestroyed');\n this.callDownwards('_$destroy', [], true, true);\n this.element.remove();\n this.emitBubblingEvent('itemDestroyed');\n }\n\n /**\n * Returns the area the component currently occupies in the format\n *\n * {\n *\t\tx1: int\n *\t\tx2: int\n *\t\ty1: int\n *\t\ty2: int\n *\t\tcontentItem: contentItem\n * }\n */\n _$getArea(element?: JQuery<HTMLElement>): ItemArea<this> | null {\n element = element || this.element;\n\n const offset = element.offset() ?? { left: 0, top: 0 };\n const width = element.width() ?? 0;\n const height = element.height() ?? 0;\n\n return {\n x1: offset.left,\n y1: offset.top,\n x2: offset.left + width,\n y2: offset.top + height,\n surface: width * height,\n contentItem: this,\n side: '',\n };\n }\n\n /**\n * The tree of content items is created in two steps: First all content items are instantiated,\n * then init is called recursively from top to bottem. This is the basic init function,\n * it can be used, extended or overwritten by the content items\n *\n * Its behaviour depends on the content item\n */\n _$init() {\n this.setSize();\n\n for (let i = 0; i < this.contentItems.length; i++) {\n this.childElementContainer?.append(this.contentItems[i].element);\n }\n\n this.isInitialised = true;\n this.emitBubblingEvent('itemCreated');\n this.emitBubblingEvent(this.type + 'Created');\n }\n\n /**\n * Emit an event that bubbles up the item tree.\n *\n * @param name The name of the event\n */\n emitBubblingEvent(name: string) {\n var event = new BubblingEvent(name, this);\n this.emit(name, event);\n }\n\n /**\n * Private method, creates all content items for this node at initialisation time\n * PLEASE NOTE, please see addChild for adding contentItems add runtime\n * @param {configuration item node} config\n */\n _createContentItems(config: ItemConfig) {\n var oContentItem;\n\n if (!(config.content instanceof Array)) {\n throw new ConfigurationError('content must be an Array', config);\n }\n\n for (let i = 0; i < config.content.length; i++) {\n oContentItem = this.layoutManager.createContentItem(\n config.content[i],\n this\n );\n this.contentItems.push(oContentItem);\n }\n }\n\n /**\n * Extends an item configuration node with default settings\n * @param config\n * @returns extended config\n */\n _extendItemNode<TConfig extends ItemConfig>(config: TConfig) {\n for (let [key, value] of Object.entries(itemDefaultConfig)) {\n // This just appeases TS\n const k = key as keyof TConfig;\n if (config[k] === undefined) {\n config[k] = value;\n }\n }\n\n return config;\n }\n\n /**\n * Called for every event on the item tree. Decides whether the event is a bubbling\n * event and propagates it to its parent\n *\n * @param name the name of the event\n * @param event\n */\n _propagateEvent(name: string, event: BubblingEvent) {\n if (\n event instanceof BubblingEvent &&\n event.isPropagationStopped === false &&\n this.isInitialised === true\n ) {\n /**\n * In some cases (e.g. if an element is created from a DragSource) it\n * doesn't have a parent and is not below root. If that's the case\n * propagate the bubbling event from the top level of the substree directly\n * to the layoutManager\n */\n if (this.isRoot === false && this.parent) {\n this.parent.emit.apply(this.parent, [name, event]);\n } else {\n this._scheduleEventPropagationToLayoutManager(name, event);\n }\n }\n }\n\n /**\n * All raw events bubble up to the root element. Some events that\n * are propagated to - and emitted by - the layoutManager however are\n * only string-based, batched and sanitized to make them more usable\n *\n * @param name the name of the event\n */\n _scheduleEventPropagationToLayoutManager(name: string, event: BubblingEvent) {\n if (this._throttledEvents.indexOf(name) === -1) {\n this.layoutManager.emit(name, event.origin);\n } else {\n if (this._pendingEventPropagations[name] !== true) {\n this._pendingEventPropagations[name] = true;\n animFrame(this._propagateEventToLayoutManager.bind(this, name, event));\n }\n }\n }\n\n /**\n * Callback for events scheduled by _scheduleEventPropagationToLayoutManager\n *\n * @param name the name of the event\n */\n _propagateEventToLayoutManager(name: string, event: BubblingEvent) {\n this._pendingEventPropagations[name] = false;\n this.layoutManager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