@genesislcap/foundation-alerts 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.
Files changed (35) hide show
  1. package/README.md +15 -2
  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 +40 -0
  5. package/dist/dts/config/config.d.ts.map +1 -0
  6. package/dist/dts/config/configure.d.ts +28 -0
  7. package/dist/dts/config/configure.d.ts.map +1 -0
  8. package/dist/dts/config/index.d.ts +3 -0
  9. package/dist/dts/config/index.d.ts.map +1 -0
  10. package/dist/dts/config/templates.d.ts +33 -0
  11. package/dist/dts/config/templates.d.ts.map +1 -0
  12. package/dist/dts/index.d.ts +1 -0
  13. package/dist/dts/index.d.ts.map +1 -1
  14. package/dist/dts/main/main.d.ts +36 -0
  15. package/dist/dts/main/main.d.ts.map +1 -1
  16. package/dist/dts/main/main.template.d.ts.map +1 -1
  17. package/dist/dts/styles/styles.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 +28 -0
  21. package/dist/dts/tags/tags.d.ts.map +1 -0
  22. package/dist/esm/components/zero-components.js +47 -0
  23. package/dist/esm/config/config.js +19 -0
  24. package/dist/esm/config/configure.js +57 -0
  25. package/dist/esm/config/index.js +2 -0
  26. package/dist/esm/config/templates.js +13 -0
  27. package/dist/esm/index.js +1 -0
  28. package/dist/esm/main/main.js +57 -6
  29. package/dist/esm/main/main.template.js +19 -15
  30. package/dist/esm/styles/styles.js +31 -31
  31. package/dist/esm/tags/index.js +1 -0
  32. package/dist/esm/tags/tags.js +31 -0
  33. package/dist/foundation-alerts.api.json +246 -0
  34. package/dist/foundation-alerts.d.ts +132 -0
  35. package/package.json +16 -8
package/README.md CHANGED
@@ -1,3 +1,16 @@
1
- # Foundation Inbox
2
-
1
+ # Foundation Alerts
2
+ `foundation-alerts` is a Micro-Frontend that is used for managing a list of alert rules. It enables users to create, edit, delete, disable and view alerts rules.
3
3
  [API](./docs/api/index.md)
4
+ `foundation-alerts` provides several exports to promote reuse and extensibility at various levels. These include but are
5
+ not limited to:
6
+
7
+ * `ZeroAlerts`: A preconfigured version of the micro frontend built with the zero design system and zero components.
8
+ * `configure`: A customisation hook for the base micro frontend that integrates it with your design system of choice.
9
+
10
+
11
+ ## License
12
+
13
+ Note: this project provides front-end dependencies and uses licensed components listed in the next section; thus, licenses for those components are required during development. Contact [Genesis Global](https://genesis.global/contact-us/) for more details.
14
+
15
+ ### Licensed components
16
+ Genesis low-code platform
@@ -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":"AAqCA;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qBAgBxC,CAAC"}
@@ -0,0 +1,40 @@
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
+ * AlertConfig DI interface.
8
+ *
9
+ * @public
10
+ */
11
+ export interface AlertConfig 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
+ * Design System prefix for foundation-form
21
+ *
22
+ * @remarks
23
+ * Used by foundation-form to specify the design system used by the form elements
24
+ */
25
+ designSystemPrefix: string;
26
+ }
27
+ /**
28
+ * Default AlertConfig DI implementation.
29
+ * @public
30
+ */
31
+ export declare const defaultAlertConfig: AlertConfig;
32
+ /**
33
+ * AlertConfig DI key.
34
+ *
35
+ * @internal
36
+ * @privateRemarks
37
+ * Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
38
+ */
39
+ export declare const AlertConfig: import("@microsoft/fast-foundation").InterfaceSymbol<AlertConfig>;
40
+ //# 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,WAAY,SAAQ,4BAA4B;IAC/D;;;;;OAKG;IACH,eAAe,EAAE,eAAe,CAAC;IACjC;;;;;OAKG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAIhC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,mEAAyE,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { AlertConfig } from './config';
2
+ /**
3
+ * configure.
4
+ *
5
+ * @remarks
6
+ * Configure the alert 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-alerts/config'); // < import from the subpath
12
+ * return configure({
13
+ * name: `nexus-app-alerts`,
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
+ * checkbox: 'nexus-checkbox-next',
18
+ * provider: 'template',
19
+ * },
20
+ * });
21
+ * },
22
+ * ```
23
+ *
24
+ * @param config - A partial AlertConfig.
25
+ * @public
26
+ */
27
+ export declare function configure(config: Partial<AlertConfig>): Promise<typeof import("../main").FoundationAlerts>;
28
+ //# 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,WAAW,EAAsB,MAAM,UAAU,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,sDAiC3D"}
@@ -0,0 +1,3 @@
1
+ export * from './config';
2
+ export * from './configure';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,33 @@
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
+ dropdownMenu: TemplateElementDependency;
11
+ divider: TemplateElementDependency;
12
+ provider: TemplateElementDependency;
13
+ };
14
+ /**
15
+ * TemplateOptions.
16
+ * @public
17
+ */
18
+ export type TemplateOptions = Partial<TemplateComponents> & {
19
+ /**
20
+ * @remarks
21
+ * Just for reference that template options may be more than tags.
22
+ * @internal
23
+ */
24
+ somePartial?: string | SyntheticViewTemplate;
25
+ };
26
+ /**
27
+ * defaultTemplateOptions.
28
+ * @remarks
29
+ * The default template options this MF has been created with.
30
+ * @public
31
+ */
32
+ export declare const defaultTemplateOptions: TemplateOptions;
33
+ //# 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,YAAY,EAAE,yBAAyB,CAAC;IACxC,OAAO,EAAE,yBAAyB,CAAC;IACnC,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,eAMpC,CAAC"}
@@ -1,2 +1,3 @@
1
+ export * from './config';
1
2
  export * from './main';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { Connect, Datasource, Message } from '@genesislcap/foundation-comms';
2
2
  import { FASTElement } from '@microsoft/fast-element';
3
3
  import { Subscription } from 'rxjs';
4
+ import { AlertConfig } from '../config';
4
5
  import { AlertRule, AlertRuleRow } from './main.types';
5
6
  type displayState = 'add' | 'edit' | 'list';
6
7
  /**
@@ -14,6 +15,7 @@ export declare class FoundationAlerts extends FASTElement {
14
15
  displayState: displayState;
15
16
  items: AlertRule[];
16
17
  alertEditItemData: AlertRule;
18
+ alertConfig: AlertConfig;
17
19
  private sourceRef;
18
20
  private resourceName;
19
21
  private statusLabelMap;
@@ -43,5 +45,39 @@ export declare class FoundationAlerts extends FASTElement {
43
45
  handleAddAlertAction(): void;
44
46
  handleEditAlertAction(item: any): void;
45
47
  }
48
+ /**
49
+ * ZeroAlerts.
50
+ *
51
+ * @remarks
52
+ * A zero version that pre-registers zero components and uses the zero design system. ZeroAlerts and its components won't bloat the core bundle as
53
+ * these are only loaded on-demand when in use.
54
+ *
55
+ * @example
56
+ * ```ts
57
+ * import { ZeroAlerts } from '@genesislcap/foundation-alerts';
58
+ * ...
59
+ * ZeroAlerts
60
+ * ```
61
+ *
62
+ * @example Load the micro frontend on-demand
63
+ * ```ts
64
+
65
+ * const { ZeroAlerts } = await import('@genesislcap/foundation-alerts');
66
+ * return ZeroAlerts;
67
+ * },
68
+ * ```
69
+ *
70
+ * @public
71
+ */
72
+ export declare class ZeroAlerts extends FoundationAlerts {
73
+ /**
74
+ * @internal
75
+ */
76
+ connectedCallback(): Promise<void>;
77
+ /**
78
+ * @internal
79
+ */
80
+ protected loadRemotes(): Promise<void>;
81
+ }
46
82
  export {};
47
83
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,UAAU,EACV,OAAO,EAKR,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAiB,WAAW,EAAc,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAIpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEvD,KAAK,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C;;;;GAIG;AACH,qBAKa,gBAAiB,SAAQ,WAAW;IACtC,OAAO,EAAE,OAAO,CAAC;IACd,UAAU,EAAG,UAAU,CAAC;IACxB,YAAY,EAAE,YAAY,CAAU;IACpC,KAAK,EAAE,SAAS,EAAE,CAAM;IACxB,iBAAiB,EAAE,SAAS,CAAC;IACzC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,cAAc,CAGpB;IACK,gBAAgB,EAAE,YAAY,CAAC;IAC/B,KAAK,EAAE,OAAO,CAAS;IACvB,OAAO;;;;;;QA4BZ;IACU,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAa;IACjE,0BAA0B;IAMpB,iBAAiB;IAQvB,OAAO,CAAC,mBAAmB;YAIb,SAAS;IAyCvB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,YAAY;IAKP,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAQpE,YAAY,CAAC,EACxB,WAAW,EACX,sBAAsB,EAAE,EAAE,GAC3B,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAO3B,oBAAoB;IAIpB,qBAAqB,CAAC,IAAI,EAAE,GAAG;CAQvC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,UAAU,EACV,OAAO,EAKR,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAiB,WAAW,EAAc,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAIxC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEvD,KAAK,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IACtC,OAAO,EAAE,OAAO,CAAC;IACd,UAAU,EAAG,UAAU,CAAC;IACxB,YAAY,EAAE,YAAY,CAAU;IACpC,KAAK,EAAE,SAAS,EAAE,CAAM;IACxB,iBAAiB,EAAE,SAAS,CAAC;IAC5B,WAAW,EAAG,WAAW,CAAC;IAEvC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,cAAc,CAGpB;IACK,gBAAgB,EAAE,YAAY,CAAC;IAC/B,KAAK,EAAE,OAAO,CAAS;IACvB,OAAO;;;;;;QA4BZ;IACU,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAa;IACjE,0BAA0B;IAMpB,iBAAiB;IAQvB,OAAO,CAAC,mBAAmB;YAIb,SAAS;IAyCvB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,YAAY;IAKP,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAQpE,YAAY,CAAC,EACxB,WAAW,EACX,sBAAsB,EAAE,EAAE,GAC3B,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAO3B,oBAAoB;IAIpB,qBAAqB,CAAC,IAAI,EAAE,GAAG;CAQvC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAKa,UAAW,SAAQ,gBAAgB;IAC9C;;OAEG;IACG,iBAAiB;IAKvB;;OAEG;cACa,WAAW;CAI5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAG1C;;GAEG;AACH,eAAO,MAAM,wBAAwB,uEA2FpC,CAAC"}
1
+ {"version":3,"file":"main.template.d.ts","sourceRoot":"","sources":["../../../src/main/main.template.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAG1C;;GAEG;AACH,eAAO,MAAM,wBAAwB,uEA8FpC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/styles/styles.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,sBAAsB,iDA0IlC,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/styles/styles.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,sBAAsB,iDA2IlC,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,28 @@
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 dropdownMenuTag: string;
24
+ /**
25
+ * @internal
26
+ */
27
+ export declare const dividerTag: string;
28
+ //# 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,+CACiB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,OAAO,QAA+B,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,SAAS,QAAiC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,eAAe,QAAuC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,UAAU,QAAkC,CAAC"}
@@ -0,0 +1,47 @@
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
+ module = yield import(
16
+ /* webpackChunkName: "foundation-zero" */
17
+ 'foundationZero/ZeroDesignSystem');
18
+ return assureDesignSystem(module);
19
+ }
20
+ catch (e) {
21
+ logger.info(`Please note remoteEntry.js load errors are expected if module federated dependencies are offline. Falling back to locally bundled versions.`);
22
+ type = ResourceType.local;
23
+ module = yield import(
24
+ /* webpackChunkName: "foundation-zero" */
25
+ '@genesislcap/foundation-zero');
26
+ return assureDesignSystem(module);
27
+ }
28
+ finally {
29
+ logger.debug(`Using '${type}' version of foundation-zero`);
30
+ }
31
+ });
32
+ }
33
+ /**
34
+ * registerCommonZeroComponents.
35
+ * @public
36
+ */
37
+ export const registerCommonZeroComponents = () => __awaiter(void 0, void 0, void 0, function* () {
38
+ const { provideDesignSystem, zeroIcon, zeroButton, zeroDivider, zeroDropdownMenu } = yield zeroDesignSystemImport();
39
+ /**
40
+ * Register the components the app is using with the system.
41
+ */
42
+ provideDesignSystem().register(
43
+ /**
44
+ * Common across most routes, so batch register these lightweight components upfront.
45
+ */
46
+ zeroIcon(), zeroButton(), zeroDropdownMenu(), zeroDivider());
47
+ });
@@ -0,0 +1,19 @@
1
+ import { DI } from '@microsoft/fast-foundation';
2
+ import { defaultTemplateOptions } from './templates';
3
+ /**
4
+ * Default AlertConfig DI implementation.
5
+ * @public
6
+ */
7
+ export const defaultAlertConfig = {
8
+ name: 'foundation-alerts',
9
+ templateOptions: defaultTemplateOptions,
10
+ designSystemPrefix: 'zero',
11
+ };
12
+ /**
13
+ * AlertConfig DI key.
14
+ *
15
+ * @internal
16
+ * @privateRemarks
17
+ * Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
18
+ */
19
+ export const AlertConfig = DI.createInterface((x) => x.instance(defaultAlertConfig));
@@ -0,0 +1,57 @@
1
+ import { __awaiter } from "tslib";
2
+ import { FASTElement } from '@microsoft/fast-element';
3
+ import { DI, Registration } from '@microsoft/fast-foundation';
4
+ import { AlertConfig, defaultAlertConfig } from './config';
5
+ /**
6
+ * configure.
7
+ *
8
+ * @remarks
9
+ * Configure the alert 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-alerts/config'); // < import from the subpath
15
+ * return configure({
16
+ * name: `nexus-app-alerts`,
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
+ * checkbox: 'nexus-checkbox-next',
21
+ * provider: 'template',
22
+ * },
23
+ * });
24
+ * },
25
+ * ```
26
+ *
27
+ * @param config - A partial AlertConfig.
28
+ * @public
29
+ */
30
+ export function configure(config) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ /**
33
+ * Merge the configs
34
+ */
35
+ const value = Object.assign(Object.assign({}, defaultAlertConfig), config);
36
+ if (config.templateOptions) {
37
+ value.templateOptions = Object.assign(Object.assign({}, defaultAlertConfig.templateOptions), config.templateOptions);
38
+ }
39
+ /**
40
+ * Register a new AlertConfig
41
+ */
42
+ DI.getOrCreateDOMContainer().register(Registration.instance(AlertConfig, value));
43
+ /**
44
+ * Lazily reference and define the micro frontend element post config setting.
45
+ */
46
+ const { FoundationAlerts, FoundationAlertsTemplate, FoundationAlertsStyles } = yield import('../main');
47
+ const { name, attributes, shadowOptions, elementOptions } = value;
48
+ return FASTElement.define(FoundationAlerts, {
49
+ name,
50
+ template: FoundationAlertsTemplate,
51
+ styles: FoundationAlertsStyles,
52
+ attributes,
53
+ shadowOptions,
54
+ elementOptions,
55
+ });
56
+ });
57
+ }
@@ -0,0 +1,2 @@
1
+ export * from './config';
2
+ export * from './configure';
@@ -0,0 +1,13 @@
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
+ dropdownMenu: 'zero-dropdown-menu',
11
+ divider: 'zero-divider',
12
+ provider: 'zero-design-system-provider',
13
+ };
package/dist/esm/index.js CHANGED
@@ -1 +1,2 @@
1
+ export * from './config';
1
2
  export * from './main';
@@ -1,6 +1,7 @@
1
1
  import { __awaiter, __decorate } from "tslib";
2
2
  import { Connect, Datasource, normaliseCriteria, dataServerResultFilter, MessageType, } from '@genesislcap/foundation-comms';
3
3
  import { customElement, FASTElement, observable } from '@microsoft/fast-element';
4
+ import { AlertConfig } from '../config';
4
5
  import { FoundationAlertsStyles as styles } from '../styles';
5
6
  import { logger } from '../utils';
6
7
  import { FoundationAlertsTemplate as template } from './main.template';
@@ -9,7 +10,7 @@ import { FoundationAlertsTemplate as template } from './main.template';
9
10
  * Allow creating, disabling and deleting alerts
10
11
  * @beta
11
12
  */
12
- let FoundationAlerts = class FoundationAlerts extends FASTElement {
13
+ export class FoundationAlerts extends FASTElement {
13
14
  constructor() {
14
15
  super(...arguments);
15
16
  this.displayState = 'list';
@@ -175,7 +176,7 @@ let FoundationAlerts = class FoundationAlerts extends FASTElement {
175
176
  this.alertEditItemData = Object.assign(Object.assign({}, item), { TABLE_ID: item.RULE_TABLE, USERNAME: item.USER_NAME });
176
177
  this.displayState = 'edit';
177
178
  }
178
- };
179
+ }
179
180
  __decorate([
180
181
  Connect
181
182
  ], FoundationAlerts.prototype, "connect", void 0);
@@ -191,14 +192,64 @@ __decorate([
191
192
  __decorate([
192
193
  observable
193
194
  ], FoundationAlerts.prototype, "alertEditItemData", void 0);
195
+ __decorate([
196
+ AlertConfig
197
+ ], FoundationAlerts.prototype, "alertConfig", void 0);
194
198
  __decorate([
195
199
  observable
196
200
  ], FoundationAlerts.prototype, "criteriaFromFilters", void 0);
197
- FoundationAlerts = __decorate([
201
+ /**
202
+ * ZeroAlerts.
203
+ *
204
+ * @remarks
205
+ * A zero version that pre-registers zero components and uses the zero design system. ZeroAlerts and its components won't bloat the core bundle as
206
+ * these are only loaded on-demand when in use.
207
+ *
208
+ * @example
209
+ * ```ts
210
+ * import { ZeroAlerts } from '@genesislcap/foundation-alerts';
211
+ * ...
212
+ * ZeroAlerts
213
+ * ```
214
+ *
215
+ * @example Load the micro frontend on-demand
216
+ * ```ts
217
+
218
+ * const { ZeroAlerts } = await import('@genesislcap/foundation-alerts');
219
+ * return ZeroAlerts;
220
+ * },
221
+ * ```
222
+ *
223
+ * @public
224
+ */
225
+ let ZeroAlerts = class ZeroAlerts extends FoundationAlerts {
226
+ /**
227
+ * @internal
228
+ */
229
+ connectedCallback() {
230
+ const _super = Object.create(null, {
231
+ connectedCallback: { get: () => super.connectedCallback }
232
+ });
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ _super.connectedCallback.call(this);
235
+ yield this.loadRemotes();
236
+ });
237
+ }
238
+ /**
239
+ * @internal
240
+ */
241
+ loadRemotes() {
242
+ return __awaiter(this, void 0, void 0, function* () {
243
+ const { registerCommonZeroComponents } = yield import('../components/zero-components');
244
+ yield registerCommonZeroComponents();
245
+ });
246
+ }
247
+ };
248
+ ZeroAlerts = __decorate([
198
249
  customElement({
199
- name: 'foundation-alerts',
250
+ name: 'zero-alerts',
200
251
  template,
201
252
  styles,
202
253
  })
203
- ], FoundationAlerts);
204
- export { FoundationAlerts };
254
+ ], ZeroAlerts);
255
+ export { ZeroAlerts };
@@ -1,4 +1,5 @@
1
1
  import { html, repeat, when } from '@microsoft/fast-element';
2
+ import { buttonTag, iconTag, dropdownMenuTag, dividerTag } from '../tags';
2
3
  /**
3
4
  * @public
4
5
  */
@@ -7,6 +8,7 @@ export const FoundationAlertsTemplate = html `
7
8
  ${when((x) => x.displayState === 'add', html `
8
9
  <foundation-form
9
10
  resourceName="EVENT_DYNAMIC_RULE_NOTIFY_CREATE"
11
+ design-system-prefix=${(x) => x.alertConfig.designSystemPrefix}
10
12
  @submit-success=${(x) => () => (x.displayState = 'list')}
11
13
  ></foundation-form>
12
14
  `)}
@@ -14,6 +16,7 @@ export const FoundationAlertsTemplate = html `
14
16
  <foundation-form
15
17
  resourceName="EVENT_DYNAMIC_RULE_NOTIFY_UPDATE"
16
18
  :data=${(x) => x.alertEditItemData}
19
+ design-system-prefix=${(x) => x.alertConfig.designSystemPrefix}
17
20
  @submit-success=${(x) => (x.displayState = 'list')}
18
21
  ></foundation-form>
19
22
  `)}
@@ -21,26 +24,27 @@ export const FoundationAlertsTemplate = html `
21
24
  <div class="header">
22
25
  <h2 class="title" part="title">Alerts rules</h2>
23
26
  <nav class="main-menu">
24
- <zero-button
27
+ <${buttonTag}
25
28
  class="main-button"
26
29
  @click=${(x) => x.handleAddAlertAction()}
27
30
  part="add-button"
28
31
  >
29
- <zero-icon name="plus" size="1x"></zero-icon>
30
- </zero-button>
31
- <zero-dropdown-menu
32
+ <${iconTag} name="plus" size="1x"></${iconTag}>
33
+ </${buttonTag}>
34
+ <${dropdownMenuTag}
32
35
  class="main-button filter-button"
33
36
  name=""
34
37
  :items=${(x) => x.filters}
35
38
  part="filter-button"
36
39
  />
37
- <zero-icon name="filter" size="1x"></zero-icon>
38
- </zero-dropdown-menu>
40
+ <${iconTag} name="filter" size="1x"></${iconTag}>
41
+ </${dropdownMenuTag}>
39
42
  </nav>
40
43
  </div>
41
44
  ${when((x) => { var _a; return ((_a = x.items) === null || _a === void 0 ? void 0 : _a.length) >= 1; }, html `
42
45
  <ul class="list" part="list">
43
46
  ${repeat((x) => x.items, html `
47
+ <${dividerTag} class="item-separator"></${dividerTag}>
44
48
  <li class="item" part="item">
45
49
  <h4 class="item-title">${(x) => x.RULE_EXPRESSION}</h4>
46
50
  <div class="item-bottom">
@@ -49,21 +53,21 @@ export const FoundationAlertsTemplate = html `
49
53
  </span>
50
54
  <span class="date">${(x) => x.DATE}</span>
51
55
  <nav class="item-menu">
52
- <zero-button
56
+ <${buttonTag}
53
57
  class="button"
54
58
  @click=${(x, c) => c.parent.handleEditAlertAction(x)}
55
59
  >
56
- <zero-icon name="gear"></zero-icon>
57
- </zero-button>
58
- <zero-button class="button" @click=${(x, c) => c.parent.toogleStatus(x)}>
59
- <zero-icon name="grip-lines-vertical"></zero-icon>
60
- </zero-button>
61
- <zero-button
60
+ <${iconTag} name="gear"></${iconTag}>
61
+ </${buttonTag}>
62
+ <${buttonTag} class="button" @click=${(x, c) => c.parent.toogleStatus(x)}>
63
+ <${iconTag} name="grip-lines-vertical"></${iconTag}>
64
+ </${buttonTag}>
65
+ <${buttonTag}
62
66
  class="button"
63
67
  @click=${(x, c) => c.parent.delete(x.DYNAMIC_NOTIFY_RULE_ID)}
64
68
  >
65
- <zero-icon name="trash"></zero-icon>
66
- </zero-button>
69
+ <${iconTag} name="trash"></${iconTag}>
70
+ </${buttonTag}>
67
71
  </nav>
68
72
  </div>
69
73
  </li>
@@ -1,29 +1,28 @@
1
- import { ColorHEX, RapidColorHEX } from '@genesislcap/foundation-zero';
2
1
  import { css } from '@microsoft/fast-element';
3
2
  /**
4
3
  * @public
5
4
  */
6
5
  export const FoundationAlertsStyles = css `
7
- .wrapper {
8
- --default-text-color: ${RapidColorHEX.white};
9
- --available-text-color: ${RapidColorHEX.green};
10
- --unavailable-text-color: ${RapidColorHEX.red};
11
- --rest-text-color: ${ColorHEX.almostWhite};
6
+
7
+ .wrapper:has(foundation-form) {
8
+ padding: calc(var(--design-unit) * 4px);
12
9
  }
13
10
 
14
11
  .header {
15
12
  width: calc(100% - (var(--design-unit) * 5px - var(--design-unit) * 3px)));
16
13
  display: flex;
17
14
  align-items: center;
18
- padding: calc(var(--design-unit) * 2px) calc(var(--design-unit) * 3px)
19
- calc(var(--design-unit) * 2px) calc(var(--design-unit) * 5px);
15
+ padding: calc(var(--design-unit) * 3px) calc(var(--design-unit) * 4px);
20
16
  }
21
17
 
22
18
  .header .main-button {
23
19
  margin: 0;
24
- min-width: 25px;
25
- min-height: 25px;
26
20
  color: var(--neutral-fill-strong-rest);
21
+ height: calc((var(--base-height-multiplier) + var(--design-unit) + 2) * 2px);
22
+ min-width: calc((var(--base-height-multiplier) + var(--design-unit)) * 2px);
23
+ width: calc((var(--base-height-multiplier) + var(--design-unit) + 2) * 2px);
24
+ align-items: center;
25
+ justify-content: center;
27
26
  }
28
27
 
29
28
  .header .main-button::part(actions-container) {
@@ -33,6 +32,7 @@ export const FoundationAlertsStyles = css `
33
32
  .header .main-button::part(actions-container),
34
33
  .header .main-button::part(actions-opener) {
35
34
  height: 100%;
35
+ min-width: calc((var(--base-height-multiplier) + var(--design-unit) + 2) * 2px);
36
36
  }
37
37
 
38
38
  .header .main-button::part(actions-opener) {
@@ -52,18 +52,15 @@ export const FoundationAlertsStyles = css `
52
52
  .title {
53
53
  padding: 0;
54
54
  margin: 0;
55
- font-size: calc(var(--design-unit) * 6px);
55
+ font-size: var(--type-ramp-plus-2-font-size);
56
56
  font-weight: 500;
57
- color: var(--default-text-color);
57
+ color: var(--neutral-foreground-rest);
58
58
  }
59
59
 
60
60
  .main-menu {
61
61
  display: flex;
62
62
  margin-left: auto;
63
63
  gap: calc(var(--design-unit) * 2px);
64
-
65
- --density: -2;
66
- --menu-item-height-multiplier: 4;
67
64
  }
68
65
 
69
66
  .list,
@@ -80,16 +77,14 @@ export const FoundationAlertsStyles = css `
80
77
 
81
78
  .item {
82
79
  width: calc(100% - (var(--design-unit) * 3px) - (var(--design-unit) * 5px));
83
- padding: calc(var(--design-unit) * 4px) calc(var(--design-unit) * 3px)
84
- calc(var(--design-unit) * 4px) calc(var(--design-unit) * 5px);
85
- border-top: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-hover);
86
- color: var(--default-text-color);
80
+ padding: calc(var(--design-unit) * 3px) calc(var(--design-unit) * 4px);
81
+ color: var(--neutral-foreground-rest);
87
82
  }
88
83
 
89
84
  .item-title {
90
85
  padding: 0;
91
- margin: 0 0 calc(var(--design-unit) * 3px) 0;
92
- font-size: calc(var(--design-unit) * 5px);
86
+ margin: 0 0 calc(var(--design-unit) * 2px) 0;
87
+ font-size: var(--type-ramp-base-font-size);
93
88
  font-weight: 400;
94
89
  }
95
90
 
@@ -97,9 +92,9 @@ export const FoundationAlertsStyles = css `
97
92
  display: flex;
98
93
  flex-wrap: nowrap;
99
94
  align-items: center;
100
- gap: calc(var(--design-unit) * 5px);
101
- font-size: calc(var(--design-unit) * 5px);
102
- color: var(--rest-text-color);
95
+ gap: calc(var(--design-unit) * 4px);
96
+ font-size: var(--type-ramp-base-font-size);
97
+ color: var(--neutral-foreground-hint);
103
98
  }
104
99
 
105
100
  .item-menu {
@@ -109,11 +104,12 @@ export const FoundationAlertsStyles = css `
109
104
  }
110
105
 
111
106
  .item-menu .button {
112
- color: var(--neutral-stroke-active);
107
+ color: var(--neutral-stroke-rest);
108
+ border: none;
113
109
  }
114
110
 
115
111
  .item-menu .button:hover {
116
- color: var(--neutral-stroke-focus);
112
+ color: var(--neutral-stroke-hover);
117
113
  }
118
114
 
119
115
  .item-bottom .button {
@@ -125,20 +121,24 @@ export const FoundationAlertsStyles = css `
125
121
  .header .button::part(control),
126
122
  .item-bottom .button::part(control) {
127
123
  padding: 0;
124
+ border: none;
128
125
  }
129
126
 
130
127
  .status.enabled {
131
- color: var(--available-text-color);
128
+ color: var(--success-color);
132
129
  }
133
130
 
134
131
  .status.disabled {
135
- color: var(--unavailable-text-color);
132
+ color: var(--error-color);
136
133
  }
137
134
 
138
135
  .empty {
139
- font-size: 12px;
140
- padding: calc(var(--design-unit) * 4px) calc(var(--design-unit) * 3px)
141
- calc(var(--design-unit) * 4px) calc(var(--design-unit) * 5px);
136
+ font-size: var(--type-ramp-base-font-size);
137
+ padding: calc(var(--design-unit) * 3px) calc(var(--design-unit) * 4px);
138
+ margin: 0;
139
+ }
140
+
141
+ .item-separator {
142
142
  margin: 0;
143
143
  }
144
144
  `;
@@ -0,0 +1 @@
1
+ export * from './tags';
@@ -0,0 +1,31 @@
1
+ import { tagFor } from '@genesislcap/foundation-ui';
2
+ import { DI } from '@microsoft/fast-foundation';
3
+ import { AlertConfig } from '../config/config';
4
+ import { defaultTemplateOptions } from '../config/templates';
5
+ /**
6
+ * It's important this file isn't referenced ahead of a `configure` call, otherwise these values may remain fixed at
7
+ * their defaults. Consumers must use the `/config` subpath to help avoid this. Files with references to tags should be
8
+ * lazily loaded. There is an alternative `getTags` utility at the end which could offer another approach, but direct
9
+ * tag exports and inline template references feel cleaner than having to convert all component `template` and `styles`
10
+ * exports to functions to call `getTags` on execution.
11
+ */
12
+ /**
13
+ * @internal
14
+ */
15
+ export const { templateOptions = defaultTemplateOptions } = DI.getOrCreateDOMContainer().get(AlertConfig);
16
+ /**
17
+ * @internal
18
+ */
19
+ export const iconTag = tagFor(templateOptions.icon);
20
+ /**
21
+ * @internal
22
+ */
23
+ export const buttonTag = tagFor(templateOptions.button);
24
+ /**
25
+ * @internal
26
+ */
27
+ export const dropdownMenuTag = tagFor(templateOptions.dropdownMenu);
28
+ /**
29
+ * @internal
30
+ */
31
+ export const dividerTag = tagFor(templateOptions.divider);
@@ -172,6 +172,190 @@
172
172
  "name": "",
173
173
  "preserveMemberOrder": false,
174
174
  "members": [
175
+ {
176
+ "kind": "Interface",
177
+ "canonicalReference": "@genesislcap/foundation-alerts!AlertConfig:interface",
178
+ "docComment": "/**\n * AlertConfig DI interface.\n *\n * @public\n */\n",
179
+ "excerptTokens": [
180
+ {
181
+ "kind": "Content",
182
+ "text": "export interface AlertConfig extends "
183
+ },
184
+ {
185
+ "kind": "Reference",
186
+ "text": "PartialFASTElementDefinition",
187
+ "canonicalReference": "@microsoft/fast-element!PartialFASTElementDefinition:interface"
188
+ },
189
+ {
190
+ "kind": "Content",
191
+ "text": " "
192
+ }
193
+ ],
194
+ "fileUrlPath": "src/config/config.ts",
195
+ "releaseTag": "Public",
196
+ "name": "AlertConfig",
197
+ "preserveMemberOrder": false,
198
+ "members": [
199
+ {
200
+ "kind": "PropertySignature",
201
+ "canonicalReference": "@genesislcap/foundation-alerts!AlertConfig#designSystemPrefix:member",
202
+ "docComment": "/**\n * Design System prefix for foundation-form\n *\n * @remarks\n *\n * Used by foundation-form to specify the design system used by the form elements\n */\n",
203
+ "excerptTokens": [
204
+ {
205
+ "kind": "Content",
206
+ "text": "designSystemPrefix: "
207
+ },
208
+ {
209
+ "kind": "Content",
210
+ "text": "string"
211
+ },
212
+ {
213
+ "kind": "Content",
214
+ "text": ";"
215
+ }
216
+ ],
217
+ "isReadonly": false,
218
+ "isOptional": false,
219
+ "releaseTag": "Public",
220
+ "name": "designSystemPrefix",
221
+ "propertyTypeTokenRange": {
222
+ "startIndex": 1,
223
+ "endIndex": 2
224
+ }
225
+ },
226
+ {
227
+ "kind": "PropertySignature",
228
+ "canonicalReference": "@genesislcap/foundation-alerts!AlertConfig#templateOptions:member",
229
+ "docComment": "/**\n * Template options.\n *\n * @remarks\n *\n * Used by host applications to assign MF template options and subcomponent tags to align with the host design system.\n */\n",
230
+ "excerptTokens": [
231
+ {
232
+ "kind": "Content",
233
+ "text": "templateOptions: "
234
+ },
235
+ {
236
+ "kind": "Reference",
237
+ "text": "TemplateOptions",
238
+ "canonicalReference": "@genesislcap/foundation-alerts!~TemplateOptions:type"
239
+ },
240
+ {
241
+ "kind": "Content",
242
+ "text": ";"
243
+ }
244
+ ],
245
+ "isReadonly": false,
246
+ "isOptional": false,
247
+ "releaseTag": "Public",
248
+ "name": "templateOptions",
249
+ "propertyTypeTokenRange": {
250
+ "startIndex": 1,
251
+ "endIndex": 2
252
+ }
253
+ }
254
+ ],
255
+ "extendsTokenRanges": [
256
+ {
257
+ "startIndex": 1,
258
+ "endIndex": 2
259
+ }
260
+ ]
261
+ },
262
+ {
263
+ "kind": "Function",
264
+ "canonicalReference": "@genesislcap/foundation-alerts!configure:function(1)",
265
+ "docComment": "/**\n * configure.\n *\n * @remarks\n *\n * Configure the alert micro frontend for host app integration.\n *\n * @param config - A partial AlertConfig.\n *\n * @example\n *\n * Providing template options to align to your host application.\n * ```ts\n *\n * const { configure } = await import('@genesislcap/foundation-alerts/config'); // < import from the subpath\n * return configure({\n * name: `nexus-app-alerts`,\n * // These will be merged with the packages `defaultTemplateOptions`. You will need to have these components registered in your application.\n * templateOptions: {\n * button: 'nexus-button',\n * checkbox: 'nexus-checkbox-next',\n * provider: 'template',\n * },\n * });\n * },\n * ```\n *\n * @public\n */\n",
266
+ "excerptTokens": [
267
+ {
268
+ "kind": "Content",
269
+ "text": "export declare function configure(config: "
270
+ },
271
+ {
272
+ "kind": "Reference",
273
+ "text": "Partial",
274
+ "canonicalReference": "!Partial:type"
275
+ },
276
+ {
277
+ "kind": "Content",
278
+ "text": "<"
279
+ },
280
+ {
281
+ "kind": "Reference",
282
+ "text": "AlertConfig",
283
+ "canonicalReference": "@genesislcap/foundation-alerts!AlertConfig:interface"
284
+ },
285
+ {
286
+ "kind": "Content",
287
+ "text": ">"
288
+ },
289
+ {
290
+ "kind": "Content",
291
+ "text": "): "
292
+ },
293
+ {
294
+ "kind": "Reference",
295
+ "text": "Promise",
296
+ "canonicalReference": "!Promise:interface"
297
+ },
298
+ {
299
+ "kind": "Content",
300
+ "text": "<typeof import(\"../main\")."
301
+ },
302
+ {
303
+ "kind": "Reference",
304
+ "text": "FoundationAlerts",
305
+ "canonicalReference": "@genesislcap/foundation-alerts!FoundationAlerts:class"
306
+ },
307
+ {
308
+ "kind": "Content",
309
+ "text": ">"
310
+ },
311
+ {
312
+ "kind": "Content",
313
+ "text": ";"
314
+ }
315
+ ],
316
+ "fileUrlPath": "src/config/configure.ts",
317
+ "returnTypeTokenRange": {
318
+ "startIndex": 6,
319
+ "endIndex": 10
320
+ },
321
+ "releaseTag": "Public",
322
+ "overloadIndex": 1,
323
+ "parameters": [
324
+ {
325
+ "parameterName": "config",
326
+ "parameterTypeTokenRange": {
327
+ "startIndex": 1,
328
+ "endIndex": 5
329
+ },
330
+ "isOptional": false
331
+ }
332
+ ],
333
+ "name": "configure"
334
+ },
335
+ {
336
+ "kind": "Variable",
337
+ "canonicalReference": "@genesislcap/foundation-alerts!defaultAlertConfig:var",
338
+ "docComment": "/**\n * Default AlertConfig DI implementation.\n *\n * @public\n */\n",
339
+ "excerptTokens": [
340
+ {
341
+ "kind": "Content",
342
+ "text": "defaultAlertConfig: "
343
+ },
344
+ {
345
+ "kind": "Reference",
346
+ "text": "AlertConfig",
347
+ "canonicalReference": "@genesislcap/foundation-alerts!AlertConfig:interface"
348
+ }
349
+ ],
350
+ "fileUrlPath": "src/config/config.ts",
351
+ "isReadonly": true,
352
+ "releaseTag": "Public",
353
+ "name": "defaultAlertConfig",
354
+ "variableTypeTokenRange": {
355
+ "startIndex": 1,
356
+ "endIndex": 2
357
+ }
358
+ },
175
359
  {
176
360
  "kind": "Class",
177
361
  "canonicalReference": "@genesislcap/foundation-alerts!FoundationAlerts:class",
@@ -197,6 +381,37 @@
197
381
  "name": "FoundationAlerts",
198
382
  "preserveMemberOrder": false,
199
383
  "members": [
384
+ {
385
+ "kind": "Property",
386
+ "canonicalReference": "@genesislcap/foundation-alerts!FoundationAlerts#alertConfig:member",
387
+ "docComment": "",
388
+ "excerptTokens": [
389
+ {
390
+ "kind": "Content",
391
+ "text": "alertConfig: "
392
+ },
393
+ {
394
+ "kind": "Reference",
395
+ "text": "AlertConfig",
396
+ "canonicalReference": "@genesislcap/foundation-alerts!AlertConfig:interface"
397
+ },
398
+ {
399
+ "kind": "Content",
400
+ "text": ";"
401
+ }
402
+ ],
403
+ "isReadonly": false,
404
+ "isOptional": false,
405
+ "releaseTag": "Beta",
406
+ "name": "alertConfig",
407
+ "propertyTypeTokenRange": {
408
+ "startIndex": 1,
409
+ "endIndex": 2
410
+ },
411
+ "isStatic": false,
412
+ "isProtected": false,
413
+ "isAbstract": false
414
+ },
200
415
  {
201
416
  "kind": "Property",
202
417
  "canonicalReference": "@genesislcap/foundation-alerts!FoundationAlerts#alertEditItemData:member",
@@ -842,6 +1057,37 @@
842
1057
  "startIndex": 1,
843
1058
  "endIndex": 6
844
1059
  }
1060
+ },
1061
+ {
1062
+ "kind": "Class",
1063
+ "canonicalReference": "@genesislcap/foundation-alerts!ZeroAlerts:class",
1064
+ "docComment": "/**\n * ZeroAlerts.\n *\n * @remarks\n *\n * A zero version that pre-registers zero components and uses the zero design system. ZeroAlerts and its components won't bloat the core bundle as these are only loaded on-demand when in use.\n *\n * @example\n * ```ts\n * import { ZeroAlerts } from '@genesislcap/foundation-alerts';\n * ...\n * ZeroAlerts\n * ```\n *\n * @example\n *\n * Load the micro frontend on-demand\n * ```ts\n *\n * const { ZeroAlerts } = await import('@genesislcap/foundation-alerts');\n * return ZeroAlerts;\n * },\n * ```\n *\n * @public\n */\n",
1065
+ "excerptTokens": [
1066
+ {
1067
+ "kind": "Content",
1068
+ "text": "export declare class ZeroAlerts extends "
1069
+ },
1070
+ {
1071
+ "kind": "Reference",
1072
+ "text": "FoundationAlerts",
1073
+ "canonicalReference": "@genesislcap/foundation-alerts!FoundationAlerts:class"
1074
+ },
1075
+ {
1076
+ "kind": "Content",
1077
+ "text": " "
1078
+ }
1079
+ ],
1080
+ "fileUrlPath": "src/main/main.ts",
1081
+ "releaseTag": "Public",
1082
+ "isAbstract": false,
1083
+ "name": "ZeroAlerts",
1084
+ "preserveMemberOrder": false,
1085
+ "members": [],
1086
+ "extendsTokenRange": {
1087
+ "startIndex": 1,
1088
+ "endIndex": 2
1089
+ },
1090
+ "implementsTokenRanges": []
845
1091
  }
846
1092
  ]
847
1093
  }
@@ -2,10 +2,48 @@ import { Connect } from '@genesislcap/foundation-comms';
2
2
  import { Datasource } from '@genesislcap/foundation-comms';
3
3
  import { ElementStyles } from '@microsoft/fast-element';
4
4
  import { FASTElement } from '@microsoft/fast-element';
5
+ import { InterfaceSymbol } from '@microsoft/fast-foundation';
5
6
  import { Message } from '@genesislcap/foundation-comms';
7
+ import { PartialFASTElementDefinition } from '@microsoft/fast-element';
6
8
  import { Subscription } from 'rxjs';
9
+ import { SyntheticViewTemplate } from '@microsoft/fast-element';
10
+ import { TemplateElementDependency } from '@genesislcap/foundation-ui';
7
11
  import { ViewTemplate } from '@microsoft/fast-element';
8
12
 
13
+ /**
14
+ * Do not reference any ../main files here. We must avoid ../tags being referenced and therefore setup pre-configuration.
15
+ */
16
+ /**
17
+ * AlertConfig DI interface.
18
+ *
19
+ * @public
20
+ */
21
+ export declare interface AlertConfig extends PartialFASTElementDefinition {
22
+ /**
23
+ * Template options.
24
+ *
25
+ * @remarks
26
+ * Used by host applications to assign MF template options and subcomponent tags to align with the host design system.
27
+ */
28
+ templateOptions: TemplateOptions;
29
+ /**
30
+ * Design System prefix for foundation-form
31
+ *
32
+ * @remarks
33
+ * Used by foundation-form to specify the design system used by the form elements
34
+ */
35
+ designSystemPrefix: string;
36
+ }
37
+
38
+ /**
39
+ * AlertConfig DI key.
40
+ *
41
+ * @internal
42
+ * @privateRemarks
43
+ * Marked as internal to stop api-extractor becoming confused cross-linking tokens with the same name.
44
+ */
45
+ export declare const AlertConfig: InterfaceSymbol<AlertConfig>;
46
+
9
47
  declare interface AlertRule extends AlertRuleRow {
10
48
  DATE: string;
11
49
  }
@@ -28,6 +66,39 @@ declare enum AlertRuleStatus {
28
66
  DISABLED = "DISABLED"
29
67
  }
30
68
 
69
+ /**
70
+ * configure.
71
+ *
72
+ * @remarks
73
+ * Configure the alert micro frontend for host app integration.
74
+ *
75
+ * @example Providing template options to align to your host application.
76
+ * ```ts
77
+
78
+ * const { configure } = await import('@genesislcap/foundation-alerts/config'); // < import from the subpath
79
+ * return configure({
80
+ * name: `nexus-app-alerts`,
81
+ * // These will be merged with the packages `defaultTemplateOptions`. You will need to have these components registered in your application.
82
+ * templateOptions: {
83
+ * button: 'nexus-button',
84
+ * checkbox: 'nexus-checkbox-next',
85
+ * provider: 'template',
86
+ * },
87
+ * });
88
+ * },
89
+ * ```
90
+ *
91
+ * @param config - A partial AlertConfig.
92
+ * @public
93
+ */
94
+ export declare function configure(config: Partial<AlertConfig>): Promise<FoundationAlerts>;
95
+
96
+ /**
97
+ * Default AlertConfig DI implementation.
98
+ * @public
99
+ */
100
+ export declare const defaultAlertConfig: AlertConfig;
101
+
31
102
  declare type displayState = 'add' | 'edit' | 'list';
32
103
 
33
104
  /**
@@ -41,6 +112,7 @@ export declare class FoundationAlerts extends FASTElement {
41
112
  displayState: displayState;
42
113
  items: AlertRule[];
43
114
  alertEditItemData: AlertRule;
115
+ alertConfig: AlertConfig;
44
116
  private sourceRef;
45
117
  private resourceName;
46
118
  private statusLabelMap;
@@ -81,4 +153,64 @@ export declare const FoundationAlertsStyles: ElementStyles;
81
153
  */
82
154
  export declare const FoundationAlertsTemplate: ViewTemplate<FoundationAlerts, any>;
83
155
 
156
+ /**
157
+ * TemplateComponents.
158
+ * @public
159
+ */
160
+ declare type TemplateComponents = {
161
+ icon: TemplateElementDependency;
162
+ button: TemplateElementDependency;
163
+ dropdownMenu: TemplateElementDependency;
164
+ divider: TemplateElementDependency;
165
+ provider: TemplateElementDependency;
166
+ };
167
+
168
+ /**
169
+ * TemplateOptions.
170
+ * @public
171
+ */
172
+ declare type TemplateOptions = Partial<TemplateComponents> & {
173
+ /**
174
+ * @remarks
175
+ * Just for reference that template options may be more than tags.
176
+ * @internal
177
+ */
178
+ somePartial?: string | SyntheticViewTemplate;
179
+ };
180
+
181
+ /**
182
+ * ZeroAlerts.
183
+ *
184
+ * @remarks
185
+ * A zero version that pre-registers zero components and uses the zero design system. ZeroAlerts and its components won't bloat the core bundle as
186
+ * these are only loaded on-demand when in use.
187
+ *
188
+ * @example
189
+ * ```ts
190
+ * import { ZeroAlerts } from '@genesislcap/foundation-alerts';
191
+ * ...
192
+ * ZeroAlerts
193
+ * ```
194
+ *
195
+ * @example Load the micro frontend on-demand
196
+ * ```ts
197
+
198
+ * const { ZeroAlerts } = await import('@genesislcap/foundation-alerts');
199
+ * return ZeroAlerts;
200
+ * },
201
+ * ```
202
+ *
203
+ * @public
204
+ */
205
+ export declare class ZeroAlerts extends FoundationAlerts {
206
+ /**
207
+ * @internal
208
+ */
209
+ connectedCallback(): Promise<void>;
210
+ /**
211
+ * @internal
212
+ */
213
+ protected loadRemotes(): Promise<void>;
214
+ }
215
+
84
216
  export { }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-alerts",
3
3
  "description": "Genesis Foundation Alerts",
4
- "version": "14.127.6",
4
+ "version": "14.128.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/foundation-alerts.d.ts",
@@ -23,6 +23,10 @@
23
23
  "types": "./dist/foundation-alerts.d.ts",
24
24
  "default": "./dist/esm/index.js"
25
25
  },
26
+ "./config": {
27
+ "types": "./dist/dts/config/index.d.ts",
28
+ "default": "./dist/esm/config/index.js"
29
+ },
26
30
  "./e2e": {
27
31
  "default": "./test/e2e/index.ts"
28
32
  },
@@ -30,6 +34,9 @@
30
34
  },
31
35
  "typesVersions": {
32
36
  "*": {
37
+ "config": [
38
+ "./dist/dts/config/index.d.ts"
39
+ ],
33
40
  "e2e": [
34
41
  "./test/e2e/index.ts"
35
42
  ]
@@ -53,15 +60,16 @@
53
60
  "test:debug": "genx test --debug"
54
61
  },
55
62
  "devDependencies": {
56
- "@genesislcap/foundation-testing": "14.127.6",
57
- "@genesislcap/genx": "14.127.6",
63
+ "@genesislcap/foundation-testing": "14.128.0",
64
+ "@genesislcap/genx": "14.128.0",
58
65
  "rimraf": "^3.0.2"
59
66
  },
60
67
  "dependencies": {
61
- "@genesislcap/foundation-comms": "14.127.6",
62
- "@genesislcap/foundation-logger": "14.127.6",
63
- "@genesislcap/foundation-ui": "14.127.6",
64
- "@genesislcap/foundation-zero": "14.127.6",
68
+ "@genesislcap/foundation-comms": "14.128.0",
69
+ "@genesislcap/foundation-logger": "14.128.0",
70
+ "@genesislcap/foundation-ui": "14.128.0",
71
+ "@genesislcap/foundation-utils": "14.128.0",
72
+ "@genesislcap/foundation-zero": "14.128.0",
65
73
  "@microsoft/fast-components": "^2.30.6",
66
74
  "@microsoft/fast-element": "^1.12.0",
67
75
  "@microsoft/fast-foundation": "^2.49.4",
@@ -79,5 +87,5 @@
79
87
  "access": "public"
80
88
  },
81
89
  "customElements": "dist/custom-elements.json",
82
- "gitHead": "bee68a5b13b648123943e49d547c27da5a7ff6ed"
90
+ "gitHead": "5fc8cef3a47b0b518e28d67f03b3ac7f4df99b38"
83
91
  }