@genesislcap/foundation-ui 14.127.7-alpha-30f6dc3.0 → 14.129.0
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/dist/custom-elements.json +234 -0
- package/dist/dts/icon/icon.d.ts +1 -0
- package/dist/dts/icon/icon.d.ts.map +1 -1
- package/dist/dts/router/index.d.ts +1 -0
- package/dist/dts/router/index.d.ts.map +1 -1
- package/dist/dts/router/navItems.d.ts +51 -0
- package/dist/dts/router/navItems.d.ts.map +1 -0
- package/dist/dts/router/router.d.ts +38 -2
- package/dist/dts/router/router.d.ts.map +1 -1
- package/dist/esm/router/index.js +1 -0
- package/dist/esm/router/navItems.js +37 -0
- package/dist/esm/router/router.js +62 -2
- package/package.json +10 -10
|
@@ -20347,6 +20347,22 @@
|
|
|
20347
20347
|
}
|
|
20348
20348
|
],
|
|
20349
20349
|
"exports": [
|
|
20350
|
+
{
|
|
20351
|
+
"kind": "js",
|
|
20352
|
+
"name": "IconName",
|
|
20353
|
+
"declaration": {
|
|
20354
|
+
"name": "IconName",
|
|
20355
|
+
"module": "src/icon/icon.ts"
|
|
20356
|
+
}
|
|
20357
|
+
},
|
|
20358
|
+
{
|
|
20359
|
+
"kind": "js",
|
|
20360
|
+
"name": "IconStyle",
|
|
20361
|
+
"declaration": {
|
|
20362
|
+
"name": "IconStyle",
|
|
20363
|
+
"module": "src/icon/icon.ts"
|
|
20364
|
+
}
|
|
20365
|
+
},
|
|
20350
20366
|
{
|
|
20351
20367
|
"kind": "js",
|
|
20352
20368
|
"name": "foundationIconShadowOptions",
|
|
@@ -28322,6 +28338,14 @@
|
|
|
28322
28338
|
"path": "src/router/index.ts",
|
|
28323
28339
|
"declarations": [],
|
|
28324
28340
|
"exports": [
|
|
28341
|
+
{
|
|
28342
|
+
"kind": "js",
|
|
28343
|
+
"name": "*",
|
|
28344
|
+
"declaration": {
|
|
28345
|
+
"name": "*",
|
|
28346
|
+
"package": "./navItems"
|
|
28347
|
+
}
|
|
28348
|
+
},
|
|
28325
28349
|
{
|
|
28326
28350
|
"kind": "js",
|
|
28327
28351
|
"name": "*",
|
|
@@ -28332,6 +28356,84 @@
|
|
|
28332
28356
|
}
|
|
28333
28357
|
]
|
|
28334
28358
|
},
|
|
28359
|
+
{
|
|
28360
|
+
"kind": "javascript-module",
|
|
28361
|
+
"path": "src/router/navItems.ts",
|
|
28362
|
+
"declarations": [
|
|
28363
|
+
{
|
|
28364
|
+
"kind": "function",
|
|
28365
|
+
"name": "defaultNavItemPredicate",
|
|
28366
|
+
"parameters": [
|
|
28367
|
+
{
|
|
28368
|
+
"name": "item",
|
|
28369
|
+
"type": {
|
|
28370
|
+
"text": "FoundationRouteNavItem"
|
|
28371
|
+
}
|
|
28372
|
+
}
|
|
28373
|
+
]
|
|
28374
|
+
},
|
|
28375
|
+
{
|
|
28376
|
+
"kind": "variable",
|
|
28377
|
+
"name": "defaultPlacementIndexPadding",
|
|
28378
|
+
"type": {
|
|
28379
|
+
"text": "number"
|
|
28380
|
+
},
|
|
28381
|
+
"default": "10"
|
|
28382
|
+
},
|
|
28383
|
+
{
|
|
28384
|
+
"kind": "function",
|
|
28385
|
+
"name": "getNavItems",
|
|
28386
|
+
"return": {
|
|
28387
|
+
"type": {
|
|
28388
|
+
"text": "FoundationRouteNavItem[]"
|
|
28389
|
+
}
|
|
28390
|
+
},
|
|
28391
|
+
"parameters": [
|
|
28392
|
+
{
|
|
28393
|
+
"name": "routes",
|
|
28394
|
+
"type": {
|
|
28395
|
+
"text": "FoundationRoute[]"
|
|
28396
|
+
}
|
|
28397
|
+
},
|
|
28398
|
+
{
|
|
28399
|
+
"name": "predicate",
|
|
28400
|
+
"default": "defaultNavItemPredicate"
|
|
28401
|
+
},
|
|
28402
|
+
{
|
|
28403
|
+
"name": "placementIndexPadding",
|
|
28404
|
+
"default": "defaultPlacementIndexPadding"
|
|
28405
|
+
}
|
|
28406
|
+
],
|
|
28407
|
+
"description": "Get navigation items from routes."
|
|
28408
|
+
}
|
|
28409
|
+
],
|
|
28410
|
+
"exports": [
|
|
28411
|
+
{
|
|
28412
|
+
"kind": "js",
|
|
28413
|
+
"name": "defaultNavItemPredicate",
|
|
28414
|
+
"declaration": {
|
|
28415
|
+
"name": "defaultNavItemPredicate",
|
|
28416
|
+
"module": "src/router/navItems.ts"
|
|
28417
|
+
}
|
|
28418
|
+
},
|
|
28419
|
+
{
|
|
28420
|
+
"kind": "js",
|
|
28421
|
+
"name": "defaultPlacementIndexPadding",
|
|
28422
|
+
"declaration": {
|
|
28423
|
+
"name": "defaultPlacementIndexPadding",
|
|
28424
|
+
"module": "src/router/navItems.ts"
|
|
28425
|
+
}
|
|
28426
|
+
},
|
|
28427
|
+
{
|
|
28428
|
+
"kind": "js",
|
|
28429
|
+
"name": "getNavItems",
|
|
28430
|
+
"declaration": {
|
|
28431
|
+
"name": "getNavItems",
|
|
28432
|
+
"module": "src/router/navItems.ts"
|
|
28433
|
+
}
|
|
28434
|
+
}
|
|
28435
|
+
]
|
|
28436
|
+
},
|
|
28335
28437
|
{
|
|
28336
28438
|
"kind": "javascript-module",
|
|
28337
28439
|
"path": "src/router/router.ts",
|
|
@@ -28340,10 +28442,126 @@
|
|
|
28340
28442
|
"kind": "class",
|
|
28341
28443
|
"description": "",
|
|
28342
28444
|
"name": "FoundationRouter",
|
|
28445
|
+
"members": [
|
|
28446
|
+
{
|
|
28447
|
+
"kind": "field",
|
|
28448
|
+
"name": "config",
|
|
28449
|
+
"type": {
|
|
28450
|
+
"text": "FoundationRouterConfiguration | null"
|
|
28451
|
+
}
|
|
28452
|
+
}
|
|
28453
|
+
],
|
|
28343
28454
|
"superclass": {
|
|
28344
28455
|
"name": "<local>_undefined",
|
|
28345
28456
|
"module": "src/router/router.ts"
|
|
28346
28457
|
}
|
|
28458
|
+
},
|
|
28459
|
+
{
|
|
28460
|
+
"kind": "class",
|
|
28461
|
+
"description": "",
|
|
28462
|
+
"name": "FoundationRouteCollection",
|
|
28463
|
+
"members": [
|
|
28464
|
+
{
|
|
28465
|
+
"kind": "field",
|
|
28466
|
+
"name": "definitions",
|
|
28467
|
+
"type": {
|
|
28468
|
+
"text": "FoundationRoute<TSettings>[]"
|
|
28469
|
+
},
|
|
28470
|
+
"default": "[]"
|
|
28471
|
+
},
|
|
28472
|
+
{
|
|
28473
|
+
"kind": "method",
|
|
28474
|
+
"name": "map",
|
|
28475
|
+
"parameters": [
|
|
28476
|
+
{
|
|
28477
|
+
"name": "routes",
|
|
28478
|
+
"type": {
|
|
28479
|
+
"text": "FoundationRoute<TSettings>[]"
|
|
28480
|
+
}
|
|
28481
|
+
}
|
|
28482
|
+
]
|
|
28483
|
+
}
|
|
28484
|
+
],
|
|
28485
|
+
"superclass": {
|
|
28486
|
+
"name": "RouteCollection",
|
|
28487
|
+
"package": "@microsoft/fast-router"
|
|
28488
|
+
}
|
|
28489
|
+
},
|
|
28490
|
+
{
|
|
28491
|
+
"kind": "class",
|
|
28492
|
+
"description": "",
|
|
28493
|
+
"name": "FoundationRouterConfiguration",
|
|
28494
|
+
"members": [
|
|
28495
|
+
{
|
|
28496
|
+
"kind": "field",
|
|
28497
|
+
"name": "container",
|
|
28498
|
+
"type": {
|
|
28499
|
+
"text": "Container"
|
|
28500
|
+
},
|
|
28501
|
+
"privacy": "protected"
|
|
28502
|
+
},
|
|
28503
|
+
{
|
|
28504
|
+
"kind": "field",
|
|
28505
|
+
"name": "analytics",
|
|
28506
|
+
"type": {
|
|
28507
|
+
"text": "FoundationAnalytics"
|
|
28508
|
+
},
|
|
28509
|
+
"privacy": "protected"
|
|
28510
|
+
},
|
|
28511
|
+
{
|
|
28512
|
+
"kind": "field",
|
|
28513
|
+
"name": "routes",
|
|
28514
|
+
"type": {
|
|
28515
|
+
"text": "FoundationRouteCollection<TSettings>"
|
|
28516
|
+
},
|
|
28517
|
+
"privacy": "public",
|
|
28518
|
+
"readonly": true,
|
|
28519
|
+
"default": "new FoundationRouteCollection<TSettings>(this)"
|
|
28520
|
+
},
|
|
28521
|
+
{
|
|
28522
|
+
"kind": "method",
|
|
28523
|
+
"name": "getNavItems",
|
|
28524
|
+
"return": {
|
|
28525
|
+
"type": {
|
|
28526
|
+
"text": "FoundationRouteNavItem[]"
|
|
28527
|
+
}
|
|
28528
|
+
},
|
|
28529
|
+
"parameters": [
|
|
28530
|
+
{
|
|
28531
|
+
"name": "predicate",
|
|
28532
|
+
"default": "defaultNavItemPredicate",
|
|
28533
|
+
"type": {
|
|
28534
|
+
"text": "NavItemPredicate"
|
|
28535
|
+
}
|
|
28536
|
+
}
|
|
28537
|
+
]
|
|
28538
|
+
},
|
|
28539
|
+
{
|
|
28540
|
+
"kind": "method",
|
|
28541
|
+
"name": "configureAnalytics"
|
|
28542
|
+
},
|
|
28543
|
+
{
|
|
28544
|
+
"kind": "method",
|
|
28545
|
+
"name": "construct",
|
|
28546
|
+
"return": {
|
|
28547
|
+
"type": {
|
|
28548
|
+
"text": "T"
|
|
28549
|
+
}
|
|
28550
|
+
},
|
|
28551
|
+
"parameters": [
|
|
28552
|
+
{
|
|
28553
|
+
"name": "Type",
|
|
28554
|
+
"type": {
|
|
28555
|
+
"text": "Constructable<T>"
|
|
28556
|
+
}
|
|
28557
|
+
}
|
|
28558
|
+
]
|
|
28559
|
+
}
|
|
28560
|
+
],
|
|
28561
|
+
"superclass": {
|
|
28562
|
+
"name": "RouterConfiguration",
|
|
28563
|
+
"package": "@microsoft/fast-router"
|
|
28564
|
+
}
|
|
28347
28565
|
}
|
|
28348
28566
|
],
|
|
28349
28567
|
"exports": [
|
|
@@ -28362,6 +28580,22 @@
|
|
|
28362
28580
|
"name": "FoundationRouter",
|
|
28363
28581
|
"module": "src/router/router.ts"
|
|
28364
28582
|
}
|
|
28583
|
+
},
|
|
28584
|
+
{
|
|
28585
|
+
"kind": "js",
|
|
28586
|
+
"name": "FoundationRouteCollection",
|
|
28587
|
+
"declaration": {
|
|
28588
|
+
"name": "FoundationRouteCollection",
|
|
28589
|
+
"module": "src/router/router.ts"
|
|
28590
|
+
}
|
|
28591
|
+
},
|
|
28592
|
+
{
|
|
28593
|
+
"kind": "js",
|
|
28594
|
+
"name": "FoundationRouterConfiguration",
|
|
28595
|
+
"declaration": {
|
|
28596
|
+
"name": "FoundationRouterConfiguration",
|
|
28597
|
+
"module": "src/router/router.ts"
|
|
28598
|
+
}
|
|
28365
28599
|
}
|
|
28366
28600
|
]
|
|
28367
28601
|
},
|
package/dist/dts/icon/icon.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IconName, IconStyle } from '@fortawesome/fontawesome-svg-core';
|
|
2
2
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
3
|
+
export { IconName, IconStyle };
|
|
3
4
|
export declare const foundationIconShadowOptions: ShadowRootInit;
|
|
4
5
|
export declare const defaultIconConfig: {};
|
|
5
6
|
export declare enum FaPrefixFromStyle {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/icon/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,QAAQ,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAElG,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/icon/icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,QAAQ,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAElG,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AAG/B,eAAO,MAAM,2BAA2B,EAAE,cAGzC,CAAC;AAEF,eAAO,MAAM,iBAAiB,IAAK,CAAC;AAEpC,oBAAY,iBAAiB;IAC3B,KAAK,QAAQ;IACb,OAAO,QAAQ;IACf,KAAK,QAAQ;CACd;AAED,MAAM,MAAM,MAAM,GACd,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,CAAC;AAEV;;GAEG;AACH,qBAAa,IAAK,SAAQ,iBAAiB;IAC7B,QAAQ,EAAE,WAAW,CAAC;IAE5B,IAAI,EAAE,QAAQ,CAAC;IACrB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAIxC,IAAI,EAAE,MAAM,CAAQ;IAC1B,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAIxC,OAAO,EAAE,SAAS,CAAW;IACnC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAIjD,iBAAiB;IAKjB,oBAAoB;IAKb,QAAQ;CAgBhB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,oTAMzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/router/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/router/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { FaSize, IconName, IconStyle } from '../icon';
|
|
2
|
+
import type { FoundationRoute } from './router';
|
|
3
|
+
/**
|
|
4
|
+
* FoundationRouteNavItem
|
|
5
|
+
* @remarks
|
|
6
|
+
* Many of the properties are dynamically assigned if not set explicitly.
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export type FoundationRouteNavItem = {
|
|
10
|
+
title: string;
|
|
11
|
+
icon?: {
|
|
12
|
+
name: IconName;
|
|
13
|
+
size?: FaSize;
|
|
14
|
+
variant?: IconStyle;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @remarks
|
|
18
|
+
* Defaults to 'header'.
|
|
19
|
+
*/
|
|
20
|
+
navId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* @remarks
|
|
23
|
+
* Lower numbers move items earlier in navs. If not explicitly assigned, this value defaults to the route mapping
|
|
24
|
+
* order and has automatic index padding applied which defaults to 10. Results in, 10, 20, 30...
|
|
25
|
+
*/
|
|
26
|
+
placementIndex?: number;
|
|
27
|
+
/**
|
|
28
|
+
* @remarks
|
|
29
|
+
* Defaults to the route details, but can be set to target elsewhere.
|
|
30
|
+
*/
|
|
31
|
+
routePath?: string;
|
|
32
|
+
routeName?: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* @beta
|
|
36
|
+
*/
|
|
37
|
+
export type NavItemPredicate = (item: FoundationRouteNavItem) => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* @beta
|
|
40
|
+
*/
|
|
41
|
+
export declare const defaultNavItemPredicate: NavItemPredicate;
|
|
42
|
+
/**
|
|
43
|
+
* @beta
|
|
44
|
+
*/
|
|
45
|
+
export declare const defaultPlacementIndexPadding = 10;
|
|
46
|
+
/**
|
|
47
|
+
* Get navigation items from routes.
|
|
48
|
+
* @beta
|
|
49
|
+
*/
|
|
50
|
+
export declare function getNavItems(routes: FoundationRoute[], predicate?: NavItemPredicate, placementIndexPadding?: number): FoundationRouteNavItem[];
|
|
51
|
+
//# sourceMappingURL=navItems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navItems.d.ts","sourceRoot":"","sources":["../../../src/router/navItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE;QACL,IAAI,EAAE,QAAQ,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,SAAS,CAAC;KACrB,CAAC;IACF;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,sBAAsB,KAAK,OAAO,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBACE,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAE/C;;;GAGG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,eAAe,EAAE,EACzB,SAAS,mBAA0B,EACnC,qBAAqB,SAA+B,GACnD,sBAAsB,EAAE,CA8B1B"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FoundationAnalytics } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { Constructable, FASTElement } from '@microsoft/fast-element';
|
|
3
|
+
import { Container } from '@microsoft/fast-foundation';
|
|
4
|
+
import { MappableRouteDefinition, RouteCollection, RouterConfiguration, RouterElement } from '@microsoft/fast-router';
|
|
5
|
+
import type { FoundationRouteNavItem, NavItemPredicate } from './navItems';
|
|
3
6
|
declare const FoundationRouter_base: new () => FASTElement & RouterElement;
|
|
4
7
|
/**
|
|
5
8
|
* @beta
|
|
@@ -8,7 +11,40 @@ declare const FoundationRouter_base: new () => FASTElement & RouterElement;
|
|
|
8
11
|
* how much we build on this, we may want to promote it to its own package.
|
|
9
12
|
*/
|
|
10
13
|
export declare class FoundationRouter extends FoundationRouter_base {
|
|
14
|
+
config: FoundationRouterConfiguration | null;
|
|
11
15
|
connectedCallback(): void;
|
|
12
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* @beta
|
|
19
|
+
*/
|
|
20
|
+
export type FoundationRoute<TSettings = any> = MappableRouteDefinition<TSettings> & {
|
|
21
|
+
navItems?: FoundationRouteNavItem[];
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @beta
|
|
25
|
+
*/
|
|
26
|
+
export declare class FoundationRouteCollection<TSettings = any> extends RouteCollection<TSettings> {
|
|
27
|
+
definitions: FoundationRoute<TSettings>[];
|
|
28
|
+
map(...routes: FoundationRoute<TSettings>[]): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @beta
|
|
32
|
+
*/
|
|
33
|
+
export declare abstract class FoundationRouterConfiguration<TSettings = any> extends RouterConfiguration<TSettings> {
|
|
34
|
+
protected container: Container;
|
|
35
|
+
protected analytics: FoundationAnalytics;
|
|
36
|
+
readonly routes: FoundationRouteCollection<TSettings>;
|
|
37
|
+
/**
|
|
38
|
+
* @remarks
|
|
39
|
+
* Get navigation items from the route definitions.
|
|
40
|
+
*/
|
|
41
|
+
getNavItems(predicate?: NavItemPredicate): FoundationRouteNavItem[];
|
|
42
|
+
/**
|
|
43
|
+
* @remarks
|
|
44
|
+
* Applies the analytics service to the navigate phase.
|
|
45
|
+
*/
|
|
46
|
+
configureAnalytics(): void;
|
|
47
|
+
construct<T>(Type: Constructable<T>): T;
|
|
48
|
+
}
|
|
13
49
|
export {};
|
|
14
50
|
//# sourceMappingURL=router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/router/router.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/router/router.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAGpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,aAAa,EAGb,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,mBAAmB,EACnB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;+CAkBjE,WAAW,GAAG,aAAa;AAVrC;;;;;GAKG;AACH,qBAGa,gBAAiB,SAAQ,qBAEpC;IACA,MAAM,EAAE,6BAA6B,GAAG,IAAI,CAAC;IAE7C,iBAAiB;CAYlB;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,SAAS,GAAG,GAAG,IAAI,uBAAuB,CAAC,SAAS,CAAC,GAAG;IAClF,QAAQ,CAAC,EAAE,sBAAsB,EAAE,CAAC;CACrC,CAAC;AAEF;;GAEG;AACH,qBAAa,yBAAyB,CAAC,SAAS,GAAG,GAAG,CAAE,SAAQ,eAAe,CAAC,SAAS,CAAC;IAC5E,WAAW,EAAE,eAAe,CAAC,SAAS,CAAC,EAAE,CAAM;IAC3D,GAAG,CAAC,GAAG,MAAM,EAAE,eAAe,CAAC,SAAS,CAAC,EAAE;CAI5C;AAED;;GAEG;AACH,8BAAsB,6BAA6B,CACjD,SAAS,GAAG,GAAG,CACf,SAAQ,mBAAmB,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,SAAS,EAAE,mBAAmB,CAAC;IAE9D,SAAgB,MAAM,EAAE,yBAAyB,CAAC,SAAS,CAAC,CACX;IAEjD;;;OAGG;IACH,WAAW,CAAC,SAAS,GAAE,gBAA0C,GAAG,sBAAsB,EAAE;IAI5F;;;OAGG;IACH,kBAAkB;IAYlB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC;CAGxC"}
|
package/dist/esm/router/index.js
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @beta
|
|
3
|
+
*/
|
|
4
|
+
export const defaultNavItemPredicate = (item) => !item.navId || item.navId === 'header';
|
|
5
|
+
/**
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export const defaultPlacementIndexPadding = 10;
|
|
9
|
+
/**
|
|
10
|
+
* Get navigation items from routes.
|
|
11
|
+
* @beta
|
|
12
|
+
*/
|
|
13
|
+
export function getNavItems(routes, predicate = defaultNavItemPredicate, placementIndexPadding = defaultPlacementIndexPadding) {
|
|
14
|
+
const items = [];
|
|
15
|
+
routes
|
|
16
|
+
.filter((route) => route.navItems && route.navItems.some(predicate))
|
|
17
|
+
.forEach((route, routeIndex) => {
|
|
18
|
+
route.navItems
|
|
19
|
+
.filter(predicate)
|
|
20
|
+
.map((item, navItemIndex) => {
|
|
21
|
+
var _a, _b, _c, _d;
|
|
22
|
+
/**
|
|
23
|
+
* Best guess placementIndex
|
|
24
|
+
*/
|
|
25
|
+
const placementIndex = (_a = item.placementIndex) !== null && _a !== void 0 ? _a : routeIndex * placementIndexPadding + navItemIndex;
|
|
26
|
+
/**
|
|
27
|
+
* Map metadata not explicitly set
|
|
28
|
+
*/
|
|
29
|
+
return Object.assign(Object.assign({}, item), { navId: (_b = item.navId) !== null && _b !== void 0 ? _b : 'header', placementIndex, routePath: (_c = item.routePath) !== null && _c !== void 0 ? _c : route.path, routeName: (_d = item.routeName) !== null && _d !== void 0 ? _d : route.name });
|
|
30
|
+
})
|
|
31
|
+
.forEach((item) => items.push(item));
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Returned sorted items based on placementIndex
|
|
35
|
+
*/
|
|
36
|
+
return items.sort((a, b) => a.placementIndex - b.placementIndex);
|
|
37
|
+
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FoundationAnalytics, FoundationAnalyticsEventType, } from '@genesislcap/foundation-comms';
|
|
3
|
+
import { customElement, DOM, FASTElement, observable, } from '@microsoft/fast-element';
|
|
4
|
+
import { Container } from '@microsoft/fast-foundation';
|
|
5
|
+
import { RouteCollection, Router, RouterConfiguration, } from '@microsoft/fast-router';
|
|
6
|
+
import { defaultNavItemPredicate, getNavItems } from './navItems';
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
4
10
|
const routerProperty = '$router';
|
|
5
11
|
/**
|
|
6
12
|
* @beta
|
|
@@ -28,3 +34,57 @@ FoundationRouter = __decorate([
|
|
|
28
34
|
})
|
|
29
35
|
], FoundationRouter);
|
|
30
36
|
export { FoundationRouter };
|
|
37
|
+
/**
|
|
38
|
+
* @beta
|
|
39
|
+
*/
|
|
40
|
+
export class FoundationRouteCollection extends RouteCollection {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments);
|
|
43
|
+
this.definitions = [];
|
|
44
|
+
}
|
|
45
|
+
map(...routes) {
|
|
46
|
+
this.definitions = [...this.definitions, ...routes];
|
|
47
|
+
super.map(...routes);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
__decorate([
|
|
51
|
+
observable
|
|
52
|
+
], FoundationRouteCollection.prototype, "definitions", void 0);
|
|
53
|
+
/**
|
|
54
|
+
* @beta
|
|
55
|
+
*/
|
|
56
|
+
export class FoundationRouterConfiguration extends RouterConfiguration {
|
|
57
|
+
constructor() {
|
|
58
|
+
super(...arguments);
|
|
59
|
+
this.routes = new FoundationRouteCollection(this);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @remarks
|
|
63
|
+
* Get navigation items from the route definitions.
|
|
64
|
+
*/
|
|
65
|
+
getNavItems(predicate = defaultNavItemPredicate) {
|
|
66
|
+
return getNavItems(this.routes.definitions, predicate);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @remarks
|
|
70
|
+
* Applies the analytics service to the navigate phase.
|
|
71
|
+
*/
|
|
72
|
+
configureAnalytics() {
|
|
73
|
+
this.contributors.push({
|
|
74
|
+
navigate: (phase) => __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
this.analytics.trackEvent(FoundationAnalyticsEventType.routeChanged, {
|
|
76
|
+
path: phase.route.endpoint.path,
|
|
77
|
+
});
|
|
78
|
+
}),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
construct(Type) {
|
|
82
|
+
return this.container.get(Type);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
__decorate([
|
|
86
|
+
Container
|
|
87
|
+
], FoundationRouterConfiguration.prototype, "container", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
FoundationAnalytics
|
|
90
|
+
], FoundationRouterConfiguration.prototype, "analytics", void 0);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-ui",
|
|
3
3
|
"description": "Genesis Foundation UI",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.129.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"test:debug": "genx test --debug"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@genesislcap/foundation-testing": "14.
|
|
78
|
-
"@genesislcap/genx": "14.
|
|
77
|
+
"@genesislcap/foundation-testing": "14.129.0",
|
|
78
|
+
"@genesislcap/genx": "14.129.0",
|
|
79
79
|
"copyfiles": "^2.4.1",
|
|
80
80
|
"rimraf": "^3.0.2",
|
|
81
81
|
"rxjs": "^7.5.4"
|
|
@@ -86,12 +86,12 @@
|
|
|
86
86
|
"@fortawesome/free-regular-svg-icons": "^6.2.1",
|
|
87
87
|
"@fortawesome/free-solid-svg-icons": "^6.2.1",
|
|
88
88
|
"@genesiscommunitysuccess/analyzer-import-alias-plugin": "^4.0.0",
|
|
89
|
-
"@genesislcap/foundation-comms": "14.
|
|
90
|
-
"@genesislcap/foundation-criteria": "14.
|
|
91
|
-
"@genesislcap/foundation-errors": "14.
|
|
92
|
-
"@genesislcap/foundation-logger": "14.
|
|
93
|
-
"@genesislcap/foundation-notifications": "14.
|
|
94
|
-
"@genesislcap/foundation-utils": "14.
|
|
89
|
+
"@genesislcap/foundation-comms": "14.129.0",
|
|
90
|
+
"@genesislcap/foundation-criteria": "14.129.0",
|
|
91
|
+
"@genesislcap/foundation-errors": "14.129.0",
|
|
92
|
+
"@genesislcap/foundation-logger": "14.129.0",
|
|
93
|
+
"@genesislcap/foundation-notifications": "14.129.0",
|
|
94
|
+
"@genesislcap/foundation-utils": "14.129.0",
|
|
95
95
|
"@microsoft/fast-colors": "^5.3.1",
|
|
96
96
|
"@microsoft/fast-components": "^2.30.6",
|
|
97
97
|
"@microsoft/fast-element": "^1.12.0",
|
|
@@ -113,5 +113,5 @@
|
|
|
113
113
|
"access": "public"
|
|
114
114
|
},
|
|
115
115
|
"customElements": "dist/custom-elements.json",
|
|
116
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "3c5fc48788499117b7acb540f96adb11bc4f05d3"
|
|
117
117
|
}
|