@everymatrix/nuts-inbox-widget 1.94.116 → 1.94.118
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/dist/cjs/{index-4522ef7e.js → index-a1087740.js} +8 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/nuts-inbox-widget.cjs.js +2 -2
- package/dist/cjs/nuts-inbox-widget_3.cjs.entry.js +44 -20
- package/dist/collection/api/methods/index.js +3 -2
- package/dist/collection/cache/notification-cache.js +17 -10
- package/dist/collection/components/nuts-popover/nuts-popover.js +25 -8
- package/dist/esm/{index-0160662f.js → index-2eda31b2.js} +8 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/nuts-inbox-widget.js +3 -3
- package/dist/esm/nuts-inbox-widget_3.entry.js +44 -20
- package/dist/nuts-inbox-widget/{index-0160662f.js → index-2eda31b2.js} +2 -2
- package/dist/nuts-inbox-widget/nuts-inbox-widget.esm.js +1 -1
- package/dist/nuts-inbox-widget/nuts-inbox-widget_3.entry.js +1 -1
- package/dist/types/cache/notification-cache.d.ts +1 -0
- package/dist/types/components/nuts-popover/nuts-popover.d.ts +2 -0
- package/hydrate/index.js +46 -21
- package/hydrate/index.mjs +46 -21
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'nuts-inbox-widget';
|
|
24
|
-
const BUILD = /* nuts-inbox-widget */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback:
|
|
24
|
+
const BUILD = /* nuts-inbox-widget */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
27
|
Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -1345,6 +1345,9 @@ var connectedCallback = (elm) => {
|
|
|
1345
1345
|
}
|
|
1346
1346
|
};
|
|
1347
1347
|
var disconnectInstance = (instance) => {
|
|
1348
|
+
{
|
|
1349
|
+
safeCall(instance, "disconnectedCallback");
|
|
1350
|
+
}
|
|
1348
1351
|
};
|
|
1349
1352
|
var disconnectedCallback = async (elm) => {
|
|
1350
1353
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1355,8 +1358,10 @@ var disconnectedCallback = async (elm) => {
|
|
|
1355
1358
|
hostRef.$rmListeners$ = void 0;
|
|
1356
1359
|
}
|
|
1357
1360
|
}
|
|
1358
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$)
|
|
1359
|
-
hostRef.$
|
|
1361
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1362
|
+
disconnectInstance(hostRef.$lazyInstance$);
|
|
1363
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1364
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
|
|
1360
1365
|
}
|
|
1361
1366
|
}
|
|
1362
1367
|
};
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-a1087740.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["nuts-inbox-widget_3.cjs",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"],[8,"closePopover","closePopoverHandler"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"deviceId":["initializeHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"isNotificationsLoading":[32],"showMarkAll":[32],"limitStylingAppends":[32],"showDeleteAllPopup":[32],"hasMore":[32]},[[8,"messageDeleted","messageDeletedHandler"],[8,"messageRead","messageReadHandler"],[8,"click","clickOutsideHandle"]],{"unseenCount":["unseenCountHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"maxTextLength":[514,"max-text-length"],"maxLines":[514,"max-lines"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32],"limitStylingAppends":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"],[8,"click","clickOutsideHandle"]],{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
11
|
+
return index.bootstrapLazy([["nuts-inbox-widget_3.cjs",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"],[8,"closePopover","closePopoverHandler"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"deviceId":["initializeHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"isNotificationsLoading":[32],"showMarkAll":[32],"limitStylingAppends":[32],"showDeleteAllPopup":[32],"hasMore":[32],"currentPage":[32]},[[8,"messageDeleted","messageDeletedHandler"],[8,"messageRead","messageReadHandler"],[8,"click","clickOutsideHandle"]],{"unseenCount":["unseenCountHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"maxTextLength":[514,"max-text-length"],"maxLines":[514,"max-lines"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32],"limitStylingAppends":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"],[8,"click","clickOutsideHandle"]],{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-a1087740.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["nuts-inbox-widget_3.cjs",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"],[8,"closePopover","closePopoverHandler"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"deviceId":["initializeHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"isNotificationsLoading":[32],"showMarkAll":[32],"limitStylingAppends":[32],"showDeleteAllPopup":[32],"hasMore":[32]},[[8,"messageDeleted","messageDeletedHandler"],[8,"messageRead","messageReadHandler"],[8,"click","clickOutsideHandle"]],{"unseenCount":["unseenCountHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"maxTextLength":[514,"max-text-length"],"maxLines":[514,"max-lines"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32],"limitStylingAppends":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"],[8,"click","clickOutsideHandle"]],{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["nuts-inbox-widget_3.cjs",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"],[8,"closePopover","closePopoverHandler"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"deviceId":["initializeHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"isNotificationsLoading":[32],"showMarkAll":[32],"limitStylingAppends":[32],"showDeleteAllPopup":[32],"hasMore":[32],"currentPage":[32]},[[8,"messageDeleted","messageDeletedHandler"],[8,"messageRead","messageReadHandler"],[8,"click","clickOutsideHandle"]],{"unseenCount":["unseenCountHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"maxTextLength":[514,"max-text-length"],"maxLines":[514,"max-lines"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32],"limitStylingAppends":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"],[8,"click","clickOutsideHandle"]],{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-a1087740.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE = 'en';
|
|
8
8
|
const TRANSLATIONS = {
|
|
@@ -4281,6 +4281,7 @@ const markAsRead = async ({ baseUrl, body, token, unread }) => {
|
|
|
4281
4281
|
}
|
|
4282
4282
|
};
|
|
4283
4283
|
const getNotifications = async ({ baseUrl, page, token }) => {
|
|
4284
|
+
var _a;
|
|
4284
4285
|
const url = new URL(`${baseUrl}/widgets/notifications/feed`);
|
|
4285
4286
|
const headers = new Headers();
|
|
4286
4287
|
url.searchParams.append('page', page.toString());
|
|
@@ -4295,7 +4296,7 @@ const getNotifications = async ({ baseUrl, page, token }) => {
|
|
|
4295
4296
|
return {
|
|
4296
4297
|
numberOfNotifications: data.totalCount,
|
|
4297
4298
|
notifications: data.data,
|
|
4298
|
-
hasMore: data.hasMore
|
|
4299
|
+
hasMore: (_a = data.hasMore) !== null && _a !== void 0 ? _a : false
|
|
4299
4300
|
};
|
|
4300
4301
|
}
|
|
4301
4302
|
catch (error) {
|
|
@@ -4303,7 +4304,7 @@ const getNotifications = async ({ baseUrl, page, token }) => {
|
|
|
4303
4304
|
return {
|
|
4304
4305
|
numberOfNotifications: 0,
|
|
4305
4306
|
notifications: [],
|
|
4306
|
-
hasMore:
|
|
4307
|
+
hasMore: false
|
|
4307
4308
|
};
|
|
4308
4309
|
}
|
|
4309
4310
|
};
|
|
@@ -4368,15 +4369,23 @@ class NotificationCache {
|
|
|
4368
4369
|
this.syncCurrentPage();
|
|
4369
4370
|
}
|
|
4370
4371
|
syncCurrentPage() {
|
|
4371
|
-
var _a;
|
|
4372
|
+
var _a, _b, _c;
|
|
4372
4373
|
const entry = this.cache.get(this.currentPage);
|
|
4373
4374
|
const notifications = (_a = entry === null || entry === void 0 ? void 0 : entry.notifications) !== null && _a !== void 0 ? _a : [];
|
|
4374
|
-
const hasMore = entry === null || entry === void 0 ? void 0 : entry.hasMore;
|
|
4375
|
-
this.onPageUpdate([...notifications], hasMore);
|
|
4375
|
+
const hasMore = (_b = entry === null || entry === void 0 ? void 0 : entry.hasMore) !== null && _b !== void 0 ? _b : false;
|
|
4376
|
+
(_c = this.onPageUpdate) === null || _c === void 0 ? void 0 : _c.call(this, [...notifications], hasMore);
|
|
4377
|
+
}
|
|
4378
|
+
updatePagesInPlace(updater) {
|
|
4379
|
+
for (const [page, entry] of this.cache.entries()) {
|
|
4380
|
+
this.cache.set(page, {
|
|
4381
|
+
notifications: updater(entry.notifications, page),
|
|
4382
|
+
hasMore: entry.hasMore
|
|
4383
|
+
});
|
|
4384
|
+
}
|
|
4385
|
+
this.syncCurrentPage();
|
|
4376
4386
|
}
|
|
4377
4387
|
deleteById(id) {
|
|
4378
|
-
|
|
4379
|
-
this.updateCache(updatedNotifications);
|
|
4388
|
+
this.updatePagesInPlace((notifications) => notifications.filter((n) => n.id !== id));
|
|
4380
4389
|
}
|
|
4381
4390
|
addToFront(notification) {
|
|
4382
4391
|
if (!this.cache.get(0)) {
|
|
@@ -4386,12 +4395,10 @@ class NotificationCache {
|
|
|
4386
4395
|
this.updateCache(updatedNotifications);
|
|
4387
4396
|
}
|
|
4388
4397
|
markAsRead(id, mark) {
|
|
4389
|
-
|
|
4390
|
-
this.updateCache(updatedNotifications);
|
|
4398
|
+
this.updatePagesInPlace((notifications) => notifications.map((n) => (n.id === id ? Object.assign(Object.assign({}, n), mark) : n)));
|
|
4391
4399
|
}
|
|
4392
4400
|
markAllAsRead() {
|
|
4393
|
-
|
|
4394
|
-
this.updateCache(updatedNotifications);
|
|
4401
|
+
this.updatePagesInPlace((notifications) => notifications.map((n) => (Object.assign(Object.assign({}, n), { read: true, seen: true }))));
|
|
4395
4402
|
}
|
|
4396
4403
|
clearAll() {
|
|
4397
4404
|
this.resetCache();
|
|
@@ -4402,12 +4409,13 @@ class NotificationCache {
|
|
|
4402
4409
|
this.cache.set(0, { notifications: [], hasMore: false });
|
|
4403
4410
|
}
|
|
4404
4411
|
async loadPageFromApi(page, loader) {
|
|
4412
|
+
var _a;
|
|
4405
4413
|
if (this.cache.has(page)) {
|
|
4406
4414
|
this.setCurrentPage(page);
|
|
4407
4415
|
return;
|
|
4408
4416
|
}
|
|
4409
4417
|
const data = await loader();
|
|
4410
|
-
this.cache.set(page, { notifications: data.notifications, hasMore: data.hasMore });
|
|
4418
|
+
this.cache.set(page, { notifications: data.notifications, hasMore: (_a = data.hasMore) !== null && _a !== void 0 ? _a : false });
|
|
4411
4419
|
this.setCurrentPage(page);
|
|
4412
4420
|
}
|
|
4413
4421
|
getAllFromCache() {
|
|
@@ -42750,7 +42758,7 @@ const NutsPopover = class {
|
|
|
42750
42758
|
this.allNotificationsRead = index.createEvent(this, "allNotificationsRead", 7);
|
|
42751
42759
|
this.allMessagesDeteled = index.createEvent(this, "allMessagesDeleted", 7);
|
|
42752
42760
|
this.closePopoverEmmiter = index.createEvent(this, "closePopover", 7);
|
|
42753
|
-
this.
|
|
42761
|
+
this.loadGeneration = 0;
|
|
42754
42762
|
this.nextPage = async () => {
|
|
42755
42763
|
this.currentPage++;
|
|
42756
42764
|
this.triggerGetNotifications();
|
|
@@ -42835,7 +42843,8 @@ const NutsPopover = class {
|
|
|
42835
42843
|
this.showMarkAll = false;
|
|
42836
42844
|
this.limitStylingAppends = false;
|
|
42837
42845
|
this.showDeleteAllPopup = false;
|
|
42838
|
-
this.hasMore =
|
|
42846
|
+
this.hasMore = false;
|
|
42847
|
+
this.currentPage = 0;
|
|
42839
42848
|
}
|
|
42840
42849
|
messageDeletedHandler(event) {
|
|
42841
42850
|
notificationCache.deleteById(event.detail);
|
|
@@ -42890,6 +42899,7 @@ const NutsPopover = class {
|
|
|
42890
42899
|
// end custom styling area
|
|
42891
42900
|
}
|
|
42892
42901
|
async triggerGetNotifications() {
|
|
42902
|
+
const generation = this.loadGeneration;
|
|
42893
42903
|
this.isNotificationsLoading = true;
|
|
42894
42904
|
try {
|
|
42895
42905
|
await notificationCache.loadPageFromApi(this.currentPage, async () => getNotifications({
|
|
@@ -42899,12 +42909,22 @@ const NutsPopover = class {
|
|
|
42899
42909
|
}));
|
|
42900
42910
|
}
|
|
42901
42911
|
finally {
|
|
42902
|
-
this.
|
|
42912
|
+
if (generation === this.loadGeneration) {
|
|
42913
|
+
this.isNotificationsLoading = false;
|
|
42914
|
+
}
|
|
42903
42915
|
}
|
|
42904
42916
|
}
|
|
42905
42917
|
connectedCallback() {
|
|
42906
42918
|
this.baseUrl = `${this.backendUrl}/v1/${this.operatorId}`;
|
|
42919
|
+
this.currentPage = 0;
|
|
42920
|
+
this.hasMore = false;
|
|
42921
|
+
this.isNotificationsLoading = true;
|
|
42922
|
+
this.loadGeneration++;
|
|
42923
|
+
const generation = this.loadGeneration;
|
|
42907
42924
|
notificationCache.observePageUpdate((notifications, hasMore) => {
|
|
42925
|
+
if (generation !== this.loadGeneration) {
|
|
42926
|
+
return;
|
|
42927
|
+
}
|
|
42908
42928
|
if ((notifications === null || notifications === void 0 ? void 0 : notifications.length) === 0 && this.currentPage > 0) {
|
|
42909
42929
|
// if it's last notification on it's page go back a page and retrigger
|
|
42910
42930
|
this.currentPage--;
|
|
@@ -42912,23 +42932,27 @@ const NutsPopover = class {
|
|
|
42912
42932
|
return;
|
|
42913
42933
|
}
|
|
42914
42934
|
this.notifications = notifications;
|
|
42915
|
-
this.hasMore = hasMore;
|
|
42935
|
+
this.hasMore = hasMore !== null && hasMore !== void 0 ? hasMore : false;
|
|
42916
42936
|
});
|
|
42917
42937
|
this.triggerGetNotifications();
|
|
42918
42938
|
if (this.unseenCount != 0) {
|
|
42919
42939
|
this.showMarkAll = true;
|
|
42920
42940
|
}
|
|
42921
42941
|
}
|
|
42942
|
+
disconnectedCallback() {
|
|
42943
|
+
this.loadGeneration++;
|
|
42944
|
+
this.isNotificationsLoading = false;
|
|
42945
|
+
}
|
|
42922
42946
|
render() {
|
|
42923
42947
|
var _a, _b;
|
|
42924
|
-
return (index.h("div", { key: '
|
|
42948
|
+
return (index.h("div", { key: 'df45b2b7da683f9895151d698a4c7def899e13d4', class: "Popover", ref: this.assignRefToStylingContainer }, index.h("div", { key: '87e638b07e89b39d9b9fa60807d5e792ef9ecece', class: "Header" }, index.h("div", { key: '238839de9ec5734950b916924d3469081b10714c', class: "Title" }, translate$1('notifications', this.language), this.unseenCount > 0 ? index.h("div", { class: "UnseenCounter" }, this.unseenCount) : ''), this.showMarkAll && (index.h("div", { key: 'efc165ffdc077d09ee2f90c5758eca8b1c048d9f', class: "MarkAsRead", onClick: this.markAllNotificationsAsRead }, translate$1('markAllAsRead', this.language))), index.h("div", { key: 'b941c6a87a071d9e45d38528d889e7dbc8848ef4', class: "ActionButtons" }, index.h("button", { key: '33d9e1f7857a80936e6b65e1fa2ecbc3c55e4e4f', class: `DeleteAll${this.showDeleteAllPopup ? ' Active' : ''}`, onClick: this.showDeletePopup, disabled: !((_a = this.notifications) === null || _a === void 0 ? void 0 : _a.length) }, index.h("svg", { key: '3b87ea1d8e1c5942db86e18cf26e176031afef6a', width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '915823d5da7a4e12d578fe9db6b968253ceba418', d: "M4.375 15.4375C4.375 16.1758 4.94922 16.75 5.6875 16.75H13.5625C14.2734 16.75 14.875 16.1758 14.875 15.4375V6.25H4.375V15.4375ZM11.8125 8.4375C11.8125 8.21875 12.0039 8 12.25 8C12.4688 8 12.6875 8.21875 12.6875 8.4375V14.5625C12.6875 14.8086 12.4688 15 12.25 15C12.0039 15 11.8125 14.8086 11.8125 14.5625V8.4375ZM9.1875 8.4375C9.1875 8.21875 9.37891 8 9.625 8C9.84375 8 10.0625 8.21875 10.0625 8.4375V14.5625C10.0625 14.8086 9.84375 15 9.625 15C9.37891 15 9.1875 14.8086 9.1875 14.5625V8.4375ZM6.5625 8.4375C6.5625 8.21875 6.75391 8 7 8C7.21875 8 7.4375 8.21875 7.4375 8.4375V14.5625C7.4375 14.8086 7.21875 15 7 15C6.75391 15 6.5625 14.8086 6.5625 14.5625V8.4375ZM15.3125 3.625H12.25L11.9219 2.99609C11.8398 2.85938 11.7031 2.75 11.5391 2.75H7.68359C7.51953 2.75 7.38281 2.85938 7.30078 2.99609L7 3.625H3.9375C3.69141 3.625 3.5 3.84375 3.5 4.0625V4.9375C3.5 5.18359 3.69141 5.375 3.9375 5.375H15.3125C15.5312 5.375 15.75 5.18359 15.75 4.9375V4.0625C15.75 3.84375 15.5312 3.625 15.3125 3.625Z", fill: "currentColor" }))), index.h("button", { key: '49d50d9f7cf56d778788dcf0d87804fa687c7b98', class: "ClosePopover", onClick: this.closePopover }, index.h("div", { key: '57f0f1d6980036373200e0e5ace18d7f09b9f292', innerHTML: renderIconDefinitionToSVGElement(CloseCircleOutlined$1, {
|
|
42925
42949
|
extraSVGAttrs: { width: '20px', height: '20px', fill: '#A1A1B2' }
|
|
42926
|
-
}) }))), this.showDeleteAllPopup && (index.h("div", { key: '
|
|
42950
|
+
}) }))), this.showDeleteAllPopup && (index.h("div", { key: '6a8733b4153724154ed148d8794c336131a32ef4', class: "DeleteAllDropdown", ref: (el) => (this.dropdownRef = el) }, index.h("button", { key: 'e5b886482308972cbfe1916dce40bcc6b15d21dd', onClick: this.deleteAllNotifications }, translate$1('deleteAllMessages', this.language))))), !this.isLoading && (index.h("div", { key: 'db28490ea2ae39401719df67c0783944b2aa6fdd', class: "NotificationList" }, this.isNotificationsLoading ? (index.h("div", { class: "Loading", innerHTML: renderIconDefinitionToSVGElement(LoadingOutlined$1, {
|
|
42927
42951
|
extraSVGAttrs: { width: '30px', height: '30px', fill: '#A1A1B2' }
|
|
42928
42952
|
}) })) : ((_b = this.notifications) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (this.notifications.map((item) => {
|
|
42929
42953
|
var _a, _b;
|
|
42930
42954
|
return (index.h("nuts-notification", { "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, key: item.id, "user-id": this.userId, "operator-id": this.operatorId, content: item.content, "message-id": item.id, badge: ((_a = item.avatar) === null || _a === void 0 ? void 0 : _a.data) || ((_b = item.actor) === null || _b === void 0 ? void 0 : _b.data) || '', sessionId: this.sessionId, date: item.createdAt, read: item.read, seen: item.seen, language: this.language, "notification-action": this.notificationAction, token: this.token, "backend-url": this.backendUrl, "redirect-url": item.cta.data.url, "translation-url": this.translationUrl, "max-text-length": 200, "max-lines": 5 }));
|
|
42931
|
-
})) : (index.h("div", { class: "NoMessages" }, index.h("svg", { width: "120", height: "108", viewBox: "0 0 120 108", fill: "none" }, index.h("circle", { cx: "11.3191", cy: "30.7872", r: "6.31915", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("ellipse", { cx: "60.117", cy: "27.9787", rx: "5.96809", ry: "5.61702", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M79.5424 49.4934C79.5424 44.1598 77.6437 39.0446 74.2641 35.2732C70.8844 31.5017 66.3006 29.3829 61.5211 29.3829C56.7415 29.3829 52.1578 31.5017 48.7781 35.2732C45.3985 39.0446 43.4998 44.1598 43.4998 49.4934C43.4998 72.9557 34.4892 79.6592 34.4892 79.6592H88.553C88.553 79.6592 79.5424 72.9557 79.5424 49.4934Z", fill: "#292933" }), index.h("path", { d: "M68.8995 81.7552C68.1496 83.551 67.0731 85.0417 65.778 86.0779C64.4828 87.1141 63.0144 87.6595 61.5198 87.6595C60.0252 87.6595 58.5568 87.1141 57.2617 86.0779C55.9665 85.0417 54.8901 83.551 54.1401 81.7552", fill: "#292933" }), index.h("path", { d: "M81.2976 50.2203C81.2976 68.2545 87.2222 76.7327 90.2814 79.9083C90.7671 80.4126 90.3802 81.4764 89.68 81.4764C88.0927 81.4764 86.5488 81.4764 85.0422 81.4764M68.5814 82.946C67.6854 84.8068 66.3993 86.3513 64.8518 87.425C63.3044 88.4987 61.5499 89.0638 59.7641 89.0638C57.9783 89.0638 56.2239 88.4987 54.6765 87.425C53.129 86.3513 51.8429 84.8068 50.9468 82.946M79.712 42.3723C78.6394 39.8192 77.0439 37.4727 74.991 35.4861C70.953 31.5783 65.4763 29.3829 59.7656 29.3829C54.055 29.3829 48.5783 31.5783 44.5403 35.4861C43.3681 36.6205 42.345 37.8722 41.4832 39.2127C40.4958 40.7487 39.7202 42.4013 39.1747 44.1276C38.5563 46.0847 38.2337 48.1364 38.2337 50.2203C38.2337 53.2503 38.0665 56.0106 37.7737 58.5212M34.8401 70.7608C32.9874 75.4551 30.7688 78.331 29.2526 79.9055C28.767 80.4099 29.155 81.4764 29.8551 81.4764C47.1962 81.4764 59.3571 81.4764 74.1593 81.4764", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M55.6345 59.0737C55.1665 59.7144 54.4949 60.2462 53.6868 60.6159C52.8787 60.9855 51.9625 61.1801 51.0299 61.1801C50.0973 61.1801 49.1811 60.9855 48.373 60.6159C47.5649 60.2462 46.8933 59.7144 46.4254 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M73.1877 59.0737C72.7197 59.7144 72.0481 60.2462 71.24 60.6159C70.4319 60.9855 69.5157 61.1801 68.5831 61.1801C67.6506 61.1801 66.7344 60.9855 65.9263 60.6159C65.1182 60.2462 64.4465 59.7144 63.9786 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("circle", { cx: "107.511", cy: "56.0638", r: "7.02128", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("circle", { cx: "16.4252", cy: "58.1703", r: "4.21277", fill: "#3D3D4D" }), index.h("ellipse", { cx: "59.9573", cy: "104.511", rx: "25.2766", ry: "2.80851", fill: "#3D3D4D" }), index.h("path", { d: "M81.5317 18.1489H88.553L81.5317 25.1702H88.553", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M96.6807 2H106.51L96.6807 11.8298H106.51", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), index.h("p", null, translate$1('noMessages', this.language)))))), !this.isLoading && (index.h("div", { key: '
|
|
42955
|
+
})) : (index.h("div", { class: "NoMessages" }, index.h("svg", { width: "120", height: "108", viewBox: "0 0 120 108", fill: "none" }, index.h("circle", { cx: "11.3191", cy: "30.7872", r: "6.31915", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("ellipse", { cx: "60.117", cy: "27.9787", rx: "5.96809", ry: "5.61702", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M79.5424 49.4934C79.5424 44.1598 77.6437 39.0446 74.2641 35.2732C70.8844 31.5017 66.3006 29.3829 61.5211 29.3829C56.7415 29.3829 52.1578 31.5017 48.7781 35.2732C45.3985 39.0446 43.4998 44.1598 43.4998 49.4934C43.4998 72.9557 34.4892 79.6592 34.4892 79.6592H88.553C88.553 79.6592 79.5424 72.9557 79.5424 49.4934Z", fill: "#292933" }), index.h("path", { d: "M68.8995 81.7552C68.1496 83.551 67.0731 85.0417 65.778 86.0779C64.4828 87.1141 63.0144 87.6595 61.5198 87.6595C60.0252 87.6595 58.5568 87.1141 57.2617 86.0779C55.9665 85.0417 54.8901 83.551 54.1401 81.7552", fill: "#292933" }), index.h("path", { d: "M81.2976 50.2203C81.2976 68.2545 87.2222 76.7327 90.2814 79.9083C90.7671 80.4126 90.3802 81.4764 89.68 81.4764C88.0927 81.4764 86.5488 81.4764 85.0422 81.4764M68.5814 82.946C67.6854 84.8068 66.3993 86.3513 64.8518 87.425C63.3044 88.4987 61.5499 89.0638 59.7641 89.0638C57.9783 89.0638 56.2239 88.4987 54.6765 87.425C53.129 86.3513 51.8429 84.8068 50.9468 82.946M79.712 42.3723C78.6394 39.8192 77.0439 37.4727 74.991 35.4861C70.953 31.5783 65.4763 29.3829 59.7656 29.3829C54.055 29.3829 48.5783 31.5783 44.5403 35.4861C43.3681 36.6205 42.345 37.8722 41.4832 39.2127C40.4958 40.7487 39.7202 42.4013 39.1747 44.1276C38.5563 46.0847 38.2337 48.1364 38.2337 50.2203C38.2337 53.2503 38.0665 56.0106 37.7737 58.5212M34.8401 70.7608C32.9874 75.4551 30.7688 78.331 29.2526 79.9055C28.767 80.4099 29.155 81.4764 29.8551 81.4764C47.1962 81.4764 59.3571 81.4764 74.1593 81.4764", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M55.6345 59.0737C55.1665 59.7144 54.4949 60.2462 53.6868 60.6159C52.8787 60.9855 51.9625 61.1801 51.0299 61.1801C50.0973 61.1801 49.1811 60.9855 48.373 60.6159C47.5649 60.2462 46.8933 59.7144 46.4254 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M73.1877 59.0737C72.7197 59.7144 72.0481 60.2462 71.24 60.6159C70.4319 60.9855 69.5157 61.1801 68.5831 61.1801C67.6506 61.1801 66.7344 60.9855 65.9263 60.6159C65.1182 60.2462 64.4465 59.7144 63.9786 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("circle", { cx: "107.511", cy: "56.0638", r: "7.02128", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("circle", { cx: "16.4252", cy: "58.1703", r: "4.21277", fill: "#3D3D4D" }), index.h("ellipse", { cx: "59.9573", cy: "104.511", rx: "25.2766", ry: "2.80851", fill: "#3D3D4D" }), index.h("path", { d: "M81.5317 18.1489H88.553L81.5317 25.1702H88.553", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M96.6807 2H106.51L96.6807 11.8298H106.51", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), index.h("p", null, translate$1('noMessages', this.language)))))), !this.isLoading && (index.h("div", { key: 'f1cd67f7c3d6de56531b5469c3e788b9c9d2c182', class: "Pagination" }, index.h("div", { key: 'd0390f412b25475603df37adf9b381e681f1dc9b', class: "Button" }, index.h("button", { key: '935f7d8e73a4418bf6fdb4602b1681c449cb2689', disabled: this.isNotificationsLoading || this.currentPage <= 0, onClick: this.prevPage }, index.h("svg", { key: 'bffd0ffe5d7cf60202c7e058912fbf38c1246cd7', class: "svg-icon", viewBox: "0 0 20 20" }, index.h("path", { key: 'b5f65704f71920d3290a818b5f4aece7607cb1b2', d: "M8.388,10.049l4.76-4.873c0.303-0.31,0.297-0.804-0.012-1.105c-0.309-0.304-0.803-0.293-1.105,0.012L6.726,9.516c-0.303,0.31-0.296,0.805,0.012,1.105l5.433,5.307c0.152,0.148,0.35,0.223,0.547,0.223c0.203,0,0.406-0.08,0.559-0.236c0.303-0.309,0.295-0.803-0.012-1.104L8.388,10.049z" })), translate$1('prev', this.language))), index.h("div", { key: '8f82ceaeaa50c9b7053a1aac2d3db813607d71ca', class: "Button" }, index.h("button", { key: '65638cc3b4c02637e0ee1198c7bd7b5f5168c71e', disabled: this.isNotificationsLoading || !this.hasMore, onClick: this.nextPage }, translate$1('next', this.language), index.h("svg", { key: '95b97901bcac88c8c4d1e449b9db87503dc1a60c', class: "svg-icon", viewBox: "0 0 20 20" }, index.h("path", { key: '7cfe484dfa41bced8c092dfa341a66951fc78de5', d: "M11.611,10.049l-4.76-4.873c-0.303-0.31-0.297-0.804,0.012-1.105c0.309-0.304,0.803-0.293,1.105,0.012l5.306,5.433c0.304,0.31,0.296,0.805-0.012,1.105L7.83,15.928c-0.152,0.148-0.35,0.223-0.547,0.223c-0.203,0-0.406-0.08-0.559-0.236c-0.303-0.309-0.295-0.803,0.012-1.104L11.611,10.049z" }))))))));
|
|
42932
42956
|
}
|
|
42933
42957
|
static get watchers() { return {
|
|
42934
42958
|
"unseenCount": ["unseenCountHandler"],
|
|
@@ -103,6 +103,7 @@ export const markAsRead = async ({ baseUrl, body, token, unread }) => {
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
export const getNotifications = async ({ baseUrl, page, token }) => {
|
|
106
|
+
var _a;
|
|
106
107
|
const url = new URL(`${baseUrl}/widgets/notifications/feed`);
|
|
107
108
|
const headers = new Headers();
|
|
108
109
|
url.searchParams.append('page', page.toString());
|
|
@@ -117,7 +118,7 @@ export const getNotifications = async ({ baseUrl, page, token }) => {
|
|
|
117
118
|
return {
|
|
118
119
|
numberOfNotifications: data.totalCount,
|
|
119
120
|
notifications: data.data,
|
|
120
|
-
hasMore: data.hasMore
|
|
121
|
+
hasMore: (_a = data.hasMore) !== null && _a !== void 0 ? _a : false
|
|
121
122
|
};
|
|
122
123
|
}
|
|
123
124
|
catch (error) {
|
|
@@ -125,7 +126,7 @@ export const getNotifications = async ({ baseUrl, page, token }) => {
|
|
|
125
126
|
return {
|
|
126
127
|
numberOfNotifications: 0,
|
|
127
128
|
notifications: [],
|
|
128
|
-
hasMore:
|
|
129
|
+
hasMore: false
|
|
129
130
|
};
|
|
130
131
|
}
|
|
131
132
|
};
|
|
@@ -22,15 +22,23 @@ class NotificationCache {
|
|
|
22
22
|
this.syncCurrentPage();
|
|
23
23
|
}
|
|
24
24
|
syncCurrentPage() {
|
|
25
|
-
var _a;
|
|
25
|
+
var _a, _b, _c;
|
|
26
26
|
const entry = this.cache.get(this.currentPage);
|
|
27
27
|
const notifications = (_a = entry === null || entry === void 0 ? void 0 : entry.notifications) !== null && _a !== void 0 ? _a : [];
|
|
28
|
-
const hasMore = entry === null || entry === void 0 ? void 0 : entry.hasMore;
|
|
29
|
-
this.onPageUpdate([...notifications], hasMore);
|
|
28
|
+
const hasMore = (_b = entry === null || entry === void 0 ? void 0 : entry.hasMore) !== null && _b !== void 0 ? _b : false;
|
|
29
|
+
(_c = this.onPageUpdate) === null || _c === void 0 ? void 0 : _c.call(this, [...notifications], hasMore);
|
|
30
|
+
}
|
|
31
|
+
updatePagesInPlace(updater) {
|
|
32
|
+
for (const [page, entry] of this.cache.entries()) {
|
|
33
|
+
this.cache.set(page, {
|
|
34
|
+
notifications: updater(entry.notifications, page),
|
|
35
|
+
hasMore: entry.hasMore
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
this.syncCurrentPage();
|
|
30
39
|
}
|
|
31
40
|
deleteById(id) {
|
|
32
|
-
|
|
33
|
-
this.updateCache(updatedNotifications);
|
|
41
|
+
this.updatePagesInPlace((notifications) => notifications.filter((n) => n.id !== id));
|
|
34
42
|
}
|
|
35
43
|
addToFront(notification) {
|
|
36
44
|
if (!this.cache.get(0)) {
|
|
@@ -40,12 +48,10 @@ class NotificationCache {
|
|
|
40
48
|
this.updateCache(updatedNotifications);
|
|
41
49
|
}
|
|
42
50
|
markAsRead(id, mark) {
|
|
43
|
-
|
|
44
|
-
this.updateCache(updatedNotifications);
|
|
51
|
+
this.updatePagesInPlace((notifications) => notifications.map((n) => (n.id === id ? Object.assign(Object.assign({}, n), mark) : n)));
|
|
45
52
|
}
|
|
46
53
|
markAllAsRead() {
|
|
47
|
-
|
|
48
|
-
this.updateCache(updatedNotifications);
|
|
54
|
+
this.updatePagesInPlace((notifications) => notifications.map((n) => (Object.assign(Object.assign({}, n), { read: true, seen: true }))));
|
|
49
55
|
}
|
|
50
56
|
clearAll() {
|
|
51
57
|
this.resetCache();
|
|
@@ -56,12 +62,13 @@ class NotificationCache {
|
|
|
56
62
|
this.cache.set(0, { notifications: [], hasMore: false });
|
|
57
63
|
}
|
|
58
64
|
async loadPageFromApi(page, loader) {
|
|
65
|
+
var _a;
|
|
59
66
|
if (this.cache.has(page)) {
|
|
60
67
|
this.setCurrentPage(page);
|
|
61
68
|
return;
|
|
62
69
|
}
|
|
63
70
|
const data = await loader();
|
|
64
|
-
this.cache.set(page, { notifications: data.notifications, hasMore: data.hasMore });
|
|
71
|
+
this.cache.set(page, { notifications: data.notifications, hasMore: (_a = data.hasMore) !== null && _a !== void 0 ? _a : false });
|
|
65
72
|
this.setCurrentPage(page);
|
|
66
73
|
}
|
|
67
74
|
getAllFromCache() {
|
|
@@ -6,7 +6,7 @@ import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpe
|
|
|
6
6
|
import { notificationCache } from "../../cache";
|
|
7
7
|
export class NutsPopover {
|
|
8
8
|
constructor() {
|
|
9
|
-
this.
|
|
9
|
+
this.loadGeneration = 0;
|
|
10
10
|
this.nextPage = async () => {
|
|
11
11
|
this.currentPage++;
|
|
12
12
|
this.triggerGetNotifications();
|
|
@@ -91,7 +91,8 @@ export class NutsPopover {
|
|
|
91
91
|
this.showMarkAll = false;
|
|
92
92
|
this.limitStylingAppends = false;
|
|
93
93
|
this.showDeleteAllPopup = false;
|
|
94
|
-
this.hasMore =
|
|
94
|
+
this.hasMore = false;
|
|
95
|
+
this.currentPage = 0;
|
|
95
96
|
}
|
|
96
97
|
messageDeletedHandler(event) {
|
|
97
98
|
notificationCache.deleteById(event.detail);
|
|
@@ -146,6 +147,7 @@ export class NutsPopover {
|
|
|
146
147
|
// end custom styling area
|
|
147
148
|
}
|
|
148
149
|
async triggerGetNotifications() {
|
|
150
|
+
const generation = this.loadGeneration;
|
|
149
151
|
this.isNotificationsLoading = true;
|
|
150
152
|
try {
|
|
151
153
|
await notificationCache.loadPageFromApi(this.currentPage, async () => getNotifications({
|
|
@@ -155,12 +157,22 @@ export class NutsPopover {
|
|
|
155
157
|
}));
|
|
156
158
|
}
|
|
157
159
|
finally {
|
|
158
|
-
this.
|
|
160
|
+
if (generation === this.loadGeneration) {
|
|
161
|
+
this.isNotificationsLoading = false;
|
|
162
|
+
}
|
|
159
163
|
}
|
|
160
164
|
}
|
|
161
165
|
connectedCallback() {
|
|
162
166
|
this.baseUrl = `${this.backendUrl}/v1/${this.operatorId}`;
|
|
167
|
+
this.currentPage = 0;
|
|
168
|
+
this.hasMore = false;
|
|
169
|
+
this.isNotificationsLoading = true;
|
|
170
|
+
this.loadGeneration++;
|
|
171
|
+
const generation = this.loadGeneration;
|
|
163
172
|
notificationCache.observePageUpdate((notifications, hasMore) => {
|
|
173
|
+
if (generation !== this.loadGeneration) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
164
176
|
if ((notifications === null || notifications === void 0 ? void 0 : notifications.length) === 0 && this.currentPage > 0) {
|
|
165
177
|
// if it's last notification on it's page go back a page and retrigger
|
|
166
178
|
this.currentPage--;
|
|
@@ -168,23 +180,27 @@ export class NutsPopover {
|
|
|
168
180
|
return;
|
|
169
181
|
}
|
|
170
182
|
this.notifications = notifications;
|
|
171
|
-
this.hasMore = hasMore;
|
|
183
|
+
this.hasMore = hasMore !== null && hasMore !== void 0 ? hasMore : false;
|
|
172
184
|
});
|
|
173
185
|
this.triggerGetNotifications();
|
|
174
186
|
if (this.unseenCount != 0) {
|
|
175
187
|
this.showMarkAll = true;
|
|
176
188
|
}
|
|
177
189
|
}
|
|
190
|
+
disconnectedCallback() {
|
|
191
|
+
this.loadGeneration++;
|
|
192
|
+
this.isNotificationsLoading = false;
|
|
193
|
+
}
|
|
178
194
|
render() {
|
|
179
195
|
var _a, _b;
|
|
180
|
-
return (h("div", { key: '
|
|
196
|
+
return (h("div", { key: 'df45b2b7da683f9895151d698a4c7def899e13d4', class: "Popover", ref: this.assignRefToStylingContainer }, h("div", { key: '87e638b07e89b39d9b9fa60807d5e792ef9ecece', class: "Header" }, h("div", { key: '238839de9ec5734950b916924d3469081b10714c', class: "Title" }, translate('notifications', this.language), this.unseenCount > 0 ? h("div", { class: "UnseenCounter" }, this.unseenCount) : ''), this.showMarkAll && (h("div", { key: 'efc165ffdc077d09ee2f90c5758eca8b1c048d9f', class: "MarkAsRead", onClick: this.markAllNotificationsAsRead }, translate('markAllAsRead', this.language))), h("div", { key: 'b941c6a87a071d9e45d38528d889e7dbc8848ef4', class: "ActionButtons" }, h("button", { key: '33d9e1f7857a80936e6b65e1fa2ecbc3c55e4e4f', class: `DeleteAll${this.showDeleteAllPopup ? ' Active' : ''}`, onClick: this.showDeletePopup, disabled: !((_a = this.notifications) === null || _a === void 0 ? void 0 : _a.length) }, h("svg", { key: '3b87ea1d8e1c5942db86e18cf26e176031afef6a', width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '915823d5da7a4e12d578fe9db6b968253ceba418', d: "M4.375 15.4375C4.375 16.1758 4.94922 16.75 5.6875 16.75H13.5625C14.2734 16.75 14.875 16.1758 14.875 15.4375V6.25H4.375V15.4375ZM11.8125 8.4375C11.8125 8.21875 12.0039 8 12.25 8C12.4688 8 12.6875 8.21875 12.6875 8.4375V14.5625C12.6875 14.8086 12.4688 15 12.25 15C12.0039 15 11.8125 14.8086 11.8125 14.5625V8.4375ZM9.1875 8.4375C9.1875 8.21875 9.37891 8 9.625 8C9.84375 8 10.0625 8.21875 10.0625 8.4375V14.5625C10.0625 14.8086 9.84375 15 9.625 15C9.37891 15 9.1875 14.8086 9.1875 14.5625V8.4375ZM6.5625 8.4375C6.5625 8.21875 6.75391 8 7 8C7.21875 8 7.4375 8.21875 7.4375 8.4375V14.5625C7.4375 14.8086 7.21875 15 7 15C6.75391 15 6.5625 14.8086 6.5625 14.5625V8.4375ZM15.3125 3.625H12.25L11.9219 2.99609C11.8398 2.85938 11.7031 2.75 11.5391 2.75H7.68359C7.51953 2.75 7.38281 2.85938 7.30078 2.99609L7 3.625H3.9375C3.69141 3.625 3.5 3.84375 3.5 4.0625V4.9375C3.5 5.18359 3.69141 5.375 3.9375 5.375H15.3125C15.5312 5.375 15.75 5.18359 15.75 4.9375V4.0625C15.75 3.84375 15.5312 3.625 15.3125 3.625Z", fill: "currentColor" }))), h("button", { key: '49d50d9f7cf56d778788dcf0d87804fa687c7b98', class: "ClosePopover", onClick: this.closePopover }, h("div", { key: '57f0f1d6980036373200e0e5ace18d7f09b9f292', innerHTML: renderIconDefinitionToSVGElement(CloseCircleOutlined, {
|
|
181
197
|
extraSVGAttrs: { width: '20px', height: '20px', fill: '#A1A1B2' }
|
|
182
|
-
}) }))), this.showDeleteAllPopup && (h("div", { key: '
|
|
198
|
+
}) }))), this.showDeleteAllPopup && (h("div", { key: '6a8733b4153724154ed148d8794c336131a32ef4', class: "DeleteAllDropdown", ref: (el) => (this.dropdownRef = el) }, h("button", { key: 'e5b886482308972cbfe1916dce40bcc6b15d21dd', onClick: this.deleteAllNotifications }, translate('deleteAllMessages', this.language))))), !this.isLoading && (h("div", { key: 'db28490ea2ae39401719df67c0783944b2aa6fdd', class: "NotificationList" }, this.isNotificationsLoading ? (h("div", { class: "Loading", innerHTML: renderIconDefinitionToSVGElement(LoadingOutlined, {
|
|
183
199
|
extraSVGAttrs: { width: '30px', height: '30px', fill: '#A1A1B2' }
|
|
184
200
|
}) })) : ((_b = this.notifications) === null || _b === void 0 ? void 0 : _b.length) > 0 ? (this.notifications.map((item) => {
|
|
185
201
|
var _a, _b;
|
|
186
202
|
return (h("nuts-notification", { "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, key: item.id, "user-id": this.userId, "operator-id": this.operatorId, content: item.content, "message-id": item.id, badge: ((_a = item.avatar) === null || _a === void 0 ? void 0 : _a.data) || ((_b = item.actor) === null || _b === void 0 ? void 0 : _b.data) || '', sessionId: this.sessionId, date: item.createdAt, read: item.read, seen: item.seen, language: this.language, "notification-action": this.notificationAction, token: this.token, "backend-url": this.backendUrl, "redirect-url": item.cta.data.url, "translation-url": this.translationUrl, "max-text-length": 200, "max-lines": 5 }));
|
|
187
|
-
})) : (h("div", { class: "NoMessages" }, h("svg", { width: "120", height: "108", viewBox: "0 0 120 108", fill: "none" }, h("circle", { cx: "11.3191", cy: "30.7872", r: "6.31915", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("ellipse", { cx: "60.117", cy: "27.9787", rx: "5.96809", ry: "5.61702", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M79.5424 49.4934C79.5424 44.1598 77.6437 39.0446 74.2641 35.2732C70.8844 31.5017 66.3006 29.3829 61.5211 29.3829C56.7415 29.3829 52.1578 31.5017 48.7781 35.2732C45.3985 39.0446 43.4998 44.1598 43.4998 49.4934C43.4998 72.9557 34.4892 79.6592 34.4892 79.6592H88.553C88.553 79.6592 79.5424 72.9557 79.5424 49.4934Z", fill: "#292933" }), h("path", { d: "M68.8995 81.7552C68.1496 83.551 67.0731 85.0417 65.778 86.0779C64.4828 87.1141 63.0144 87.6595 61.5198 87.6595C60.0252 87.6595 58.5568 87.1141 57.2617 86.0779C55.9665 85.0417 54.8901 83.551 54.1401 81.7552", fill: "#292933" }), h("path", { d: "M81.2976 50.2203C81.2976 68.2545 87.2222 76.7327 90.2814 79.9083C90.7671 80.4126 90.3802 81.4764 89.68 81.4764C88.0927 81.4764 86.5488 81.4764 85.0422 81.4764M68.5814 82.946C67.6854 84.8068 66.3993 86.3513 64.8518 87.425C63.3044 88.4987 61.5499 89.0638 59.7641 89.0638C57.9783 89.0638 56.2239 88.4987 54.6765 87.425C53.129 86.3513 51.8429 84.8068 50.9468 82.946M79.712 42.3723C78.6394 39.8192 77.0439 37.4727 74.991 35.4861C70.953 31.5783 65.4763 29.3829 59.7656 29.3829C54.055 29.3829 48.5783 31.5783 44.5403 35.4861C43.3681 36.6205 42.345 37.8722 41.4832 39.2127C40.4958 40.7487 39.7202 42.4013 39.1747 44.1276C38.5563 46.0847 38.2337 48.1364 38.2337 50.2203C38.2337 53.2503 38.0665 56.0106 37.7737 58.5212M34.8401 70.7608C32.9874 75.4551 30.7688 78.331 29.2526 79.9055C28.767 80.4099 29.155 81.4764 29.8551 81.4764C47.1962 81.4764 59.3571 81.4764 74.1593 81.4764", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M55.6345 59.0737C55.1665 59.7144 54.4949 60.2462 53.6868 60.6159C52.8787 60.9855 51.9625 61.1801 51.0299 61.1801C50.0973 61.1801 49.1811 60.9855 48.373 60.6159C47.5649 60.2462 46.8933 59.7144 46.4254 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M73.1877 59.0737C72.7197 59.7144 72.0481 60.2462 71.24 60.6159C70.4319 60.9855 69.5157 61.1801 68.5831 61.1801C67.6506 61.1801 66.7344 60.9855 65.9263 60.6159C65.1182 60.2462 64.4465 59.7144 63.9786 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("circle", { cx: "107.511", cy: "56.0638", r: "7.02128", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("circle", { cx: "16.4252", cy: "58.1703", r: "4.21277", fill: "#3D3D4D" }), h("ellipse", { cx: "59.9573", cy: "104.511", rx: "25.2766", ry: "2.80851", fill: "#3D3D4D" }), h("path", { d: "M81.5317 18.1489H88.553L81.5317 25.1702H88.553", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M96.6807 2H106.51L96.6807 11.8298H106.51", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), h("p", null, translate('noMessages', this.language)))))), !this.isLoading && (h("div", { key: '
|
|
203
|
+
})) : (h("div", { class: "NoMessages" }, h("svg", { width: "120", height: "108", viewBox: "0 0 120 108", fill: "none" }, h("circle", { cx: "11.3191", cy: "30.7872", r: "6.31915", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("ellipse", { cx: "60.117", cy: "27.9787", rx: "5.96809", ry: "5.61702", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M79.5424 49.4934C79.5424 44.1598 77.6437 39.0446 74.2641 35.2732C70.8844 31.5017 66.3006 29.3829 61.5211 29.3829C56.7415 29.3829 52.1578 31.5017 48.7781 35.2732C45.3985 39.0446 43.4998 44.1598 43.4998 49.4934C43.4998 72.9557 34.4892 79.6592 34.4892 79.6592H88.553C88.553 79.6592 79.5424 72.9557 79.5424 49.4934Z", fill: "#292933" }), h("path", { d: "M68.8995 81.7552C68.1496 83.551 67.0731 85.0417 65.778 86.0779C64.4828 87.1141 63.0144 87.6595 61.5198 87.6595C60.0252 87.6595 58.5568 87.1141 57.2617 86.0779C55.9665 85.0417 54.8901 83.551 54.1401 81.7552", fill: "#292933" }), h("path", { d: "M81.2976 50.2203C81.2976 68.2545 87.2222 76.7327 90.2814 79.9083C90.7671 80.4126 90.3802 81.4764 89.68 81.4764C88.0927 81.4764 86.5488 81.4764 85.0422 81.4764M68.5814 82.946C67.6854 84.8068 66.3993 86.3513 64.8518 87.425C63.3044 88.4987 61.5499 89.0638 59.7641 89.0638C57.9783 89.0638 56.2239 88.4987 54.6765 87.425C53.129 86.3513 51.8429 84.8068 50.9468 82.946M79.712 42.3723C78.6394 39.8192 77.0439 37.4727 74.991 35.4861C70.953 31.5783 65.4763 29.3829 59.7656 29.3829C54.055 29.3829 48.5783 31.5783 44.5403 35.4861C43.3681 36.6205 42.345 37.8722 41.4832 39.2127C40.4958 40.7487 39.7202 42.4013 39.1747 44.1276C38.5563 46.0847 38.2337 48.1364 38.2337 50.2203C38.2337 53.2503 38.0665 56.0106 37.7737 58.5212M34.8401 70.7608C32.9874 75.4551 30.7688 78.331 29.2526 79.9055C28.767 80.4099 29.155 81.4764 29.8551 81.4764C47.1962 81.4764 59.3571 81.4764 74.1593 81.4764", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M55.6345 59.0737C55.1665 59.7144 54.4949 60.2462 53.6868 60.6159C52.8787 60.9855 51.9625 61.1801 51.0299 61.1801C50.0973 61.1801 49.1811 60.9855 48.373 60.6159C47.5649 60.2462 46.8933 59.7144 46.4254 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M73.1877 59.0737C72.7197 59.7144 72.0481 60.2462 71.24 60.6159C70.4319 60.9855 69.5157 61.1801 68.5831 61.1801C67.6506 61.1801 66.7344 60.9855 65.9263 60.6159C65.1182 60.2462 64.4465 59.7144 63.9786 59.0737", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("circle", { cx: "107.511", cy: "56.0638", r: "7.02128", stroke: "#3D3D4D", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("circle", { cx: "16.4252", cy: "58.1703", r: "4.21277", fill: "#3D3D4D" }), h("ellipse", { cx: "59.9573", cy: "104.511", rx: "25.2766", ry: "2.80851", fill: "#3D3D4D" }), h("path", { d: "M81.5317 18.1489H88.553L81.5317 25.1702H88.553", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { d: "M96.6807 2H106.51L96.6807 11.8298H106.51", stroke: "#828299", "stroke-width": "3.5", "stroke-linecap": "round", "stroke-linejoin": "round" })), h("p", null, translate('noMessages', this.language)))))), !this.isLoading && (h("div", { key: 'f1cd67f7c3d6de56531b5469c3e788b9c9d2c182', class: "Pagination" }, h("div", { key: 'd0390f412b25475603df37adf9b381e681f1dc9b', class: "Button" }, h("button", { key: '935f7d8e73a4418bf6fdb4602b1681c449cb2689', disabled: this.isNotificationsLoading || this.currentPage <= 0, onClick: this.prevPage }, h("svg", { key: 'bffd0ffe5d7cf60202c7e058912fbf38c1246cd7', class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { key: 'b5f65704f71920d3290a818b5f4aece7607cb1b2', d: "M8.388,10.049l4.76-4.873c0.303-0.31,0.297-0.804-0.012-1.105c-0.309-0.304-0.803-0.293-1.105,0.012L6.726,9.516c-0.303,0.31-0.296,0.805,0.012,1.105l5.433,5.307c0.152,0.148,0.35,0.223,0.547,0.223c0.203,0,0.406-0.08,0.559-0.236c0.303-0.309,0.295-0.803-0.012-1.104L8.388,10.049z" })), translate('prev', this.language))), h("div", { key: '8f82ceaeaa50c9b7053a1aac2d3db813607d71ca', class: "Button" }, h("button", { key: '65638cc3b4c02637e0ee1198c7bd7b5f5168c71e', disabled: this.isNotificationsLoading || !this.hasMore, onClick: this.nextPage }, translate('next', this.language), h("svg", { key: '95b97901bcac88c8c4d1e449b9db87503dc1a60c', class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { key: '7cfe484dfa41bced8c092dfa341a66951fc78de5', d: "M11.611,10.049l-4.76-4.873c-0.303-0.31-0.297-0.804,0.012-1.105c0.309-0.304,0.803-0.293,1.105,0.012l5.306,5.433c0.304,0.31,0.296,0.805-0.012,1.105L7.83,15.928c-0.152,0.148-0.35,0.223-0.547,0.223c-0.203,0-0.406-0.08-0.559-0.236c-0.303-0.309-0.295-0.803,0.012-1.104L11.611,10.049z" }))))))));
|
|
188
204
|
}
|
|
189
205
|
static get is() { return "nuts-popover"; }
|
|
190
206
|
static get originalStyleUrls() {
|
|
@@ -398,7 +414,8 @@ export class NutsPopover {
|
|
|
398
414
|
"showMarkAll": {},
|
|
399
415
|
"limitStylingAppends": {},
|
|
400
416
|
"showDeleteAllPopup": {},
|
|
401
|
-
"hasMore": {}
|
|
417
|
+
"hasMore": {},
|
|
418
|
+
"currentPage": {}
|
|
402
419
|
};
|
|
403
420
|
}
|
|
404
421
|
static get events() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'nuts-inbox-widget';
|
|
2
|
-
const BUILD = /* nuts-inbox-widget */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback:
|
|
2
|
+
const BUILD = /* nuts-inbox-widget */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -1323,6 +1323,9 @@ var connectedCallback = (elm) => {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
};
|
|
1325
1325
|
var disconnectInstance = (instance) => {
|
|
1326
|
+
{
|
|
1327
|
+
safeCall(instance, "disconnectedCallback");
|
|
1328
|
+
}
|
|
1326
1329
|
};
|
|
1327
1330
|
var disconnectedCallback = async (elm) => {
|
|
1328
1331
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1333,8 +1336,10 @@ var disconnectedCallback = async (elm) => {
|
|
|
1333
1336
|
hostRef.$rmListeners$ = void 0;
|
|
1334
1337
|
}
|
|
1335
1338
|
}
|
|
1336
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$)
|
|
1337
|
-
hostRef.$
|
|
1339
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1340
|
+
disconnectInstance(hostRef.$lazyInstance$);
|
|
1341
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1342
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
|
|
1338
1343
|
}
|
|
1339
1344
|
}
|
|
1340
1345
|
};
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-2eda31b2.js';
|
|
2
|
+
export { s as setNonce } from './index-2eda31b2.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["nuts-inbox-widget_3",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"],[8,"closePopover","closePopoverHandler"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"deviceId":["initializeHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"isNotificationsLoading":[32],"showMarkAll":[32],"limitStylingAppends":[32],"showDeleteAllPopup":[32],"hasMore":[32]},[[8,"messageDeleted","messageDeletedHandler"],[8,"messageRead","messageReadHandler"],[8,"click","clickOutsideHandle"]],{"unseenCount":["unseenCountHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"maxTextLength":[514,"max-text-length"],"maxLines":[514,"max-lines"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32],"limitStylingAppends":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"],[8,"click","clickOutsideHandle"]],{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["nuts-inbox-widget_3",[[1,"nuts-inbox-widget",{"backendUrl":[513,"backend-url"],"socketUrl":[513,"socket-url"],"userId":[513,"user-id"],"sessionId":[513,"session-id"],"operatorId":[513,"operator-id"],"subscriberId":[513,"subscriber-id"],"deviceId":[513,"device-id"],"language":[513],"environment":[513],"applicationIdentifier":[513,"application-identifier"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"bellIconPosition":[513,"bell-icon-position"],"notificationAction":[513,"notification-action"],"translationUrl":[513,"translation-url"],"isLoading":[32],"popoverVisible":[32],"unseenCount":[32]},[[8,"click","clickOutsideHandle"],[0,"allNotificationsRead","resetUnseenCount"],[8,"closePopover","closePopoverHandler"]],{"subscriberId":["initializeHandler"],"operatorId":["initializeHandler"],"applicationIdentifier":["initializeHandler"],"deviceId":["initializeHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-popover",{"language":[513],"userId":[513,"user-id"],"operatorId":[513,"operator-id"],"token":[513],"sessionId":[513,"session-id"],"backendUrl":[513,"backend-url"],"unseenCount":[514,"unseen-count"],"clientStylingUrl":[513,"client-styling-url"],"notificationAction":[513,"notification-action"],"clientStyling":[1537,"client-styling"],"translationUrl":[513,"translation-url"],"notifications":[32],"isLoading":[32],"isNotificationsLoading":[32],"showMarkAll":[32],"limitStylingAppends":[32],"showDeleteAllPopup":[32],"hasMore":[32],"currentPage":[32]},[[8,"messageDeleted","messageDeletedHandler"],[8,"messageRead","messageReadHandler"],[8,"click","clickOutsideHandle"]],{"unseenCount":["unseenCountHandler"],"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}],[0,"nuts-notification",{"badge":[513],"content":[513],"date":[513],"showSettings":[516,"show-settings"],"read":[516],"seen":[516],"language":[513],"sessionId":[513,"session-id"],"subscriberId":[513,"subscriber-id"],"userId":[513,"user-id"],"messageId":[513,"message-id"],"operatorId":[513,"operator-id"],"token":[513],"backendUrl":[513,"backend-url"],"redirectUrl":[513,"redirect-url"],"notificationAction":[513,"notification-action"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"maxTextLength":[514,"max-text-length"],"maxLines":[514,"max-lines"],"showSettingsModal":[32],"messageSeen":[32],"messageRead":[32],"displayedContent":[32],"limitStylingAppends":[32]},[[8,"allNotificationsRead","allNotificationsReadHandler"],[8,"settingsOpened","settingsOpenedHandler"],[8,"click","clickOutsideHandle"]],{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"],"translationUrl":["handleNewTranslations"]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|