@genesislcap/foundation-ui 14.127.6 → 14.128.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 +990 -756
- 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
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.128.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.128.0",
|
|
78
|
+
"@genesislcap/genx": "14.128.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.128.0",
|
|
90
|
+
"@genesislcap/foundation-criteria": "14.128.0",
|
|
91
|
+
"@genesislcap/foundation-errors": "14.128.0",
|
|
92
|
+
"@genesislcap/foundation-logger": "14.128.0",
|
|
93
|
+
"@genesislcap/foundation-notifications": "14.128.0",
|
|
94
|
+
"@genesislcap/foundation-utils": "14.128.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": "5fc8cef3a47b0b518e28d67f03b3ac7f4df99b38"
|
|
117
117
|
}
|