@genesislcap/foundation-layout 14.70.3 → 14.70.4-es2021.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -237,6 +237,117 @@
237
237
  },
238
238
  "description": "Sets the registration name for the item, which can be used later to add the item via the JavaScript API using FoundationLayout.addItem.",
239
239
  "privacy": "public"
240
+ },
241
+ {
242
+ "kind": "field",
243
+ "name": "_presentation",
244
+ "type": {
245
+ "text": "ComponentPresentation | null | undefined"
246
+ },
247
+ "privacy": "private",
248
+ "default": "void 0",
249
+ "inheritedFrom": {
250
+ "name": "FoundationElement",
251
+ "module": "src/foundation-element/foundation-element.ts"
252
+ }
253
+ },
254
+ {
255
+ "kind": "field",
256
+ "name": "$presentation",
257
+ "type": {
258
+ "text": "ComponentPresentation | null"
259
+ },
260
+ "privacy": "public",
261
+ "description": "A property which resolves the ComponentPresentation instance\nfor the current component.",
262
+ "inheritedFrom": {
263
+ "name": "FoundationElement",
264
+ "module": "src/foundation-element/foundation-element.ts"
265
+ }
266
+ },
267
+ {
268
+ "kind": "field",
269
+ "name": "template",
270
+ "type": {
271
+ "text": "ElementViewTemplate | void | null"
272
+ },
273
+ "privacy": "public",
274
+ "description": "Sets the template of the element instance. When undefined,\nthe element will attempt to resolve the template from\nthe associated presentation or custom element definition.",
275
+ "inheritedFrom": {
276
+ "name": "FoundationElement",
277
+ "module": "src/foundation-element/foundation-element.ts"
278
+ }
279
+ },
280
+ {
281
+ "kind": "method",
282
+ "name": "templateChanged",
283
+ "privacy": "protected",
284
+ "return": {
285
+ "type": {
286
+ "text": "void"
287
+ }
288
+ },
289
+ "inheritedFrom": {
290
+ "name": "FoundationElement",
291
+ "module": "src/foundation-element/foundation-element.ts"
292
+ }
293
+ },
294
+ {
295
+ "kind": "field",
296
+ "name": "styles",
297
+ "type": {
298
+ "text": "ElementStyles | void | null"
299
+ },
300
+ "privacy": "public",
301
+ "description": "Sets the default styles for the element instance. When undefined,\nthe element will attempt to resolve default styles from\nthe associated presentation or custom element definition.",
302
+ "inheritedFrom": {
303
+ "name": "FoundationElement",
304
+ "module": "src/foundation-element/foundation-element.ts"
305
+ }
306
+ },
307
+ {
308
+ "kind": "method",
309
+ "name": "stylesChanged",
310
+ "privacy": "protected",
311
+ "return": {
312
+ "type": {
313
+ "text": "void"
314
+ }
315
+ },
316
+ "inheritedFrom": {
317
+ "name": "FoundationElement",
318
+ "module": "src/foundation-element/foundation-element.ts"
319
+ }
320
+ },
321
+ {
322
+ "kind": "method",
323
+ "name": "compose",
324
+ "privacy": "public",
325
+ "static": true,
326
+ "return": {
327
+ "type": {
328
+ "text": "(\n overrideDefinition?: OverrideFoundationElementDefinition<T>\n ) => FoundationElementRegistry<T, K>"
329
+ }
330
+ },
331
+ "parameters": [
332
+ {
333
+ "name": "this",
334
+ "type": {
335
+ "text": "K"
336
+ }
337
+ },
338
+ {
339
+ "name": "elementDefinition",
340
+ "type": {
341
+ "text": "T"
342
+ },
343
+ "description": "The definition of the element to create the registry\nfunction for."
344
+ }
345
+ ],
346
+ "description": "Defines an element registry function with a set of element definition defaults.",
347
+ "inheritedFrom": {
348
+ "name": "FoundationElement",
349
+ "module": "src/foundation-element/foundation-element.ts"
350
+ }
240
351
  }
241
352
  ],
242
353
  "attributes": [
@@ -501,6 +612,117 @@
501
612
  }
502
613
  ],
503
614
  "privacy": "public"
615
+ },
616
+ {
617
+ "kind": "field",
618
+ "name": "_presentation",
619
+ "type": {
620
+ "text": "ComponentPresentation | null | undefined"
621
+ },
622
+ "privacy": "private",
623
+ "default": "void 0",
624
+ "inheritedFrom": {
625
+ "name": "FoundationElement",
626
+ "module": "src/foundation-element/foundation-element.ts"
627
+ }
628
+ },
629
+ {
630
+ "kind": "field",
631
+ "name": "$presentation",
632
+ "type": {
633
+ "text": "ComponentPresentation | null"
634
+ },
635
+ "privacy": "public",
636
+ "description": "A property which resolves the ComponentPresentation instance\nfor the current component.",
637
+ "inheritedFrom": {
638
+ "name": "FoundationElement",
639
+ "module": "src/foundation-element/foundation-element.ts"
640
+ }
641
+ },
642
+ {
643
+ "kind": "field",
644
+ "name": "template",
645
+ "type": {
646
+ "text": "ElementViewTemplate | void | null"
647
+ },
648
+ "privacy": "public",
649
+ "description": "Sets the template of the element instance. When undefined,\nthe element will attempt to resolve the template from\nthe associated presentation or custom element definition.",
650
+ "inheritedFrom": {
651
+ "name": "FoundationElement",
652
+ "module": "src/foundation-element/foundation-element.ts"
653
+ }
654
+ },
655
+ {
656
+ "kind": "method",
657
+ "name": "templateChanged",
658
+ "privacy": "protected",
659
+ "return": {
660
+ "type": {
661
+ "text": "void"
662
+ }
663
+ },
664
+ "inheritedFrom": {
665
+ "name": "FoundationElement",
666
+ "module": "src/foundation-element/foundation-element.ts"
667
+ }
668
+ },
669
+ {
670
+ "kind": "field",
671
+ "name": "styles",
672
+ "type": {
673
+ "text": "ElementStyles | void | null"
674
+ },
675
+ "privacy": "public",
676
+ "description": "Sets the default styles for the element instance. When undefined,\nthe element will attempt to resolve default styles from\nthe associated presentation or custom element definition.",
677
+ "inheritedFrom": {
678
+ "name": "FoundationElement",
679
+ "module": "src/foundation-element/foundation-element.ts"
680
+ }
681
+ },
682
+ {
683
+ "kind": "method",
684
+ "name": "stylesChanged",
685
+ "privacy": "protected",
686
+ "return": {
687
+ "type": {
688
+ "text": "void"
689
+ }
690
+ },
691
+ "inheritedFrom": {
692
+ "name": "FoundationElement",
693
+ "module": "src/foundation-element/foundation-element.ts"
694
+ }
695
+ },
696
+ {
697
+ "kind": "method",
698
+ "name": "compose",
699
+ "privacy": "public",
700
+ "static": true,
701
+ "return": {
702
+ "type": {
703
+ "text": "(\n overrideDefinition?: OverrideFoundationElementDefinition<T>\n ) => FoundationElementRegistry<T, K>"
704
+ }
705
+ },
706
+ "parameters": [
707
+ {
708
+ "name": "this",
709
+ "type": {
710
+ "text": "K"
711
+ }
712
+ },
713
+ {
714
+ "name": "elementDefinition",
715
+ "type": {
716
+ "text": "T"
717
+ },
718
+ "description": "The definition of the element to create the registry\nfunction for."
719
+ }
720
+ ],
721
+ "description": "Defines an element registry function with a set of element definition defaults.",
722
+ "inheritedFrom": {
723
+ "name": "FoundationElement",
724
+ "module": "src/foundation-element/foundation-element.ts"
725
+ }
504
726
  }
505
727
  ],
506
728
  "attributes": [
@@ -593,6 +815,117 @@
593
815
  },
594
816
  "description": "Defines the LayoutRegionType| type of the region.\nDefaults to `horizontal`.",
595
817
  "privacy": "public"
818
+ },
819
+ {
820
+ "kind": "field",
821
+ "name": "_presentation",
822
+ "type": {
823
+ "text": "ComponentPresentation | null | undefined"
824
+ },
825
+ "privacy": "private",
826
+ "default": "void 0",
827
+ "inheritedFrom": {
828
+ "name": "FoundationElement",
829
+ "module": "src/foundation-element/foundation-element.ts"
830
+ }
831
+ },
832
+ {
833
+ "kind": "field",
834
+ "name": "$presentation",
835
+ "type": {
836
+ "text": "ComponentPresentation | null"
837
+ },
838
+ "privacy": "public",
839
+ "description": "A property which resolves the ComponentPresentation instance\nfor the current component.",
840
+ "inheritedFrom": {
841
+ "name": "FoundationElement",
842
+ "module": "src/foundation-element/foundation-element.ts"
843
+ }
844
+ },
845
+ {
846
+ "kind": "field",
847
+ "name": "template",
848
+ "type": {
849
+ "text": "ElementViewTemplate | void | null"
850
+ },
851
+ "privacy": "public",
852
+ "description": "Sets the template of the element instance. When undefined,\nthe element will attempt to resolve the template from\nthe associated presentation or custom element definition.",
853
+ "inheritedFrom": {
854
+ "name": "FoundationElement",
855
+ "module": "src/foundation-element/foundation-element.ts"
856
+ }
857
+ },
858
+ {
859
+ "kind": "method",
860
+ "name": "templateChanged",
861
+ "privacy": "protected",
862
+ "return": {
863
+ "type": {
864
+ "text": "void"
865
+ }
866
+ },
867
+ "inheritedFrom": {
868
+ "name": "FoundationElement",
869
+ "module": "src/foundation-element/foundation-element.ts"
870
+ }
871
+ },
872
+ {
873
+ "kind": "field",
874
+ "name": "styles",
875
+ "type": {
876
+ "text": "ElementStyles | void | null"
877
+ },
878
+ "privacy": "public",
879
+ "description": "Sets the default styles for the element instance. When undefined,\nthe element will attempt to resolve default styles from\nthe associated presentation or custom element definition.",
880
+ "inheritedFrom": {
881
+ "name": "FoundationElement",
882
+ "module": "src/foundation-element/foundation-element.ts"
883
+ }
884
+ },
885
+ {
886
+ "kind": "method",
887
+ "name": "stylesChanged",
888
+ "privacy": "protected",
889
+ "return": {
890
+ "type": {
891
+ "text": "void"
892
+ }
893
+ },
894
+ "inheritedFrom": {
895
+ "name": "FoundationElement",
896
+ "module": "src/foundation-element/foundation-element.ts"
897
+ }
898
+ },
899
+ {
900
+ "kind": "method",
901
+ "name": "compose",
902
+ "privacy": "public",
903
+ "static": true,
904
+ "return": {
905
+ "type": {
906
+ "text": "(\n overrideDefinition?: OverrideFoundationElementDefinition<T>\n ) => FoundationElementRegistry<T, K>"
907
+ }
908
+ },
909
+ "parameters": [
910
+ {
911
+ "name": "this",
912
+ "type": {
913
+ "text": "K"
914
+ }
915
+ },
916
+ {
917
+ "name": "elementDefinition",
918
+ "type": {
919
+ "text": "T"
920
+ },
921
+ "description": "The definition of the element to create the registry\nfunction for."
922
+ }
923
+ ],
924
+ "description": "Defines an element registry function with a set of element definition defaults.",
925
+ "inheritedFrom": {
926
+ "name": "FoundationElement",
927
+ "module": "src/foundation-element/foundation-element.ts"
928
+ }
596
929
  }
597
930
  ],
598
931
  "attributes": [
@@ -26,7 +26,6 @@ export class FoundationLayoutItem extends FoundationElement {
26
26
  }
27
27
  /** @internal */
28
28
  connectedCallback() {
29
- var _b;
30
29
  super.connectedCallback();
31
30
  this.slottedElements = this.shadowRoot.querySelector('slot.target').assignedElements();
32
31
  const registeredID = this.cacheElementsAndRegister({
@@ -36,7 +35,7 @@ export class FoundationLayoutItem extends FoundationElement {
36
35
  const itemConfig = {
37
36
  type: 'component',
38
37
  componentType: registeredID,
39
- title: (_b = this.title) !== null && _b !== void 0 ? _b : `Item ${registeredID}`,
38
+ title: this.title ?? `Item ${registeredID}`,
40
39
  reorderEnabled: true,
41
40
  isClosable: this.closable,
42
41
  size: this.size,
@@ -236,7 +236,6 @@ export class FoundationLayout extends FoundationElement {
236
236
  * @throws {@link LayoutRegistrationError} if you attempt to add an item before it has been registered
237
237
  */
238
238
  addItem(config, placement = defaultAddItemPlacement) {
239
- var _b, _c;
240
239
  const configArray = Array.isArray(config) ? config : [config];
241
240
  const isSingleItem = configArray.length === 1;
242
241
  const childItems = configArray.map((regConfig) => {
@@ -247,16 +246,16 @@ export class FoundationLayout extends FoundationElement {
247
246
  return {
248
247
  type: 'component',
249
248
  componentType: registration,
250
- title: title !== null && title !== void 0 ? title : `Item ${registration}`,
249
+ title: title ?? `Item ${registration}`,
251
250
  reorderEnabled: true,
252
251
  isClosable: closable || false,
253
252
  size: !isSingleItem ? size : undefined,
254
253
  };
255
254
  });
256
255
  const itemConfig = {
257
- type: regionConveter(((_b = placement === null || placement === void 0 ? void 0 : placement.multiple) === null || _b === void 0 ? void 0 : _b.type) || 'tabs'),
256
+ type: regionConveter(placement?.multiple?.type || 'tabs'),
258
257
  content: childItems,
259
- size: isSingleItem ? configArray[0].size : (_c = placement === null || placement === void 0 ? void 0 : placement.multiple) === null || _c === void 0 ? void 0 : _c.size,
258
+ size: isSingleItem ? configArray[0].size : placement?.multiple?.size,
260
259
  };
261
260
  /**
262
261
  * If no root is added (no items via declerative API) then
@@ -384,17 +383,16 @@ export class FoundationLayout extends FoundationElement {
384
383
  elements.forEach((e) => masterCopy.appendChild(e));
385
384
  const instances = new Map();
386
385
  return (container, state) => {
387
- var _b;
388
386
  // If this is a new instance then assign it uuid instance
389
- if (!(state === null || state === void 0 ? void 0 : state['instance'])) {
387
+ if (!state?.['instance']) {
390
388
  state['instance'] = this.uuid.createId();
391
389
  }
392
390
  container.state['instance'] = state['instance'];
393
- container.state['originalTitle'] = (_b = state['originalTitle']) !== null && _b !== void 0 ? _b : container.title;
391
+ container.state['originalTitle'] = state['originalTitle'] ?? container.title;
394
392
  // If this is a new instance then copy the master copy into the instances map
395
393
  // this is then the instance that is recalled for this version each time
396
394
  // the key point is "cloneNode" which makes a copy at this point
397
- if (!instances.has(state === null || state === void 0 ? void 0 : state['instance'])) {
395
+ if (!instances.has(state?.['instance'])) {
398
396
  const instanceCopy = document.createDocumentFragment();
399
397
  Array.from(masterCopy.children).forEach((e) => instanceCopy.appendChild(e.cloneNode(true)));
400
398
  instances.set(state['instance'], [...instanceCopy.children]);
@@ -414,9 +412,9 @@ export class FoundationLayout extends FoundationElement {
414
412
  setupLayoutReceiveEvents(container, state) {
415
413
  const originalTitle = container.state['originalTitle'];
416
414
  container.element.addEventListener(LayoutReceiveEvents.changeTitle, (e) => {
417
- const maybeDetail = e === null || e === void 0 ? void 0 : e.detail;
418
- if (!((maybeDetail === null || maybeDetail === void 0 ? void 0 : maybeDetail.title) && (maybeDetail === null || maybeDetail === void 0 ? void 0 : maybeDetail.mode))) {
419
- logger.error('Invalid change-title event.detail:', e === null || e === void 0 ? void 0 : e.detail);
415
+ const maybeDetail = e?.detail;
416
+ if (!(maybeDetail?.title && maybeDetail?.mode)) {
417
+ logger.error('Invalid change-title event.detail:', e?.detail);
420
418
  }
421
419
  container.setTitle(`${maybeDetail.mode === 'suffix' ? originalTitle + ' ' : ''}${maybeDetail.title}`);
422
420
  });
@@ -449,7 +447,6 @@ export class FoundationLayout extends FoundationElement {
449
447
  placeholderElement.style.position = 'relative';
450
448
  placeholderElement.style.top = '50%';
451
449
  const recurseSetClosable = (node) => {
452
- var _b;
453
450
  if (node.type === 'component' &&
454
451
  missingRegisteredItems.includes(node.componentType.toString())) {
455
452
  const nodeName = node.componentType.toString();
@@ -458,7 +455,7 @@ export class FoundationLayout extends FoundationElement {
458
455
  placeholderCopy.textContent = this.missingItemPlaceholder(nodeName);
459
456
  this.registerItem(nodeName, [placeholderCopy]);
460
457
  }
461
- (_b = node.content) === null || _b === void 0 ? void 0 : _b.forEach(recurseSetClosable);
458
+ node.content?.forEach(recurseSetClosable);
462
459
  };
463
460
  recurseSetClosable(config.root);
464
461
  }
@@ -474,7 +471,7 @@ export class FoundationLayout extends FoundationElement {
474
471
  */
475
472
  loadGLConfigAndSetup(config) {
476
473
  this.hasFirstLoaded = true;
477
- this.layout.loadLayout(Object.assign(Object.assign({}, config), glVisualConfig));
474
+ this.layout.loadLayout({ ...config, ...glVisualConfig });
478
475
  this.attatchResizeEvents();
479
476
  }
480
477
  /**
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.70.3",
4
+ "version": "14.70.4-es2021.1",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/foundation-layout.d.ts",
@@ -24,14 +24,14 @@
24
24
  "test:debug": "genx test --debug"
25
25
  },
26
26
  "devDependencies": {
27
- "@genesislcap/foundation-testing": "14.70.3",
28
- "@genesislcap/genx": "14.70.3",
27
+ "@genesislcap/foundation-testing": "14.70.4-es2021.1",
28
+ "@genesislcap/genx": "14.70.4-es2021.1",
29
29
  "rimraf": "^3.0.2"
30
30
  },
31
31
  "dependencies": {
32
32
  "@genesis-community/golden-layout": "^2.9.3",
33
- "@genesislcap/foundation-comms": "14.70.3",
34
- "@genesislcap/foundation-utils": "14.70.3",
33
+ "@genesislcap/foundation-comms": "14.70.4-es2021.1",
34
+ "@genesislcap/foundation-utils": "14.70.4-es2021.1",
35
35
  "@microsoft/fast-components": "^2.21.3",
36
36
  "@microsoft/fast-element": "^1.7.0",
37
37
  "@microsoft/fast-foundation": "^2.33.2",
@@ -46,5 +46,5 @@
46
46
  "access": "public"
47
47
  },
48
48
  "customElements": "dist/custom-elements.json",
49
- "gitHead": "2bd15e0c3928fa0fbfa60ccb7e4f89e956afda73"
49
+ "gitHead": "5d0d8ee36cfd068cfc6211033b326d0a978cfc05"
50
50
  }