@genesislcap/foundation-header 14.178.0 → 14.180.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 +1151 -181
- package/dist/dts/components/zero-components.d.ts +5 -0
- package/dist/dts/components/zero-components.d.ts.map +1 -0
- package/dist/dts/config/config.d.ts +33 -0
- package/dist/dts/config/config.d.ts.map +1 -0
- package/dist/dts/config/configure.d.ts +26 -0
- package/dist/dts/config/configure.d.ts.map +1 -0
- package/dist/dts/config/index.d.ts +2 -0
- package/dist/dts/config/index.d.ts.map +1 -1
- package/dist/dts/config/templates.d.ts +35 -0
- package/dist/dts/config/templates.d.ts.map +1 -0
- package/dist/dts/main/index.d.ts +1 -1
- package/dist/dts/main/index.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +81 -15
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.styles.d.ts.map +1 -1
- package/dist/dts/main/main.template.d.ts.map +1 -1
- package/dist/dts/tags/index.d.ts +2 -0
- package/dist/dts/tags/index.d.ts.map +1 -0
- package/dist/dts/tags/tags.d.ts +40 -0
- package/dist/dts/tags/tags.d.ts.map +1 -0
- package/dist/esm/components/zero-components.js +49 -0
- package/dist/esm/config/config.js +18 -0
- package/dist/esm/config/configure.js +55 -0
- package/dist/esm/config/index.js +2 -0
- package/dist/esm/config/templates.js +15 -0
- package/dist/esm/main/index.js +1 -1
- package/dist/esm/main/main.js +66 -2
- package/dist/esm/main/main.styles.js +59 -134
- package/dist/esm/main/main.template.js +32 -41
- package/dist/esm/tags/index.js +1 -0
- package/dist/esm/tags/tags.js +43 -0
- package/dist/foundation-header.api.json +287 -0
- package/dist/foundation-header.d.ts +216 -15
- package/docs/api/foundation-header.configure.md +45 -0
- package/docs/api/foundation-header.defaultheaderconfig.md +13 -0
- package/docs/api/foundation-header.foundationheader.loadremotes.md +15 -0
- package/docs/api/foundation-header.foundationheader.md +27 -0
- package/docs/api/foundation-header.headerconfig.md +21 -0
- package/docs/api/foundation-header.headerconfig.templateoptions.md +18 -0
- package/docs/api/foundation-header.md +15 -0
- package/docs/api/foundation-header.navigation.headerconfig.md +11 -0
- package/docs/api/foundation-header.navigation.md +1 -0
- package/docs/api/foundation-header.zeroheader.md +37 -0
- package/docs/api-report.md +48 -0
- package/package.json +19 -19
- package/dist/dts/components/components.d.ts +0 -9
- package/dist/dts/components/components.d.ts.map +0 -1
- package/dist/dts/components/index.d.ts +0 -2
- package/dist/dts/components/index.d.ts.map +0 -1
- package/dist/esm/components/components.js +0 -42
- package/dist/esm/components/index.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zero-components.d.ts","sourceRoot":"","sources":["../../../src/components/zero-components.ts"],"names":[],"mappings":"AAoCA;;GAEG;AACH,eAAO,MAAM,4BAA4B,qBA8BxC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PartialFASTElementDefinition } from '@microsoft/fast-element';
|
|
2
|
+
import { TemplateOptions } from './templates';
|
|
3
|
+
/**
|
|
4
|
+
* Do not reference any ../main files here. We must avoid ../tags being referenced and therefore setup pre-configuration.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* HeaderConfig DI interface.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface HeaderConfig extends PartialFASTElementDefinition {
|
|
12
|
+
/**
|
|
13
|
+
* Template options.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Used by host applications to assign MF template options and subcomponent tags to align with the host design system.
|
|
17
|
+
*/
|
|
18
|
+
templateOptions: TemplateOptions;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Default HeaderConfig DI implementation.
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare const defaultHeaderConfig: HeaderConfig;
|
|
25
|
+
/**
|
|
26
|
+
* HeaderConfig DI key.
|
|
27
|
+
*
|
|
28
|
+
* @internal
|
|
29
|
+
* @privateRemarks
|
|
30
|
+
* Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
|
|
31
|
+
*/
|
|
32
|
+
export declare const HeaderConfig: import("@microsoft/fast-foundation").InterfaceSymbol<HeaderConfig>;
|
|
33
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAA0B,eAAe,EAAE,MAAM,aAAa,CAAC;AAEtE;;GAEG;AAEH;;;;GAIG;AACH,MAAM,WAAW,YAAa,SAAQ,4BAA4B;IAChE;;;;;OAKG;IACH,eAAe,EAAE,eAAe,CAAC;CAClC;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAGjC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,oEAExB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HeaderConfig } from './config';
|
|
2
|
+
/**
|
|
3
|
+
* A function that allows configuring the header micro-frontend with name and templateOptions.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Configure the Header micro frontend for host app integration.
|
|
7
|
+
*
|
|
8
|
+
* @example Providing template options to align to your host application.
|
|
9
|
+
* ```ts
|
|
10
|
+
* const { configure } = await import('@genesislcap/foundation-header/config'); // < import from the subpath
|
|
11
|
+
* return configure({
|
|
12
|
+
* name: `nexus-app-header`,
|
|
13
|
+
* // These will be merged with the packages `defaultTemplateOptions`. You will need to have these components registered in your application.
|
|
14
|
+
* templateOptions: {
|
|
15
|
+
* button: 'nexus-button',
|
|
16
|
+
* icon: 'nexus-icon-next',
|
|
17
|
+
* },
|
|
18
|
+
* });
|
|
19
|
+
* },
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @param config - A partial HeaderConfig.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare function configure(config: Partial<HeaderConfig>): Promise<typeof import("../main").Navigation>;
|
|
26
|
+
//# sourceMappingURL=configure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../src/config/configure.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAuB,MAAM,UAAU,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,gDAgC5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TemplateElementDependency } from '@genesislcap/foundation-ui';
|
|
2
|
+
import { SyntheticViewTemplate } from '@microsoft/fast-element';
|
|
3
|
+
/**
|
|
4
|
+
* TemplateComponents.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type TemplateComponents = {
|
|
8
|
+
icon: TemplateElementDependency;
|
|
9
|
+
button: TemplateElementDependency;
|
|
10
|
+
connectionIndicator: TemplateElementDependency;
|
|
11
|
+
select: TemplateElementDependency;
|
|
12
|
+
option: TemplateElementDependency;
|
|
13
|
+
flyout: TemplateElementDependency;
|
|
14
|
+
provider: TemplateElementDependency;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* TemplateOptions.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export type TemplateOptions = Partial<TemplateComponents> & {
|
|
21
|
+
/**
|
|
22
|
+
* @remarks
|
|
23
|
+
* Just for reference that template options may be more than tags.
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
somePartial?: string | SyntheticViewTemplate;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* defaultTemplateOptions.
|
|
30
|
+
* @remarks
|
|
31
|
+
* The default template options this MF has been created with.
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export declare const defaultTemplateOptions: TemplateOptions;
|
|
35
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/config/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,yBAAyB,CAAC;IAChC,MAAM,EAAE,yBAAyB,CAAC;IAClC,mBAAmB,EAAE,yBAAyB,CAAC;IAC/C,MAAM,EAAE,yBAAyB,CAAC;IAClC,MAAM,EAAE,yBAAyB,CAAC;IAClC,MAAM,EAAE,yBAAyB,CAAC;IAClC,QAAQ,EAAE,yBAAyB,CAAC;CACrC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,GAAG;IAC1D;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,qBAAqB,CAAC;CAC9C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,eAQpC,CAAC"}
|
package/dist/dts/main/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/main/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/main/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC"}
|
package/dist/dts/main/main.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Auth, CredentialManager } from '@genesislcap/foundation-comms';
|
|
2
2
|
import { I18next } from '@genesislcap/foundation-i18n';
|
|
3
3
|
import type { FoundationRouteNavItem } from '@genesislcap/foundation-ui';
|
|
4
|
+
import { HeaderConfig } from '../config';
|
|
4
5
|
/**
|
|
5
6
|
* Events dispatched by the navigation control buttons
|
|
6
7
|
* @public
|
|
@@ -49,9 +50,7 @@ declare const Navigation_base: abstract new (...args: any[]) => {
|
|
|
49
50
|
readonly classList: DOMTokenList;
|
|
50
51
|
className: string;
|
|
51
52
|
readonly clientHeight: number;
|
|
52
|
-
readonly clientLeft: number;
|
|
53
|
-
* Username of the logged in user
|
|
54
|
-
*/
|
|
53
|
+
readonly clientLeft: number;
|
|
55
54
|
readonly clientTop: number;
|
|
56
55
|
readonly clientWidth: number;
|
|
57
56
|
id: string;
|
|
@@ -65,6 +64,14 @@ declare const Navigation_base: abstract new (...args: any[]) => {
|
|
|
65
64
|
readonly prefix: string;
|
|
66
65
|
readonly scrollHeight: number;
|
|
67
66
|
scrollLeft: number;
|
|
67
|
+
/**
|
|
68
|
+
* Optional attribute which controls the icon to show on the navigation bar and flyout
|
|
69
|
+
* Control via `logo-src`
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
*
|
|
73
|
+
* If this attribute is not set then the Genesis logo is shown instead
|
|
74
|
+
*/
|
|
68
75
|
scrollTop: number;
|
|
69
76
|
readonly scrollWidth: number;
|
|
70
77
|
readonly shadowRoot: ShadowRoot;
|
|
@@ -159,7 +166,17 @@ declare const Navigation_base: abstract new (...args: any[]) => {
|
|
|
159
166
|
readonly ELEMENT_NODE: number;
|
|
160
167
|
readonly ENTITY_NODE: number;
|
|
161
168
|
readonly ENTITY_REFERENCE_NODE: number;
|
|
162
|
-
readonly NOTATION_NODE: number;
|
|
169
|
+
readonly NOTATION_NODE: number; /**
|
|
170
|
+
* Changes the route of the current page
|
|
171
|
+
*
|
|
172
|
+
* @remarks
|
|
173
|
+
*
|
|
174
|
+
* Requires setup of the Router and usage of the FAST Router
|
|
175
|
+
*
|
|
176
|
+
* @param path - string represeting the new route to move to
|
|
177
|
+
*
|
|
178
|
+
* @public
|
|
179
|
+
*/
|
|
163
180
|
readonly PROCESSING_INSTRUCTION_NODE: number;
|
|
164
181
|
readonly TEXT_NODE: number;
|
|
165
182
|
dispatchEvent(event: Event): boolean;
|
|
@@ -184,7 +201,16 @@ declare const Navigation_base: abstract new (...args: any[]) => {
|
|
|
184
201
|
ariaModal: string;
|
|
185
202
|
ariaMultiLine: string;
|
|
186
203
|
ariaMultiSelectable: string;
|
|
187
|
-
ariaOrientation: string;
|
|
204
|
+
ariaOrientation: string; /**
|
|
205
|
+
* Emits the event corresponding to the luminance icon being clicked
|
|
206
|
+
*
|
|
207
|
+
* @remarks
|
|
208
|
+
*
|
|
209
|
+
* Activated when the user clicks on the moon icon on the navigation
|
|
210
|
+
* bar right hand side
|
|
211
|
+
*
|
|
212
|
+
* @internal
|
|
213
|
+
*/
|
|
188
214
|
ariaPlaceholder: string;
|
|
189
215
|
ariaPosInSet: string;
|
|
190
216
|
ariaPressed: string;
|
|
@@ -202,16 +228,7 @@ declare const Navigation_base: abstract new (...args: any[]) => {
|
|
|
202
228
|
ariaValueMin: string;
|
|
203
229
|
ariaValueNow: string;
|
|
204
230
|
ariaValueText: string;
|
|
205
|
-
role: string;
|
|
206
|
-
* Emits the event corresponding to the notification icon being clicked
|
|
207
|
-
*
|
|
208
|
-
* @remarks
|
|
209
|
-
*
|
|
210
|
-
* Activated when the user clicks on the bell icon on the navigation
|
|
211
|
-
* bar right hand side
|
|
212
|
-
*
|
|
213
|
-
* @internal
|
|
214
|
-
*/
|
|
231
|
+
role: string;
|
|
215
232
|
animate(keyframes: PropertyIndexedKeyframes | Keyframe[], options?: number | KeyframeAnimationOptions): Animation;
|
|
216
233
|
getAnimations(options?: GetAnimationsOptions): Animation[];
|
|
217
234
|
after(...nodes: (string | Node)[]): void;
|
|
@@ -382,6 +399,7 @@ export declare class Navigation extends Navigation_base {
|
|
|
382
399
|
auth: Auth;
|
|
383
400
|
credentialManager: CredentialManager;
|
|
384
401
|
i18next: I18next;
|
|
402
|
+
headerConfig: HeaderConfig;
|
|
385
403
|
ready: boolean;
|
|
386
404
|
/**
|
|
387
405
|
* Username of the logged in user
|
|
@@ -573,5 +591,53 @@ export declare class Navigation extends Navigation_base {
|
|
|
573
591
|
*/
|
|
574
592
|
toLocalisedText(text: string): string;
|
|
575
593
|
}
|
|
594
|
+
/**
|
|
595
|
+
* FoundationHeader.
|
|
596
|
+
*
|
|
597
|
+
* @remarks
|
|
598
|
+
* Base MF export used by host application `configure` calls. It does not set up a design system or components. Both are
|
|
599
|
+
* expected to be registered in the host application, which should provide the details of which to the MF via
|
|
600
|
+
* TemplateOptions.
|
|
601
|
+
*
|
|
602
|
+
* See the {@link configure} hook for more information on how to set up and use this micro frontend in your application.
|
|
603
|
+
*
|
|
604
|
+
* @privateRemarks
|
|
605
|
+
* We will override loadRemotes to remove zero. This setup is the inverse of FoundationAuth.
|
|
606
|
+
* We're doing this to avoid a breaking change, so consumers can continue to use Navigation which bundles zero.
|
|
607
|
+
*
|
|
608
|
+
* @public
|
|
609
|
+
*/
|
|
610
|
+
export declare class FoundationHeader extends Navigation {
|
|
611
|
+
loadRemotes(): Promise<void>;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* ZeroHeader is a zero version of the header micro-frontend.
|
|
615
|
+
*
|
|
616
|
+
* @remarks
|
|
617
|
+
* A zero version that pre-registers zero components and uses the zero design system so that it can run standalone.
|
|
618
|
+
* Generally this is used for development purposes, but can be deployed as a standalone application if required or be
|
|
619
|
+
* used by a host application that is already using zero. ZeroHeader and its components won't bloat the core bundle as
|
|
620
|
+
* these are only loaded on-demand when in use.
|
|
621
|
+
*
|
|
622
|
+
* @example
|
|
623
|
+
* ```ts
|
|
624
|
+
* import { ZeroHeader } from '@genesislcap/foundation-header';
|
|
625
|
+
* ...
|
|
626
|
+
* ZeroHeader
|
|
627
|
+
* ```
|
|
628
|
+
*
|
|
629
|
+
* @example Load the micro frontend on-demand
|
|
630
|
+
* ```ts
|
|
631
|
+
* const { ZeroHeader } = await import('@genesislcap/foundation-header');
|
|
632
|
+
* },
|
|
633
|
+
* ```
|
|
634
|
+
*
|
|
635
|
+
* @privateRemarks
|
|
636
|
+
* For now we just extend Navigation as is, given that is ZeroHeader really.
|
|
637
|
+
*
|
|
638
|
+
* @public
|
|
639
|
+
*/
|
|
640
|
+
export declare class ZeroHeader extends Navigation {
|
|
641
|
+
}
|
|
576
642
|
export {};
|
|
577
643
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAgB,MAAM,+BAA+B,CAAC;AAEtF,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAgB,MAAM,+BAA+B,CAAC;AAEtF,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,4BAA4B,CAAC;AAI9F,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAKzC;;;GAGG;A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+
{"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,iDAmLgD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAW5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AA6EzC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,+BA6FvB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAIpD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAEpD,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,UAAU,CAEjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tags/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* It's important this file isn't referenced ahead of a `configure` call, otherwise these values may remain fixed at
|
|
3
|
+
* their defaults. Consumers must use the `/config` subpath to help avoid this. Files with references to tags should be
|
|
4
|
+
* lazily loaded. There is an alternative `getTags` utility at the end which could offer another approach, but direct
|
|
5
|
+
* tag exports and inline template references feel cleaner than having to convert all component `template` and `styles`
|
|
6
|
+
* exports to functions to call `getTags` on execution.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare const templateOptions: import("../config/templates").TemplateOptions;
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare const iconTag: string;
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const buttonTag: string;
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare const connectionIndicatorTag: string;
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export declare const selectTag: string;
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare const optionTag: string;
|
|
32
|
+
/**
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare const flyoutTag: string;
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export declare const providerTag: string;
|
|
40
|
+
//# sourceMappingURL=tags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../../src/tags/tags.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AAEH;;GAEG;AACH,eAAO,MAAQ,eAAe,+CACkB,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,OAAO,QAA+B,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,SAAS,QAAiC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAA8C,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,SAAS,QAAiC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,SAAS,QAAiC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,SAAS,QAAiC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,WAAW,QAAmC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { assureDesignSystem, ResourceType, } from '@genesislcap/foundation-utils';
|
|
3
|
+
import { logger } from '../utils';
|
|
4
|
+
/**
|
|
5
|
+
* @remarks
|
|
6
|
+
* Attempts to use a module federation version of zero before falling back to the version that was bundled with the app.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
function zeroDesignSystemImport() {
|
|
10
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
let module;
|
|
12
|
+
let type = ResourceType.remote;
|
|
13
|
+
try {
|
|
14
|
+
module = yield import(
|
|
15
|
+
/* webpackChunkName: "foundation-zero" */
|
|
16
|
+
'foundationZero/ZeroDesignSystem');
|
|
17
|
+
return assureDesignSystem(module);
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
logger.info(`Please note remoteEntry.js load errors are expected if module federated dependencies are offline. Falling back to locally bundled versions.`);
|
|
21
|
+
type = ResourceType.local;
|
|
22
|
+
module = yield import(
|
|
23
|
+
/* webpackChunkName: "foundation-zero" */
|
|
24
|
+
'@genesislcap/foundation-zero');
|
|
25
|
+
return assureDesignSystem(module);
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
logger.debug(`Using '${type}' version of foundation-zero`);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export const registerCommonZeroComponents = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
const { provideDesignSystem, zeroIcon, zeroButton, zeroDesignSystemProvider, zeroSelect, zeroListboxOption, zeroFlyout, zeroConnectionIndicator, } = yield zeroDesignSystemImport();
|
|
37
|
+
/**
|
|
38
|
+
* Register the components the app is using with the system.
|
|
39
|
+
*/
|
|
40
|
+
provideDesignSystem().register(
|
|
41
|
+
/**
|
|
42
|
+
* Design system provider element used to declaratively apply zero config to every dom node in the host tree.
|
|
43
|
+
*/
|
|
44
|
+
zeroDesignSystemProvider(),
|
|
45
|
+
/**
|
|
46
|
+
* Common across most routes, so batch register these lightweight components upfront.
|
|
47
|
+
*/
|
|
48
|
+
zeroIcon(), zeroButton(), zeroSelect(), zeroListboxOption(), zeroFlyout(), zeroConnectionIndicator);
|
|
49
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DI } from '@microsoft/fast-foundation';
|
|
2
|
+
import { defaultTemplateOptions } from './templates';
|
|
3
|
+
/**
|
|
4
|
+
* Default HeaderConfig DI implementation.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export const defaultHeaderConfig = {
|
|
8
|
+
name: 'foundation-header',
|
|
9
|
+
templateOptions: defaultTemplateOptions,
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* HeaderConfig DI key.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
* @privateRemarks
|
|
16
|
+
* Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
|
|
17
|
+
*/
|
|
18
|
+
export const HeaderConfig = DI.createInterface((x) => x.instance(defaultHeaderConfig));
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { FASTElement } from '@microsoft/fast-element';
|
|
3
|
+
import { DI, Registration } from '@microsoft/fast-foundation';
|
|
4
|
+
import { HeaderConfig, defaultHeaderConfig } from './config';
|
|
5
|
+
/**
|
|
6
|
+
* A function that allows configuring the header micro-frontend with name and templateOptions.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Configure the Header micro frontend for host app integration.
|
|
10
|
+
*
|
|
11
|
+
* @example Providing template options to align to your host application.
|
|
12
|
+
* ```ts
|
|
13
|
+
* const { configure } = await import('@genesislcap/foundation-header/config'); // < import from the subpath
|
|
14
|
+
* return configure({
|
|
15
|
+
* name: `nexus-app-header`,
|
|
16
|
+
* // These will be merged with the packages `defaultTemplateOptions`. You will need to have these components registered in your application.
|
|
17
|
+
* templateOptions: {
|
|
18
|
+
* button: 'nexus-button',
|
|
19
|
+
* icon: 'nexus-icon-next',
|
|
20
|
+
* },
|
|
21
|
+
* });
|
|
22
|
+
* },
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @param config - A partial HeaderConfig.
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export function configure(config) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
/**
|
|
31
|
+
* Merge the configs
|
|
32
|
+
*/
|
|
33
|
+
const value = Object.assign(Object.assign({}, defaultHeaderConfig), config);
|
|
34
|
+
if (config.templateOptions) {
|
|
35
|
+
value.templateOptions = Object.assign(Object.assign(Object.assign({}, defaultHeaderConfig.templateOptions), { provider: 'template' }), config.templateOptions);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Register a new HeaderConfig
|
|
39
|
+
*/
|
|
40
|
+
DI.getOrCreateDOMContainer().register(Registration.instance(HeaderConfig, value));
|
|
41
|
+
/**
|
|
42
|
+
* Lazily reference and define the micro frontend element post config setting.
|
|
43
|
+
*/
|
|
44
|
+
const { Navigation, DynamicTemplate, MainStyles } = yield import('../main');
|
|
45
|
+
const { name, attributes, shadowOptions, elementOptions } = value;
|
|
46
|
+
return FASTElement.define(Navigation, {
|
|
47
|
+
name,
|
|
48
|
+
template: DynamicTemplate,
|
|
49
|
+
styles: MainStyles,
|
|
50
|
+
attributes,
|
|
51
|
+
shadowOptions,
|
|
52
|
+
elementOptions,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
package/dist/esm/config/index.js
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* defaultTemplateOptions.
|
|
3
|
+
* @remarks
|
|
4
|
+
* The default template options this MF has been created with.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export const defaultTemplateOptions = {
|
|
8
|
+
icon: 'zero-icon',
|
|
9
|
+
button: 'zero-button',
|
|
10
|
+
connectionIndicator: 'zero-connection-indicator',
|
|
11
|
+
select: 'zero-select',
|
|
12
|
+
option: 'zero-option',
|
|
13
|
+
flyout: 'zero-flyout',
|
|
14
|
+
provider: 'zero-design-system-provider',
|
|
15
|
+
};
|
package/dist/esm/main/index.js
CHANGED
package/dist/esm/main/main.js
CHANGED
|
@@ -5,7 +5,7 @@ import { I18next } from '@genesislcap/foundation-i18n';
|
|
|
5
5
|
import { FASTElement, customElement, observable, attr } from '@microsoft/fast-element';
|
|
6
6
|
import { Route } from '@microsoft/fast-router';
|
|
7
7
|
import logo from '../assets/logo.svg';
|
|
8
|
-
import
|
|
8
|
+
import { HeaderConfig } from '../config';
|
|
9
9
|
import { logger } from '../utils';
|
|
10
10
|
import { MainStyles as styles } from './main.styles';
|
|
11
11
|
import { DynamicTemplate as template, LoadingTemplate, MainTemplate } from './main.template';
|
|
@@ -127,7 +127,8 @@ let Navigation = class Navigation extends EventEmitter(FASTElement) {
|
|
|
127
127
|
*/
|
|
128
128
|
loadRemotes() {
|
|
129
129
|
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
-
const
|
|
130
|
+
const { registerCommonZeroComponents } = yield import('../components/zero-components');
|
|
131
|
+
yield registerCommonZeroComponents();
|
|
131
132
|
this.ready = true;
|
|
132
133
|
});
|
|
133
134
|
}
|
|
@@ -271,6 +272,9 @@ __decorate([
|
|
|
271
272
|
__decorate([
|
|
272
273
|
I18next
|
|
273
274
|
], Navigation.prototype, "i18next", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
HeaderConfig
|
|
277
|
+
], Navigation.prototype, "headerConfig", void 0);
|
|
274
278
|
__decorate([
|
|
275
279
|
observable
|
|
276
280
|
], Navigation.prototype, "ready", void 0);
|
|
@@ -318,3 +322,63 @@ Navigation = __decorate([
|
|
|
318
322
|
})
|
|
319
323
|
], Navigation);
|
|
320
324
|
export { Navigation };
|
|
325
|
+
/**
|
|
326
|
+
* FoundationHeader.
|
|
327
|
+
*
|
|
328
|
+
* @remarks
|
|
329
|
+
* Base MF export used by host application `configure` calls. It does not set up a design system or components. Both are
|
|
330
|
+
* expected to be registered in the host application, which should provide the details of which to the MF via
|
|
331
|
+
* TemplateOptions.
|
|
332
|
+
*
|
|
333
|
+
* See the {@link configure} hook for more information on how to set up and use this micro frontend in your application.
|
|
334
|
+
*
|
|
335
|
+
* @privateRemarks
|
|
336
|
+
* We will override loadRemotes to remove zero. This setup is the inverse of FoundationAuth.
|
|
337
|
+
* We're doing this to avoid a breaking change, so consumers can continue to use Navigation which bundles zero.
|
|
338
|
+
*
|
|
339
|
+
* @public
|
|
340
|
+
*/
|
|
341
|
+
export class FoundationHeader extends Navigation {
|
|
342
|
+
loadRemotes() {
|
|
343
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
344
|
+
this.ready = true;
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* ZeroHeader is a zero version of the header micro-frontend.
|
|
350
|
+
*
|
|
351
|
+
* @remarks
|
|
352
|
+
* A zero version that pre-registers zero components and uses the zero design system so that it can run standalone.
|
|
353
|
+
* Generally this is used for development purposes, but can be deployed as a standalone application if required or be
|
|
354
|
+
* used by a host application that is already using zero. ZeroHeader and its components won't bloat the core bundle as
|
|
355
|
+
* these are only loaded on-demand when in use.
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* ```ts
|
|
359
|
+
* import { ZeroHeader } from '@genesislcap/foundation-header';
|
|
360
|
+
* ...
|
|
361
|
+
* ZeroHeader
|
|
362
|
+
* ```
|
|
363
|
+
*
|
|
364
|
+
* @example Load the micro frontend on-demand
|
|
365
|
+
* ```ts
|
|
366
|
+
* const { ZeroHeader } = await import('@genesislcap/foundation-header');
|
|
367
|
+
* },
|
|
368
|
+
* ```
|
|
369
|
+
*
|
|
370
|
+
* @privateRemarks
|
|
371
|
+
* For now we just extend Navigation as is, given that is ZeroHeader really.
|
|
372
|
+
*
|
|
373
|
+
* @public
|
|
374
|
+
*/
|
|
375
|
+
let ZeroHeader = class ZeroHeader extends Navigation {
|
|
376
|
+
};
|
|
377
|
+
ZeroHeader = __decorate([
|
|
378
|
+
customElement({
|
|
379
|
+
name: 'zero-header',
|
|
380
|
+
template,
|
|
381
|
+
styles,
|
|
382
|
+
})
|
|
383
|
+
], ZeroHeader);
|
|
384
|
+
export { ZeroHeader };
|