@genesislcap/foundation-header 14.140.0 → 14.141.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.
Files changed (50) hide show
  1. package/dist/custom-elements.json +690 -160
  2. package/dist/dts/components/zero-components.d.ts +6 -0
  3. package/dist/dts/components/zero-components.d.ts.map +1 -0
  4. package/dist/dts/config/config.d.ts +33 -0
  5. package/dist/dts/config/config.d.ts.map +1 -0
  6. package/dist/dts/config/configure.d.ts +27 -0
  7. package/dist/dts/config/configure.d.ts.map +1 -0
  8. package/dist/dts/config/index.d.ts +2 -0
  9. package/dist/dts/config/index.d.ts.map +1 -1
  10. package/dist/dts/config/templates.d.ts +34 -0
  11. package/dist/dts/config/templates.d.ts.map +1 -0
  12. package/dist/dts/main/index.d.ts +1 -1
  13. package/dist/dts/main/index.d.ts.map +1 -1
  14. package/dist/dts/main/main.d.ts +53 -24
  15. package/dist/dts/main/main.d.ts.map +1 -1
  16. package/dist/dts/main/main.styles.d.ts.map +1 -1
  17. package/dist/dts/main/main.template.d.ts.map +1 -1
  18. package/dist/dts/tags/index.d.ts +2 -0
  19. package/dist/dts/tags/index.d.ts.map +1 -0
  20. package/dist/dts/tags/tags.d.ts +36 -0
  21. package/dist/dts/tags/tags.d.ts.map +1 -0
  22. package/dist/esm/components/zero-components.js +48 -0
  23. package/dist/esm/config/config.js +18 -0
  24. package/dist/esm/config/configure.js +56 -0
  25. package/dist/esm/config/index.js +2 -0
  26. package/dist/esm/config/templates.js +14 -0
  27. package/dist/esm/main/index.js +1 -1
  28. package/dist/esm/main/main.js +58 -23
  29. package/dist/esm/main/main.styles.js +56 -133
  30. package/dist/esm/main/main.template.js +32 -28
  31. package/dist/esm/tags/index.js +1 -0
  32. package/dist/esm/tags/tags.js +39 -0
  33. package/dist/foundation-header.api.json +219 -0
  34. package/dist/foundation-header.d.ts +187 -24
  35. package/docs/api/foundation-header.configure.md +46 -0
  36. package/docs/api/foundation-header.defaultheaderconfig.md +13 -0
  37. package/docs/api/foundation-header.headerconfig.md +21 -0
  38. package/docs/api/foundation-header.headerconfig.templateoptions.md +18 -0
  39. package/docs/api/foundation-header.md +14 -0
  40. package/docs/api/foundation-header.navigation.headerconfig.md +11 -0
  41. package/docs/api/foundation-header.navigation.md +1 -0
  42. package/docs/api/foundation-header.zeroheader.md +39 -0
  43. package/docs/api-report.md +46 -2
  44. package/package.json +14 -12
  45. package/dist/dts/components/components.d.ts +0 -9
  46. package/dist/dts/components/components.d.ts.map +0 -1
  47. package/dist/dts/components/index.d.ts +0 -2
  48. package/dist/dts/components/index.d.ts.map +0 -1
  49. package/dist/esm/components/components.js +0 -42
  50. package/dist/esm/components/index.js +0 -1
@@ -0,0 +1,6 @@
1
+ /**
2
+ * registerCommonZeroComponents.
3
+ * @public
4
+ */
5
+ export declare const registerCommonZeroComponents: () => Promise<void>;
6
+ //# sourceMappingURL=zero-components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zero-components.d.ts","sourceRoot":"","sources":["../../../src/components/zero-components.ts"],"names":[],"mappings":"AAsCA;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qBAyBxC,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,27 @@
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
+
11
+ * const { configure } = await import('@genesislcap/foundation-header/config'); // < import from the subpath
12
+ * return configure({
13
+ * name: `nexus-app-header`,
14
+ * // These will be merged with the packages `defaultTemplateOptions`. You will need to have these components registered in your application.
15
+ * templateOptions: {
16
+ * button: 'nexus-button',
17
+ * icon: 'nexus-icon-next',
18
+ * },
19
+ * });
20
+ * },
21
+ * ```
22
+ *
23
+ * @param config - A partial HeaderConfig.
24
+ * @public
25
+ */
26
+ export declare function configure(config: Partial<HeaderConfig>): Promise<typeof import("../main").Navigation>;
27
+ //# 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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,gDA+B5D"}
@@ -1,2 +1,4 @@
1
+ export * from './config';
2
+ export * from './configure';
1
3
  export * from './targetId';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -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,34 @@
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
+ };
15
+ /**
16
+ * TemplateOptions.
17
+ * @public
18
+ */
19
+ export type TemplateOptions = Partial<TemplateComponents> & {
20
+ /**
21
+ * @remarks
22
+ * Just for reference that template options may be more than tags.
23
+ * @internal
24
+ */
25
+ somePartial?: string | SyntheticViewTemplate;
26
+ };
27
+ /**
28
+ * defaultTemplateOptions.
29
+ * @remarks
30
+ * The default template options this MF has been created with.
31
+ * @public
32
+ */
33
+ export declare const defaultTemplateOptions: TemplateOptions;
34
+ //# 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;CACnC,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,eAOpC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export * from './main.styles';
2
- export { NavTemplate } from './main.template';
2
+ export * from './main.template';
3
3
  export * from './main';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/main/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,cAAc,QAAQ,CAAC"}
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"}
@@ -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;
@@ -109,6 +108,11 @@ declare const Navigation_base: abstract new (...args: any[]) => {
109
108
  scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
110
109
  scrollTo(options?: ScrollToOptions): void;
111
110
  scrollTo(x: number, y: number): void;
111
+ /**
112
+ * If present the defined route buttons will be rendered in the header 'routes' slot
113
+ *
114
+ * @deprecated - Use `routeNavItems` instead.
115
+ */
112
116
  setAttribute(qualifiedName: string, value: string): void;
113
117
  setAttributeNS(namespace: string, qualifiedName: string, value: string): void;
114
118
  setAttributeNode(attr: Attr): Attr;
@@ -169,7 +173,16 @@ declare const Navigation_base: abstract new (...args: any[]) => {
169
173
  ariaChecked: string;
170
174
  ariaColCount: string;
171
175
  ariaColIndex: string;
172
- ariaColIndexText: string;
176
+ ariaColIndexText: string; /**
177
+ * Emits the event corresponding to the luminance icon being clicked
178
+ *
179
+ * @remarks
180
+ *
181
+ * Activated when the user clicks on the moon icon on the navigation
182
+ * bar right hand side
183
+ *
184
+ * @internal
185
+ */
173
186
  ariaColSpan: string;
174
187
  ariaCurrent: string;
175
188
  ariaDisabled: string;
@@ -202,16 +215,7 @@ declare const Navigation_base: abstract new (...args: any[]) => {
202
215
  ariaValueMin: string;
203
216
  ariaValueNow: string;
204
217
  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
- */
218
+ role: string;
215
219
  animate(keyframes: PropertyIndexedKeyframes | Keyframe[], options?: number | KeyframeAnimationOptions): Animation;
216
220
  getAnimations(options?: GetAnimationsOptions): Animation[];
217
221
  after(...nodes: (string | Node)[]): void;
@@ -382,6 +386,7 @@ export declare class Navigation extends Navigation_base {
382
386
  auth: Auth;
383
387
  credentialManager: CredentialManager;
384
388
  i18next: I18next;
389
+ headerConfig: HeaderConfig;
385
390
  ready: boolean;
386
391
  /**
387
392
  * Username of the logged in user
@@ -474,16 +479,6 @@ export declare class Navigation extends Navigation_base {
474
479
  * If present the defined {@link @genesislcap/foundation-ui#FoundationRouteNavItem | FoundationRouteNavItems} will be rendered in the header 'routes' slot
475
480
  */
476
481
  routeNavItems: FoundationRouteNavItem[];
477
- /**
478
- * Load remote components
479
- *
480
- * @remarks
481
- *
482
- * With regards to module federation
483
- *
484
- * @internal
485
- */
486
- loadRemotes(): Promise<void>;
487
482
  selectTemplate(): import("@microsoft/fast-element").ViewTemplate<Navigation, any>;
488
483
  /**
489
484
  * Logs the user out of their session
@@ -573,5 +568,39 @@ export declare class Navigation extends Navigation_base {
573
568
  */
574
569
  toLocalisedText(text: string): string;
575
570
  }
571
+ /**
572
+ * ZeroHeader is a zero version of the header micro-frontend.
573
+ *
574
+ * @remarks
575
+ * A zero version that pre-registers zero components and uses the zero design system. ZeroHeader and its components won't bloat the core bundle as
576
+ * these are only loaded on-demand when in use.
577
+ *
578
+ * @example
579
+ * ```ts
580
+ * import { ZeroHeader } from '@genesislcap/foundation-header';
581
+ * ...
582
+ * ZeroHeader
583
+ * ```
584
+ *
585
+ * @example Load the micro frontend on-demand
586
+ * ```ts
587
+
588
+ * const { ZeroHeader } = await import('@genesislcap/foundation-header');
589
+ * return ZeroHeader;
590
+ * },
591
+ * ```
592
+ *
593
+ * @public
594
+ */
595
+ export declare class ZeroHeader extends Navigation {
596
+ /**
597
+ * @internal
598
+ */
599
+ connectedCallback(): Promise<void>;
600
+ /**
601
+ * @internal
602
+ */
603
+ loadRemotes(): Promise<void>;
604
+ }
576
605
  export {};
577
606
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","s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 -1 +1 @@
1
- {"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAYA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,iDA6PgD,CAAC"}
1
+ {"version":3,"file":"main.styles.d.ts","sourceRoot":"","sources":["../../../src/main/main.styles.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,iDAiLgD,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;AAE5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AA0EzC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,+BA+GvB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAEpD,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"}
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;AAU5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AA6EzC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,+BA+GvB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,CAAC,UAAU,CAEpD,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,2 @@
1
+ export * from './tags';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,36 @@
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
+ //# 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"}
@@ -0,0 +1,48 @@
1
+ import { __awaiter } from "tslib";
2
+ import { assureDesignSystem, ResourceType, } from '@genesislcap/foundation-utils';
3
+ import { logger } from '../utils';
4
+ /**
5
+ * zeroDesignSystemImport.
6
+ * @remarks
7
+ * Attempts to use a module federation version of zero before falling back to the version that was bundled with the app.
8
+ * @internal
9
+ */
10
+ function zeroDesignSystemImport() {
11
+ return __awaiter(this, void 0, void 0, function* () {
12
+ let module;
13
+ let type = ResourceType.remote;
14
+ try {
15
+ // @ts-ignore
16
+ module = yield import(
17
+ /* webpackChunkName: "foundation-zero" */
18
+ 'foundationZero/ZeroDesignSystem');
19
+ return assureDesignSystem(module);
20
+ }
21
+ catch (e) {
22
+ logger.info(`Please note remoteEntry.js load errors are expected if module federated dependencies are offline. Falling back to locally bundled versions.`);
23
+ type = ResourceType.local;
24
+ module = yield import(
25
+ /* webpackChunkName: "foundation-zero" */
26
+ '@genesislcap/foundation-zero');
27
+ return assureDesignSystem(module);
28
+ }
29
+ finally {
30
+ logger.debug(`Using '${type}' version of foundation-zero`);
31
+ }
32
+ });
33
+ }
34
+ /**
35
+ * registerCommonZeroComponents.
36
+ * @public
37
+ */
38
+ export const registerCommonZeroComponents = () => __awaiter(void 0, void 0, void 0, function* () {
39
+ const { provideDesignSystem, zeroIcon, zeroButton, zeroSelect, zeroListboxOption, zeroFlyout, zeroConnectionIndicator, } = yield zeroDesignSystemImport();
40
+ /**
41
+ * Register the components the app is using with the system.
42
+ */
43
+ provideDesignSystem().register(
44
+ /**
45
+ * Common across most routes, so batch register these lightweight components upfront.
46
+ */
47
+ zeroIcon(), zeroButton(), zeroSelect(), zeroListboxOption(), zeroFlyout(), zeroConnectionIndicator);
48
+ });
@@ -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,56 @@
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
+
14
+ * const { configure } = await import('@genesislcap/foundation-header/config'); // < import from the subpath
15
+ * return configure({
16
+ * name: `nexus-app-header`,
17
+ * // These will be merged with the packages `defaultTemplateOptions`. You will need to have these components registered in your application.
18
+ * templateOptions: {
19
+ * button: 'nexus-button',
20
+ * icon: 'nexus-icon-next',
21
+ * },
22
+ * });
23
+ * },
24
+ * ```
25
+ *
26
+ * @param config - A partial HeaderConfig.
27
+ * @public
28
+ */
29
+ export function configure(config) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ /**
32
+ * Merge the configs
33
+ */
34
+ const value = Object.assign(Object.assign({}, defaultHeaderConfig), config);
35
+ if (config.templateOptions) {
36
+ value.templateOptions = Object.assign(Object.assign({}, defaultHeaderConfig.templateOptions), config.templateOptions);
37
+ }
38
+ /**
39
+ * Register a new HeaderConfig
40
+ */
41
+ DI.getOrCreateDOMContainer().register(Registration.instance(HeaderConfig, value));
42
+ /**
43
+ * Lazily reference and define the micro frontend element post config setting.
44
+ */
45
+ const { Navigation, DynamicTemplate, MainStyles } = yield import('../main');
46
+ const { name, attributes, shadowOptions, elementOptions } = value;
47
+ return FASTElement.define(Navigation, {
48
+ name,
49
+ template: DynamicTemplate,
50
+ styles: MainStyles,
51
+ attributes,
52
+ shadowOptions,
53
+ elementOptions,
54
+ });
55
+ });
56
+ }
@@ -1 +1,3 @@
1
+ export * from './config';
2
+ export * from './configure';
1
3
  export * from './targetId';
@@ -0,0 +1,14 @@
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
+ };
@@ -1,3 +1,3 @@
1
1
  export * from './main.styles';
2
- export { NavTemplate } from './main.template';
2
+ export * from './main.template';
3
3
  export * from './main';
@@ -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 * as Components from '../components';
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';
@@ -42,7 +42,7 @@ import { DynamicTemplate as template, LoadingTemplate, MainTemplate } from './ma
42
42
  * @fires language-changed - Dispatched when the user changes the language in the language selector.
43
43
  *
44
44
  */
45
- let Navigation = class Navigation extends EventEmitter(FASTElement) {
45
+ export class Navigation extends EventEmitter(FASTElement) {
46
46
  constructor() {
47
47
  var _a;
48
48
  super(...arguments);
@@ -85,10 +85,10 @@ let Navigation = class Navigation extends EventEmitter(FASTElement) {
85
85
  return __awaiter(this, void 0, void 0, function* () {
86
86
  _super.connectedCallback.call(this);
87
87
  logger.debug(`foundation-header is now connected to the DOM`);
88
- yield this.loadRemotes();
89
88
  this.userName = this.auth.loggedUserResult
90
89
  ? this.auth.loggedUserResult.username
91
90
  : 'Genesis User';
91
+ this.ready = true;
92
92
  });
93
93
  }
94
94
  /**
@@ -116,21 +116,6 @@ let Navigation = class Navigation extends EventEmitter(FASTElement) {
116
116
  }));
117
117
  }
118
118
  }
119
- /**
120
- * Load remote components
121
- *
122
- * @remarks
123
- *
124
- * With regards to module federation
125
- *
126
- * @internal
127
- */
128
- loadRemotes() {
129
- return __awaiter(this, void 0, void 0, function* () {
130
- const remoteComponents = yield Components.loadRemotes();
131
- this.ready = true;
132
- });
133
- }
134
119
  selectTemplate() {
135
120
  return this.ready ? MainTemplate : LoadingTemplate;
136
121
  }
@@ -261,7 +246,7 @@ let Navigation = class Navigation extends EventEmitter(FASTElement) {
261
246
  ? this.i18next.t(text, { lng: this.i18next.language })
262
247
  : text;
263
248
  }
264
- };
249
+ }
265
250
  __decorate([
266
251
  Auth
267
252
  ], Navigation.prototype, "auth", void 0);
@@ -271,6 +256,9 @@ __decorate([
271
256
  __decorate([
272
257
  I18next
273
258
  ], Navigation.prototype, "i18next", void 0);
259
+ __decorate([
260
+ HeaderConfig
261
+ ], Navigation.prototype, "headerConfig", void 0);
274
262
  __decorate([
275
263
  observable
276
264
  ], Navigation.prototype, "ready", void 0);
@@ -310,11 +298,58 @@ __decorate([
310
298
  __decorate([
311
299
  observable
312
300
  ], Navigation.prototype, "routeNavItems", void 0);
313
- Navigation = __decorate([
301
+ /**
302
+ * ZeroHeader is a zero version of the header micro-frontend.
303
+ *
304
+ * @remarks
305
+ * A zero version that pre-registers zero components and uses the zero design system. ZeroHeader and its components won't bloat the core bundle as
306
+ * these are only loaded on-demand when in use.
307
+ *
308
+ * @example
309
+ * ```ts
310
+ * import { ZeroHeader } from '@genesislcap/foundation-header';
311
+ * ...
312
+ * ZeroHeader
313
+ * ```
314
+ *
315
+ * @example Load the micro frontend on-demand
316
+ * ```ts
317
+
318
+ * const { ZeroHeader } = await import('@genesislcap/foundation-header');
319
+ * return ZeroHeader;
320
+ * },
321
+ * ```
322
+ *
323
+ * @public
324
+ */
325
+ let ZeroHeader = class ZeroHeader extends Navigation {
326
+ /**
327
+ * @internal
328
+ */
329
+ connectedCallback() {
330
+ const _super = Object.create(null, {
331
+ connectedCallback: { get: () => super.connectedCallback }
332
+ });
333
+ return __awaiter(this, void 0, void 0, function* () {
334
+ _super.connectedCallback.call(this);
335
+ yield this.loadRemotes();
336
+ });
337
+ }
338
+ /**
339
+ * @internal
340
+ */
341
+ loadRemotes() {
342
+ return __awaiter(this, void 0, void 0, function* () {
343
+ const { registerCommonZeroComponents } = yield import('../components/zero-components');
344
+ yield registerCommonZeroComponents();
345
+ });
346
+ }
347
+ };
348
+ ZeroHeader = __decorate([
314
349
  customElement({
315
- name: 'foundation-header',
350
+ name: 'zero-header',
316
351
  template,
317
352
  styles,
318
353
  })
319
- ], Navigation);
320
- export { Navigation };
354
+ ], ZeroHeader);
355
+ export { ZeroHeader };