@everymatrix/nuts-inbox-widget 1.73.21 → 1.73.23
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/loader.cjs.js +1 -1
- package/dist/cjs/nuts-inbox-widget.cjs.js +1 -1
- package/dist/cjs/nuts-inbox-widget_3.cjs.entry.js +29 -44
- package/dist/collection/api/methods/index.js +0 -2
- package/dist/collection/components/nuts-inbox-widget/nuts-inbox-widget.js +2 -1
- package/dist/collection/components/nuts-popover/nuts-popover.css +19 -6
- package/dist/collection/components/nuts-popover/nuts-popover.js +27 -40
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nuts-inbox-widget.js +1 -1
- package/dist/esm/nuts-inbox-widget_3.entry.js +29 -44
- 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/api/methods/types.d.ts +0 -1
- package/dist/types/components/nuts-popover/nuts-popover.d.ts +2 -2
- package/package.json +1 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
|
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],"limitStylingAppends":[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],"showMarkAll":[32],"limitStylingAppends":[32],"showDeleteAllPopup":[32],"hasMore":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"allMessagesDeleted","allMessagesDeletedHandler"],[8,"newNotification","newNotificationHandler"],[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"],"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],"limitStylingAppends":[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","messageDeteledHandler"],[8,"allMessagesDeleted","allMessagesDeletedHandler"],[8,"newNotification","newNotificationHandler"],[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"],"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;
|
|
@@ -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],"limitStylingAppends":[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],"showMarkAll":[32],"limitStylingAppends":[32],"showDeleteAllPopup":[32],"hasMore":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"allMessagesDeleted","allMessagesDeletedHandler"],[8,"newNotification","newNotificationHandler"],[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"],"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],"limitStylingAppends":[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","messageDeteledHandler"],[8,"allMessagesDeleted","allMessagesDeletedHandler"],[8,"newNotification","newNotificationHandler"],[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"],"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;
|
|
@@ -4203,7 +4203,6 @@ const getNotifications = async ({ baseUrl, page, token }) => {
|
|
|
4203
4203
|
const res = await fetch(url.href, options);
|
|
4204
4204
|
const data = await res.json();
|
|
4205
4205
|
return {
|
|
4206
|
-
isLoading: false,
|
|
4207
4206
|
numberOfNotifications: data.totalCount,
|
|
4208
4207
|
notifications: data.data,
|
|
4209
4208
|
hasMore: data.hasMore
|
|
@@ -4212,7 +4211,6 @@ const getNotifications = async ({ baseUrl, page, token }) => {
|
|
|
4212
4211
|
catch (error) {
|
|
4213
4212
|
console.log(error);
|
|
4214
4213
|
return {
|
|
4215
|
-
isLoading: false,
|
|
4216
4214
|
numberOfNotifications: 0,
|
|
4217
4215
|
notifications: [],
|
|
4218
4216
|
hasMore: undefined
|
|
@@ -4354,6 +4352,7 @@ const NutsInboxWidget = class {
|
|
|
4354
4352
|
}
|
|
4355
4353
|
closePopoverHandler() {
|
|
4356
4354
|
this.popoverVisible = false;
|
|
4355
|
+
window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
|
|
4357
4356
|
}
|
|
4358
4357
|
positionIcon() {
|
|
4359
4358
|
if (this.bellIconPosition == 'left') {
|
|
@@ -4440,7 +4439,7 @@ const NutsInboxWidget = class {
|
|
|
4440
4439
|
return (index.h("div", { onClick: this.togglePopover, class: "BellIcon" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", fill: "currentColor", class: "bi bi-bell", viewBox: "0 0 16 16" }, ' ', index.h("path", { d: "M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z" }), ' '), this.unseenCount > 0 ? (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", class: "nc-bell-button-dot css-0 css-1eg2znq" }, index.h("rect", { x: "1.5", y: "1.5", width: "13", height: "13", rx: "6.5", fill: "url(#paint0_linear_1722_2699)", stroke: "#1E1E26", "stroke-width": "3" }), index.h("defs", null, index.h("linearGradient", { id: "paint0_linear_1722_2699", x1: "8", y1: "13", x2: "8", y2: "3", gradientUnits: "userSpaceOnUse" }, index.h("stop", { "stop-color": "#FF512F" }), index.h("stop", { offset: "1", "stop-color": "#DD2476" }))))) : ('')));
|
|
4441
4440
|
}
|
|
4442
4441
|
render() {
|
|
4443
|
-
return (index.h("div", { key: '
|
|
4442
|
+
return (index.h("div", { key: '787bb05f5d9899db7ffb3ec0e4af11f3942d22f0', ref: this.assignRefToStylingContainer, class: "Wrapper" }, index.h("div", { key: 'dbb13d5d8b49a2a0f0b4cf937bac1040ce49c1c0', ref: this.assignRefToBell, class: "BellIconWrapper" }, !this.isLoading && this.renderBellIcon()), this.popoverVisible && (index.h("nuts-popover", { key: 'f69d320f49d55b352e388af91949a03adf09cc9f', "notification-action": this.notificationAction, sessionId: this.sessionId, "unseen-count": this.unseenCount, token: this.token, "backend-url": this.backendUrl, "operator-id": this.operatorId, "user-id": this.userId, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl }))));
|
|
4444
4443
|
}
|
|
4445
4444
|
get el() { return index.getElement(this); }
|
|
4446
4445
|
static get watchers() { return {
|
|
@@ -42473,7 +42472,7 @@ const NutsNotification = class {
|
|
|
42473
42472
|
};
|
|
42474
42473
|
NutsNotification.style = NutsNotificationStyle0;
|
|
42475
42474
|
|
|
42476
|
-
const nutsPopoverCss = ":host{display:block}.Popover{padding:15px 0px;border-radius:7px;box-shadow:var(--emw--color-gray-400, rgba(0, 0, 0, 0.2)) 0px 5px 20px;background:var(--emw--color-gray-300, rgb(30, 30, 38));margin:0px;font-family:inherit;color:var(--emw--color-gray-200, rgb(51, 55, 55));direction:ltr;width:420px;z-index:999;position:absolute;right:0}.Popover .Header{display:flex;padding:0 20px 10px 20px;align-items:center;box-shadow:var(--emw--color-gray-20, rgba(0, 0, 0, 0.2)) 0px 5px 5px -5px}.Popover .Header .Title{color:var(--emw--color-white, rgb(255, 255, 255));font-size:20px;font-style:normal;font-weight:700;line-height:24px;text-align:center;padding-left:10px;display:flex;align-items:center;gap:5px}.Popover .Header .Title .UnseenCounter{margin-right:5px;display:flex;align-items:center;justify-content:center;text-decoration:none;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;text-transform:uppercase;border-radius:var(--emw--border-radius-medium, 10px);letter-spacing:0.25px;text-overflow:ellipsis;overflow:hidden;padding:0px;width:25px;height:20px;pointer-events:none;border:none;background:linear-gradient(0deg, var(--emw--color-secondary-20, rgb(255, 81, 47)) 0%, var(--emw--color-secondary, rgb(221, 36, 118)) 100%);font-family:inherit;line-height:14px;color:var(--emw--color-white, rgb(255, 255, 255));font-weight:bold;font-size:12px}.Popover .Header .MarkAsRead{font-size:14px;font-style:normal;font-weight:400;line-height:17px;color:var(--emw--color-gray-150, rgb(130, 130, 153));cursor:pointer;pointer-events:auto;opacity:0.5}.Popover .Header .MarkAsRead:hover{opacity:0.7;transition:250ms}.Popover .Header .DeleteAll,.Popover .Header .
|
|
42475
|
+
const nutsPopoverCss = ":host{display:block}.Popover{padding:15px 0px;border-radius:7px;box-shadow:var(--emw--color-gray-400, rgba(0, 0, 0, 0.2)) 0px 5px 20px;background:var(--emw--color-gray-300, rgb(30, 30, 38));margin:0px;font-family:inherit;color:var(--emw--color-gray-200, rgb(51, 55, 55));direction:ltr;width:420px;z-index:999;position:absolute;right:0}.Popover .Header{display:flex;padding:0 20px 10px 20px;align-items:center;box-shadow:var(--emw--color-gray-20, rgba(0, 0, 0, 0.2)) 0px 5px 5px -5px}.Popover .Header .Title{color:var(--emw--color-white, rgb(255, 255, 255));font-size:20px;font-style:normal;font-weight:700;line-height:24px;text-align:center;padding-left:10px;display:flex;align-items:center;gap:5px}.Popover .Header .Title .UnseenCounter{margin-right:5px;display:flex;align-items:center;justify-content:center;text-decoration:none;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;text-transform:uppercase;border-radius:var(--emw--border-radius-medium, 10px);letter-spacing:0.25px;text-overflow:ellipsis;overflow:hidden;padding:0px;width:25px;height:20px;pointer-events:none;border:none;background:linear-gradient(0deg, var(--emw--color-secondary-20, rgb(255, 81, 47)) 0%, var(--emw--color-secondary, rgb(221, 36, 118)) 100%);font-family:inherit;line-height:14px;color:var(--emw--color-white, rgb(255, 255, 255));font-weight:bold;font-size:12px}.Popover .Header .MarkAsRead{font-size:14px;font-style:normal;font-weight:400;line-height:17px;color:var(--emw--color-gray-150, rgb(130, 130, 153));cursor:pointer;pointer-events:auto;opacity:0.5}.Popover .Header .MarkAsRead:hover{opacity:0.7;transition:250ms}.Popover .Header .ActionButtons{margin-left:auto;display:flex;align-items:center;justify-content:center}.Popover .Header .DeleteAll,.Popover .Header .ClosePopover{font-style:normal;border:none;background:transparent;font-weight:400;line-height:17px;color:var(--emw--color-gray-150, rgb(130, 130, 153));cursor:pointer;pointer-events:auto;opacity:0.5}.Popover .Header .DeleteAll svg,.Popover .Header .ClosePopover svg{width:25px;height:25px}.Popover .Header .DeleteAll:hover,.Popover .Header .ClosePopover:hover{opacity:0.7;transition:250ms}.Popover .Header .ClosePopover div{display:flex;align-items:center;justify-content:center}.Popover .Header .DeleteAll{display:flex;align-items:center;justify-content:center}.Popover .Header .DeleteAll svg{width:30px;height:30px}.Popover .Header .DeleteAll.Active{opacity:1}.Popover .Header .DeleteAll:disabled{opacity:0.5;cursor:not-allowed}.Popover .DeleteAllDropdown{z-index:999;position:absolute;background:var(--emw--color-gray-400, rgb(41, 41, 51));box-shadow:var(--emw--color-gray-20, rgba(0, 0, 0, 0.2)) 0px 5px 20px;border-radius:7px;padding:4px;border:none;transition-property:opacity;transition-duration:150ms;transition-timing-function:ease;opacity:1;width:max-content;display:flex;flex-direction:column;right:100px;top:50px}.Popover .DeleteAllDropdown svg{margin-right:10px}.Popover .DeleteAllDropdown button{font-family:inherit;border:0px;background-color:transparent;outline:0px;width:100%;text-align:left;text-decoration:none;box-sizing:border-box;padding:10px 12px;cursor:pointer;border-radius:7px;display:flex;align-items:center;color:var(--emw--color-white, rgb(255, 255, 255));font-weight:400;font-size:14px}.Popover .DeleteAllDropdown button:hover{background:var(--emw--color-gray-300, rgb(61, 61, 77));transition:300ms}.Popover .NotificationList{height:400px;overflow:auto;box-shadow:0px 20px 10px -20px rgba(0, 0, 0, 0.45) inset, 0px -20px 10px -20px rgba(0, 0, 0, 0.45) inset}.Popover .NotificationList .NoMessages{display:flex;justify-content:center;flex-direction:column;align-items:center;height:100%}.Popover .NotificationList .NoMessages p{color:var(--emw--color-white, #fff);opacity:0.7}.Popover .Pagination{display:flex;justify-content:space-around;margin-top:13px}.Popover .Pagination .Button{width:43%}.Popover .Pagination .Button button{font-family:inherit;border:0px;background-color:transparent;outline:0px;width:100%;text-align:left;text-decoration:none;box-sizing:border-box;padding:10px 12px;cursor:pointer;border-radius:7px;display:flex;align-items:center;color:var(--emw--color-white, rgb(255, 255, 255));font-weight:400;font-size:14px;justify-content:center}.Popover .Pagination .Button button svg{width:15px;height:15px;fill:white}.Popover .Pagination .Button button:disabled{cursor:default;opacity:0.5}.Popover .Pagination .Button button:hover:enabled{background:var(--emw--color-gray-300, rgb(61, 61, 77));transition:300ms}";
|
|
42477
42476
|
const NutsPopoverStyle0 = nutsPopoverCss;
|
|
42478
42477
|
|
|
42479
42478
|
const NutsPopover = class {
|
|
@@ -42483,33 +42482,15 @@ const NutsPopover = class {
|
|
|
42483
42482
|
this.allMessagesDeteled = index.createEvent(this, "allMessagesDeleted", 7);
|
|
42484
42483
|
this.closePopoverEmmiter = index.createEvent(this, "closePopover", 7);
|
|
42485
42484
|
this.currentPage = 0;
|
|
42486
|
-
this.updateNotificationsDataAfterPageChange = (getNotificationsData) => {
|
|
42487
|
-
this.notifications = getNotificationsData.notifications;
|
|
42488
|
-
this.hasMore = getNotificationsData.hasMore;
|
|
42489
|
-
this.isLoading = getNotificationsData.isLoading;
|
|
42490
|
-
};
|
|
42491
42485
|
this.nextPage = async () => {
|
|
42492
|
-
if (!this.hasMore) {
|
|
42493
|
-
return;
|
|
42494
|
-
}
|
|
42495
42486
|
this.currentPage++;
|
|
42496
|
-
|
|
42497
|
-
baseUrl: this.baseUrl,
|
|
42498
|
-
token: this.token,
|
|
42499
|
-
page: this.currentPage
|
|
42500
|
-
}).then((data) => {
|
|
42501
|
-
return this.updateNotificationsDataAfterPageChange(data);
|
|
42502
|
-
});
|
|
42487
|
+
this.triggerGetNotifications();
|
|
42503
42488
|
};
|
|
42504
42489
|
this.prevPage = () => {
|
|
42505
42490
|
if (this.currentPage > 0) {
|
|
42506
42491
|
this.currentPage--;
|
|
42507
42492
|
}
|
|
42508
|
-
|
|
42509
|
-
baseUrl: this.baseUrl,
|
|
42510
|
-
token: this.token,
|
|
42511
|
-
page: this.currentPage
|
|
42512
|
-
}).then((data) => this.updateNotificationsDataAfterPageChange(data));
|
|
42493
|
+
this.triggerGetNotifications();
|
|
42513
42494
|
};
|
|
42514
42495
|
this.setClientStyling = () => {
|
|
42515
42496
|
let sheet = document.createElement('style');
|
|
@@ -42577,7 +42558,8 @@ const NutsPopover = class {
|
|
|
42577
42558
|
this.clientStyling = '';
|
|
42578
42559
|
this.translationUrl = '';
|
|
42579
42560
|
this.notifications = undefined;
|
|
42580
|
-
this.isLoading =
|
|
42561
|
+
this.isLoading = false;
|
|
42562
|
+
this.isNotificationsLoading = true;
|
|
42581
42563
|
this.showMarkAll = false;
|
|
42582
42564
|
this.limitStylingAppends = false;
|
|
42583
42565
|
this.showDeleteAllPopup = false;
|
|
@@ -42587,19 +42569,11 @@ const NutsPopover = class {
|
|
|
42587
42569
|
this.notifications = this.notifications.filter((item) => {
|
|
42588
42570
|
return item.id != event.detail;
|
|
42589
42571
|
});
|
|
42590
|
-
|
|
42591
|
-
baseUrl: this.baseUrl,
|
|
42592
|
-
token: this.token,
|
|
42593
|
-
page: this.currentPage
|
|
42594
|
-
}).then((data) => this.updateNotificationsDataAfterPageChange(data));
|
|
42572
|
+
this.triggerGetNotifications();
|
|
42595
42573
|
}
|
|
42596
42574
|
allMessagesDeletedHandler() {
|
|
42597
42575
|
this.notifications = [];
|
|
42598
|
-
|
|
42599
|
-
baseUrl: this.baseUrl,
|
|
42600
|
-
token: this.token,
|
|
42601
|
-
page: this.currentPage
|
|
42602
|
-
}).then((data) => this.updateNotificationsDataAfterPageChange(data));
|
|
42576
|
+
this.triggerGetNotifications();
|
|
42603
42577
|
}
|
|
42604
42578
|
newNotificationHandler(event) {
|
|
42605
42579
|
if (Array.isArray(this.notifications)) {
|
|
@@ -42653,26 +42627,37 @@ const NutsPopover = class {
|
|
|
42653
42627
|
}
|
|
42654
42628
|
// end custom styling area
|
|
42655
42629
|
}
|
|
42656
|
-
|
|
42657
|
-
this.
|
|
42630
|
+
async triggerGetNotifications() {
|
|
42631
|
+
this.isNotificationsLoading = true;
|
|
42658
42632
|
getNotifications({
|
|
42659
42633
|
baseUrl: this.baseUrl,
|
|
42660
42634
|
token: this.token,
|
|
42661
42635
|
page: this.currentPage
|
|
42662
|
-
})
|
|
42636
|
+
})
|
|
42637
|
+
.then((data) => {
|
|
42638
|
+
this.notifications = data.notifications;
|
|
42639
|
+
this.hasMore = data.hasMore;
|
|
42640
|
+
})
|
|
42641
|
+
.finally(() => {
|
|
42642
|
+
this.isNotificationsLoading = false;
|
|
42643
|
+
});
|
|
42644
|
+
}
|
|
42645
|
+
connectedCallback() {
|
|
42646
|
+
this.baseUrl = `${this.backendUrl}/v1/${this.operatorId}`;
|
|
42647
|
+
this.triggerGetNotifications();
|
|
42663
42648
|
if (this.unseenCount != 0) {
|
|
42664
42649
|
this.showMarkAll = true;
|
|
42665
42650
|
}
|
|
42666
42651
|
}
|
|
42667
42652
|
render() {
|
|
42668
42653
|
var _a, _b, _c;
|
|
42669
|
-
|
|
42654
|
+
const hasMore = this.hasMore || ((_a = this.notifications) === null || _a === void 0 ? void 0 : _a.length) > 10;
|
|
42655
|
+
return (index.h("div", { key: '94960f5609a5dd4f9a318b052e99896da2670bbb', class: "Popover", ref: this.assignRefToStylingContainer }, index.h("div", { key: 'cb40bd7d3db8d9ce4fab632e5460ea562882f809', class: "Header" }, index.h("div", { key: '058ea6897706dd84ba25d06f91fe8a2bfc1fd01b', class: "Title" }, translate$1('notifications', this.language), this.unseenCount > 0 ? index.h("div", { class: "UnseenCounter" }, this.unseenCount) : ''), this.showMarkAll && (index.h("div", { key: '32d7c170433047c845ff9dd2218e7c87e1290ff4', class: "MarkAsRead", onClick: this.markAllNotificationsAsRead }, translate$1('markAllAsRead', this.language))), index.h("div", { key: '4aff88677c6bf58cca1eb73eda1da1f58c75ce71', class: "ActionButtons" }, index.h("button", { key: '5590daa75d8905058f776207e45b910438cbfa3e', class: `DeleteAll${this.showDeleteAllPopup ? ' Active' : ''}`, onClick: this.showDeletePopup, disabled: !((_b = this.notifications) === null || _b === void 0 ? void 0 : _b.length) }, index.h("svg", { key: '3a76d4a165150da3929654e3e261c89ecfea1563', width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: 'a7a3cedc1e9f785cc26cb413dbaf183c49ed02f8', 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: '71e571b7f006bbcbcdac05ddd204f7b5dbdad04e', class: "ClosePopover", onClick: this.closePopover }, index.h("div", { key: 'ef1eeb7359b3957a14ddabd04db94e385da975eb', innerHTML: renderIconDefinitionToSVGElement(CloseCircleOutlined$1, {
|
|
42670
42656
|
extraSVGAttrs: { width: '20px', height: '20px', fill: '#A1A1B2' }
|
|
42671
|
-
}) })), this.showDeleteAllPopup && (index.h("div", { key: '
|
|
42672
|
-
|
|
42673
|
-
|
|
42674
|
-
|
|
42675
|
-
})) : (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 && (((_c = this.notifications) === null || _c === void 0 ? void 0 : _c.length) >= 10 || this.currentPage !== 0) ? (index.h("div", { class: "Pagination" }, index.h("div", { class: "Button" }, index.h("button", { disabled: this.currentPage <= 0, onClick: this.prevPage }, index.h("svg", { class: "svg-icon", viewBox: "0 0 20 20" }, index.h("path", { 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", { class: "Button" }, index.h("button", { disabled: !this.hasMore, onClick: this.nextPage }, translate$1('next', this.language), index.h("svg", { class: "svg-icon", viewBox: "0 0 20 20" }, index.h("path", { 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" })))))) : ('')));
|
|
42657
|
+
}) }))), this.showDeleteAllPopup && (index.h("div", { key: 'd0b41220c1f8621a60aecd33dd9898c04600951b', class: "DeleteAllDropdown", ref: (el) => (this.dropdownRef = el) }, index.h("button", { key: 'af20f31747b4998eeff55a028fde7c9fe11149a9', onClick: this.deleteAllNotifications }, translate$1('deleteAllMessages', this.language))))), index.h("div", { key: '61f995dcbf74c027b0f70c84ef8dbc35e66c782f', class: "NotificationList" }, !this.isLoading && ((_c = this.notifications) === null || _c === void 0 ? void 0 : _c.length) > 0 ? (this.notifications.map((item) => {
|
|
42658
|
+
var _a;
|
|
42659
|
+
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.actor) === null || _a === void 0 ? void 0 : _a.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 }));
|
|
42660
|
+
})) : (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: '65cf0c44a9c280e0124a157641d87f3cfe86f044', class: "Pagination" }, index.h("div", { key: 'fdbd9a5e01bc05a0eda65385d914a9ae3df38770', class: "Button" }, index.h("button", { key: 'ff49010496c01de7b501037c8d50f9e1abf59726', disabled: this.currentPage <= 0, onClick: this.prevPage }, index.h("svg", { key: '1da4701f89af5f1072f0faba9e2c7775bd761044', class: "svg-icon", viewBox: "0 0 20 20" }, index.h("path", { key: 'e66f3da84a565461a92839b883cb05c5b62242ad', 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: '7f24dbe58cf922a17ea57e03dee020afbacd879f', class: "Button" }, index.h("button", { key: 'fe8515e9bc6c35c3c6032745415b3f8b405fe4bb', disabled: this.isNotificationsLoading || !hasMore, onClick: this.nextPage }, translate$1('next', this.language), index.h("svg", { key: '9bb9aa49db50905f571bb0b70159c813742dd37c', class: "svg-icon", viewBox: "0 0 20 20" }, index.h("path", { key: '4a84d3e9108bba79370cae2df4224252ef3d2733', 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" }))))))));
|
|
42676
42661
|
}
|
|
42677
42662
|
static get watchers() { return {
|
|
42678
42663
|
"unseenCount": ["unseenCountHandler"],
|
|
@@ -109,7 +109,6 @@ export const getNotifications = async ({ baseUrl, page, token }) => {
|
|
|
109
109
|
const res = await fetch(url.href, options);
|
|
110
110
|
const data = await res.json();
|
|
111
111
|
return {
|
|
112
|
-
isLoading: false,
|
|
113
112
|
numberOfNotifications: data.totalCount,
|
|
114
113
|
notifications: data.data,
|
|
115
114
|
hasMore: data.hasMore
|
|
@@ -118,7 +117,6 @@ export const getNotifications = async ({ baseUrl, page, token }) => {
|
|
|
118
117
|
catch (error) {
|
|
119
118
|
console.log(error);
|
|
120
119
|
return {
|
|
121
|
-
isLoading: false,
|
|
122
120
|
numberOfNotifications: 0,
|
|
123
121
|
notifications: [],
|
|
124
122
|
hasMore: undefined
|
|
@@ -94,6 +94,7 @@ export class NutsInboxWidget {
|
|
|
94
94
|
}
|
|
95
95
|
closePopoverHandler() {
|
|
96
96
|
this.popoverVisible = false;
|
|
97
|
+
window.postMessage({ type: 'nuts-popover-isVisible', value: this.popoverVisible }, window.location.href);
|
|
97
98
|
}
|
|
98
99
|
positionIcon() {
|
|
99
100
|
if (this.bellIconPosition == 'left') {
|
|
@@ -180,7 +181,7 @@ export class NutsInboxWidget {
|
|
|
180
181
|
return (h("div", { onClick: this.togglePopover, class: "BellIcon" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", fill: "currentColor", class: "bi bi-bell", viewBox: "0 0 16 16" }, ' ', h("path", { d: "M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z" }), ' '), this.unseenCount > 0 ? (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", class: "nc-bell-button-dot css-0 css-1eg2znq" }, h("rect", { x: "1.5", y: "1.5", width: "13", height: "13", rx: "6.5", fill: "url(#paint0_linear_1722_2699)", stroke: "#1E1E26", "stroke-width": "3" }), h("defs", null, h("linearGradient", { id: "paint0_linear_1722_2699", x1: "8", y1: "13", x2: "8", y2: "3", gradientUnits: "userSpaceOnUse" }, h("stop", { "stop-color": "#FF512F" }), h("stop", { offset: "1", "stop-color": "#DD2476" }))))) : ('')));
|
|
181
182
|
}
|
|
182
183
|
render() {
|
|
183
|
-
return (h("div", { key: '
|
|
184
|
+
return (h("div", { key: '787bb05f5d9899db7ffb3ec0e4af11f3942d22f0', ref: this.assignRefToStylingContainer, class: "Wrapper" }, h("div", { key: 'dbb13d5d8b49a2a0f0b4cf937bac1040ce49c1c0', ref: this.assignRefToBell, class: "BellIconWrapper" }, !this.isLoading && this.renderBellIcon()), this.popoverVisible && (h("nuts-popover", { key: 'f69d320f49d55b352e388af91949a03adf09cc9f', "notification-action": this.notificationAction, sessionId: this.sessionId, "unseen-count": this.unseenCount, token: this.token, "backend-url": this.backendUrl, "operator-id": this.operatorId, "user-id": this.userId, language: this.language, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-url": this.translationUrl }))));
|
|
184
185
|
}
|
|
185
186
|
static get is() { return "nuts-inbox-widget"; }
|
|
186
187
|
static get encapsulation() { return "shadow"; }
|
|
@@ -75,8 +75,14 @@
|
|
|
75
75
|
opacity: 0.7;
|
|
76
76
|
transition: 250ms;
|
|
77
77
|
}
|
|
78
|
+
.Popover .Header .ActionButtons {
|
|
79
|
+
margin-left: auto;
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
}
|
|
78
84
|
.Popover .Header .DeleteAll,
|
|
79
|
-
.Popover .Header .
|
|
85
|
+
.Popover .Header .ClosePopover {
|
|
80
86
|
font-style: normal;
|
|
81
87
|
border: none;
|
|
82
88
|
background: transparent;
|
|
@@ -88,15 +94,25 @@
|
|
|
88
94
|
opacity: 0.5;
|
|
89
95
|
}
|
|
90
96
|
.Popover .Header .DeleteAll svg,
|
|
91
|
-
.Popover .Header .
|
|
97
|
+
.Popover .Header .ClosePopover svg {
|
|
92
98
|
width: 25px;
|
|
93
99
|
height: 25px;
|
|
94
100
|
}
|
|
95
101
|
.Popover .Header .DeleteAll:hover,
|
|
96
|
-
.Popover .Header .
|
|
102
|
+
.Popover .Header .ClosePopover:hover {
|
|
97
103
|
opacity: 0.7;
|
|
98
104
|
transition: 250ms;
|
|
99
105
|
}
|
|
106
|
+
.Popover .Header .ClosePopover div {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
}
|
|
111
|
+
.Popover .Header .DeleteAll {
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
}
|
|
100
116
|
.Popover .Header .DeleteAll svg {
|
|
101
117
|
width: 30px;
|
|
102
118
|
height: 30px;
|
|
@@ -108,9 +124,6 @@
|
|
|
108
124
|
opacity: 0.5;
|
|
109
125
|
cursor: not-allowed;
|
|
110
126
|
}
|
|
111
|
-
.Popover .Header .Close {
|
|
112
|
-
margin-left: auto;
|
|
113
|
-
}
|
|
114
127
|
.Popover .DeleteAllDropdown {
|
|
115
128
|
z-index: 999;
|
|
116
129
|
position: absolute;
|
|
@@ -6,33 +6,15 @@ import { renderIconDefinitionToSVGElement } from "@ant-design/icons-svg/es/helpe
|
|
|
6
6
|
export class NutsPopover {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.currentPage = 0;
|
|
9
|
-
this.updateNotificationsDataAfterPageChange = (getNotificationsData) => {
|
|
10
|
-
this.notifications = getNotificationsData.notifications;
|
|
11
|
-
this.hasMore = getNotificationsData.hasMore;
|
|
12
|
-
this.isLoading = getNotificationsData.isLoading;
|
|
13
|
-
};
|
|
14
9
|
this.nextPage = async () => {
|
|
15
|
-
if (!this.hasMore) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
10
|
this.currentPage++;
|
|
19
|
-
|
|
20
|
-
baseUrl: this.baseUrl,
|
|
21
|
-
token: this.token,
|
|
22
|
-
page: this.currentPage
|
|
23
|
-
}).then((data) => {
|
|
24
|
-
return this.updateNotificationsDataAfterPageChange(data);
|
|
25
|
-
});
|
|
11
|
+
this.triggerGetNotifications();
|
|
26
12
|
};
|
|
27
13
|
this.prevPage = () => {
|
|
28
14
|
if (this.currentPage > 0) {
|
|
29
15
|
this.currentPage--;
|
|
30
16
|
}
|
|
31
|
-
|
|
32
|
-
baseUrl: this.baseUrl,
|
|
33
|
-
token: this.token,
|
|
34
|
-
page: this.currentPage
|
|
35
|
-
}).then((data) => this.updateNotificationsDataAfterPageChange(data));
|
|
17
|
+
this.triggerGetNotifications();
|
|
36
18
|
};
|
|
37
19
|
this.setClientStyling = () => {
|
|
38
20
|
let sheet = document.createElement('style');
|
|
@@ -100,7 +82,8 @@ export class NutsPopover {
|
|
|
100
82
|
this.clientStyling = '';
|
|
101
83
|
this.translationUrl = '';
|
|
102
84
|
this.notifications = undefined;
|
|
103
|
-
this.isLoading =
|
|
85
|
+
this.isLoading = false;
|
|
86
|
+
this.isNotificationsLoading = true;
|
|
104
87
|
this.showMarkAll = false;
|
|
105
88
|
this.limitStylingAppends = false;
|
|
106
89
|
this.showDeleteAllPopup = false;
|
|
@@ -110,19 +93,11 @@ export class NutsPopover {
|
|
|
110
93
|
this.notifications = this.notifications.filter((item) => {
|
|
111
94
|
return item.id != event.detail;
|
|
112
95
|
});
|
|
113
|
-
|
|
114
|
-
baseUrl: this.baseUrl,
|
|
115
|
-
token: this.token,
|
|
116
|
-
page: this.currentPage
|
|
117
|
-
}).then((data) => this.updateNotificationsDataAfterPageChange(data));
|
|
96
|
+
this.triggerGetNotifications();
|
|
118
97
|
}
|
|
119
98
|
allMessagesDeletedHandler() {
|
|
120
99
|
this.notifications = [];
|
|
121
|
-
|
|
122
|
-
baseUrl: this.baseUrl,
|
|
123
|
-
token: this.token,
|
|
124
|
-
page: this.currentPage
|
|
125
|
-
}).then((data) => this.updateNotificationsDataAfterPageChange(data));
|
|
100
|
+
this.triggerGetNotifications();
|
|
126
101
|
}
|
|
127
102
|
newNotificationHandler(event) {
|
|
128
103
|
if (Array.isArray(this.notifications)) {
|
|
@@ -176,26 +151,37 @@ export class NutsPopover {
|
|
|
176
151
|
}
|
|
177
152
|
// end custom styling area
|
|
178
153
|
}
|
|
179
|
-
|
|
180
|
-
this.
|
|
154
|
+
async triggerGetNotifications() {
|
|
155
|
+
this.isNotificationsLoading = true;
|
|
181
156
|
getNotifications({
|
|
182
157
|
baseUrl: this.baseUrl,
|
|
183
158
|
token: this.token,
|
|
184
159
|
page: this.currentPage
|
|
185
|
-
})
|
|
160
|
+
})
|
|
161
|
+
.then((data) => {
|
|
162
|
+
this.notifications = data.notifications;
|
|
163
|
+
this.hasMore = data.hasMore;
|
|
164
|
+
})
|
|
165
|
+
.finally(() => {
|
|
166
|
+
this.isNotificationsLoading = false;
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
connectedCallback() {
|
|
170
|
+
this.baseUrl = `${this.backendUrl}/v1/${this.operatorId}`;
|
|
171
|
+
this.triggerGetNotifications();
|
|
186
172
|
if (this.unseenCount != 0) {
|
|
187
173
|
this.showMarkAll = true;
|
|
188
174
|
}
|
|
189
175
|
}
|
|
190
176
|
render() {
|
|
191
177
|
var _a, _b, _c;
|
|
192
|
-
|
|
178
|
+
const hasMore = this.hasMore || ((_a = this.notifications) === null || _a === void 0 ? void 0 : _a.length) > 10;
|
|
179
|
+
return (h("div", { key: '94960f5609a5dd4f9a318b052e99896da2670bbb', class: "Popover", ref: this.assignRefToStylingContainer }, h("div", { key: 'cb40bd7d3db8d9ce4fab632e5460ea562882f809', class: "Header" }, h("div", { key: '058ea6897706dd84ba25d06f91fe8a2bfc1fd01b', class: "Title" }, translate('notifications', this.language), this.unseenCount > 0 ? h("div", { class: "UnseenCounter" }, this.unseenCount) : ''), this.showMarkAll && (h("div", { key: '32d7c170433047c845ff9dd2218e7c87e1290ff4', class: "MarkAsRead", onClick: this.markAllNotificationsAsRead }, translate('markAllAsRead', this.language))), h("div", { key: '4aff88677c6bf58cca1eb73eda1da1f58c75ce71', class: "ActionButtons" }, h("button", { key: '5590daa75d8905058f776207e45b910438cbfa3e', class: `DeleteAll${this.showDeleteAllPopup ? ' Active' : ''}`, onClick: this.showDeletePopup, disabled: !((_b = this.notifications) === null || _b === void 0 ? void 0 : _b.length) }, h("svg", { key: '3a76d4a165150da3929654e3e261c89ecfea1563', width: "16", height: "16", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: 'a7a3cedc1e9f785cc26cb413dbaf183c49ed02f8', 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: '71e571b7f006bbcbcdac05ddd204f7b5dbdad04e', class: "ClosePopover", onClick: this.closePopover }, h("div", { key: 'ef1eeb7359b3957a14ddabd04db94e385da975eb', innerHTML: renderIconDefinitionToSVGElement(CloseCircleOutlined, {
|
|
193
180
|
extraSVGAttrs: { width: '20px', height: '20px', fill: '#A1A1B2' }
|
|
194
|
-
}) })), this.showDeleteAllPopup && (h("div", { key: '
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
})) : (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 && (((_c = this.notifications) === null || _c === void 0 ? void 0 : _c.length) >= 10 || this.currentPage !== 0) ? (h("div", { class: "Pagination" }, h("div", { class: "Button" }, h("button", { disabled: this.currentPage <= 0, onClick: this.prevPage }, h("svg", { class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { 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", { class: "Button" }, h("button", { disabled: !this.hasMore, onClick: this.nextPage }, translate('next', this.language), h("svg", { class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { 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" })))))) : ('')));
|
|
181
|
+
}) }))), this.showDeleteAllPopup && (h("div", { key: 'd0b41220c1f8621a60aecd33dd9898c04600951b', class: "DeleteAllDropdown", ref: (el) => (this.dropdownRef = el) }, h("button", { key: 'af20f31747b4998eeff55a028fde7c9fe11149a9', onClick: this.deleteAllNotifications }, translate('deleteAllMessages', this.language))))), h("div", { key: '61f995dcbf74c027b0f70c84ef8dbc35e66c782f', class: "NotificationList" }, !this.isLoading && ((_c = this.notifications) === null || _c === void 0 ? void 0 : _c.length) > 0 ? (this.notifications.map((item) => {
|
|
182
|
+
var _a;
|
|
183
|
+
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.actor) === null || _a === void 0 ? void 0 : _a.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 }));
|
|
184
|
+
})) : (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: '65cf0c44a9c280e0124a157641d87f3cfe86f044', class: "Pagination" }, h("div", { key: 'fdbd9a5e01bc05a0eda65385d914a9ae3df38770', class: "Button" }, h("button", { key: 'ff49010496c01de7b501037c8d50f9e1abf59726', disabled: this.currentPage <= 0, onClick: this.prevPage }, h("svg", { key: '1da4701f89af5f1072f0faba9e2c7775bd761044', class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { key: 'e66f3da84a565461a92839b883cb05c5b62242ad', 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: '7f24dbe58cf922a17ea57e03dee020afbacd879f', class: "Button" }, h("button", { key: 'fe8515e9bc6c35c3c6032745415b3f8b405fe4bb', disabled: this.isNotificationsLoading || !hasMore, onClick: this.nextPage }, translate('next', this.language), h("svg", { key: '9bb9aa49db50905f571bb0b70159c813742dd37c', class: "svg-icon", viewBox: "0 0 20 20" }, h("path", { key: '4a84d3e9108bba79370cae2df4224252ef3d2733', 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" }))))))));
|
|
199
185
|
}
|
|
200
186
|
static get is() { return "nuts-popover"; }
|
|
201
187
|
static get originalStyleUrls() {
|
|
@@ -405,6 +391,7 @@ export class NutsPopover {
|
|
|
405
391
|
return {
|
|
406
392
|
"notifications": {},
|
|
407
393
|
"isLoading": {},
|
|
394
|
+
"isNotificationsLoading": {},
|
|
408
395
|
"showMarkAll": {},
|
|
409
396
|
"limitStylingAppends": {},
|
|
410
397
|
"showDeleteAllPopup": {},
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
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],"limitStylingAppends":[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],"showMarkAll":[32],"limitStylingAppends":[32],"showDeleteAllPopup":[32],"hasMore":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"allMessagesDeleted","allMessagesDeletedHandler"],[8,"newNotification","newNotificationHandler"],[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"],"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],"limitStylingAppends":[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","messageDeteledHandler"],[8,"allMessagesDeleted","allMessagesDeletedHandler"],[8,"newNotification","newNotificationHandler"],[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"],"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 };
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
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],"limitStylingAppends":[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],"showMarkAll":[32],"limitStylingAppends":[32],"showDeleteAllPopup":[32],"hasMore":[32]},[[8,"messageDeleted","messageDeteledHandler"],[8,"allMessagesDeleted","allMessagesDeletedHandler"],[8,"newNotification","newNotificationHandler"],[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"],"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);
|
|
19
|
+
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],"limitStylingAppends":[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","messageDeteledHandler"],[8,"allMessagesDeleted","allMessagesDeletedHandler"],[8,"newNotification","newNotificationHandler"],[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"],"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);
|
|
20
20
|
});
|