@genesislcap/pbc-notify-ui 15.0.0 → 15.1.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.
@@ -1,12 +1,13 @@
1
1
  import { Auth, Connect } from '@genesislcap/foundation-comms';
2
2
  import { Expression } from '@genesislcap/foundation-criteria';
3
3
  import type { Tabs } from '@genesislcap/foundation-ui';
4
- import { GenesisElement } from '@genesislcap/web-core';
4
+ import { GenesisElement, ViewTemplate } from '@genesislcap/web-core';
5
5
  import { AlertService } from '../../../services/alert.service';
6
6
  import { FoundationInboxService } from '../../../services/inbox.service';
7
7
  import { NotifyChannel, NotifyRoute, NotifyRouteService } from '../../../services/notify-route.service';
8
8
  import { RuleService } from '../../../services/rule.service';
9
9
  import { TemplateService } from '../../../services/template.service';
10
+ import type { FoundationInbox } from '../inbox';
10
11
  import { Alert, InboxTab, NotificationRuleTemplateReply, Rule, RuleTemplate } from '../inbox.types';
11
12
  export declare class FoundationInboxBase extends GenesisElement {
12
13
  auth: Auth;
@@ -17,6 +18,41 @@ export declare class FoundationInboxBase extends GenesisElement {
17
18
  private alerts;
18
19
  alertsFilter: Alert[];
19
20
  moreAlerts: boolean;
21
+ /**
22
+ * Optional per-row template for the Alerts / Alert History lists. When set, it replaces the
23
+ * default alert row (the `.toast` element) and is rendered with the alert as its source (`x`)
24
+ * and the inbox host as `c.parent`, mirroring the internal `html<Alert, FoundationInbox>` row.
25
+ * When unset, the built-in row is used, so existing consumers are unaffected.
26
+ *
27
+ * @public
28
+ */
29
+ renderAlert: ViewTemplate<Alert, FoundationInbox> | undefined;
30
+ /**
31
+ * Hide the Severity filter block in the search bar. Set via the `hide-severity-filter`
32
+ * attribute or property. @public
33
+ */
34
+ hideSeverityFilter: boolean;
35
+ /**
36
+ * Hide the Date Range filter block in the search bar. Set via the `hide-date-range`
37
+ * attribute or property. @public
38
+ */
39
+ hideDateRange: boolean;
40
+ /**
41
+ * Hide the Search-by-Title field in the search bar. Set via the `hide-title-search`
42
+ * attribute or property. @public
43
+ */
44
+ hideTitleSearch: boolean;
45
+ /**
46
+ * Hide the Search-by-Body field in the search bar. Set via the `hide-body-search`
47
+ * attribute or property. @public
48
+ */
49
+ hideBodySearch: boolean;
50
+ /**
51
+ * Optional click handler for an alert row, fired with the clicked alert so consumers can open
52
+ * the related record. Interactive elements inside a custom {@link renderAlert} template should
53
+ * call `event.stopPropagation()` to avoid triggering this. @public
54
+ */
55
+ onAlertClick: ((alert: Alert) => void) | undefined;
20
56
  ruleService: RuleService;
21
57
  rules: Rule[];
22
58
  templateService: TemplateService;
@@ -39,7 +75,7 @@ export declare class FoundationInboxBase extends GenesisElement {
39
75
  toDatePickerValue: string;
40
76
  criteriaMatchAlertStatus: Expression;
41
77
  reverse: boolean;
42
- sortDirection: string;
78
+ sortDirection: 'Asc' | 'Desc';
43
79
  showLoadingIndicator: boolean;
44
80
  severityType: any[];
45
81
  tabs: Tabs;
@@ -1 +1 @@
1
- {"version":3,"file":"inbox-base.d.ts","sourceRoot":"","sources":["../../../../../src/components/foundation-inbox/inbox-base/inbox-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAEL,UAAU,EAKX,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAc,MAAM,uBAAuB,CAAC;AAKnE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAmB,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EACL,aAAa,EACb,WAAW,EACX,kBAAkB,EACnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAIrE,OAAO,EAAE,KAAK,E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6BAA6B,CAAC,IAAI,CAAC,EAAE,MAAM;CAG5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"inbox.template.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox/inbox.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAmM/C;;GAEG;AACH,eAAO,MAAM,uBAAuB,sEAiJnC,CAAC"}
1
+ {"version":3,"file":"inbox.template.d.ts","sourceRoot":"","sources":["../../../../src/components/foundation-inbox/inbox.template.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAiO/C;;GAEG;AACH,eAAO,MAAM,uBAAuB,sEAiJnC,CAAC"}
@@ -2,7 +2,8 @@ export * from './components/foundation-inbox/inbox';
2
2
  export * from './components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout';
3
3
  export * from './components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter';
4
4
  export * from './components/foundation-notification-dashboard';
5
- export type { ParameterEditedEventDetail, RuleParameterEntity, } from './components/foundation-inbox/inbox.types';
5
+ export type { Alert, ParameterEditedEventDetail, RuleParameterEntity, } from './components/foundation-inbox/inbox.types';
6
+ export { AlertStatus } from './components/foundation-inbox/inbox.types';
6
7
  export type { ConditionBuilderEntity } from './notify.types';
7
8
  export type { ParameterBuilderEntity } from './components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.types';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,0FAA0F,CAAC;AACzG,cAAc,4FAA4F,CAAC;AAC3G,cAAc,gDAAgD,CAAC;AAC/D,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,2CAA2C,CAAC;AACnD,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,YAAY,EAAE,sBAAsB,EAAE,MAAM,2GAA2G,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,0FAA0F,CAAC;AACzG,cAAc,4FAA4F,CAAC;AAC3G,cAAc,gDAAgD,CAAC;AAC/D,YAAY,EACV,KAAK,EACL,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,YAAY,EAAE,sBAAsB,EAAE,MAAM,2GAA2G,CAAC"}
@@ -225,17 +225,6 @@ export declare const TemplateDialog: React.ForwardRefExoticComponent<
225
225
  >;
226
226
  export type TemplateDialogRef = TemplateDialogWC;
227
227
 
228
- export declare const RuleConditionGroup: React.ForwardRefExoticComponent<
229
- React.PropsWithChildren<
230
- Omit<PublicOf<RuleConditionGroupWC>, 'children' | 'style'> &
231
- HTMLWCProps & {
232
- onDelete?: (event: CustomEvent<unknown>) => void;
233
- onEdit?: (event: CustomEvent<unknown>) => void;
234
- }
235
- > & React.RefAttributes<RuleConditionGroupWC>
236
- >;
237
- export type RuleConditionGroupRef = RuleConditionGroupWC;
238
-
239
228
  export declare const RuleConditionBuilder: React.ForwardRefExoticComponent<
240
229
  React.PropsWithChildren<
241
230
  Omit<PublicOf<RuleConditionBuilderWC>, 'children' | 'style'> &
@@ -247,6 +236,17 @@ export declare const RuleConditionBuilder: React.ForwardRefExoticComponent<
247
236
  >;
248
237
  export type RuleConditionBuilderRef = RuleConditionBuilderWC;
249
238
 
239
+ export declare const RuleConditionGroup: React.ForwardRefExoticComponent<
240
+ React.PropsWithChildren<
241
+ Omit<PublicOf<RuleConditionGroupWC>, 'children' | 'style'> &
242
+ HTMLWCProps & {
243
+ onDelete?: (event: CustomEvent<unknown>) => void;
244
+ onEdit?: (event: CustomEvent<unknown>) => void;
245
+ }
246
+ > & React.RefAttributes<RuleConditionGroupWC>
247
+ >;
248
+ export type RuleConditionGroupRef = RuleConditionGroupWC;
249
+
250
250
  export declare const ParameterBuilder: React.ForwardRefExoticComponent<
251
251
  React.PropsWithChildren<
252
252
  Omit<PublicOf<ParameterBuilderWC>, 'children' | 'style'> &
@@ -258,17 +258,6 @@ export declare const ParameterBuilder: React.ForwardRefExoticComponent<
258
258
  >;
259
259
  export type ParameterBuilderRef = ParameterBuilderWC;
260
260
 
261
- export declare const TemplateConditionGroup: React.ForwardRefExoticComponent<
262
- React.PropsWithChildren<
263
- Omit<PublicOf<TemplateConditionGroupWC>, 'children' | 'style'> &
264
- HTMLWCProps & {
265
- onDelete?: (event: CustomEvent<unknown>) => void;
266
- onEdit?: (event: CustomEvent<unknown>) => void;
267
- }
268
- > & React.RefAttributes<TemplateConditionGroupWC>
269
- >;
270
- export type TemplateConditionGroupRef = TemplateConditionGroupWC;
271
-
272
261
  export declare const TemplateConditionBuilder: React.ForwardRefExoticComponent<
273
262
  React.PropsWithChildren<
274
263
  Omit<PublicOf<TemplateConditionBuilderWC>, 'children' | 'style'> &
@@ -280,4 +269,15 @@ export declare const TemplateConditionBuilder: React.ForwardRefExoticComponent<
280
269
  >;
281
270
  export type TemplateConditionBuilderRef = TemplateConditionBuilderWC;
282
271
 
272
+ export declare const TemplateConditionGroup: React.ForwardRefExoticComponent<
273
+ React.PropsWithChildren<
274
+ Omit<PublicOf<TemplateConditionGroupWC>, 'children' | 'style'> &
275
+ HTMLWCProps & {
276
+ onDelete?: (event: CustomEvent<unknown>) => void;
277
+ onEdit?: (event: CustomEvent<unknown>) => void;
278
+ }
279
+ > & React.RefAttributes<TemplateConditionGroupWC>
280
+ >;
281
+ export type TemplateConditionGroupRef = TemplateConditionGroupWC;
282
+
283
283
  export {};
@@ -2,7 +2,7 @@ import { __awaiter, __decorate, __rest } from "tslib";
2
2
  import { Auth, Connect } from '@genesislcap/foundation-comms';
3
3
  import { CriteriaBuilder, ExpressionBuilder, Join, Serialisers, } from '@genesislcap/foundation-criteria';
4
4
  import { showNotificationDialog } from '@genesislcap/foundation-notifications';
5
- import { GenesisElement, observable } from '@genesislcap/web-core';
5
+ import { attr, GenesisElement, observable } from '@genesislcap/web-core';
6
6
  import dayjs from 'dayjs';
7
7
  import utc from 'dayjs/plugin/utc';
8
8
  import debounce from 'lodash.debounce';
@@ -32,6 +32,41 @@ export class FoundationInboxBase extends GenesisElement {
32
32
  this.alerts = [];
33
33
  this.alertsFilter = [];
34
34
  this.moreAlerts = false;
35
+ /**
36
+ * Optional per-row template for the Alerts / Alert History lists. When set, it replaces the
37
+ * default alert row (the `.toast` element) and is rendered with the alert as its source (`x`)
38
+ * and the inbox host as `c.parent`, mirroring the internal `html<Alert, FoundationInbox>` row.
39
+ * When unset, the built-in row is used, so existing consumers are unaffected.
40
+ *
41
+ * @public
42
+ */
43
+ this.renderAlert = undefined;
44
+ /**
45
+ * Hide the Severity filter block in the search bar. Set via the `hide-severity-filter`
46
+ * attribute or property. @public
47
+ */
48
+ this.hideSeverityFilter = false;
49
+ /**
50
+ * Hide the Date Range filter block in the search bar. Set via the `hide-date-range`
51
+ * attribute or property. @public
52
+ */
53
+ this.hideDateRange = false;
54
+ /**
55
+ * Hide the Search-by-Title field in the search bar. Set via the `hide-title-search`
56
+ * attribute or property. @public
57
+ */
58
+ this.hideTitleSearch = false;
59
+ /**
60
+ * Hide the Search-by-Body field in the search bar. Set via the `hide-body-search`
61
+ * attribute or property. @public
62
+ */
63
+ this.hideBodySearch = false;
64
+ /**
65
+ * Optional click handler for an alert row, fired with the clicked alert so consumers can open
66
+ * the related record. Interactive elements inside a custom {@link renderAlert} template should
67
+ * call `event.stopPropagation()` to avoid triggering this. @public
68
+ */
69
+ this.onAlertClick = undefined;
35
70
  this.rules = [];
36
71
  this.templates = [];
37
72
  this.templatesFilter = [];
@@ -52,7 +87,7 @@ export class FoundationInboxBase extends GenesisElement {
52
87
  this.fromDatePickerValue = null;
53
88
  this.toDatePickerValue = null;
54
89
  this.reverse = false;
55
- this.sortDirection = 'Asc';
90
+ this.sortDirection = 'Desc';
56
91
  this.showLoadingIndicator = false;
57
92
  this.severityType = [];
58
93
  this.alertSubscription = ({ store }) => {
@@ -464,6 +499,24 @@ __decorate([
464
499
  __decorate([
465
500
  observable
466
501
  ], FoundationInboxBase.prototype, "moreAlerts", void 0);
502
+ __decorate([
503
+ observable
504
+ ], FoundationInboxBase.prototype, "renderAlert", void 0);
505
+ __decorate([
506
+ attr({ mode: 'boolean' })
507
+ ], FoundationInboxBase.prototype, "hideSeverityFilter", void 0);
508
+ __decorate([
509
+ attr({ mode: 'boolean' })
510
+ ], FoundationInboxBase.prototype, "hideDateRange", void 0);
511
+ __decorate([
512
+ attr({ mode: 'boolean' })
513
+ ], FoundationInboxBase.prototype, "hideTitleSearch", void 0);
514
+ __decorate([
515
+ attr({ mode: 'boolean' })
516
+ ], FoundationInboxBase.prototype, "hideBodySearch", void 0);
517
+ __decorate([
518
+ observable
519
+ ], FoundationInboxBase.prototype, "onAlertClick", void 0);
467
520
  __decorate([
468
521
  RuleService
469
522
  ], FoundationInboxBase.prototype, "ruleService", void 0);
@@ -1,4 +1,4 @@
1
- import { html, ref, repeat, sync, when } from '@genesislcap/web-core';
1
+ import { html, ref, repeat, sync, when, whenElse } from '@genesislcap/web-core';
2
2
  import { eventDetail } from '../../utils';
3
3
  import { NotifyPermission } from '../../utils/notifyPermissions';
4
4
  import { AlertStatus, InboxTab } from './inbox.types';
@@ -11,7 +11,9 @@ const alertsTab = (tab) => html `
11
11
  style=${(x) => (x.selectedTab === tab ? '' : 'display: none;')}
12
12
  >
13
13
  <div class="search">
14
- <div style="display: flex; flex-direction: column;">
14
+ <div
15
+ style=${(x) => x.hideSeverityFilter ? 'display: none;' : 'display: flex; flex-direction: column;'}
16
+ >
15
17
  <label part="label" for="control" class="search-label">
16
18
  <slot>Severity</slot>
17
19
  </label>
@@ -63,7 +65,9 @@ const alertsTab = (tab) => html `
63
65
  </div>
64
66
  </div>
65
67
 
66
- <div style="display: flex; flex-direction: column;">
68
+ <div
69
+ style=${(x) => x.hideDateRange ? 'display: none;' : 'display: flex; flex-direction: column;'}
70
+ >
67
71
  <label part="label" for="control" class="search-label">
68
72
  <slot>Date Range</slot>
69
73
  </label>
@@ -92,6 +96,7 @@ const alertsTab = (tab) => html `
92
96
 
93
97
  <rapid-text-field
94
98
  class="search-input"
99
+ style=${(x) => (x.hideTitleSearch ? 'display: none;' : '')}
95
100
  :value=${(x) => x.titleSearchValue}
96
101
  @input=${(x, c) => {
97
102
  x.titleSearchValue = c.event.target.value;
@@ -103,6 +108,7 @@ const alertsTab = (tab) => html `
103
108
 
104
109
  <rapid-text-field
105
110
  class="search-input"
111
+ style=${(x) => (x.hideBodySearch ? 'display: none;' : '')}
106
112
  :value=${(x) => x.bodySearchValue}
107
113
  @input=${(x, c) => {
108
114
  x.bodySearchValue = c.event.target.value;
@@ -118,8 +124,8 @@ const alertsTab = (tab) => html `
118
124
  <slot>Sort By</slot>
119
125
  </label>
120
126
  <rapid-segmented-control :value=${sync((x) => x.sortDirection)}>
121
- <rapid-segmented-item checked value="Asc">Asc</rapid-segmented-item>
122
- <rapid-segmented-item value="Desc">Desc</rapid-segmented-item>
127
+ <rapid-segmented-item value="Asc">Asc</rapid-segmented-item>
128
+ <rapid-segmented-item checked value="Desc">Desc</rapid-segmented-item>
123
129
  </rapid-segmented-control>
124
130
  </div>
125
131
  ${when(() => tab === InboxTab.ALERTS_NEW, html `
@@ -137,24 +143,42 @@ const alertsTab = (tab) => html `
137
143
 
138
144
  <div class="alert-log-tab-content" part="alert-log">
139
145
  ${repeat((x) => x.alertsFilter, html `
140
- <div class="toast" id=${(x) => x.ALERT_ID}>
141
- <div
142
- class="toast-severity"
143
- style="background-color: ${(x) => getSeverityColor(x.NOTIFY_SEVERITY)}"
144
- ></div>
146
+ <div
147
+ class="alert-row"
148
+ style=${(x, c) => (c.parent.onAlertClick ? 'cursor: pointer;' : '')}
149
+ @click=${(x, c) => { var _a, _b; return (_b = (_a = c.parent).onAlertClick) === null || _b === void 0 ? void 0 : _b.call(_a, x); }}
150
+ >
151
+ ${whenElse((x, c) => !!c.parent.renderAlert, html `
152
+ ${(x, c) => c.parent.renderAlert}
153
+ `, html `
154
+ <div class="toast" id=${(x) => x.ALERT_ID}>
155
+ <div
156
+ class="toast-severity"
157
+ style="background-color: ${(x) => getSeverityColor(x.NOTIFY_SEVERITY)}"
158
+ ></div>
145
159
 
146
- <div class="toast-content">
147
- ${when((x) => x.ALERT_STATUS === AlertStatus.NEW, html `
148
- <div class="close-icon" @click=${(x, c) => c.parent.dismissAlert(x.ALERT_ID)}>
149
- <rapid-icon name="times"></rapid-icon>
160
+ <div class="toast-content">
161
+ ${when((x) => x.ALERT_STATUS === AlertStatus.NEW, html `
162
+ <div
163
+ class="close-icon"
164
+ @click=${(x, c) => {
165
+ c.event.stopPropagation();
166
+ c.parent.dismissAlert(x.ALERT_ID);
167
+ }}
168
+ >
169
+ <rapid-icon name="times"></rapid-icon>
170
+ </div>
171
+ `)}
172
+ <span class="toast-header">${(x) => x.HEADER}</span>
173
+ <span class="toast-message">${(x) => x.MESSAGE}</span>
174
+ <div class="toast-bottom" slot="bottom">
175
+ <span class="toast-date" slot="date">
176
+ ${(x) => getFormattedDate(x.CREATED_AT)}
177
+ </span>
178
+ </div>
150
179
  </div>
151
- `)}
152
- <span class="toast-header">${(x) => x.HEADER}</span>
153
- <span class="toast-message">${(x) => x.MESSAGE}</span>
154
- <div class="toast-bottom" slot="bottom">
155
- <span class="toast-date" slot="date">${(x) => getFormattedDate(x.CREATED_AT)}</span>
156
- </div>
157
- </div>
180
+ </div>
181
+ `)}
158
182
  </div>
159
183
  `)}
160
184
  ${when((x) => x.alertsFilter.length === 0 && !x.showLoadingIndicator, html `
package/dist/esm/index.js CHANGED
@@ -2,3 +2,4 @@ export * from './components/foundation-inbox/inbox';
2
2
  export * from './components/foundation-inbox/components/foundation-inbox-flyout/foundation-inbox-flyout';
3
3
  export * from './components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter';
4
4
  export * from './components/foundation-notification-dashboard';
5
+ export { AlertStatus } from './components/foundation-inbox/inbox.types';