@genesislcap/foundation-errors 10.3.1 → 11.3.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 (139) hide show
  1. package/README.md +57 -0
  2. package/dist/dts/banner/error-banner-builder.d.ts +25 -0
  3. package/dist/dts/banner/error-banner-builder.d.ts.map +1 -1
  4. package/dist/dts/dialog/error-dialog-builder.d.ts +25 -0
  5. package/dist/dts/dialog/error-dialog-builder.d.ts.map +1 -1
  6. package/dist/dts/dialog/error-dialog-launcher.d.ts +1 -1
  7. package/dist/dts/dialog/error-dialog-launcher.d.ts.map +1 -1
  8. package/dist/dts/error-builder.d.ts +60 -0
  9. package/dist/dts/error-builder.d.ts.map +1 -1
  10. package/dist/dts/error-launcher.d.ts.map +1 -1
  11. package/dist/dts/logger.d.ts.map +1 -1
  12. package/dist/dts/notification/notification-builder.d.ts +32 -2
  13. package/dist/dts/notification/notification-builder.d.ts.map +1 -1
  14. package/dist/dts/notification/notification-launcher.d.ts +1 -1
  15. package/dist/dts/notification/notification-launcher.d.ts.map +1 -1
  16. package/dist/dts/snackbar/snackbar-builder.d.ts +15 -7
  17. package/dist/dts/snackbar/snackbar-builder.d.ts.map +1 -1
  18. package/dist/dts/snackbar/snackbar-launcher.d.ts +1 -1
  19. package/dist/dts/snackbar/snackbar-launcher.d.ts.map +1 -1
  20. package/dist/dts/types.d.ts +50 -2
  21. package/dist/dts/types.d.ts.map +1 -1
  22. package/dist/esm/banner/error-banner-builder.js +25 -1
  23. package/dist/esm/banner/index.js +0 -1
  24. package/dist/esm/dialog/error-dialog-builder.js +25 -1
  25. package/dist/esm/dialog/error-dialog-launcher.js +1 -2
  26. package/dist/esm/dialog/index.js +0 -1
  27. package/dist/esm/error-builder.js +60 -1
  28. package/dist/esm/error-launcher.js +2 -3
  29. package/dist/esm/error-util.js +0 -1
  30. package/dist/esm/index.federated.js +0 -1
  31. package/dist/esm/index.js +0 -1
  32. package/dist/esm/logger.js +0 -1
  33. package/dist/esm/notification/index.js +0 -1
  34. package/dist/esm/notification/notification-builder.js +30 -1
  35. package/dist/esm/notification/notification-launcher.js +1 -2
  36. package/dist/esm/snackbar/index.js +0 -1
  37. package/dist/esm/snackbar/snackbar-builder.js +13 -6
  38. package/dist/esm/snackbar/snackbar-launcher.js +1 -2
  39. package/dist/esm/types.js +4 -1
  40. package/dist/foundation-errors.api.json +103 -250
  41. package/dist/foundation-errors.d.ts +210 -12
  42. package/docs/.gitattributes +2 -0
  43. package/docs/api/foundation-errors.confirmingaction.md +2 -0
  44. package/docs/api/foundation-errors.dismissingaction.md +2 -0
  45. package/docs/api/foundation-errors.errorbanner.md +2 -0
  46. package/docs/api/foundation-errors.errorbannerbuilder.build.md +4 -0
  47. package/docs/api/foundation-errors.errorbannerbuilder.md +5 -3
  48. package/docs/api/foundation-errors.errorbannerbuilder.withconfirmingaction.md +4 -1
  49. package/docs/api/foundation-errors.errorbannerbuilder.withdismissingaction.md +4 -1
  50. package/docs/api/foundation-errors.errorboundaryevent.md +2 -0
  51. package/docs/api/foundation-errors.errorbuilder.build.md +3 -0
  52. package/docs/api/foundation-errors.errorbuilder.md +11 -9
  53. package/docs/api/foundation-errors.errorbuilder.withalert.md +4 -1
  54. package/docs/api/foundation-errors.errorbuilder.withbanner.md +4 -1
  55. package/docs/api/foundation-errors.errorbuilder.withdialog.md +4 -1
  56. package/docs/api/foundation-errors.errorbuilder.witherrordetails.md +4 -1
  57. package/docs/api/foundation-errors.errorbuilder.withloglevel.md +3 -0
  58. package/docs/api/foundation-errors.errorbuilder.withnotification.md +4 -1
  59. package/docs/api/foundation-errors.errorbuilder.withsnackbar.md +4 -1
  60. package/docs/api/foundation-errors.errorbuilder.withtitle.md +4 -1
  61. package/docs/api/foundation-errors.errordialog.md +2 -0
  62. package/docs/api/foundation-errors.errordialogbuilder.build.md +4 -0
  63. package/docs/api/foundation-errors.errordialogbuilder.md +5 -3
  64. package/docs/api/foundation-errors.errordialogbuilder.withconfirmingaction.md +4 -1
  65. package/docs/api/foundation-errors.errordialogbuilder.withdismissingaction.md +4 -1
  66. package/docs/api/foundation-errors.errornotification.md +3 -1
  67. package/docs/api/foundation-errors.errornotification.type.md +1 -1
  68. package/docs/api/foundation-errors.errornotificationtype.md +13 -0
  69. package/docs/api/foundation-errors.errorstructure.md +2 -0
  70. package/docs/api/foundation-errors.geterrorbannerbuilder.md +2 -0
  71. package/docs/api/foundation-errors.geterrorbuilder.md +2 -0
  72. package/docs/api/foundation-errors.geterrordialogbuilder.md +2 -0
  73. package/docs/api/foundation-errors.getnotificationbuilder.md +2 -0
  74. package/docs/api/foundation-errors.getsnackbarbuilder.md +2 -0
  75. package/docs/api/foundation-errors.md +20 -23
  76. package/docs/api/foundation-errors.notificationbuilder.build.md +4 -0
  77. package/docs/api/foundation-errors.notificationbuilder.md +6 -4
  78. package/docs/api/foundation-errors.notificationbuilder.withautoclose.md +4 -1
  79. package/docs/api/foundation-errors.notificationbuilder.withclosetimeout.md +4 -1
  80. package/docs/api/foundation-errors.notificationbuilder.withtype.md +5 -2
  81. package/docs/api/foundation-errors.snackbar.md +3 -1
  82. package/docs/api/foundation-errors.snackbar.type.md +1 -1
  83. package/docs/api/foundation-errors.snackbarbuilder.md +3 -1
  84. package/docs/api/foundation-errors.snackbarbuilder.withconfirmingaction.md +1 -1
  85. package/docs/api/foundation-errors.snackbarbuilder.withtype.md +3 -3
  86. package/docs/api/foundation-errors.snackbartype.md +13 -0
  87. package/docs/api-report.md +43 -46
  88. package/package.json +8 -8
  89. package/dist/1.0.0.remoteEntry.js +0 -1
  90. package/dist/145.145.48c3a34dc8598a016d9b.js +0 -2
  91. package/dist/145.9debf52d04b6fdb805987fa6a56e9266.js.map +0 -1
  92. package/dist/191.191.da8a5884febca6f1a439.js +0 -2
  93. package/dist/191.efd2fea1a42a47cddbf6e6ab15fbf2bb.js.map +0 -1
  94. package/dist/366.366.82702b77300a9353fc87.js +0 -2
  95. package/dist/366.a181180b871f72ff9f4ad3e3f3ea3734.js.map +0 -1
  96. package/dist/755.62d9698f4e62142b980949b517fded3f.js.map +0 -1
  97. package/dist/755.755.f8db61516204a76477a8.js +0 -2
  98. package/dist/dashboard.json +0 -1
  99. package/dist/esm/banner/error-banner-builder.js.map +0 -1
  100. package/dist/esm/banner/index.js.map +0 -1
  101. package/dist/esm/dialog/error-dialog-builder.js.map +0 -1
  102. package/dist/esm/dialog/error-dialog-launcher.js.map +0 -1
  103. package/dist/esm/dialog/index.js.map +0 -1
  104. package/dist/esm/error-builder.js.map +0 -1
  105. package/dist/esm/error-launcher.js.map +0 -1
  106. package/dist/esm/error-util.js.map +0 -1
  107. package/dist/esm/index.federated.js.map +0 -1
  108. package/dist/esm/index.js.map +0 -1
  109. package/dist/esm/logger.js.map +0 -1
  110. package/dist/esm/notification/index.js.map +0 -1
  111. package/dist/esm/notification/notification-builder.js.map +0 -1
  112. package/dist/esm/notification/notification-launcher.js.map +0 -1
  113. package/dist/esm/snackbar/index.js.map +0 -1
  114. package/dist/esm/snackbar/snackbar-builder.js.map +0 -1
  115. package/dist/esm/snackbar/snackbar-launcher.js.map +0 -1
  116. package/dist/esm/types.js.map +0 -1
  117. package/dist/favicon.ico +0 -0
  118. package/dist/foundation-errors.iife.min.js +0 -1
  119. package/dist/foundation-errors.js +0 -1240
  120. package/dist/foundation-errors.min.js +0 -1
  121. package/dist/foundationErrors.2c93e6eb2ef9200237968325716b6236.js.map +0 -1
  122. package/dist/index.ejs +0 -23
  123. package/dist/index.html +0 -10
  124. package/dist/info.ejs +0 -13
  125. package/dist/info.html +0 -14
  126. package/dist/main.32b6b5ccbc4fb35f99c6.js +0 -2
  127. package/dist/main.48adf629bdf2e8347fb7dc199f202017.js.map +0 -1
  128. package/dist/npm.consola.713.6bcc5abc1500250af5f5.js +0 -2
  129. package/dist/npm.consola.de429dd64b8dd7d3424e047e422d6ee1.js.map +0 -1
  130. package/dist/npm.microsoft.127.821cbcff47e0a34e88c9.js +0 -3
  131. package/dist/npm.microsoft.127.821cbcff47e0a34e88c9.js.LICENSE.txt +0 -14
  132. package/dist/npm.microsoft.4ae729aafa2e074df718ae9a73d16fa1.js.map +0 -1
  133. package/dist/remoteEntry.js +0 -2
  134. package/dist/serve.json +0 -3
  135. package/docs/api/foundation-errors.errordialogelement.md +0 -15
  136. package/docs/api/foundation-errors.errorelement.md +0 -15
  137. package/docs/api/foundation-errors.showdialog.md +0 -13
  138. package/docs/api/foundation-errors.shownotification.md +0 -13
  139. package/docs/api/foundation-errors.showsnackbar.md +0 -13
@@ -1,37 +1,93 @@
1
1
  import { LogLevel } from '@genesislcap/foundation-utils';
2
+ /**
3
+ * ErrorBuilder to build ErrorStructure
4
+ * @public
5
+ */
2
6
  export class ErrorBuilder {
7
+ /**
8
+ * Add title to error
9
+ * @public
10
+ * @param title - string
11
+ * @returns
12
+ */
3
13
  withTitle(title) {
4
14
  this.title = title;
5
15
  return this;
6
16
  }
17
+ /**
18
+ * Add error details to error
19
+ * @public
20
+ * @param errorDetails - string
21
+ * @returns
22
+ */
7
23
  withErrorDetails(errorDetails) {
8
24
  this.errorDetails = errorDetails;
9
25
  return this;
10
26
  }
27
+ /**
28
+ * Add log level to error
29
+ * @public
30
+ * @returns
31
+ */
11
32
  withLogLevel(logLevel) {
12
33
  this.logLevel = logLevel;
13
34
  return this;
14
35
  }
36
+ /**
37
+ * Add alert to error
38
+ * @public
39
+ * @param alert - boolean
40
+ * @returns
41
+ */
15
42
  withAlert(alert) {
16
43
  this.alert = alert;
17
44
  return this;
18
45
  }
46
+ /**
47
+ * Add notification to error
48
+ * @public
49
+ * @param notification - {@link ErrorNotification}
50
+ * @returns
51
+ */
19
52
  withNotification(notification) {
20
53
  this.notification = notification;
21
54
  return this;
22
55
  }
56
+ /**
57
+ * Add banner to error
58
+ * @public
59
+ * @param banner - {@link ErrorBanner}
60
+ * @returns
61
+ */
23
62
  withBanner(banner) {
24
63
  this.banner = banner;
25
64
  return this;
26
65
  }
66
+ /**
67
+ * Add snackbar to error
68
+ * @public
69
+ * @param snackbar - {@link Snackbar}
70
+ * @returns
71
+ */
27
72
  withSnackbar(snackbar) {
28
73
  this.snackbar = snackbar;
29
74
  return this;
30
75
  }
76
+ /**
77
+ * Add dialog to error
78
+ * @public
79
+ * @param dialog - {@link ErrorDialog}
80
+ * @returns
81
+ */
31
82
  withDialog(dialog) {
32
83
  this.dialog = dialog;
33
84
  return this;
34
85
  }
86
+ /**
87
+ * Build ErrorStructure
88
+ * @public
89
+ * @returns
90
+ */
35
91
  build() {
36
92
  if (!this.title) {
37
93
  throw new Error('Title is required');
@@ -70,5 +126,8 @@ export class ErrorBuilder {
70
126
  return errorStructure;
71
127
  }
72
128
  }
129
+ /**
130
+ * Returns a new ErrorBuilder instance
131
+ * @public
132
+ */
73
133
  export const getErrorBuilder = () => new ErrorBuilder();
74
- //# sourceMappingURL=error-builder.js.map
@@ -1,8 +1,8 @@
1
+ import { createLogger } from '@genesislcap/foundation-utils';
2
+ import { showDialog } from './dialog';
1
3
  import { getErrorDetails, getLoglevel } from './error-util';
2
4
  import { showNotification } from './notification';
3
- import { showDialog } from './dialog';
4
5
  import { showSnackbar } from './snackbar';
5
- import { createLogger } from '@genesislcap/foundation-utils';
6
6
  const logger = createLogger('foundation-error');
7
7
  const errorTypeToComponentMap = {
8
8
  alert: (error) => {
@@ -31,4 +31,3 @@ export const showError = (error, tagName) => {
31
31
  }
32
32
  });
33
33
  };
34
- //# sourceMappingURL=error-launcher.js.map
@@ -40,4 +40,3 @@ export const getErrorContainer = (id, tagName) => {
40
40
  }
41
41
  return container;
42
42
  };
43
- //# sourceMappingURL=error-util.js.map
@@ -1,2 +1 @@
1
1
  import('./index');
2
- //# sourceMappingURL=index.federated.js.map
package/dist/esm/index.js CHANGED
@@ -6,4 +6,3 @@ export * from './dialog';
6
6
  export * from './snackbar';
7
7
  export * from './error-util';
8
8
  export * from './error-launcher';
9
- //# sourceMappingURL=index.js.map
@@ -1,3 +1,2 @@
1
1
  import { createLogger } from '@genesislcap/foundation-utils';
2
2
  export const logger = createLogger('foundation-errors');
3
- //# sourceMappingURL=logger.js.map
@@ -1,3 +1,2 @@
1
1
  export * from './notification-builder';
2
2
  export * from './notification-launcher';
3
- //# sourceMappingURL=index.js.map
@@ -1,16 +1,42 @@
1
+ /**
2
+ * NotificationBuilder to build ErrorNotification
3
+ * @public
4
+ */
1
5
  export class NotificationBuilder {
6
+ /**
7
+ * Add auto close to notification
8
+ * @public
9
+ * @param autoClose - boolean
10
+ * @returns
11
+ */
2
12
  withAutoClose(autoClose) {
3
13
  this.autoClose = autoClose;
4
14
  return this;
5
15
  }
16
+ /**
17
+ * Add close timeout to notification
18
+ * @public
19
+ * @param closeTimeout - number
20
+ * @returns
21
+ */
6
22
  withCloseTimeout(closeTimeout) {
7
23
  this.closeTimeout = closeTimeout;
8
24
  return this;
9
25
  }
26
+ /**
27
+ * Add type to notification, if the type is anything other than 'warning' or 'success' do not add it
28
+ * @public
29
+ * @param type - {@link ErrorNotificationType}
30
+ * @returns
31
+ */
10
32
  withType(type) {
11
33
  this.type = type;
12
34
  return this;
13
35
  }
36
+ /**
37
+ * Build notification
38
+ * @returns ErrorNotification
39
+ */
14
40
  build() {
15
41
  let notification = {};
16
42
  if (this.autoClose) {
@@ -25,5 +51,8 @@ export class NotificationBuilder {
25
51
  return notification;
26
52
  }
27
53
  }
54
+ /**
55
+ * Get notification builder instance
56
+ * @public
57
+ */
28
58
  export const getNotificationBuilder = () => new NotificationBuilder();
29
- //# sourceMappingURL=notification-builder.js.map
@@ -1,7 +1,7 @@
1
1
  import { getErrorContainer } from '../error-util';
2
2
  /**
3
3
  * Shows the error notification
4
- * @public
4
+ * @internal
5
5
  * @param error - The ErrorStructure object
6
6
  * @param tagName - The tag name to create prefix for the design system provider & error component
7
7
  * @returns
@@ -37,4 +37,3 @@ export const showNotification = (error, tagName) => {
37
37
  toastNotify.appendChild(errorDate);
38
38
  container.appendChild(toastNotify);
39
39
  };
40
- //# sourceMappingURL=notification-launcher.js.map
@@ -1,3 +1,2 @@
1
1
  export * from './snackbar-builder';
2
2
  export * from './snackbar-launcher';
3
- //# sourceMappingURL=index.js.map
@@ -1,8 +1,12 @@
1
+ /**
2
+ * SnackbarBuilder to build Snackbar
3
+ * @public
4
+ */
1
5
  export class SnackbarBuilder {
2
6
  /**
3
- * Add type to snackbar
7
+ * Add type to snackbar, if the type is anything other than 'error' do not add it
4
8
  * @public
5
- * @param type
9
+ * @param type - {@link SnackbarType}
6
10
  * @returns
7
11
  */
8
12
  withType(type) {
@@ -12,9 +16,9 @@ export class SnackbarBuilder {
12
16
  /**
13
17
  * Add confirming action to snackbar
14
18
  * @public
15
- * @param confirmingAction
19
+ * @param confirmingAction - {@link ConfirmingAction}
16
20
  * @returns
17
- * */
21
+ */
18
22
  withConfirmingAction(confirmingAction) {
19
23
  if (!this.confirmingActions) {
20
24
  this.confirmingActions = [];
@@ -26,7 +30,7 @@ export class SnackbarBuilder {
26
30
  * Build snackbar
27
31
  * @public
28
32
  * @returns Snackbar
29
- * */
33
+ */
30
34
  build() {
31
35
  let snackbar = {};
32
36
  if (this.confirmingActions) {
@@ -38,5 +42,8 @@ export class SnackbarBuilder {
38
42
  return snackbar;
39
43
  }
40
44
  }
45
+ /**
46
+ * Get snackbar builder instance
47
+ * @public
48
+ */
41
49
  export const getSnackbarBuilder = () => new SnackbarBuilder();
42
- //# sourceMappingURL=snackbar-builder.js.map
@@ -1,7 +1,7 @@
1
1
  import { getErrorContainer } from '../error-util';
2
2
  /**
3
3
  * Shows the snackbar
4
- * @public
4
+ * @internal
5
5
  * @param error - The ErrorStructure object
6
6
  * @param tagName - The tag name to create prefix for the design system provider & error component
7
7
  * @returns
@@ -13,4 +13,3 @@ export const showSnackbar = (error, tagName) => {
13
13
  container.appendChild(snackbar);
14
14
  snackbar.error = error;
15
15
  };
16
- //# sourceMappingURL=snackbar-launcher.js.map
package/dist/esm/types.js CHANGED
@@ -1,5 +1,8 @@
1
+ /**
2
+ * @public
3
+ * enum for different types of error boundary events
4
+ */
1
5
  export var ErrorBoundaryEvent;
2
6
  (function (ErrorBoundaryEvent) {
3
7
  ErrorBoundaryEvent["ERROR_BOUNDARY_EVENT"] = "error-boundary-event";
4
8
  })(ErrorBoundaryEvent || (ErrorBoundaryEvent = {}));
5
- //# sourceMappingURL=types.js.map