@genesislcap/foundation-header 14.140.0 → 14.141.1

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 +555 -25
  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 +64 -22
  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 +57 -22
  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 +200 -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.foundationheader.md +39 -0
  38. package/docs/api/foundation-header.headerconfig.md +21 -0
  39. package/docs/api/foundation-header.headerconfig.templateoptions.md +18 -0
  40. package/docs/api/foundation-header.md +14 -0
  41. package/docs/api/foundation-header.navigation.headerconfig.md +11 -0
  42. package/docs/api/foundation-header.navigation.md +1 -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;
@@ -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;
@@ -172,7 +179,16 @@ declare const Navigation_base: abstract new (...args: any[]) => {
172
179
  ariaColIndexText: string;
173
180
  ariaColSpan: string;
174
181
  ariaCurrent: string;
175
- ariaDisabled: string;
182
+ ariaDisabled: string; /**
183
+ * Emits the event corresponding to the luminance icon being clicked
184
+ *
185
+ * @remarks
186
+ *
187
+ * Activated when the user clicks on the moon icon on the navigation
188
+ * bar right hand side
189
+ *
190
+ * @internal
191
+ */
176
192
  ariaExpanded: string;
177
193
  ariaHasPopup: string;
178
194
  ariaHidden: string;
@@ -195,14 +211,7 @@ declare const Navigation_base: abstract new (...args: any[]) => {
195
211
  ariaRowIndex: string;
196
212
  ariaRowIndexText: string;
197
213
  ariaRowSpan: string;
198
- ariaSelected: string;
199
- ariaSetSize: string;
200
- ariaSort: string;
201
- ariaValueMax: string;
202
- ariaValueMin: string;
203
- ariaValueNow: string;
204
- ariaValueText: string;
205
- role: string; /**
214
+ /**
206
215
  * Emits the event corresponding to the notification icon being clicked
207
216
  *
208
217
  * @remarks
@@ -212,6 +221,14 @@ declare const Navigation_base: abstract new (...args: any[]) => {
212
221
  *
213
222
  * @internal
214
223
  */
224
+ ariaSelected: string;
225
+ ariaSetSize: string;
226
+ ariaSort: string;
227
+ ariaValueMax: string;
228
+ ariaValueMin: string;
229
+ ariaValueNow: string;
230
+ ariaValueText: string;
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
@@ -474,16 +492,6 @@ export declare class Navigation extends Navigation_base {
474
492
  * If present the defined {@link @genesislcap/foundation-ui#FoundationRouteNavItem | FoundationRouteNavItems} will be rendered in the header 'routes' slot
475
493
  */
476
494
  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
495
  selectTemplate(): import("@microsoft/fast-element").ViewTemplate<Navigation, any>;
488
496
  /**
489
497
  * Logs the user out of their session
@@ -573,5 +581,39 @@ export declare class Navigation extends Navigation_base {
573
581
  */
574
582
  toLocalisedText(text: string): string;
575
583
  }
584
+ /**
585
+ * FoundationHeader is a zero version of the header micro-frontend.
586
+ *
587
+ * @remarks
588
+ * A header version that pre-registers zero components and uses the zero design system. ZeroHeader and its components won't bloat the core bundle as
589
+ * these are only loaded on-demand when in use.
590
+ *
591
+ * @example
592
+ * ```ts
593
+ * import { FoundationHeader } from '@genesislcap/foundation-header';
594
+ * ...
595
+ * FoundationHeader
596
+ * ```
597
+ *
598
+ * @example Load the micro frontend on-demand
599
+ * ```ts
600
+
601
+ * const { FoundationHeader } = await import('@genesislcap/foundation-header');
602
+ * return FoundationHeader;
603
+ * },
604
+ * ```
605
+ *
606
+ * @public
607
+ */
608
+ export declare class FoundationHeader extends Navigation {
609
+ /**
610
+ * @internal
611
+ */
612
+ connectedCallback(): Promise<void>;
613
+ /**
614
+ * @internal
615
+ */
616
+ loadRemotes(): Promise<void>;
617
+ }
576
618
  export {};
577
619
  //# 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;AAS9F;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wBAAwB,EAAE,IAAI,CAAC;IAC/B,mBAAmB,EAAE,IAAI,CAAC;IAC1B,2BAA2B,EAAE,IAAI,CAAC;IAClC,kBAAkB,EAAE,IAAI,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAkDA;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmPH;;;;;;;;;OASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3SL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBA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QG;IACH,cAAc,CAAC,CAAC,EAAE,WAAW;IAK7B;;;;;;;;OAQG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAKtC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAKa,gBAAiB,SAAQ,UAAU;IAC9C;;OAEG;IACG,iBAAiB;IAKvB;;OAEG;IACG,WAAW;CAGlB"}
@@ -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,8 @@ 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 { registerCommonZeroComponents } from '../components/zero-components';
9
+ import { HeaderConfig } from '../config';
9
10
  import { logger } from '../utils';
10
11
  import { MainStyles as styles } from './main.styles';
11
12
  import { DynamicTemplate as template, LoadingTemplate, MainTemplate } from './main.template';
@@ -42,7 +43,7 @@ import { DynamicTemplate as template, LoadingTemplate, MainTemplate } from './ma
42
43
  * @fires language-changed - Dispatched when the user changes the language in the language selector.
43
44
  *
44
45
  */
45
- let Navigation = class Navigation extends EventEmitter(FASTElement) {
46
+ export class Navigation extends EventEmitter(FASTElement) {
46
47
  constructor() {
47
48
  var _a;
48
49
  super(...arguments);
@@ -85,10 +86,10 @@ let Navigation = class Navigation extends EventEmitter(FASTElement) {
85
86
  return __awaiter(this, void 0, void 0, function* () {
86
87
  _super.connectedCallback.call(this);
87
88
  logger.debug(`foundation-header is now connected to the DOM`);
88
- yield this.loadRemotes();
89
89
  this.userName = this.auth.loggedUserResult
90
90
  ? this.auth.loggedUserResult.username
91
91
  : 'Genesis User';
92
+ this.ready = true;
92
93
  });
93
94
  }
94
95
  /**
@@ -116,21 +117,6 @@ let Navigation = class Navigation extends EventEmitter(FASTElement) {
116
117
  }));
117
118
  }
118
119
  }
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
120
  selectTemplate() {
135
121
  return this.ready ? MainTemplate : LoadingTemplate;
136
122
  }
@@ -261,7 +247,7 @@ let Navigation = class Navigation extends EventEmitter(FASTElement) {
261
247
  ? this.i18next.t(text, { lng: this.i18next.language })
262
248
  : text;
263
249
  }
264
- };
250
+ }
265
251
  __decorate([
266
252
  Auth
267
253
  ], Navigation.prototype, "auth", void 0);
@@ -271,6 +257,9 @@ __decorate([
271
257
  __decorate([
272
258
  I18next
273
259
  ], Navigation.prototype, "i18next", void 0);
260
+ __decorate([
261
+ HeaderConfig
262
+ ], Navigation.prototype, "headerConfig", void 0);
274
263
  __decorate([
275
264
  observable
276
265
  ], Navigation.prototype, "ready", void 0);
@@ -310,11 +299,57 @@ __decorate([
310
299
  __decorate([
311
300
  observable
312
301
  ], Navigation.prototype, "routeNavItems", void 0);
313
- Navigation = __decorate([
302
+ /**
303
+ * FoundationHeader is a zero version of the header micro-frontend.
304
+ *
305
+ * @remarks
306
+ * A header version that pre-registers zero components and uses the zero design system. ZeroHeader and its components won't bloat the core bundle as
307
+ * these are only loaded on-demand when in use.
308
+ *
309
+ * @example
310
+ * ```ts
311
+ * import { FoundationHeader } from '@genesislcap/foundation-header';
312
+ * ...
313
+ * FoundationHeader
314
+ * ```
315
+ *
316
+ * @example Load the micro frontend on-demand
317
+ * ```ts
318
+
319
+ * const { FoundationHeader } = await import('@genesislcap/foundation-header');
320
+ * return FoundationHeader;
321
+ * },
322
+ * ```
323
+ *
324
+ * @public
325
+ */
326
+ let FoundationHeader = class FoundationHeader extends Navigation {
327
+ /**
328
+ * @internal
329
+ */
330
+ connectedCallback() {
331
+ const _super = Object.create(null, {
332
+ connectedCallback: { get: () => super.connectedCallback }
333
+ });
334
+ return __awaiter(this, void 0, void 0, function* () {
335
+ _super.connectedCallback.call(this);
336
+ yield this.loadRemotes();
337
+ });
338
+ }
339
+ /**
340
+ * @internal
341
+ */
342
+ loadRemotes() {
343
+ return __awaiter(this, void 0, void 0, function* () {
344
+ yield registerCommonZeroComponents();
345
+ });
346
+ }
347
+ };
348
+ FoundationHeader = __decorate([
314
349
  customElement({
315
350
  name: 'foundation-header',
316
351
  template,
317
352
  styles,
318
353
  })
319
- ], Navigation);
320
- export { Navigation };
354
+ ], FoundationHeader);
355
+ export { FoundationHeader };