@genesislcap/foundation-layout 14.126.0 → 14.127.0

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -169,6 +169,10 @@ This API enables you to register an item at runtime, but it will not be displaye
169
169
 
170
170
  Add an item or items that have previously been registered with the layout.
171
171
 
172
+ #### [Remove Items](./docs/api/foundation-layout.foundationlayout.removeitems.md)
173
+
174
+ Dynamically remove items from the layout. See linked API for side effects and options.
175
+
172
176
  #### [Layout Required Registrations](./docs/api/foundation-layout.foundationlayout.layoutrequiredregistrations.md)
173
177
 
174
178
  Static function to read a layout config. It returns a list of all the required registrations required to load it in the layout system. [See this example](#loading-serialised-layouts).
@@ -693,6 +693,33 @@
693
693
  ],
694
694
  "privacy": "public"
695
695
  },
696
+ {
697
+ "kind": "method",
698
+ "name": "removeItems",
699
+ "return": {
700
+ "type": {
701
+ "text": ""
702
+ }
703
+ },
704
+ "parameters": [
705
+ {
706
+ "name": "registration",
707
+ "type": {
708
+ "text": "string"
709
+ },
710
+ "description": "string of the registration ID"
711
+ },
712
+ {
713
+ "name": "force",
714
+ "default": "false",
715
+ "type": {
716
+ "text": "boolean"
717
+ },
718
+ "description": "if set to true then the item will be removed even if it is not closable. Defaults to false, which is the same behaviour as the close button on the header."
719
+ }
720
+ ],
721
+ "privacy": "public"
722
+ },
696
723
  {
697
724
  "kind": "method",
698
725
  "name": "registerItem",
@@ -212,6 +212,17 @@ export declare class FoundationLayout extends FoundationElement implements Layou
212
212
  * @throws {@link LayoutRegistrationError} if you attempt to add an item before it has been registered
213
213
  */
214
214
  addItem(config: RegisteredElementConfig | RegisteredElementConfig[], placement?: Placement): void;
215
+ /**
216
+ * @public
217
+ * Removes all instances of a specified registered item from the layout.
218
+ * @param registration - string of the registration ID
219
+ * @param force - if set to true then the item will be removed even if it is not closable. Defaults to false, which is the same behaviour as the close button on the header.
220
+ * @returns number of items removed
221
+ * @remarks
222
+ * Does not remove the registration from the layout system.
223
+ * Has a side affect of setting all tab views to be viewing the first tab in the stack.
224
+ */
225
+ removeItems(registration: string, force?: boolean): number;
215
226
  /**
216
227
  * @public
217
228
  * Register a collection of `Element` and associate them with an `ID` with the layout system for later use.
@@ -272,6 +283,10 @@ export declare class FoundationLayout extends FoundationElement implements Layou
272
283
  * Saves the stored layout config according to the Golden Layout provider.
273
284
  * And caches the layout in local storage if {@link FoundationLayout.autoSaveKey} is set.
274
285
  * @internal
286
+ * @remarks
287
+ * This will also normalise the config. E.g. over time when adding and deleting items from
288
+ * the layout, the layout config can become deeply nested but only have one item in it.
289
+ * `fromResolved()` function will remove all of the unnecessary nesting.
275
290
  * */
276
291
  private cacheAndSaveLayout;
277
292
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"layout-main.d.ts","sourceRoot":"","sources":["../../../src/main/layout-main.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,YAAY,EAEZ,cAAc,EAGf,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAEL,eAAe,EAGf,SAAS,EACT,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EAKb,YAAY,EAQb,MAAM,WAAW,CAAC;AAKnB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAiBzC;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAiB,SAAQ,iBAAkB,YAAW,eAAe;;IAChF,OAAO,CAAC,MAAM,CAAe;IAC7B,gBAAgB;IAChB,aAAa,EAAE,WAAW,CAAC;IAC3B,OAAO,CAAC,YAAY,CAAqC;IAEzD,gBAAgB;IAChB,CAAC,aAAa,CAAC,SAAmB;IAElC;;;;OAIG;IACmC,YAAY,EAAE,MAAM,CAAyB;IACnF,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,oBAAoB,CAAK;IAEjC,gBAAgB;IACV,OAAO,CAAC,IAAI,CAAO;IAEzB,gBAAgB;IACP,OAAO,CAAC,OAAO,CAAU;IAClC;;;;;OAKG;IACmC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,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM;IAW/D;;OAEG;IAEH;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;;OAIG;IACH,mBAAmB,IAAI,IAAI;IAmB3B;;;;;;;OAOG;IACH,gBAAgB,CAAC,CAAC,SAAS,cAAc,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC;IAetD;;;;;;;OAOG;IACH,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,kBAAkB,GAAG,MAAM;IAuEtE;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAehC;;;;;;;;SAQK;IACL,OAAO,CAAC,kBAAkB;IAY1B;;;;;;;;OAQG;IACH,OAAO,CAAC,kCAAkC;IA4B1C;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,oBAAoB;IAU5B;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAU3B;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAc1B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAM3B;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAWpC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;CAyBhC;AAMD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,uEAK1B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;2BAI3B,CAAC"}
@@ -436,6 +436,61 @@ export class FoundationLayout extends FoundationElement {
436
436
  this.loadGLConfigAndSetup(this.layoutConfig);
437
437
  this.onPostItemAdded();
438
438
  }
439
+ /**
440
+ * @public
441
+ * Removes all instances of a specified registered item from the layout.
442
+ * @param registration - string of the registration ID
443
+ * @param force - if set to true then the item will be removed even if it is not closable. Defaults to false, which is the same behaviour as the close button on the header.
444
+ * @returns number of items removed
445
+ * @remarks
446
+ * Does not remove the registration from the layout system.
447
+ * Has a side affect of setting all tab views to be viewing the first tab in the stack.
448
+ */
449
+ removeItems(registration, force = false) {
450
+ let removedCount = 0;
451
+ const countDeletion = () => ((removedCount += 1), true);
452
+ const closeableCheck = (c) => force || c.isClosable;
453
+ // Remove an item when it matches the registration and is valid closable,
454
+ // or when it is now an empty container (because we just removed all items from it)
455
+ const predicate = (c) => {
456
+ var _b;
457
+ return !(((_b = c.content) === null || _b === void 0 ? void 0 : _b.length) === 0 ||
458
+ (c.type === 'component' &&
459
+ c.componentType === registration &&
460
+ closeableCheck(c) &&
461
+ countDeletion()));
462
+ };
463
+ const removeItemFromNode = (node) => {
464
+ var _b, _c;
465
+ const recurse = (_node) => {
466
+ var _b, _c;
467
+ if (_node.type === 'component')
468
+ return;
469
+ (_b = _node.content) === null || _b === void 0 ? void 0 : _b.forEach(recurse);
470
+ _node.content = (_c = _node.content) === null || _c === void 0 ? void 0 : _c.filter(predicate);
471
+ // activeItemIndex tracks which tab you have open in a stack and
472
+ // will potentially become out of bounds if we remove an item. Deleting it
473
+ // is safe and just sets you back to the 1st tab, but UX could be improved
474
+ // with proper tracking of the value
475
+ if (_node.type === 'stack')
476
+ delete _node.activeItemIndex;
477
+ };
478
+ (_b = node === null || node === void 0 ? void 0 : node.content) === null || _b === void 0 ? void 0 : _b.forEach(recurse);
479
+ if (node.type === 'stack')
480
+ delete node.activeItemIndex;
481
+ return (_c = node === null || node === void 0 ? void 0 : node.content) === null || _c === void 0 ? void 0 : _c.filter(predicate);
482
+ };
483
+ const content = removeItemFromNode(this.layoutConfig.root);
484
+ if (removedCount === 0)
485
+ return 0;
486
+ this.layoutConfig = Object.assign(Object.assign({}, this.layoutConfig), { root: content.length > 0
487
+ ? Object.assign(Object.assign({}, this.layoutConfig.root), { content })
488
+ : undefined });
489
+ this.updateLifecycleToken();
490
+ this.loadGLConfigAndSetup(this.layoutConfig);
491
+ this.onPostItemRemoved();
492
+ return removedCount;
493
+ }
439
494
  /**
440
495
  * @public
441
496
  * Register a collection of `Element` and associate them with an `ID` with the layout system for later use.
@@ -601,6 +656,10 @@ export class FoundationLayout extends FoundationElement {
601
656
  * Saves the stored layout config according to the Golden Layout provider.
602
657
  * And caches the layout in local storage if {@link FoundationLayout.autoSaveKey} is set.
603
658
  * @internal
659
+ * @remarks
660
+ * This will also normalise the config. E.g. over time when adding and deleting items from
661
+ * the layout, the layout config can become deeply nested but only have one item in it.
662
+ * `fromResolved()` function will remove all of the unnecessary nesting.
604
663
  * */
605
664
  cacheAndSaveLayout() {
606
665
  this.layoutConfig = LayoutConfig.fromResolved(this.layout.saveLayout());
@@ -936,6 +936,70 @@
936
936
  "isProtected": false,
937
937
  "isAbstract": false
938
938
  },
939
+ {
940
+ "kind": "Method",
941
+ "canonicalReference": "@genesislcap/foundation-layout!FoundationLayout#removeItems:member(1)",
942
+ "docComment": "/**\n * Removes all instances of a specified registered item from the layout.\n *\n * @remarks\n *\n * Does not remove the registration from the layout system. Has a side affect of setting all tab views to be viewing the first tab in the stack.\n *\n * @param registration - string of the registration ID\n *\n * @param force - if set to true then the item will be removed even if it is not closable. Defaults to false, which is the same behaviour as the close button on the header.\n *\n * @returns number of items removed\n *\n * @public\n */\n",
943
+ "excerptTokens": [
944
+ {
945
+ "kind": "Content",
946
+ "text": "removeItems(registration: "
947
+ },
948
+ {
949
+ "kind": "Content",
950
+ "text": "string"
951
+ },
952
+ {
953
+ "kind": "Content",
954
+ "text": ", force?: "
955
+ },
956
+ {
957
+ "kind": "Content",
958
+ "text": "boolean"
959
+ },
960
+ {
961
+ "kind": "Content",
962
+ "text": "): "
963
+ },
964
+ {
965
+ "kind": "Content",
966
+ "text": "number"
967
+ },
968
+ {
969
+ "kind": "Content",
970
+ "text": ";"
971
+ }
972
+ ],
973
+ "isStatic": false,
974
+ "returnTypeTokenRange": {
975
+ "startIndex": 5,
976
+ "endIndex": 6
977
+ },
978
+ "releaseTag": "Public",
979
+ "isProtected": false,
980
+ "overloadIndex": 1,
981
+ "parameters": [
982
+ {
983
+ "parameterName": "registration",
984
+ "parameterTypeTokenRange": {
985
+ "startIndex": 1,
986
+ "endIndex": 2
987
+ },
988
+ "isOptional": false
989
+ },
990
+ {
991
+ "parameterName": "force",
992
+ "parameterTypeTokenRange": {
993
+ "startIndex": 3,
994
+ "endIndex": 4
995
+ },
996
+ "isOptional": true
997
+ }
998
+ ],
999
+ "isOptional": false,
1000
+ "isAbstract": false,
1001
+ "name": "removeItems"
1002
+ },
939
1003
  {
940
1004
  "kind": "Method",
941
1005
  "canonicalReference": "@genesislcap/foundation-layout!FoundationLayout#tryActivatePopoutMode:member(1)",
@@ -248,6 +248,17 @@ export declare class FoundationLayout extends FoundationElement implements Layou
248
248
  * @throws {@link LayoutRegistrationError} if you attempt to add an item before it has been registered
249
249
  */
250
250
  addItem(config: RegisteredElementConfig | RegisteredElementConfig[], placement?: Placement): void;
251
+ /**
252
+ * @public
253
+ * Removes all instances of a specified registered item from the layout.
254
+ * @param registration - string of the registration ID
255
+ * @param force - if set to true then the item will be removed even if it is not closable. Defaults to false, which is the same behaviour as the close button on the header.
256
+ * @returns number of items removed
257
+ * @remarks
258
+ * Does not remove the registration from the layout system.
259
+ * Has a side affect of setting all tab views to be viewing the first tab in the stack.
260
+ */
261
+ removeItems(registration: string, force?: boolean): number;
251
262
  /**
252
263
  * @public
253
264
  * Register a collection of `Element` and associate them with an `ID` with the layout system for later use.
@@ -308,6 +319,10 @@ export declare class FoundationLayout extends FoundationElement implements Layou
308
319
  * Saves the stored layout config according to the Golden Layout provider.
309
320
  * And caches the layout in local storage if {@link FoundationLayout.autoSaveKey} is set.
310
321
  * @internal
322
+ * @remarks
323
+ * This will also normalise the config. E.g. over time when adding and deleting items from
324
+ * the layout, the layout config can become deeply nested but only have one item in it.
325
+ * `fromResolved()` function will remove all of the unnecessary nesting.
311
326
  * */
312
327
  private cacheAndSaveLayout;
313
328
  /**
@@ -46,6 +46,7 @@ The constructor for this class is marked as internal. Third-party code should no
46
46
  | [loadLayout(layout, handleMissingItem, disableCache)](./foundation-layout.foundationlayout.loadlayout.md) | | Restores a layout described in the config from [getLayout()](./foundation-layout.foundationlayout.getlayout.md) |
47
47
  | [registeredItems()](./foundation-layout.foundationlayout.registereditems.md) | | Gets all of the currently registered names |
48
48
  | [registerItem(registration, elements)](./foundation-layout.foundationlayout.registeritem.md) | | Register a collection of <code>Element</code> and associate them with an <code>ID</code> with the layout system for later use. |
49
+ | [removeItems(registration, force)](./foundation-layout.foundationlayout.removeitems.md) | | Removes all instances of a specified registered item from the layout. |
49
50
  | [tryActivatePopoutMode()](./foundation-layout.foundationlayout.tryactivatepopoutmode.md) | | **_(BETA)_** If in a popout window from the dynamic layout, this function will run the flow to put the component in popout mode. This function is automatically called if using the declarative HTML API, but if only using the JavaScript API then you will need to call this function manually. |
50
51
  | [tryLoadLayoutFromLocalStorage()](./foundation-layout.foundationlayout.tryloadlayoutfromlocalstorage.md) | | Try to load a layout from local storage, or return false. Only required if manually calling [FoundationLayout.registerItem()](./foundation-layout.foundationlayout.registeritem.md) |
51
52
 
@@ -0,0 +1,31 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-layout](./foundation-layout.md) &gt; [FoundationLayout](./foundation-layout.foundationlayout.md) &gt; [removeItems](./foundation-layout.foundationlayout.removeitems.md)
4
+
5
+ ## FoundationLayout.removeItems() method
6
+
7
+ Removes all instances of a specified registered item from the layout.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ removeItems(registration: string, force?: boolean): number;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | registration | string | string of the registration ID |
20
+ | force | boolean | _(Optional)_ if set to true then the item will be removed even if it is not closable. Defaults to false, which is the same behaviour as the close button on the header. |
21
+
22
+ **Returns:**
23
+
24
+ number
25
+
26
+ number of items removed
27
+
28
+ ## Remarks
29
+
30
+ Does not remove the registration from the layout system. Has a side affect of setting all tab views to be viewing the first tab in the stack.
31
+
@@ -58,6 +58,7 @@ export class FoundationLayout extends FoundationElement implements LayoutCompone
58
58
  registeredItems(): string[];
59
59
  registerItem(registration: string, elements: Element[]): string;
60
60
  reloadBuffer: number;
61
+ removeItems(registration: string, force?: boolean): number;
61
62
  // @internal
62
63
  requestLayoutReload(): void;
63
64
  // @beta
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-layout",
3
3
  "description": "Genesis Foundation UI App Layout",
4
- "version": "14.126.0",
4
+ "version": "14.127.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/foundation-layout.d.ts",
@@ -27,18 +27,18 @@
27
27
  "test:debug": "genx test --debug"
28
28
  },
29
29
  "devDependencies": {
30
- "@genesislcap/foundation-testing": "14.126.0",
31
- "@genesislcap/genx": "14.126.0",
30
+ "@genesislcap/foundation-testing": "14.127.0",
31
+ "@genesislcap/genx": "14.127.0",
32
32
  "rimraf": "^3.0.2"
33
33
  },
34
34
  "dependencies": {
35
35
  "@genesis-community/golden-layout": "^2.11.0",
36
- "@genesislcap/foundation-comms": "14.126.0",
37
- "@genesislcap/foundation-logger": "14.126.0",
38
- "@genesislcap/foundation-utils": "14.126.0",
39
- "@microsoft/fast-components": "^2.21.3",
40
- "@microsoft/fast-element": "^1.7.0",
41
- "@microsoft/fast-foundation": "^2.33.2",
36
+ "@genesislcap/foundation-comms": "14.127.0",
37
+ "@genesislcap/foundation-logger": "14.127.0",
38
+ "@genesislcap/foundation-utils": "14.127.0",
39
+ "@microsoft/fast-components": "^2.30.6",
40
+ "@microsoft/fast-element": "^1.12.0",
41
+ "@microsoft/fast-foundation": "^2.49.4",
42
42
  "tslib": "^2.3.1"
43
43
  },
44
44
  "repository": {
@@ -50,5 +50,5 @@
50
50
  "access": "public"
51
51
  },
52
52
  "customElements": "dist/custom-elements.json",
53
- "gitHead": "726c78d9ec85c2d1b308d070eb090db8b68e421d"
53
+ "gitHead": "9dab321ca616a32643b29abc699626e973a3ac8f"
54
54
  }