@genesislcap/foundation-layout 14.70.4-es2021.1 → 14.70.4-test.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -237,117 +237,6 @@
|
|
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
|
-
}
|
351
240
|
}
|
352
241
|
],
|
353
242
|
"attributes": [
|
@@ -612,117 +501,6 @@
|
|
612
501
|
}
|
613
502
|
],
|
614
503
|
"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
|
-
}
|
726
504
|
}
|
727
505
|
],
|
728
506
|
"attributes": [
|
@@ -815,117 +593,6 @@
|
|
815
593
|
},
|
816
594
|
"description": "Defines the LayoutRegionType| type of the region.\nDefaults to `horizontal`.",
|
817
595
|
"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
|
-
}
|
929
596
|
}
|
930
597
|
],
|
931
598
|
"attributes": [
|
@@ -26,6 +26,7 @@ export class FoundationLayoutItem extends FoundationElement {
|
|
26
26
|
}
|
27
27
|
/** @internal */
|
28
28
|
connectedCallback() {
|
29
|
+
var _b;
|
29
30
|
super.connectedCallback();
|
30
31
|
this.slottedElements = this.shadowRoot.querySelector('slot.target').assignedElements();
|
31
32
|
const registeredID = this.cacheElementsAndRegister({
|
@@ -35,7 +36,7 @@ export class FoundationLayoutItem extends FoundationElement {
|
|
35
36
|
const itemConfig = {
|
36
37
|
type: 'component',
|
37
38
|
componentType: registeredID,
|
38
|
-
title: this.title
|
39
|
+
title: (_b = this.title) !== null && _b !== void 0 ? _b : `Item ${registeredID}`,
|
39
40
|
reorderEnabled: true,
|
40
41
|
isClosable: this.closable,
|
41
42
|
size: this.size,
|
@@ -236,6 +236,7 @@ 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;
|
239
240
|
const configArray = Array.isArray(config) ? config : [config];
|
240
241
|
const isSingleItem = configArray.length === 1;
|
241
242
|
const childItems = configArray.map((regConfig) => {
|
@@ -246,16 +247,16 @@ export class FoundationLayout extends FoundationElement {
|
|
246
247
|
return {
|
247
248
|
type: 'component',
|
248
249
|
componentType: registration,
|
249
|
-
title: title
|
250
|
+
title: title !== null && title !== void 0 ? title : `Item ${registration}`,
|
250
251
|
reorderEnabled: true,
|
251
252
|
isClosable: closable || false,
|
252
253
|
size: !isSingleItem ? size : undefined,
|
253
254
|
};
|
254
255
|
});
|
255
256
|
const itemConfig = {
|
256
|
-
type: regionConveter(placement
|
257
|
+
type: regionConveter(((_b = placement === null || placement === void 0 ? void 0 : placement.multiple) === null || _b === void 0 ? void 0 : _b.type) || 'tabs'),
|
257
258
|
content: childItems,
|
258
|
-
size: isSingleItem ? configArray[0].size : placement
|
259
|
+
size: isSingleItem ? configArray[0].size : (_c = placement === null || placement === void 0 ? void 0 : placement.multiple) === null || _c === void 0 ? void 0 : _c.size,
|
259
260
|
};
|
260
261
|
/**
|
261
262
|
* If no root is added (no items via declerative API) then
|
@@ -383,16 +384,17 @@ export class FoundationLayout extends FoundationElement {
|
|
383
384
|
elements.forEach((e) => masterCopy.appendChild(e));
|
384
385
|
const instances = new Map();
|
385
386
|
return (container, state) => {
|
387
|
+
var _b;
|
386
388
|
// If this is a new instance then assign it uuid instance
|
387
|
-
if (!state
|
389
|
+
if (!(state === null || state === void 0 ? void 0 : state['instance'])) {
|
388
390
|
state['instance'] = this.uuid.createId();
|
389
391
|
}
|
390
392
|
container.state['instance'] = state['instance'];
|
391
|
-
container.state['originalTitle'] = state['originalTitle']
|
393
|
+
container.state['originalTitle'] = (_b = state['originalTitle']) !== null && _b !== void 0 ? _b : container.title;
|
392
394
|
// If this is a new instance then copy the master copy into the instances map
|
393
395
|
// this is then the instance that is recalled for this version each time
|
394
396
|
// the key point is "cloneNode" which makes a copy at this point
|
395
|
-
if (!instances.has(state
|
397
|
+
if (!instances.has(state === null || state === void 0 ? void 0 : state['instance'])) {
|
396
398
|
const instanceCopy = document.createDocumentFragment();
|
397
399
|
Array.from(masterCopy.children).forEach((e) => instanceCopy.appendChild(e.cloneNode(true)));
|
398
400
|
instances.set(state['instance'], [...instanceCopy.children]);
|
@@ -412,9 +414,9 @@ export class FoundationLayout extends FoundationElement {
|
|
412
414
|
setupLayoutReceiveEvents(container, state) {
|
413
415
|
const originalTitle = container.state['originalTitle'];
|
414
416
|
container.element.addEventListener(LayoutReceiveEvents.changeTitle, (e) => {
|
415
|
-
const maybeDetail = e
|
416
|
-
if (!(maybeDetail
|
417
|
-
logger.error('Invalid change-title event.detail:', 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);
|
418
420
|
}
|
419
421
|
container.setTitle(`${maybeDetail.mode === 'suffix' ? originalTitle + ' ' : ''}${maybeDetail.title}`);
|
420
422
|
});
|
@@ -447,6 +449,7 @@ export class FoundationLayout extends FoundationElement {
|
|
447
449
|
placeholderElement.style.position = 'relative';
|
448
450
|
placeholderElement.style.top = '50%';
|
449
451
|
const recurseSetClosable = (node) => {
|
452
|
+
var _b;
|
450
453
|
if (node.type === 'component' &&
|
451
454
|
missingRegisteredItems.includes(node.componentType.toString())) {
|
452
455
|
const nodeName = node.componentType.toString();
|
@@ -455,7 +458,7 @@ export class FoundationLayout extends FoundationElement {
|
|
455
458
|
placeholderCopy.textContent = this.missingItemPlaceholder(nodeName);
|
456
459
|
this.registerItem(nodeName, [placeholderCopy]);
|
457
460
|
}
|
458
|
-
node.content
|
461
|
+
(_b = node.content) === null || _b === void 0 ? void 0 : _b.forEach(recurseSetClosable);
|
459
462
|
};
|
460
463
|
recurseSetClosable(config.root);
|
461
464
|
}
|
@@ -471,7 +474,7 @@ export class FoundationLayout extends FoundationElement {
|
|
471
474
|
*/
|
472
475
|
loadGLConfigAndSetup(config) {
|
473
476
|
this.hasFirstLoaded = true;
|
474
|
-
this.layout.loadLayout({
|
477
|
+
this.layout.loadLayout(Object.assign(Object.assign({}, config), glVisualConfig));
|
475
478
|
this.attatchResizeEvents();
|
476
479
|
}
|
477
480
|
/**
|
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.4-
|
4
|
+
"version": "14.70.4-test.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.4-
|
28
|
-
"@genesislcap/genx": "14.70.4-
|
27
|
+
"@genesislcap/foundation-testing": "14.70.4-test.1",
|
28
|
+
"@genesislcap/genx": "14.70.4-test.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.4-
|
34
|
-
"@genesislcap/foundation-utils": "14.70.4-
|
33
|
+
"@genesislcap/foundation-comms": "14.70.4-test.1",
|
34
|
+
"@genesislcap/foundation-utils": "14.70.4-test.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": "
|
49
|
+
"gitHead": "2414c66a7a84c61343d756e240cb4140d82f1311"
|
50
50
|
}
|