@openfin/core 32.75.11 → 32.75.13
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/package.json
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import type * as OpenFin from '../../../../OpenFin';
|
|
2
2
|
import { LayoutEntitiesClient } from '../shapes';
|
|
3
3
|
/**
|
|
4
|
+
* @ignore
|
|
4
5
|
* @internal
|
|
5
6
|
* Supplies an ApiClient for {@link LayoutEntitiesController} and helper methods
|
|
6
7
|
* for the entities {@link TabStack} AND {@link ColumnOrRow} to use.
|
|
7
8
|
*/
|
|
8
9
|
export declare abstract class LayoutNode {
|
|
9
10
|
#private;
|
|
10
|
-
/** @internal */
|
|
11
|
-
protected constructor(client: LayoutEntitiesClient, entityId: string);
|
|
12
11
|
/**
|
|
13
12
|
* @internal
|
|
14
|
-
*
|
|
13
|
+
* @ignore
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
protected constructor(client: LayoutEntitiesClient, entityId: string);
|
|
16
|
+
abstract readonly type: OpenFin.LayoutEntityTypes;
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
|
19
|
+
* @ignore
|
|
19
20
|
* This instance's unique id used when calling the layout-entities-controller api client
|
|
20
21
|
*/
|
|
21
22
|
protected readonly entityId: string;
|
|
22
23
|
/**
|
|
24
|
+
* @ignore
|
|
23
25
|
* @internal
|
|
24
26
|
* Encapsulates Api consumption of {@link LayoutEntitiesController} with a relayed dispatch
|
|
25
27
|
* @param client
|
|
@@ -29,51 +31,83 @@ export declare abstract class LayoutNode {
|
|
|
29
31
|
*/
|
|
30
32
|
static newLayoutEntitiesClient: (client: OpenFin.ChannelClient, controllerId: string, identity: OpenFin.Identity) => Promise<LayoutEntitiesClient>;
|
|
31
33
|
static getEntity: (definition: OpenFin.LayoutEntityDefinition, client: LayoutEntitiesClient) => ColumnOrRow | TabStack;
|
|
34
|
+
isRoot: () => Promise<boolean>;
|
|
35
|
+
exists: () => Promise<boolean>;
|
|
36
|
+
getParent: () => Promise<ColumnOrRow | TabStack | undefined>;
|
|
37
|
+
createAdjacentStack: (views: OpenFin.PlatformViewCreationOptions[], options: {
|
|
38
|
+
position?: OpenFin.LayoutPosition;
|
|
39
|
+
}) => Promise<TabStack>;
|
|
40
|
+
getAdjacentStacks: (edge: OpenFin.LayoutPosition) => Promise<TabStack[]>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @typedef {string} LayoutPosition
|
|
44
|
+
* @summary Represents the position of an item in a layout relative to another. Possible values are 'top', 'bottom', 'left' and 'right'.
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* @typedef {object} StackCreationOptions
|
|
48
|
+
* @summary Stack creation options.
|
|
49
|
+
* @property {LayoutPosition} [position] - The position to create the new {@link TabStack} in, relative to the given adjacent {@link TabStack}. Defaults to 'right'.
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* @typedef {object} TabStack~AddViewOptions
|
|
53
|
+
* @summary Options to use when adding a view to a {@link TabStack}
|
|
54
|
+
* @property {number} [index] - Insertion index when adding the view. Defaults to 0.
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* A TabStack is used to manage the state of a stack of tabs within an OpenFin Layout.
|
|
58
|
+
*/
|
|
59
|
+
export declare class TabStack extends LayoutNode {
|
|
60
|
+
#private;
|
|
32
61
|
/**
|
|
33
|
-
* Determines if this {@link
|
|
34
|
-
* @
|
|
62
|
+
* Determines if this {@link TabStack} is the top level content item in the current layout.
|
|
63
|
+
* @function isRoot
|
|
64
|
+
* @memberof TabStack
|
|
65
|
+
* @instance
|
|
66
|
+
* @tutorial TabStack.isRoot
|
|
67
|
+
* @return {Promise<boolean>} Resolves true if this TabStack is the top level content item, or false if it is not.
|
|
35
68
|
*/
|
|
36
|
-
isRoot: () => Promise<boolean>;
|
|
37
69
|
/**
|
|
38
|
-
* Determines if this
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
70
|
+
* Determines if this {@link TabStack} exists.
|
|
71
|
+
* @function exists
|
|
72
|
+
* @instance
|
|
73
|
+
* @memberof TabStack
|
|
74
|
+
* @tutorial TabStack.exists
|
|
75
|
+
* @return {Promise<boolean>} Resolves true if this is the TabStack exists, or false if it has been destroyed.
|
|
41
76
|
*/
|
|
42
|
-
exists: () => Promise<boolean>;
|
|
43
77
|
/**
|
|
44
|
-
* Retrieves the parent {@link ColumnOrRow}
|
|
45
|
-
* @
|
|
78
|
+
* Retrieves the parent {@link ColumnOrRow} of this {@link TabStack}, if one exists.
|
|
79
|
+
* @function getParent
|
|
80
|
+
* @instance
|
|
81
|
+
* @memberof TabStack
|
|
82
|
+
* @tutorial TabStack.getParent
|
|
83
|
+
* @return {Promise<ColumnOrRow | TabStack | undefined>} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link TabStack} is the root content item or does not exist.
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* Returns all the adjacent stacks that share an edge with the given {@link TabStack}.
|
|
87
|
+
* @function getAdjacentStacks
|
|
88
|
+
* @instance
|
|
89
|
+
* @memberof TabStack
|
|
90
|
+
* @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
|
|
91
|
+
* @returns {Promise<TabStack[]>}
|
|
92
|
+
* @tutorial TabStack.getAdjacentStacks
|
|
46
93
|
*/
|
|
47
|
-
getParent: () => Promise<ColumnOrRow | TabStack | undefined>;
|
|
48
94
|
/**
|
|
49
|
-
* Given a list of view creation options or references and a layout position, creates
|
|
95
|
+
* Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the current {@link TabStack}
|
|
50
96
|
*
|
|
51
97
|
* Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
|
|
52
98
|
* during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
53
99
|
* This means the views you pass to createAdjacentStack() may not render in the order given by the array.
|
|
54
100
|
* Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
|
|
55
101
|
*
|
|
56
|
-
* @
|
|
57
|
-
* @
|
|
58
|
-
* @
|
|
102
|
+
* @function createAdjacentStack
|
|
103
|
+
* @instance
|
|
104
|
+
* @memberof TabStack
|
|
105
|
+
* @param {View~options} views - List of identities or view creation options of the views to include in the stack
|
|
106
|
+
* @param {StackCreationOptions} options - Creation options.
|
|
107
|
+
* @returns {Promise<TabStack>} The created TabStack.
|
|
108
|
+
* @tutorial TabStack.createAdjacentStack
|
|
59
109
|
* @experimental
|
|
60
110
|
*/
|
|
61
|
-
createAdjacentStack: (views: OpenFin.PlatformViewCreationOptions[], options: {
|
|
62
|
-
position?: OpenFin.LayoutPosition;
|
|
63
|
-
}) => Promise<TabStack>;
|
|
64
|
-
/**
|
|
65
|
-
* Finds the immediate adjacent layout item given an edge Position
|
|
66
|
-
* @param edge
|
|
67
|
-
* @returns an array of {@link TabStack} found, if none found returns an empty array.
|
|
68
|
-
*/
|
|
69
|
-
getAdjacentStacks: (edge: OpenFin.LayoutPosition) => Promise<TabStack[]>;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* A {@link TabStack} is used to manage the state of a TabStack within an OpenFin Layout and
|
|
73
|
-
* traverse to its parent Content Item.
|
|
74
|
-
*/
|
|
75
|
-
export declare class TabStack extends LayoutNode {
|
|
76
|
-
#private;
|
|
77
111
|
/** @internal */
|
|
78
112
|
constructor(client: LayoutEntitiesClient, entityId: string);
|
|
79
113
|
/**
|
|
@@ -88,8 +122,9 @@ export declare class TabStack extends LayoutNode {
|
|
|
88
122
|
* If that happens and then getViews() is called, it will return the identities in a different order than
|
|
89
123
|
* than the currently rendered tab order.
|
|
90
124
|
*
|
|
91
|
-
* @returns Resolves with a list containing the {@link OpenFin.Identity identities} of each view belonging to the {@link TabStack}.
|
|
125
|
+
* @returns {Promise<Identity[]>} Resolves with a list containing the {@link OpenFin.Identity identities} of each view belonging to the {@link TabStack}.
|
|
92
126
|
* @throws If the {@link TabStack} has been destroyed.
|
|
127
|
+
* @tutorial TabStack.getViews
|
|
93
128
|
* @experimental
|
|
94
129
|
*/
|
|
95
130
|
getViews: () => Promise<OpenFin.Identity[]>;
|
|
@@ -99,25 +134,28 @@ export declare class TabStack extends LayoutNode {
|
|
|
99
134
|
* Known Issue: If adding a view overflows the tab-container, the added view will be set as active
|
|
100
135
|
* and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
101
136
|
*
|
|
102
|
-
* @param view The identity of an existing view to add, or options to create a view.
|
|
103
|
-
* @param options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
|
|
104
|
-
* @returns Resolves with the {@link OpenFin.Identity identity} of the added view.
|
|
137
|
+
* @param {View~options} view The identity of an existing view to add, or options to create a view.
|
|
138
|
+
* @param {TabStack~AddViewOptions} options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
|
|
139
|
+
* @returns {Promise<identity>} Resolves with the {@link OpenFin.Identity identity} of the added view.
|
|
105
140
|
* @throws If the view does not exist or fails to create.
|
|
106
141
|
* @throws If the {@link TabStack} has been destroyed.
|
|
142
|
+
* @tutorial TabStack.addView
|
|
107
143
|
* @experimental
|
|
108
144
|
*/
|
|
109
145
|
addView: (view: OpenFin.Identity | OpenFin.PlatformViewCreationOptions, options?: OpenFin.AddViewToStackOptions) => Promise<OpenFin.Identity>;
|
|
110
146
|
/**
|
|
111
147
|
* Removes a view from this {@link TabStack}.
|
|
112
|
-
* @param view
|
|
148
|
+
* @param {Identity} view - Identity of the view to remove.
|
|
113
149
|
* @throws If the view does not exist or does not belong to the stack.
|
|
114
150
|
* @throws If the {@link TabStack} has been destroyed.
|
|
151
|
+
* @return {Promise<void>}
|
|
152
|
+
* @tutorial TabStack.removeView
|
|
115
153
|
*/
|
|
116
154
|
removeView: (view: OpenFin.Identity) => Promise<void>;
|
|
117
155
|
/**
|
|
118
156
|
* Sets the active view of the {@link TabStack} without focusing it.
|
|
119
|
-
* @param view
|
|
120
|
-
* @returns Promise which resolves with void once the view has been activated.
|
|
157
|
+
* @param {Identity} view - Identity of the view to activate.
|
|
158
|
+
* @returns {Promise<void>} Promise which resolves with void once the view has been activated.
|
|
121
159
|
* @throws If the {@link TabStack} has been destroyed.
|
|
122
160
|
* @throws If the view does not exist.
|
|
123
161
|
* @tutorial TabStack.setActiveView
|
|
@@ -126,11 +164,63 @@ export declare class TabStack extends LayoutNode {
|
|
|
126
164
|
setActiveView: (view: OpenFin.Identity) => Promise<void>;
|
|
127
165
|
}
|
|
128
166
|
/**
|
|
129
|
-
* A
|
|
167
|
+
* A ColumnOrRow is used to manage the state of Column and Rows within an OpenFin Layout.
|
|
130
168
|
*/
|
|
131
169
|
export declare class ColumnOrRow extends LayoutNode {
|
|
132
170
|
#private;
|
|
133
|
-
/**
|
|
171
|
+
/**
|
|
172
|
+
* Determines if this {@link ColumnOrRow} is the top level content item in the current layout.
|
|
173
|
+
* @function isRoot
|
|
174
|
+
* @memberof ColumnOrRow
|
|
175
|
+
* @instance
|
|
176
|
+
* @tutorial ColumnOrRow.isRoot
|
|
177
|
+
* @return {Promise<boolean>} Resolves true if this TabStack is the top level content item, or false if it is not.
|
|
178
|
+
*/
|
|
179
|
+
/**
|
|
180
|
+
* Determines if this {@link ColumnOrRow} exists.
|
|
181
|
+
* @function exists
|
|
182
|
+
* @instance
|
|
183
|
+
* @memberof ColumnOrRow
|
|
184
|
+
* @tutorial ColumnOrRow.exists
|
|
185
|
+
* @return {Promise<boolean>} Resolves true if the TabStack exists, or false if it has been destroyed.
|
|
186
|
+
*/
|
|
187
|
+
/**
|
|
188
|
+
* Retrieves the parent {@link ColumnOrRow} of this {@link ColumnOrRow}, if one exists.
|
|
189
|
+
* @function getParent
|
|
190
|
+
* @instance
|
|
191
|
+
* @memberof ColumnOrRow
|
|
192
|
+
* @tutorial ColumnOrRow.getParent
|
|
193
|
+
* @return {Promise<ColumnOrRow | undefined>} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link ColumnOrRow} does not exist or is the root content item.
|
|
194
|
+
*/
|
|
195
|
+
/**
|
|
196
|
+
* Returns all the adjacent stacks that share an edge with the given {@link ColumnOrRow}.
|
|
197
|
+
* @function getAdjacentStacks
|
|
198
|
+
* @instance
|
|
199
|
+
* @memberof ColumnOrRow
|
|
200
|
+
* @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
|
|
201
|
+
* @returns {Promise<TabStack[]>}
|
|
202
|
+
* @tutorial ColumnOrRow.getAdjacentStacks
|
|
203
|
+
*/
|
|
204
|
+
/**
|
|
205
|
+
* Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the given {@link ColumnOrRow}
|
|
206
|
+
*
|
|
207
|
+
* Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
|
|
208
|
+
* during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
209
|
+
* This means the views you pass to createAdjacentStack() may not render in the order given by the array.
|
|
210
|
+
* Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
|
|
211
|
+
*
|
|
212
|
+
* @function createAdjacentStack
|
|
213
|
+
* @instance
|
|
214
|
+
* @memberof ColumnOrRow
|
|
215
|
+
* @param {View~options} views - List of identities or view creation options of the views to include in the stack
|
|
216
|
+
* @param {StackCreationOptions} options - Creation options.
|
|
217
|
+
* @returns {Promise<TabStack>} The created TabStack
|
|
218
|
+
* @tutorial ColumnOrRow.createAdjacentStack
|
|
219
|
+
* @experimental
|
|
220
|
+
*/
|
|
221
|
+
/**
|
|
222
|
+
* @internal
|
|
223
|
+
*/
|
|
134
224
|
constructor(client: LayoutEntitiesClient, entityId: string, type: 'row' | 'column');
|
|
135
225
|
/**
|
|
136
226
|
* The type of this {@link ColumnOrRow}. Either 'row' or 'column'.
|
|
@@ -138,7 +228,8 @@ export declare class ColumnOrRow extends LayoutNode {
|
|
|
138
228
|
readonly type: 'column' | 'row';
|
|
139
229
|
/**
|
|
140
230
|
* Retrieves a list of all content items belonging to this {@link ColumnOrRow} in order of appearance.
|
|
141
|
-
* @returns Resolves with a list containing {@link ColumnOrRow} and {@link TabStack} items belonging to this {@link ColumnOrRow}.
|
|
231
|
+
* @returns {Promise<Array<ColumnOrRow | TabStack>>} Resolves with a list containing {@link ColumnOrRow} and {@link TabStack} items belonging to this {@link ColumnOrRow}.
|
|
232
|
+
* @tutorial ColumnOrRow.getContent
|
|
142
233
|
*/
|
|
143
234
|
getContent: () => Promise<(ColumnOrRow | TabStack)[]>;
|
|
144
235
|
}
|
|
@@ -21,33 +21,25 @@ const channel_api_relay_1 = require("../../../../util/channel-api-relay");
|
|
|
21
21
|
refs, we define and export all the classes here.
|
|
22
22
|
*/
|
|
23
23
|
/**
|
|
24
|
+
* @ignore
|
|
24
25
|
* @internal
|
|
25
26
|
* Supplies an ApiClient for {@link LayoutEntitiesController} and helper methods
|
|
26
27
|
* for the entities {@link TabStack} AND {@link ColumnOrRow} to use.
|
|
27
28
|
*/
|
|
28
29
|
class LayoutNode {
|
|
29
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
* @ignore
|
|
33
|
+
*/
|
|
30
34
|
constructor(client, entityId) {
|
|
31
35
|
/**
|
|
36
|
+
* @ignore
|
|
32
37
|
* @internal
|
|
33
38
|
* ApiClient for {@link LayoutEntitiesController}
|
|
34
39
|
*/
|
|
35
40
|
_LayoutNode_client.set(this, void 0);
|
|
36
|
-
/**
|
|
37
|
-
* Determines if this {@link ColumnOrRow} or {@link TabStack} is the top level content item in the current layout.
|
|
38
|
-
* @returns Promise resolving true if this is the root, or false otherwise.
|
|
39
|
-
*/
|
|
40
41
|
this.isRoot = () => __classPrivateFieldGet(this, _LayoutNode_client, "f").isRoot(this.entityId);
|
|
41
|
-
/**
|
|
42
|
-
* Determines if this {@link ColumnOrRow} or {@link TabStack} is the top level
|
|
43
|
-
* content item in the current layout.
|
|
44
|
-
* @returns Promise resolving true if this is the root, or false otherwise.
|
|
45
|
-
*/
|
|
46
42
|
this.exists = () => __classPrivateFieldGet(this, _LayoutNode_client, "f").exists(this.entityId);
|
|
47
|
-
/**
|
|
48
|
-
* Retrieves the parent {@link ColumnOrRow} or {@link TabStack} of this item, if one exists.
|
|
49
|
-
* @returns Promise resolving with the {@link ColumnOrRow} or {@link TabStack} that contains this item, or undefined if this is the root content item.
|
|
50
|
-
*/
|
|
51
43
|
this.getParent = async () => {
|
|
52
44
|
const parent = await __classPrivateFieldGet(this, _LayoutNode_client, "f").getParent(this.entityId);
|
|
53
45
|
if (!parent) {
|
|
@@ -55,34 +47,16 @@ class LayoutNode {
|
|
|
55
47
|
}
|
|
56
48
|
return LayoutNode.getEntity(parent, __classPrivateFieldGet(this, _LayoutNode_client, "f"));
|
|
57
49
|
};
|
|
58
|
-
/**
|
|
59
|
-
* Given a list of view creation options or references and a layout position, creates an adjacent {@link TabStack}
|
|
60
|
-
*
|
|
61
|
-
* Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
|
|
62
|
-
* during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
63
|
-
* This means the views you pass to createAdjacentStack() may not render in the order given by the array.
|
|
64
|
-
* Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
|
|
65
|
-
*
|
|
66
|
-
* @param views List of identities or view creation options of the views to include in the stack
|
|
67
|
-
* @param options Creation options, defaults to position: 'right'
|
|
68
|
-
* @returns an instance of {@link TabStack} containing the given views
|
|
69
|
-
* @experimental
|
|
70
|
-
*/
|
|
71
50
|
this.createAdjacentStack = async (views, options) => {
|
|
72
51
|
const entityId = await __classPrivateFieldGet(this, _LayoutNode_client, "f").createAdjacentStack(this.entityId, views, options);
|
|
73
52
|
return LayoutNode.getEntity({ entityId, type: 'stack' }, __classPrivateFieldGet(this, _LayoutNode_client, "f"));
|
|
74
53
|
};
|
|
75
|
-
/**
|
|
76
|
-
* Finds the immediate adjacent layout item given an edge Position
|
|
77
|
-
* @param edge
|
|
78
|
-
* @returns an array of {@link TabStack} found, if none found returns an empty array.
|
|
79
|
-
*/
|
|
80
54
|
this.getAdjacentStacks = async (edge) => {
|
|
81
55
|
const adjacentStacks = await __classPrivateFieldGet(this, _LayoutNode_client, "f").getAdjacentStacks({
|
|
82
56
|
targetId: this.entityId,
|
|
83
57
|
edge
|
|
84
58
|
});
|
|
85
|
-
return adjacentStacks.map(stack => LayoutNode.getEntity({
|
|
59
|
+
return adjacentStacks.map((stack) => LayoutNode.getEntity({
|
|
86
60
|
type: 'stack',
|
|
87
61
|
entityId: stack.entityId
|
|
88
62
|
}, __classPrivateFieldGet(this, _LayoutNode_client, "f")));
|
|
@@ -94,6 +68,7 @@ class LayoutNode {
|
|
|
94
68
|
exports.LayoutNode = LayoutNode;
|
|
95
69
|
_a = LayoutNode, _LayoutNode_client = new WeakMap();
|
|
96
70
|
/**
|
|
71
|
+
* @ignore
|
|
97
72
|
* @internal
|
|
98
73
|
* Encapsulates Api consumption of {@link LayoutEntitiesController} with a relayed dispatch
|
|
99
74
|
* @param client
|
|
@@ -119,10 +94,73 @@ LayoutNode.getEntity = (definition, client) => {
|
|
|
119
94
|
}
|
|
120
95
|
};
|
|
121
96
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
97
|
+
* @typedef {string} LayoutPosition
|
|
98
|
+
* @summary Represents the position of an item in a layout relative to another. Possible values are 'top', 'bottom', 'left' and 'right'.
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* @typedef {object} StackCreationOptions
|
|
102
|
+
* @summary Stack creation options.
|
|
103
|
+
* @property {LayoutPosition} [position] - The position to create the new {@link TabStack} in, relative to the given adjacent {@link TabStack}. Defaults to 'right'.
|
|
104
|
+
*/
|
|
105
|
+
/**
|
|
106
|
+
* @typedef {object} TabStack~AddViewOptions
|
|
107
|
+
* @summary Options to use when adding a view to a {@link TabStack}
|
|
108
|
+
* @property {number} [index] - Insertion index when adding the view. Defaults to 0.
|
|
109
|
+
*/
|
|
110
|
+
/**
|
|
111
|
+
* A TabStack is used to manage the state of a stack of tabs within an OpenFin Layout.
|
|
124
112
|
*/
|
|
125
113
|
class TabStack extends LayoutNode {
|
|
114
|
+
/**
|
|
115
|
+
* Determines if this {@link TabStack} is the top level content item in the current layout.
|
|
116
|
+
* @function isRoot
|
|
117
|
+
* @memberof TabStack
|
|
118
|
+
* @instance
|
|
119
|
+
* @tutorial TabStack.isRoot
|
|
120
|
+
* @return {Promise<boolean>} Resolves true if this TabStack is the top level content item, or false if it is not.
|
|
121
|
+
*/
|
|
122
|
+
/**
|
|
123
|
+
* Determines if this {@link TabStack} exists.
|
|
124
|
+
* @function exists
|
|
125
|
+
* @instance
|
|
126
|
+
* @memberof TabStack
|
|
127
|
+
* @tutorial TabStack.exists
|
|
128
|
+
* @return {Promise<boolean>} Resolves true if this is the TabStack exists, or false if it has been destroyed.
|
|
129
|
+
*/
|
|
130
|
+
/**
|
|
131
|
+
* Retrieves the parent {@link ColumnOrRow} of this {@link TabStack}, if one exists.
|
|
132
|
+
* @function getParent
|
|
133
|
+
* @instance
|
|
134
|
+
* @memberof TabStack
|
|
135
|
+
* @tutorial TabStack.getParent
|
|
136
|
+
* @return {Promise<ColumnOrRow | TabStack | undefined>} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link TabStack} is the root content item or does not exist.
|
|
137
|
+
*/
|
|
138
|
+
/**
|
|
139
|
+
* Returns all the adjacent stacks that share an edge with the given {@link TabStack}.
|
|
140
|
+
* @function getAdjacentStacks
|
|
141
|
+
* @instance
|
|
142
|
+
* @memberof TabStack
|
|
143
|
+
* @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
|
|
144
|
+
* @returns {Promise<TabStack[]>}
|
|
145
|
+
* @tutorial TabStack.getAdjacentStacks
|
|
146
|
+
*/
|
|
147
|
+
/**
|
|
148
|
+
* Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the current {@link TabStack}
|
|
149
|
+
*
|
|
150
|
+
* Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
|
|
151
|
+
* during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
152
|
+
* This means the views you pass to createAdjacentStack() may not render in the order given by the array.
|
|
153
|
+
* Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
|
|
154
|
+
*
|
|
155
|
+
* @function createAdjacentStack
|
|
156
|
+
* @instance
|
|
157
|
+
* @memberof TabStack
|
|
158
|
+
* @param {View~options} views - List of identities or view creation options of the views to include in the stack
|
|
159
|
+
* @param {StackCreationOptions} options - Creation options.
|
|
160
|
+
* @returns {Promise<TabStack>} The created TabStack.
|
|
161
|
+
* @tutorial TabStack.createAdjacentStack
|
|
162
|
+
* @experimental
|
|
163
|
+
*/
|
|
126
164
|
/** @internal */
|
|
127
165
|
constructor(client, entityId) {
|
|
128
166
|
super(client, entityId);
|
|
@@ -143,8 +181,9 @@ class TabStack extends LayoutNode {
|
|
|
143
181
|
* If that happens and then getViews() is called, it will return the identities in a different order than
|
|
144
182
|
* than the currently rendered tab order.
|
|
145
183
|
*
|
|
146
|
-
* @returns Resolves with a list containing the {@link OpenFin.Identity identities} of each view belonging to the {@link TabStack}.
|
|
184
|
+
* @returns {Promise<Identity[]>} Resolves with a list containing the {@link OpenFin.Identity identities} of each view belonging to the {@link TabStack}.
|
|
147
185
|
* @throws If the {@link TabStack} has been destroyed.
|
|
186
|
+
* @tutorial TabStack.getViews
|
|
148
187
|
* @experimental
|
|
149
188
|
*/
|
|
150
189
|
this.getViews = () => __classPrivateFieldGet(this, _TabStack_client, "f").getStackViews(this.entityId);
|
|
@@ -154,27 +193,30 @@ class TabStack extends LayoutNode {
|
|
|
154
193
|
* Known Issue: If adding a view overflows the tab-container, the added view will be set as active
|
|
155
194
|
* and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
156
195
|
*
|
|
157
|
-
* @param view The identity of an existing view to add, or options to create a view.
|
|
158
|
-
* @param options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
|
|
159
|
-
* @returns Resolves with the {@link OpenFin.Identity identity} of the added view.
|
|
196
|
+
* @param {View~options} view The identity of an existing view to add, or options to create a view.
|
|
197
|
+
* @param {TabStack~AddViewOptions} options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
|
|
198
|
+
* @returns {Promise<identity>} Resolves with the {@link OpenFin.Identity identity} of the added view.
|
|
160
199
|
* @throws If the view does not exist or fails to create.
|
|
161
200
|
* @throws If the {@link TabStack} has been destroyed.
|
|
201
|
+
* @tutorial TabStack.addView
|
|
162
202
|
* @experimental
|
|
163
203
|
*/
|
|
164
204
|
this.addView = async (view, options = { index: 0 }) => __classPrivateFieldGet(this, _TabStack_client, "f").addViewToStack(this.entityId, view, options);
|
|
165
205
|
/**
|
|
166
206
|
* Removes a view from this {@link TabStack}.
|
|
167
|
-
* @param view
|
|
207
|
+
* @param {Identity} view - Identity of the view to remove.
|
|
168
208
|
* @throws If the view does not exist or does not belong to the stack.
|
|
169
209
|
* @throws If the {@link TabStack} has been destroyed.
|
|
210
|
+
* @return {Promise<void>}
|
|
211
|
+
* @tutorial TabStack.removeView
|
|
170
212
|
*/
|
|
171
213
|
this.removeView = async (view) => {
|
|
172
214
|
await __classPrivateFieldGet(this, _TabStack_client, "f").removeViewFromStack(this.entityId, view);
|
|
173
215
|
};
|
|
174
216
|
/**
|
|
175
217
|
* Sets the active view of the {@link TabStack} without focusing it.
|
|
176
|
-
* @param view
|
|
177
|
-
* @returns Promise which resolves with void once the view has been activated.
|
|
218
|
+
* @param {Identity} view - Identity of the view to activate.
|
|
219
|
+
* @returns {Promise<void>} Promise which resolves with void once the view has been activated.
|
|
178
220
|
* @throws If the {@link TabStack} has been destroyed.
|
|
179
221
|
* @throws If the view does not exist.
|
|
180
222
|
* @tutorial TabStack.setActiveView
|
|
@@ -189,20 +231,74 @@ class TabStack extends LayoutNode {
|
|
|
189
231
|
exports.TabStack = TabStack;
|
|
190
232
|
_TabStack_client = new WeakMap();
|
|
191
233
|
/**
|
|
192
|
-
* A
|
|
234
|
+
* A ColumnOrRow is used to manage the state of Column and Rows within an OpenFin Layout.
|
|
193
235
|
*/
|
|
194
236
|
class ColumnOrRow extends LayoutNode {
|
|
195
|
-
/**
|
|
237
|
+
/**
|
|
238
|
+
* Determines if this {@link ColumnOrRow} is the top level content item in the current layout.
|
|
239
|
+
* @function isRoot
|
|
240
|
+
* @memberof ColumnOrRow
|
|
241
|
+
* @instance
|
|
242
|
+
* @tutorial ColumnOrRow.isRoot
|
|
243
|
+
* @return {Promise<boolean>} Resolves true if this TabStack is the top level content item, or false if it is not.
|
|
244
|
+
*/
|
|
245
|
+
/**
|
|
246
|
+
* Determines if this {@link ColumnOrRow} exists.
|
|
247
|
+
* @function exists
|
|
248
|
+
* @instance
|
|
249
|
+
* @memberof ColumnOrRow
|
|
250
|
+
* @tutorial ColumnOrRow.exists
|
|
251
|
+
* @return {Promise<boolean>} Resolves true if the TabStack exists, or false if it has been destroyed.
|
|
252
|
+
*/
|
|
253
|
+
/**
|
|
254
|
+
* Retrieves the parent {@link ColumnOrRow} of this {@link ColumnOrRow}, if one exists.
|
|
255
|
+
* @function getParent
|
|
256
|
+
* @instance
|
|
257
|
+
* @memberof ColumnOrRow
|
|
258
|
+
* @tutorial ColumnOrRow.getParent
|
|
259
|
+
* @return {Promise<ColumnOrRow | undefined>} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link ColumnOrRow} does not exist or is the root content item.
|
|
260
|
+
*/
|
|
261
|
+
/**
|
|
262
|
+
* Returns all the adjacent stacks that share an edge with the given {@link ColumnOrRow}.
|
|
263
|
+
* @function getAdjacentStacks
|
|
264
|
+
* @instance
|
|
265
|
+
* @memberof ColumnOrRow
|
|
266
|
+
* @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
|
|
267
|
+
* @returns {Promise<TabStack[]>}
|
|
268
|
+
* @tutorial ColumnOrRow.getAdjacentStacks
|
|
269
|
+
*/
|
|
270
|
+
/**
|
|
271
|
+
* Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the given {@link ColumnOrRow}
|
|
272
|
+
*
|
|
273
|
+
* Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
|
|
274
|
+
* during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
275
|
+
* This means the views you pass to createAdjacentStack() may not render in the order given by the array.
|
|
276
|
+
* Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
|
|
277
|
+
*
|
|
278
|
+
* @function createAdjacentStack
|
|
279
|
+
* @instance
|
|
280
|
+
* @memberof ColumnOrRow
|
|
281
|
+
* @param {View~options} views - List of identities or view creation options of the views to include in the stack
|
|
282
|
+
* @param {StackCreationOptions} options - Creation options.
|
|
283
|
+
* @returns {Promise<TabStack>} The created TabStack
|
|
284
|
+
* @tutorial ColumnOrRow.createAdjacentStack
|
|
285
|
+
* @experimental
|
|
286
|
+
*/
|
|
287
|
+
/**
|
|
288
|
+
* @internal
|
|
289
|
+
*/
|
|
196
290
|
constructor(client, entityId, type) {
|
|
197
291
|
super(client, entityId);
|
|
198
292
|
/**
|
|
293
|
+
* @ignore
|
|
199
294
|
* @internal
|
|
200
295
|
* ApiClient for {@link LayoutEntitiesController}
|
|
201
296
|
*/
|
|
202
297
|
_ColumnOrRow_client.set(this, void 0);
|
|
203
298
|
/**
|
|
204
299
|
* Retrieves a list of all content items belonging to this {@link ColumnOrRow} in order of appearance.
|
|
205
|
-
* @returns Resolves with a list containing {@link ColumnOrRow} and {@link TabStack} items belonging to this {@link ColumnOrRow}.
|
|
300
|
+
* @returns {Promise<Array<ColumnOrRow | TabStack>>} Resolves with a list containing {@link ColumnOrRow} and {@link TabStack} items belonging to this {@link ColumnOrRow}.
|
|
301
|
+
* @tutorial ColumnOrRow.getContent
|
|
206
302
|
*/
|
|
207
303
|
this.getContent = async () => {
|
|
208
304
|
const contentItemEntities = await __classPrivateFieldGet(this, _ColumnOrRow_client, "f").getContent(this.entityId);
|