@genesislcap/foundation-errors 9.0.1-alpha-b5c5eb7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/1.0.0.remoteEntry.js +1 -0
- package/dist/145.145.25912f2c12344fb25e16.js +2 -0
- package/dist/145.e7ed8da0367f1288ec24cf6472d1f047.js.map +1 -0
- package/dist/191.191.da8a5884febca6f1a439.js +2 -0
- package/dist/191.efd2fea1a42a47cddbf6e6ab15fbf2bb.js.map +1 -0
- package/dist/366.366.82702b77300a9353fc87.js +2 -0
- package/dist/366.a181180b871f72ff9f4ad3e3f3ea3734.js.map +1 -0
- package/dist/755.62d9698f4e62142b980949b517fded3f.js.map +1 -0
- package/dist/755.755.f8db61516204a76477a8.js +2 -0
- package/dist/dashboard.json +1 -0
- package/dist/dts/banner/error-banner-builder.d.ts +10 -0
- package/dist/dts/banner/error-banner-builder.d.ts.map +1 -0
- package/dist/dts/banner/index.d.ts +2 -0
- package/dist/dts/banner/index.d.ts.map +1 -0
- package/dist/dts/dialog/error-dialog-builder.d.ts +10 -0
- package/dist/dts/dialog/error-dialog-builder.d.ts.map +1 -0
- package/dist/dts/dialog/error-dialog-launcher.d.ts +10 -0
- package/dist/dts/dialog/error-dialog-launcher.d.ts.map +1 -0
- package/dist/dts/dialog/index.d.ts +3 -0
- package/dist/dts/dialog/index.d.ts.map +1 -0
- package/dist/dts/error-builder.d.ts +23 -0
- package/dist/dts/error-builder.d.ts.map +1 -0
- package/dist/dts/error-launcher.d.ts +10 -0
- package/dist/dts/error-launcher.d.ts.map +1 -0
- package/dist/dts/error-util.d.ts +25 -0
- package/dist/dts/error-util.d.ts.map +1 -0
- package/dist/dts/index.d.ts +9 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/index.federated.d.ts +1 -0
- package/dist/dts/index.federated.d.ts.map +1 -0
- package/dist/dts/logger.d.ts +2 -0
- package/dist/dts/logger.d.ts.map +1 -0
- package/dist/dts/notification/index.d.ts +3 -0
- package/dist/dts/notification/index.d.ts.map +1 -0
- package/dist/dts/notification/notification-builder.d.ts +12 -0
- package/dist/dts/notification/notification-builder.d.ts.map +1 -0
- package/dist/dts/notification/notification-launcher.d.ts +10 -0
- package/dist/dts/notification/notification-launcher.d.ts.map +1 -0
- package/dist/dts/snackbar/index.d.ts +3 -0
- package/dist/dts/snackbar/index.d.ts.map +1 -0
- package/dist/dts/snackbar/snackbar-builder.d.ts +27 -0
- package/dist/dts/snackbar/snackbar-builder.d.ts.map +1 -0
- package/dist/dts/snackbar/snackbar-launcher.d.ts +10 -0
- package/dist/dts/snackbar/snackbar-launcher.d.ts.map +1 -0
- package/dist/dts/tsdoc-metadata.json +11 -0
- package/dist/dts/types.d.ts +52 -0
- package/dist/dts/types.d.ts.map +1 -0
- package/dist/esm/banner/error-banner-builder.js +25 -0
- package/dist/esm/banner/error-banner-builder.js.map +1 -0
- package/dist/esm/banner/index.js +2 -0
- package/dist/esm/banner/index.js.map +1 -0
- package/dist/esm/dialog/error-dialog-builder.js +25 -0
- package/dist/esm/dialog/error-dialog-builder.js.map +1 -0
- package/dist/esm/dialog/error-dialog-launcher.js +17 -0
- package/dist/esm/dialog/error-dialog-launcher.js.map +1 -0
- package/dist/esm/dialog/index.js +3 -0
- package/dist/esm/dialog/index.js.map +1 -0
- package/dist/esm/error-builder.js +74 -0
- package/dist/esm/error-builder.js.map +1 -0
- package/dist/esm/error-launcher.js +34 -0
- package/dist/esm/error-launcher.js.map +1 -0
- package/dist/esm/error-util.js +43 -0
- package/dist/esm/error-util.js.map +1 -0
- package/dist/esm/index.federated.js +2 -0
- package/dist/esm/index.federated.js.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.js +3 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/notification/index.js +3 -0
- package/dist/esm/notification/index.js.map +1 -0
- package/dist/esm/notification/notification-builder.js +29 -0
- package/dist/esm/notification/notification-builder.js.map +1 -0
- package/dist/esm/notification/notification-launcher.js +40 -0
- package/dist/esm/notification/notification-launcher.js.map +1 -0
- package/dist/esm/snackbar/index.js +3 -0
- package/dist/esm/snackbar/index.js.map +1 -0
- package/dist/esm/snackbar/snackbar-builder.js +42 -0
- package/dist/esm/snackbar/snackbar-builder.js.map +1 -0
- package/dist/esm/snackbar/snackbar-launcher.js +16 -0
- package/dist/esm/snackbar/snackbar-launcher.js.map +1 -0
- package/dist/esm/types.js +5 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/foundation-errors.api.json +2483 -0
- package/dist/foundation-errors.d.ts +205 -0
- package/dist/foundation-errors.iife.min.js +1 -0
- package/dist/foundation-errors.js +1240 -0
- package/dist/foundation-errors.min.js +1 -0
- package/dist/foundationErrors.3332a181471a7c01e0521b713cbe35e9.js.map +1 -0
- package/dist/index.ejs +23 -0
- package/dist/index.html +10 -0
- package/dist/info.ejs +13 -0
- package/dist/info.html +14 -0
- package/dist/main.5ba41fdd245152fbed9605c3b9e25cee.js.map +1 -0
- package/dist/main.729daae38fba054a7206.js +2 -0
- package/dist/npm.consola.713.6bcc5abc1500250af5f5.js +2 -0
- package/dist/npm.consola.de429dd64b8dd7d3424e047e422d6ee1.js.map +1 -0
- package/dist/npm.microsoft.127.821cbcff47e0a34e88c9.js +3 -0
- package/dist/npm.microsoft.127.821cbcff47e0a34e88c9.js.LICENSE.txt +14 -0
- package/dist/npm.microsoft.4ae729aafa2e074df718ae9a73d16fa1.js.map +1 -0
- package/dist/remoteEntry.js +2 -0
- package/dist/serve.json +3 -0
- package/docs/api/foundation-errors.confirmingaction.action.md +11 -0
- package/docs/api/foundation-errors.confirmingaction.label.md +11 -0
- package/docs/api/foundation-errors.confirmingaction.md +19 -0
- package/docs/api/foundation-errors.dismissingaction.action.md +11 -0
- package/docs/api/foundation-errors.dismissingaction.label.md +11 -0
- package/docs/api/foundation-errors.dismissingaction.md +19 -0
- package/docs/api/foundation-errors.errorbanner.confirmingactions.md +11 -0
- package/docs/api/foundation-errors.errorbanner.dismissingaction.md +11 -0
- package/docs/api/foundation-errors.errorbanner.md +19 -0
- package/docs/api/foundation-errors.errorbannerbuilder.build.md +15 -0
- package/docs/api/foundation-errors.errorbannerbuilder.md +20 -0
- package/docs/api/foundation-errors.errorbannerbuilder.withconfirmingaction.md +22 -0
- package/docs/api/foundation-errors.errorbannerbuilder.withdismissingaction.md +22 -0
- package/docs/api/foundation-errors.errorboundaryevent.md +18 -0
- package/docs/api/foundation-errors.errorbuilder.build.md +15 -0
- package/docs/api/foundation-errors.errorbuilder.md +26 -0
- package/docs/api/foundation-errors.errorbuilder.withalert.md +22 -0
- package/docs/api/foundation-errors.errorbuilder.withbanner.md +22 -0
- package/docs/api/foundation-errors.errorbuilder.withdialog.md +22 -0
- package/docs/api/foundation-errors.errorbuilder.witherrordetails.md +22 -0
- package/docs/api/foundation-errors.errorbuilder.withloglevel.md +22 -0
- package/docs/api/foundation-errors.errorbuilder.withnotification.md +22 -0
- package/docs/api/foundation-errors.errorbuilder.withsnackbar.md +22 -0
- package/docs/api/foundation-errors.errorbuilder.withtitle.md +22 -0
- package/docs/api/foundation-errors.errordialog.confirmingactions.md +11 -0
- package/docs/api/foundation-errors.errordialog.dismissingaction.md +11 -0
- package/docs/api/foundation-errors.errordialog.md +19 -0
- package/docs/api/foundation-errors.errordialogbuilder.build.md +15 -0
- package/docs/api/foundation-errors.errordialogbuilder.md +20 -0
- package/docs/api/foundation-errors.errordialogbuilder.withconfirmingaction.md +22 -0
- package/docs/api/foundation-errors.errordialogbuilder.withdismissingaction.md +22 -0
- package/docs/api/foundation-errors.errordialogelement.md +15 -0
- package/docs/api/foundation-errors.errorelement.md +15 -0
- package/docs/api/foundation-errors.errornotification.autoclose.md +11 -0
- package/docs/api/foundation-errors.errornotification.closetimeout.md +11 -0
- package/docs/api/foundation-errors.errornotification.md +20 -0
- package/docs/api/foundation-errors.errornotification.type.md +11 -0
- package/docs/api/foundation-errors.errorstructure.config.md +18 -0
- package/docs/api/foundation-errors.errorstructure.errordetails.md +11 -0
- package/docs/api/foundation-errors.errorstructure.loglevel.md +11 -0
- package/docs/api/foundation-errors.errorstructure.md +21 -0
- package/docs/api/foundation-errors.errorstructure.title.md +11 -0
- package/docs/api/foundation-errors.geterrorbannerbuilder.md +11 -0
- package/docs/api/foundation-errors.geterrorbuilder.md +11 -0
- package/docs/api/foundation-errors.geterrorcontainer.md +13 -0
- package/docs/api/foundation-errors.geterrordetails.md +13 -0
- package/docs/api/foundation-errors.geterrordialogbuilder.md +11 -0
- package/docs/api/foundation-errors.getloglevel.md +13 -0
- package/docs/api/foundation-errors.getnotificationbuilder.md +11 -0
- package/docs/api/foundation-errors.getsnackbarbuilder.md +11 -0
- package/docs/api/foundation-errors.md +58 -0
- package/docs/api/foundation-errors.notificationbuilder.build.md +15 -0
- package/docs/api/foundation-errors.notificationbuilder.md +21 -0
- package/docs/api/foundation-errors.notificationbuilder.withautoclose.md +22 -0
- package/docs/api/foundation-errors.notificationbuilder.withclosetimeout.md +22 -0
- package/docs/api/foundation-errors.notificationbuilder.withtype.md +22 -0
- package/docs/api/foundation-errors.showdialog.md +13 -0
- package/docs/api/foundation-errors.showerror.md +13 -0
- package/docs/api/foundation-errors.shownotification.md +13 -0
- package/docs/api/foundation-errors.showsnackbar.md +13 -0
- package/docs/api/foundation-errors.snackbar.confirmingactions.md +11 -0
- package/docs/api/foundation-errors.snackbar.md +19 -0
- package/docs/api/foundation-errors.snackbar.type.md +11 -0
- package/docs/api/foundation-errors.snackbarbuilder.build.md +19 -0
- package/docs/api/foundation-errors.snackbarbuilder.md +20 -0
- package/docs/api/foundation-errors.snackbarbuilder.withconfirmingaction.md +25 -0
- package/docs/api/foundation-errors.snackbarbuilder.withtype.md +25 -0
- package/docs/api/index.md +12 -0
- package/docs/api-report.md +193 -0
- package/jsdom.setup.ts +1 -0
- package/license.txt +46 -0
- package/package.json +101 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Snackbar, ConfirmingAction } from '../types';
|
|
2
|
+
export declare class SnackbarBuilder {
|
|
3
|
+
private confirmingActions;
|
|
4
|
+
private type;
|
|
5
|
+
/**
|
|
6
|
+
* Add type to snackbar
|
|
7
|
+
* @public
|
|
8
|
+
* @param type
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
withType(type: 'error' | ''): SnackbarBuilder;
|
|
12
|
+
/**
|
|
13
|
+
* Add confirming action to snackbar
|
|
14
|
+
* @public
|
|
15
|
+
* @param confirmingAction
|
|
16
|
+
* @returns
|
|
17
|
+
* */
|
|
18
|
+
withConfirmingAction(confirmingAction: ConfirmingAction): SnackbarBuilder;
|
|
19
|
+
/**
|
|
20
|
+
* Build snackbar
|
|
21
|
+
* @public
|
|
22
|
+
* @returns Snackbar
|
|
23
|
+
* */
|
|
24
|
+
build(): Snackbar;
|
|
25
|
+
}
|
|
26
|
+
export declare const getSnackbarBuilder: () => SnackbarBuilder;
|
|
27
|
+
//# sourceMappingURL=snackbar-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snackbar-builder.d.ts","sourceRoot":"","sources":["../../../src/snackbar/snackbar-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEtD,qBAAa,eAAe;IAC1B,OAAO,CAAC,iBAAiB,CAA0B;IACnD,OAAO,CAAC,IAAI,CAAe;IAE3B;;;;;OAKG;IACI,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,EAAE,GAAG,eAAe;IAKpD;;;;;SAKK;IAEE,oBAAoB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,eAAe;IAQhF;;;;SAIK;IAEE,KAAK,IAAI,QAAQ;CAUzB;AAED,eAAO,MAAM,kBAAkB,QAAO,eAAwC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ErrorStructure } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Shows the snackbar
|
|
4
|
+
* @public
|
|
5
|
+
* @param error - The ErrorStructure object
|
|
6
|
+
* @param tagName - The tag name to create prefix for the design system provider & error component
|
|
7
|
+
* @returns
|
|
8
|
+
* */
|
|
9
|
+
export declare const showSnackbar: (error: ErrorStructure, tagName: String) => void;
|
|
10
|
+
//# sourceMappingURL=snackbar-launcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snackbar-launcher.d.ts","sourceRoot":"","sources":["../../../src/snackbar/snackbar-launcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgB,MAAM,UAAU,CAAC;AAGxD;;;;;;KAMK;AACL,eAAO,MAAM,YAAY,UAAW,cAAc,WAAW,MAAM,KAAG,IAMrE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.34.4"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LogLevel } from '@genesislcap/foundation-utils';
|
|
2
|
+
export declare enum ErrorBoundaryEvent {
|
|
3
|
+
ERROR_BOUNDARY_EVENT = "error-boundary-event"
|
|
4
|
+
}
|
|
5
|
+
export interface ErrorNotification {
|
|
6
|
+
readonly type?: 'warning' | 'success' | '';
|
|
7
|
+
readonly autoClose?: boolean;
|
|
8
|
+
readonly closeTimeout?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface DismissingAction {
|
|
11
|
+
readonly label: String;
|
|
12
|
+
readonly action?: Function;
|
|
13
|
+
}
|
|
14
|
+
export interface ConfirmingAction {
|
|
15
|
+
readonly label: String;
|
|
16
|
+
readonly action: Function;
|
|
17
|
+
}
|
|
18
|
+
export interface ErrorDialog {
|
|
19
|
+
readonly confirmingActions?: Array<ConfirmingAction>;
|
|
20
|
+
readonly dismissingAction?: DismissingAction;
|
|
21
|
+
}
|
|
22
|
+
export interface ErrorBanner {
|
|
23
|
+
readonly dismissingAction?: DismissingAction;
|
|
24
|
+
readonly confirmingActions?: Array<ConfirmingAction>;
|
|
25
|
+
}
|
|
26
|
+
export interface Snackbar {
|
|
27
|
+
readonly type?: 'error' | '';
|
|
28
|
+
readonly confirmingActions?: Array<ConfirmingAction>;
|
|
29
|
+
}
|
|
30
|
+
export interface ErrorStructure {
|
|
31
|
+
readonly title: string;
|
|
32
|
+
readonly errorDetails: string;
|
|
33
|
+
readonly logLevel?: LogLevel;
|
|
34
|
+
readonly config?: {
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Use logLevel from the top level instead
|
|
37
|
+
*/
|
|
38
|
+
readonly logLevel?: LogLevel;
|
|
39
|
+
readonly alert?: boolean;
|
|
40
|
+
readonly notification?: ErrorNotification;
|
|
41
|
+
readonly banner?: ErrorBanner;
|
|
42
|
+
readonly snackbar?: Snackbar;
|
|
43
|
+
readonly dialog?: ErrorDialog;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export type ErrorElement = HTMLElement & {
|
|
47
|
+
error: ErrorStructure;
|
|
48
|
+
};
|
|
49
|
+
export type ErrorDialogElement = ErrorElement & {
|
|
50
|
+
show: Function;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,oBAAY,kBAAkB;IAC5B,oBAAoB,yBAAyB;CAC9C;AAED,MAAM,WAAW,iBAAiB;IAChC,Q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CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;QAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;QAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;QAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;KAC/B,CAAC;CACH;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IAAE,KAAK,EAAE,cAAc,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class ErrorBannerBuilder {
|
|
2
|
+
withDismissingAction(dismissingAction) {
|
|
3
|
+
this.dismissingAction = dismissingAction;
|
|
4
|
+
return this;
|
|
5
|
+
}
|
|
6
|
+
withConfirmingAction(confirmingAction) {
|
|
7
|
+
if (!this.confirmingActions) {
|
|
8
|
+
this.confirmingActions = [];
|
|
9
|
+
}
|
|
10
|
+
this.confirmingActions.push(confirmingAction);
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
build() {
|
|
14
|
+
let errorBanner = {};
|
|
15
|
+
if (this.dismissingAction) {
|
|
16
|
+
errorBanner = Object.assign({ dismissingAction: this.dismissingAction }, errorBanner);
|
|
17
|
+
}
|
|
18
|
+
if (this.confirmingActions) {
|
|
19
|
+
errorBanner = Object.assign({ confirmingActions: this.confirmingActions }, errorBanner);
|
|
20
|
+
}
|
|
21
|
+
return errorBanner;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export const getErrorBannerBuilder = () => new ErrorBannerBuilder();
|
|
25
|
+
//# sourceMappingURL=error-banner-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-banner-builder.js","sourceRoot":"","sources":["../../../src/banner/error-banner-builder.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,kBAAkB;IAItB,oBAAoB,CAAC,gBAAkC;QAC5D,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,oBAAoB,CAAC,gBAAkC;QAC5D,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;SAC7B;QACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK;QACV,IAAI,WAAW,GAAgB,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,WAAW,mBAAK,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,IAAK,WAAW,CAAE,CAAC;SAC3E;QAED,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,WAAW,mBAAK,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAK,WAAW,CAAE,CAAC;SAC7E;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAuB,EAAE,CAAC,IAAI,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/banner/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class ErrorDialogBuilder {
|
|
2
|
+
withDismissingAction(dismissingAction) {
|
|
3
|
+
this.dismissingAction = dismissingAction;
|
|
4
|
+
return this;
|
|
5
|
+
}
|
|
6
|
+
withConfirmingAction(confirmingAction) {
|
|
7
|
+
if (!this.confirmingActions) {
|
|
8
|
+
this.confirmingActions = [];
|
|
9
|
+
}
|
|
10
|
+
this.confirmingActions.push(confirmingAction);
|
|
11
|
+
return this;
|
|
12
|
+
}
|
|
13
|
+
build() {
|
|
14
|
+
let errorDialog = {};
|
|
15
|
+
if (this.dismissingAction) {
|
|
16
|
+
errorDialog = Object.assign({ dismissingAction: this.dismissingAction }, errorDialog);
|
|
17
|
+
}
|
|
18
|
+
if (this.confirmingActions) {
|
|
19
|
+
errorDialog = Object.assign({ confirmingActions: this.confirmingActions }, errorDialog);
|
|
20
|
+
}
|
|
21
|
+
return errorDialog;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export const getErrorDialogBuilder = () => new ErrorDialogBuilder();
|
|
25
|
+
//# sourceMappingURL=error-dialog-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-dialog-builder.js","sourceRoot":"","sources":["../../../src/dialog/error-dialog-builder.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,kBAAkB;IAItB,oBAAoB,CAAC,gBAAkC;QAC5D,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,oBAAoB,CAAC,gBAAkC;QAC5D,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;SAC7B;QACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK;QACV,IAAI,WAAW,GAAgB,EAAE,CAAC;QAClC,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,WAAW,mBAAK,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,IAAK,WAAW,CAAE,CAAC;SAC3E;QACD,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,WAAW,mBAAK,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAK,WAAW,CAAE,CAAC;SAC7E;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAuB,EAAE,CAAC,IAAI,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getErrorContainer } from '../error-util';
|
|
2
|
+
/**
|
|
3
|
+
* Shows the error dialog
|
|
4
|
+
* @public
|
|
5
|
+
* @param error - The ErrorStructure object
|
|
6
|
+
* @param tagName - The tag name to create prefix for the design system provider & error component
|
|
7
|
+
* @returns
|
|
8
|
+
* */
|
|
9
|
+
export const showDialog = (error, tagName) => {
|
|
10
|
+
const tagPrefix = tagName.split('-')[0];
|
|
11
|
+
const dialog = document.createElement(`${tagPrefix}-error-dialog`);
|
|
12
|
+
const container = getErrorContainer('dialog-container', tagName);
|
|
13
|
+
container.appendChild(dialog);
|
|
14
|
+
dialog.error = error;
|
|
15
|
+
dialog.show();
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=error-dialog-launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-dialog-launcher.js","sourceRoot":"","sources":["../../../src/dialog/error-dialog-launcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;KAMK;AACL,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAqB,EAAE,OAAe,EAAQ,EAAE;IACzE,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,SAAS,eAAe,CAAuB,CAAC;IACzF,MAAM,SAAS,GAAgB,iBAAiB,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAC9E,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,MAAM,CAAC,IAAI,EAAE,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dialog/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { LogLevel } from '@genesislcap/foundation-utils';
|
|
2
|
+
export class ErrorBuilder {
|
|
3
|
+
withTitle(title) {
|
|
4
|
+
this.title = title;
|
|
5
|
+
return this;
|
|
6
|
+
}
|
|
7
|
+
withErrorDetails(errorDetails) {
|
|
8
|
+
this.errorDetails = errorDetails;
|
|
9
|
+
return this;
|
|
10
|
+
}
|
|
11
|
+
withLogLevel(logLevel) {
|
|
12
|
+
this.logLevel = logLevel;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
withAlert(alert) {
|
|
16
|
+
this.alert = alert;
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
withNotification(notification) {
|
|
20
|
+
this.notification = notification;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
withBanner(banner) {
|
|
24
|
+
this.banner = banner;
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
withSnackbar(snackbar) {
|
|
28
|
+
this.snackbar = snackbar;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
withDialog(dialog) {
|
|
32
|
+
this.dialog = dialog;
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
build() {
|
|
36
|
+
if (!this.title) {
|
|
37
|
+
throw new Error('Title is required');
|
|
38
|
+
}
|
|
39
|
+
if (!this.errorDetails) {
|
|
40
|
+
throw new Error(`Missing required param 'errorDetails'`);
|
|
41
|
+
}
|
|
42
|
+
let errorStructure = {
|
|
43
|
+
title: this.title,
|
|
44
|
+
errorDetails: this.errorDetails,
|
|
45
|
+
};
|
|
46
|
+
let config = {};
|
|
47
|
+
if (this.logLevel in LogLevel) {
|
|
48
|
+
errorStructure = Object.assign({ logLevel: this.logLevel }, errorStructure);
|
|
49
|
+
}
|
|
50
|
+
if (this.alert) {
|
|
51
|
+
config = Object.assign({ alert: this.alert }, config);
|
|
52
|
+
errorStructure = Object.assign({ config }, errorStructure);
|
|
53
|
+
}
|
|
54
|
+
if (this.notification) {
|
|
55
|
+
config = Object.assign({ notification: this.notification }, config);
|
|
56
|
+
errorStructure = Object.assign({ config }, errorStructure);
|
|
57
|
+
}
|
|
58
|
+
if (this.banner) {
|
|
59
|
+
config = Object.assign({ banner: this.banner }, config);
|
|
60
|
+
errorStructure = Object.assign({ config }, errorStructure);
|
|
61
|
+
}
|
|
62
|
+
if (this.snackbar) {
|
|
63
|
+
config = Object.assign({ snackbar: this.snackbar }, config);
|
|
64
|
+
errorStructure = Object.assign({ config }, errorStructure);
|
|
65
|
+
}
|
|
66
|
+
if (this.dialog) {
|
|
67
|
+
config = Object.assign({ dialog: this.dialog }, config);
|
|
68
|
+
errorStructure = Object.assign({ config }, errorStructure);
|
|
69
|
+
}
|
|
70
|
+
return errorStructure;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export const getErrorBuilder = () => new ErrorBuilder();
|
|
74
|
+
//# sourceMappingURL=error-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-builder.js","sourceRoot":"","sources":["../../src/error-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAGzD,MAAM,OAAO,YAAY;IAUhB,SAAS,CAAC,KAAa;QAC5B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,gBAAgB,CAAC,YAAoB;QAC1C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,YAAY,CAAC,QAAkB;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,SAAS,CAAC,KAAc;QAC7B,IAAI,CAAC,KAAK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cAAc,mBAAK,MAAM,IAAK,cAAc,CAAE,CAAC;SAChD;QAED,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,MAAM,mBAAK,MAAM,EAAE,IAAI,CAAC,MAAM,IAAK,MAAM,CAAE,CAAC;YAC5C,cAAc,mBAAK,MAAM,IAAK,cAAc,CAAE,CAAC;SAChD;QAED,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,MAAM,mBAAK,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAK,MAAM,CAAE,CAAC;YAChD,cAAc,mBAAK,MAAM,IAAK,cAAc,CAAE,CAAC;SAChD;QAED,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,MAAM,mBAAK,MAAM,EAAE,IAAI,CAAC,MAAM,IAAK,MAAM,CAAE,CAAC;YAC5C,cAAc,mBAAK,MAAM,IAAK,cAAc,CAAE,CAAC;SAChD;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,GAAiB,EAAE,CAAC,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getErrorDetails, getLoglevel } from './error-util';
|
|
2
|
+
import { showNotification } from './notification';
|
|
3
|
+
import { showDialog } from './dialog';
|
|
4
|
+
import { showSnackbar } from './snackbar';
|
|
5
|
+
import { createLogger } from '@genesislcap/foundation-utils';
|
|
6
|
+
const logger = createLogger('foundation-error');
|
|
7
|
+
const errorTypeToComponentMap = {
|
|
8
|
+
alert: (error) => {
|
|
9
|
+
alert(getErrorDetails(error));
|
|
10
|
+
},
|
|
11
|
+
notification: showNotification,
|
|
12
|
+
dialog: showDialog,
|
|
13
|
+
snackbar: showSnackbar,
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Shows the error in the appropriate component
|
|
17
|
+
* @public
|
|
18
|
+
* @param error - The ErrorStructure object
|
|
19
|
+
* @param tagName - The tag name to create prefix for the design system provider *
|
|
20
|
+
* @returns
|
|
21
|
+
* */
|
|
22
|
+
export const showError = (error, tagName) => {
|
|
23
|
+
logger.log({
|
|
24
|
+
message: getErrorDetails(error),
|
|
25
|
+
level: getLoglevel(error),
|
|
26
|
+
});
|
|
27
|
+
const keys = Object.keys((error === null || error === void 0 ? void 0 : error.config) || {});
|
|
28
|
+
keys.forEach((key) => {
|
|
29
|
+
if (errorTypeToComponentMap[key]) {
|
|
30
|
+
errorTypeToComponentMap[key](error, tagName);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=error-launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-launcher.js","sourceRoot":"","sources":["../../src/error-launcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,MAAM,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC;AAEhD,MAAM,uBAAuB,GAAG;IAC9B,KAAK,EAAE,CAAC,KAAqB,EAAQ,EAAE;QACrC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IAChC,CAAC;IACD,YAAY,EAAE,gBAAgB;IAC9B,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,YAAY;CACvB,CAAC;AAEF;;;;;;KAMK;AACL,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,OAAe,EAAQ,EAAE;IACxE,MAAM,CAAC,GAAG,CAAC;QACT,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC;QAC/B,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC;KAC1B,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,KAAI,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,IAAI,uBAAuB,CAAC,GAAG,CAAC,EAAE;YAChC,uBAAuB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;SAC9C;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { LogLevel } from '@genesislcap/foundation-utils';
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves the error details from an ErrorStructure object
|
|
4
|
+
* @public
|
|
5
|
+
* @param details - The ErrorStructure object
|
|
6
|
+
* @returns The title and error details concatenated as a string, or default values ('Error: Something went wrong') if not present
|
|
7
|
+
*/
|
|
8
|
+
export const getErrorDetails = (details) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const title = (_a = details === null || details === void 0 ? void 0 : details.title) !== null && _a !== void 0 ? _a : 'Error';
|
|
11
|
+
const errorDetails = (_b = details === null || details === void 0 ? void 0 : details.errorDetails) !== null && _b !== void 0 ? _b : 'Something went wrong';
|
|
12
|
+
return `${title}: ${errorDetails}`;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves the log level from an ErrorStructure object
|
|
16
|
+
* @public
|
|
17
|
+
* @param details - The ErrorStructure object
|
|
18
|
+
* @returns The log level or the default value (LogLevel.Error) if not present
|
|
19
|
+
*/
|
|
20
|
+
export const getLoglevel = (details) => {
|
|
21
|
+
var _a;
|
|
22
|
+
return (details === null || details === void 0 ? void 0 : details.logLevel) || ((_a = details === null || details === void 0 ? void 0 : details.config) === null || _a === void 0 ? void 0 : _a.logLevel) || LogLevel.Error;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Get/Create the error container in the DOM
|
|
26
|
+
* @public
|
|
27
|
+
* @param id - The id of the container
|
|
28
|
+
* @param tagName - The tag name to create prefix for the design system provider
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
export const getErrorContainer = (id, tagName) => {
|
|
32
|
+
const tagPrefix = tagName.split('-')[0];
|
|
33
|
+
let container = document.querySelector(`#${id}`);
|
|
34
|
+
if (!container) {
|
|
35
|
+
container = document.createElement('div');
|
|
36
|
+
container.setAttribute('id', id);
|
|
37
|
+
const dsProvider = document.createElement(`${tagPrefix}-design-system-provider`);
|
|
38
|
+
dsProvider.appendChild(container);
|
|
39
|
+
document.body.appendChild(dsProvider);
|
|
40
|
+
}
|
|
41
|
+
return container;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=error-util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-util.js","sourceRoot":"","sources":["../../src/error-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAGzD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAuB,EAAU,EAAE;;IACjE,MAAM,KAAK,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,mCAAI,OAAO,CAAC;IACxC,MAAM,YAAY,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,mCAAI,sBAAsB,CAAC;IACrE,OAAO,GAAG,KAAK,KAAK,YAAY,EAAE,CAAC;AACrC,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAuB,EAAY,EAAE;;IAC/D,OAAO,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,MAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,0CAAE,QAAQ,CAAA,IAAI,QAAQ,CAAC,KAAK,CAAC;AAC1E,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAU,EAAE,OAAe,EAAe,EAAE;IAC5E,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,IAAI,SAAS,GAAgB,QAAQ,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAE9D,IAAI,CAAC,SAAS,EAAE;QACd,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACjC,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,SAAS,yBAAyB,CAAC,CAAC;QACjF,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAClC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;KACvC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.federated.js","sourceRoot":"","sources":["../../src/index.federated.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './error-builder';
|
|
3
|
+
export * from './notification';
|
|
4
|
+
export * from './banner';
|
|
5
|
+
export * from './dialog';
|
|
6
|
+
export * from './snackbar';
|
|
7
|
+
export * from './error-util';
|
|
8
|
+
export * from './error-launcher';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/notification/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export class NotificationBuilder {
|
|
2
|
+
withAutoClose(autoClose) {
|
|
3
|
+
this.autoClose = autoClose;
|
|
4
|
+
return this;
|
|
5
|
+
}
|
|
6
|
+
withCloseTimeout(closeTimeout) {
|
|
7
|
+
this.closeTimeout = closeTimeout;
|
|
8
|
+
return this;
|
|
9
|
+
}
|
|
10
|
+
withType(type) {
|
|
11
|
+
this.type = type;
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
build() {
|
|
15
|
+
let notification = {};
|
|
16
|
+
if (this.autoClose) {
|
|
17
|
+
notification = Object.assign({ autoClose: this.autoClose }, notification);
|
|
18
|
+
}
|
|
19
|
+
if (this.closeTimeout) {
|
|
20
|
+
notification = Object.assign({ closeTimeout: this.closeTimeout }, notification);
|
|
21
|
+
}
|
|
22
|
+
if (this.type) {
|
|
23
|
+
notification = Object.assign({ type: this.type }, notification);
|
|
24
|
+
}
|
|
25
|
+
return notification;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export const getNotificationBuilder = () => new NotificationBuilder();
|
|
29
|
+
//# sourceMappingURL=notification-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-builder.js","sourceRoot":"","sources":["../../../src/notification/notification-builder.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,mBAAmB;IAKvB,aAAa,CAAC,SAAkB;QACrC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,gBAAgB,CAAC,YAAoB;QAC1C,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,QAAQ,CAAC,IAAgC;QAC9C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK;QACV,IAAI,YAAY,GAAG,EAAE,CAAC;QACtB,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,YAAY,mBAAK,SAAS,EAAE,IAAI,CAAC,SAAS,IAAK,YAAY,CAAE,CAAC;SAC/D;QACD,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,YAAY,mBAAK,YAAY,EAAE,IAAI,CAAC,YAAY,IAAK,YAAY,CAAE,CAAC;SACrE;QACD,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,YAAY,mBAAK,IAAI,EAAE,IAAI,CAAC,IAAI,IAAK,YAAY,CAAE,CAAC;SACrD;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAwB,EAAE,CAAC,IAAI,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getErrorContainer } from '../error-util';
|
|
2
|
+
/**
|
|
3
|
+
* Shows the error notification
|
|
4
|
+
* @public
|
|
5
|
+
* @param error - The ErrorStructure object
|
|
6
|
+
* @param tagName - The tag name to create prefix for the design system provider & error component
|
|
7
|
+
* @returns
|
|
8
|
+
* */
|
|
9
|
+
export const showNotification = (error, tagName) => {
|
|
10
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
11
|
+
const tagPrefix = tagName.split('-')[0];
|
|
12
|
+
const container = getErrorContainer('notify-container', tagName);
|
|
13
|
+
if (container) {
|
|
14
|
+
container.style.position = 'fixed';
|
|
15
|
+
container.style.top = '0';
|
|
16
|
+
container.style.right = '0';
|
|
17
|
+
}
|
|
18
|
+
const toastNotify = document.createElement(`${tagPrefix}-toast`);
|
|
19
|
+
const errorTitle = document.createElement('div');
|
|
20
|
+
errorTitle.setAttribute('slot', 'top');
|
|
21
|
+
errorTitle.textContent = (_a = error.title) !== null && _a !== void 0 ? _a : 'Error';
|
|
22
|
+
const errorDetails = document.createElement('div');
|
|
23
|
+
errorDetails.setAttribute('slot', 'content');
|
|
24
|
+
errorDetails.textContent = (error === null || error === void 0 ? void 0 : error.errorDetails) || '';
|
|
25
|
+
const errorDate = document.createElement('div');
|
|
26
|
+
errorDate.setAttribute('slot', 'date');
|
|
27
|
+
errorDate.textContent = new Date().toLocaleTimeString();
|
|
28
|
+
toastNotify.setAttribute('notify', ((_c = (_b = error === null || error === void 0 ? void 0 : error.config) === null || _b === void 0 ? void 0 : _b.notification) === null || _c === void 0 ? void 0 : _c.type) || '');
|
|
29
|
+
((_e = (_d = error === null || error === void 0 ? void 0 : error.config) === null || _d === void 0 ? void 0 : _d.notification) === null || _e === void 0 ? void 0 : _e.autoClose)
|
|
30
|
+
? toastNotify.setAttribute('auto-close', `${(_g = (_f = error === null || error === void 0 ? void 0 : error.config) === null || _f === void 0 ? void 0 : _f.notification) === null || _g === void 0 ? void 0 : _g.autoClose}`)
|
|
31
|
+
: '';
|
|
32
|
+
((_j = (_h = error === null || error === void 0 ? void 0 : error.config) === null || _h === void 0 ? void 0 : _h.notification) === null || _j === void 0 ? void 0 : _j.closeTimeout)
|
|
33
|
+
? toastNotify.setAttribute('close-timeout', `${(_l = (_k = error === null || error === void 0 ? void 0 : error.config) === null || _k === void 0 ? void 0 : _k.notification) === null || _l === void 0 ? void 0 : _l.closeTimeout}`)
|
|
34
|
+
: '';
|
|
35
|
+
toastNotify.appendChild(errorTitle);
|
|
36
|
+
toastNotify.appendChild(errorDetails);
|
|
37
|
+
toastNotify.appendChild(errorDate);
|
|
38
|
+
container.appendChild(toastNotify);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=notification-launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-launcher.js","sourceRoot":"","sources":["../../../src/notification/notification-launcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;KAMK;AACL,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAqB,EAAE,OAAe,EAAQ,EAAE;;IAC/E,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,MAAM,SAAS,GAAgB,iBAAiB,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAE9E,IAAI,SAAS,EAAE;QACb,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;QACnC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;QAC1B,SAAS,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC;KAC7B;IAED,MAAM,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,SAAS,QAAQ,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACjD,UAAU,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACvC,UAAU,CAAC,WAAW,GAAG,MAAA,KAAK,CAAC,KAAK,mCAAI,OAAO,CAAC;IAEhD,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACnD,YAAY,CAAC,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC7C,YAAY,CAAC,WAAW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
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/snackbar/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export class SnackbarBuilder {
|
|
2
|
+
/**
|
|
3
|
+
* Add type to snackbar
|
|
4
|
+
* @public
|
|
5
|
+
* @param type
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
withType(type) {
|
|
9
|
+
this.type = type;
|
|
10
|
+
return this;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Add confirming action to snackbar
|
|
14
|
+
* @public
|
|
15
|
+
* @param confirmingAction
|
|
16
|
+
* @returns
|
|
17
|
+
* */
|
|
18
|
+
withConfirmingAction(confirmingAction) {
|
|
19
|
+
if (!this.confirmingActions) {
|
|
20
|
+
this.confirmingActions = [];
|
|
21
|
+
}
|
|
22
|
+
this.confirmingActions.push(confirmingAction);
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Build snackbar
|
|
27
|
+
* @public
|
|
28
|
+
* @returns Snackbar
|
|
29
|
+
* */
|
|
30
|
+
build() {
|
|
31
|
+
let snackbar = {};
|
|
32
|
+
if (this.confirmingActions) {
|
|
33
|
+
snackbar = Object.assign({ confirmingActions: this.confirmingActions }, snackbar);
|
|
34
|
+
}
|
|
35
|
+
if (this.type !== undefined) {
|
|
36
|
+
snackbar = Object.assign({ type: this.type }, snackbar);
|
|
37
|
+
}
|
|
38
|
+
return snackbar;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export const getSnackbarBuilder = () => new SnackbarBuilder();
|
|
42
|
+
//# sourceMappingURL=snackbar-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snackbar-builder.js","sourceRoot":"","sources":["../../../src/snackbar/snackbar-builder.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,eAAe;IAI1B;;;;;OAKG;IACI,QAAQ,CAAC,IAAkB;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;SAKK;IAEE,oBAAoB,CAAC,gBAAkC;QAC5D,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;YAC3B,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;SAC7B;QACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;SAIK;IAEE,KAAK;QACV,IAAI,QAAQ,GAAa,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,QAAQ,mBAAK,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAK,QAAQ,CAAE,CAAC;SACvE;QACD,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;YAC3B,QAAQ,mBAAK,IAAI,EAAE,IAAI,CAAC,IAAI,IAAK,QAAQ,CAAE,CAAC;SAC7C;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAoB,EAAE,CAAC,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getErrorContainer } from '../error-util';
|
|
2
|
+
/**
|
|
3
|
+
* Shows the snackbar
|
|
4
|
+
* @public
|
|
5
|
+
* @param error - The ErrorStructure object
|
|
6
|
+
* @param tagName - The tag name to create prefix for the design system provider & error component
|
|
7
|
+
* @returns
|
|
8
|
+
* */
|
|
9
|
+
export const showSnackbar = (error, tagName) => {
|
|
10
|
+
const tagPrefix = tagName.split('-')[0];
|
|
11
|
+
const snackbar = document.createElement(`${tagPrefix}-snackbar`);
|
|
12
|
+
const container = getErrorContainer('snack-container', tagName);
|
|
13
|
+
container.appendChild(snackbar);
|
|
14
|
+
snackbar.error = error;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=snackbar-launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snackbar-launcher.js","sourceRoot":"","sources":["../../../src/snackbar/snackbar-launcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD;;;;;;KAMK;AACL,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAqB,EAAE,OAAe,EAAQ,EAAE;IAC3E,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,SAAS,WAAW,CAAiB,CAAC;IACjF,MAAM,SAAS,GAAgB,iBAAiB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAC7E,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAChC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;AACzB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,mEAA6C,CAAA;AAC/C,CAAC,EAFW,kBAAkB,KAAlB,kBAAkB,QAE7B"}
|
package/dist/favicon.ico
ADDED
|
Binary file
|