@digital-realty/ix-notifications 1.0.21 → 1.0.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/IxNotifications.js +90 -48
- package/dist/IxNotifications.js.map +1 -1
- package/dist/assets/iconset.d.ts +6 -0
- package/dist/assets/iconset.js +8 -0
- package/dist/assets/iconset.js.map +1 -0
- package/dist/components/notifications/date-filters.js +20 -20
- package/dist/components/notifications/date-filters.js.map +1 -1
- package/dist/components/notifications/group-filters.js +28 -22
- package/dist/components/notifications/group-filters.js.map +1 -1
- package/dist/components/notifications/grouped-item.d.ts +1 -1
- package/dist/components/notifications/grouped-item.js +10 -5
- package/dist/components/notifications/grouped-item.js.map +1 -1
- package/dist/components/notifications/notification-item.d.ts +3 -2
- package/dist/components/notifications/notification-item.js +74 -42
- package/dist/components/notifications/notification-item.js.map +1 -1
- package/dist/components/notifications/notification-tooltip.d.ts +9 -0
- package/dist/components/notifications/notification-tooltip.js +53 -0
- package/dist/components/notifications/notification-tooltip.js.map +1 -0
- package/dist/components/notifications/view-item-dialog.d.ts +1 -1
- package/dist/components/notifications/view-item-dialog.js +15 -20
- package/dist/components/notifications/view-item-dialog.js.map +1 -1
- package/dist/constants/notifications.d.ts +1 -1
- package/dist/constants/notifications.js +1 -1
- package/dist/constants/notifications.js.map +1 -1
- package/dist/helper/common.js +3 -4
- package/dist/helper/common.js.map +1 -1
- package/dist/ix-notifications.min.js +1 -1
- package/dist/models/notification.js.map +1 -1
- package/dist/state/NotificationState.js +14 -14
- package/dist/state/NotificationState.js.map +1 -1
- package/dist/styles/notifications-style.js +49 -6
- package/dist/styles/notifications-style.js.map +1 -1
- package/package.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationState.js","sourceRoot":"","sources":["../../src/state/NotificationState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,mB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kB,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import { makeAutoObservable } from 'mobx';\nimport { clearPersistedStore, getPersistedStore, hydrateStore, isHydrated, makePersistable } from 'mobx-persist-store';\nimport { parse, subDays } from 'date-fns';\nimport { ApiCallResult, Notification } from '../models/notification.js';\nimport {\n NotificationFilters,\n NotificationDateFilters,\n} from '../constants/notification-types.js';\nimport {\n NotificationGroups,\n NotificationStatus,\n DefaultDateFormat,\n DefaultDisplayDays,\n ApiCallState,\n} from '../constants/notifications.js';\nimport { ApiClient } from '../services/api-client.js';\nimport {\n mapNotificationDataToNotification,\n mapNotificationResponseToNotifications,\n mapParametersToPatchNotificationRequest,\n mapParametersToNotificationRequest,\n mapParametersToDeleteNotificationRequest,\n getNextPageCursorfromQueryParam,\n} from '../services/notifications-service.js';\nimport { handleError } from '../helper/errors.js';\nimport { getUserAuthorization } from '../services/app-service.js';\n\nclass NotificationState {\n constructor() {\n makeAutoObservable(this);\n makePersistable(this, {\n name: 'notification-state',\n properties: [\n 'notificationFilters',\n 'dateFilters'\n ],\n storage: window.localStorage,\n });\n\n }\n\n get isHydrated() {\n return isHydrated(this);\n }\n\n async hydrateStore() {\n await hydrateStore(this);\n }\n\n async clearStoredData() {\n await clearPersistedStore(this);\n }\n\n async getStoredData() {\n return getPersistedStore(this);\n }\n\n apiClient: ApiClient = { noInit: true } as ApiClient;\n\n baseApiUrl: string = '';\n\n localStorageKey: string = '';\n\n public NewApiClient = () => {\n this.apiClient = new ApiClient({\n NotificationApiUrl: this.baseApiUrl,\n getAuthorizationFn: () => getUserAuthorization(this.localStorageKey),\n });\n\n this.getNotifications();\n };\n\n public ConstructApiClient() {\n return this.apiClient.noInit ? this.NewApiClient() : this.apiClient;\n }\n\n nextPageCursor: string | undefined = '';\n\n submissionResult?: any;\n\n notifications: Notification[] = [] as Notification[];\n\n unreadNotificationCount: number = 0;\n\n notificationFilters: NotificationFilters = {\n SHOW_PLANNED_MAINTENANCE: true,\n SHOW_SERVICE_TICKETS: true,\n SHOW_DCIM_ALERTS: true,\n } as NotificationFilters;\n\n selectedNotification: Notification = {\n id: '',\n resourceType: NotificationGroups.PLANNED_MAINTENANCE,\n subGroup: '',\n subject: '',\n resourceId: '',\n locations: [],\n createdAt: '',\n accountNumber: '',\n createdBy: '',\n status: NotificationStatus.READ,\n } as Notification;\n\n dateFilters: NotificationDateFilters = {\n FROM_DATE: subDays(new Date(), DefaultDisplayDays),\n TO_DATE: new Date(),\n } as NotificationDateFilters;\n\n async clearStoredNotificationsData() {\n this.notifications = [] as Notification[];\n this.unreadNotificationCount = 0;\n this.nextPageCursor = \"\";\n }\n\n public async setNotificationReadStatus(Id: String): Promise<Boolean> {\n const result = await this.setNotificationAsRead(Id.toString());\n if(await result === true)\n {\n this.ReduceUnreadNotificationCount();\n const itemIndex = this.notifications.findIndex(item => item.id === Id);\n this.notifications[itemIndex].status = NotificationStatus.READ;\n this.selectedNotification = this.notifications[itemIndex];\n }\n return result;\n }\n\n\n public async setNotificationDeleted(Id: String) : Promise<ApiCallResult> {\n const result = await this.DeleteNotification(Id.toString());\n if (result === true) {\n const deleteditem = this.notifications.find(item => item.id === Id);\n if(deleteditem?.status == 'unread')\n this.ReduceUnreadNotificationCount();\n\n const itemIndex = this.notifications.findIndex(item => item.id === Id);\n this.notifications.splice(itemIndex, 1);\n }\n\n return { State : result === true? ApiCallState.SUCCESS : ApiCallState.ERROR,\n Message : result === true? \"Successfully deleted the notificaion\" : \"Error while deleting the notification\"\n } as ApiCallResult;\n }\n\n public setNotificationDateFilter(fromDate?: string, toDate?: string) {\n if (fromDate !== undefined) {\n this.dateFilters.FROM_DATE = parse(fromDate,DefaultDateFormat,new Date());\n } else {\n this.dateFilters.FROM_DATE = undefined;\n }\n\n if (toDate !== undefined) {\n this.dateFilters.TO_DATE = parse(toDate, DefaultDateFormat, new Date());\n } else {\n this.dateFilters.TO_DATE = undefined;\n }\n }\n\n public setNotificationFilter(Id: String | undefined, value: Boolean) {\n switch (Id) {\n case NotificationGroups.PLANNED_MAINTENANCE:\n this.notificationFilters.SHOW_PLANNED_MAINTENANCE = value;\n break;\n case NotificationGroups.SERVICE_TICKETS:\n this.notificationFilters.SHOW_SERVICE_TICKETS = value;\n break;\n case NotificationGroups.DCIM_ALERTS:\n this.notificationFilters.SHOW_DCIM_ALERTS = value;\n break;\n default:\n }\n }\n\n public async getNotifications() {\n let result;\n // this.nextPageCursor === undefined means Next page not available\n if (this.nextPageCursor !== undefined) {\n result = await this.apiClient?.notificationsApi\n .getNotificationsRaw(\n mapParametersToNotificationRequest(\n getNextPageCursorfromQueryParam(this.nextPageCursor)\n )\n )\n .catch((e: any) => {\n handleError(e, false);\n return undefined;\n });\n\n if (result) {\n\n this.unreadNotificationCount = Number(((result as any).raw.headers as any).get('x-total-unread-count') ?? '0');\n\n const responseResult = await result?.value();\n this.notifications =\n this.nextPageCursor === ''\n ? mapNotificationResponseToNotifications(responseResult?.items)\n : this.notifications.concat(\n mapNotificationResponseToNotifications(responseResult?.items)\n );\n\n this.nextPageCursor =\n responseResult?.next !== undefined ? responseResult?.next : undefined;\n }\n }\n }\n\n public async getNotificationsById(id?: string) {\n let result;\n if (id) {\n result = await this.apiClient?.notificationsApi\n .getNotificationsById({ id })\n .catch((e: any) => {\n handleError(e, false);\n return undefined;\n });\n }\n if (result) {\n this.selectedNotification = mapNotificationDataToNotification(result);\n }\n }\n\n private async setNotificationAsRead(id?: string) : Promise<Boolean> {\n if (id) {\n await this.apiClient?.notificationsApi\n .patchNotificationsById(\n mapParametersToPatchNotificationRequest(id, 'read')\n )\n .catch((e: any) => {\n handleError(e, false);\n return false;\n });\n return true;\n }\n return false;\n }\n\n private async DeleteNotification(id?: string): Promise<boolean> {\n let result = false;\n if (id) {\n await this.apiClient?.notificationsApi\n .deleteNotificationsById(mapParametersToDeleteNotificationRequest(id))\n .catch((e: any) => {\n handleError(e, false);\n result = false;\n })\n .then((data : any) => {\n result = true;\n });\n }\n return result;\n }\n\n private ReduceUnreadNotificationCount() {\n if(this.unreadNotificationCount > 0)\n this.unreadNotificationCount = this.unreadNotificationCount - 1;\n }\n}\n\nconst NotificationsState = new NotificationState();\n\nexport { NotificationsState };\n"]}
|
|
1
|
+
{"version":3,"file":"NotificationState.js","sourceRoot":"","sources":["../../src/state/NotificationState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAM1C,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,GACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,iCAAiC,EACjC,sCAAsC,EACtC,uCAAuC,EACvC,kCAAkC,EAClC,wCAAwC,EACxC,+BAA+B,GAChC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,iBAAiB;IACrB;QAyBA,cAAS,GAAc,EAAE,MAAM,EAAE,IAAI,EAAe,CAAC;QAErD,eAAU,GAAW,EAAE,CAAC;QAExB,oBAAe,GAAW,EAAE,CAAC;QAEtB,iBAAY,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC;gBAC7B,kBAAkB,EAAE,IAAI,CAAC,UAAU;gBACnC,kBAAkB,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,eAAe,CAAC;aACrE,CAAC,CAAC;YAEH,IAAI,CAAC,gBAAgB,EAA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,MAAM,GAAG,KAAK,CAAC;YACjB,CAAC,EACA,IAAI,CAAC,GAAG,EAAE;gBACT,MAAM,GAAG,IAAI,CAAC;YAChB,CAAC,CAAC,CAAA,CAAC;SACN;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,6BAA6B;QACnC,IAAI,IAAI,CAAC,uBAAuB,GAAG,CAAC;YAAE,IAAI,CAAC,uBAAuB,IAAI,CAAC,CAAC;IAC1E,CAAC;CACF;AAED,MAAM,kBAAkB,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import { makeAutoObservable } from 'mobx';\nimport {\n clearPersistedStore,\n getPersistedStore,\n hydrateStore,\n isHydrated,\n makePersistable,\n} from 'mobx-persist-store';\nimport { parse, subDays } from 'date-fns';\nimport { ApiCallResult, Notification } from '../models/notification.js';\nimport {\n NotificationFilters,\n NotificationDateFilters,\n} from '../constants/notification-types.js';\nimport {\n NotificationGroups,\n NotificationStatus,\n DefaultDateFormat,\n DefaultDisplayDays,\n ApiCallState,\n} from '../constants/notifications.js';\nimport { ApiClient } from '../services/api-client.js';\nimport {\n mapNotificationDataToNotification,\n mapNotificationResponseToNotifications,\n mapParametersToPatchNotificationRequest,\n mapParametersToNotificationRequest,\n mapParametersToDeleteNotificationRequest,\n getNextPageCursorfromQueryParam,\n} from '../services/notifications-service.js';\nimport { handleError } from '../helper/errors.js';\nimport { getUserAuthorization } from '../services/app-service.js';\n\nclass NotificationState {\n constructor() {\n makeAutoObservable(this);\n makePersistable(this, {\n name: 'notification-state',\n properties: ['notificationFilters', 'nextPageCursor'],\n storage: window.localStorage,\n });\n }\n\n get isHydrated() {\n return isHydrated(this);\n }\n\n async hydrateStore() {\n await hydrateStore(this);\n }\n\n async clearStoredData() {\n await clearPersistedStore(this);\n }\n\n async getStoredData() {\n return getPersistedStore(this);\n }\n\n apiClient: ApiClient = { noInit: true } as ApiClient;\n\n baseApiUrl: string = '';\n\n localStorageKey: string = '';\n\n public NewApiClient = () => {\n this.apiClient = new ApiClient({\n NotificationApiUrl: this.baseApiUrl,\n getAuthorizationFn: () => getUserAuthorization(this.localStorageKey),\n });\n\n this.getNotifications();\n };\n\n public ConstructApiClient() {\n return this.apiClient.noInit ? this.NewApiClient() : this.apiClient;\n }\n\n nextPageCursor: string | undefined = '';\n\n submissionResult?: any;\n\n notifications: Notification[] = [] as Notification[];\n\n unreadNotificationCount: number = 0;\n\n notificationFilters: NotificationFilters = {\n SHOW_PLANNED_MAINTENANCE: true,\n SHOW_SERVICE_TICKETS: true,\n SHOW_DCIM_ALERTS: true,\n } as NotificationFilters;\n\n selectedNotification: Notification = {\n id: '',\n resourceType: NotificationGroups.PLANNED_MAINTENANCE,\n subGroup: '',\n subject: '',\n resourceId: '',\n locations: [],\n createdAt: '',\n accountNumber: '',\n createdBy: '',\n status: NotificationStatus.READ,\n } as Notification;\n\n dateFilters: NotificationDateFilters = {\n FROM_DATE: subDays(new Date(), DefaultDisplayDays),\n TO_DATE: new Date(),\n } as NotificationDateFilters;\n\n async clearStoredNotificationsData() {\n this.notifications = [] as Notification[];\n this.unreadNotificationCount = 0;\n this.nextPageCursor = '';\n }\n\n public async setNotificationReadStatus(Id: String): Promise<Boolean> {\n const result = await this.setNotificationAsRead(Id.toString());\n if ((await result) === true) {\n this.ReduceUnreadNotificationCount();\n const itemIndex = this.notifications.findIndex(item => item.id === Id);\n this.notifications[itemIndex].status = NotificationStatus.READ;\n this.selectedNotification = this.notifications[itemIndex];\n }\n return result;\n }\n\n public async setNotificationDeleted(Id: String): Promise<ApiCallResult> {\n const result = await this.DeleteNotification(Id.toString());\n if (result === true) {\n const deleteditem = this.notifications.find(item => item.id === Id);\n if (deleteditem?.status === 'unread')\n this.ReduceUnreadNotificationCount();\n\n const itemIndex = this.notifications.findIndex(item => item.id === Id);\n this.notifications.splice(itemIndex, 1);\n }\n\n return {\n State: result === true ? ApiCallState.SUCCESS : ApiCallState.ERROR,\n Message:\n result === true\n ? 'Successfully deleted the notificaion'\n : 'Error while deleting the notification',\n } as ApiCallResult;\n }\n\n public setNotificationDateFilter(fromDate?: string, toDate?: string) {\n if (fromDate !== undefined) {\n this.dateFilters.FROM_DATE = parse(\n fromDate,\n DefaultDateFormat,\n new Date()\n );\n } else {\n this.dateFilters.FROM_DATE = undefined;\n }\n\n if (toDate !== undefined) {\n this.dateFilters.TO_DATE = parse(toDate, DefaultDateFormat, new Date());\n } else {\n this.dateFilters.TO_DATE = undefined;\n }\n }\n\n public setNotificationFilter(Id: String | undefined, value: Boolean) {\n switch (Id) {\n case NotificationGroups.PLANNED_MAINTENANCE:\n this.notificationFilters.SHOW_PLANNED_MAINTENANCE = value;\n break;\n case NotificationGroups.SERVICE_TICKETS:\n this.notificationFilters.SHOW_SERVICE_TICKETS = value;\n break;\n case NotificationGroups.DCIM_ALERTS:\n this.notificationFilters.SHOW_DCIM_ALERTS = value;\n break;\n default:\n }\n }\n\n public async getNotifications() {\n let result;\n // this.nextPageCursor === undefined means Next page not available\n if (this.nextPageCursor !== undefined) {\n result = await this.apiClient?.notificationsApi\n .getNotificationsRaw(\n mapParametersToNotificationRequest(\n getNextPageCursorfromQueryParam(this.nextPageCursor)\n )\n )\n .catch((e: any) => {\n handleError(e, false);\n return undefined;\n });\n\n if (result) {\n const responseResult = await result?.value();\n this.notifications =\n this.nextPageCursor === ''\n ? mapNotificationResponseToNotifications(responseResult?.items)\n : this.notifications.concat(\n mapNotificationResponseToNotifications(responseResult?.items)\n );\n this.nextPageCursor =\n responseResult?.next !== undefined ? responseResult?.next : undefined;\n this.unreadNotificationCount = this.notifications.filter(\n notification => notification.status === NotificationStatus.UNREAD\n ).length;\n }\n }\n }\n\n public async getNotificationsById(id?: string) {\n let result;\n if (id) {\n result = await this.apiClient?.notificationsApi\n .getNotificationsById({ id })\n .catch((e: any) => {\n handleError(e, false);\n return undefined;\n });\n }\n if (result) {\n this.selectedNotification = mapNotificationDataToNotification(result);\n }\n }\n\n private async setNotificationAsRead(id?: string): Promise<Boolean> {\n if (id) {\n await this.apiClient?.notificationsApi\n .patchNotificationsById(\n mapParametersToPatchNotificationRequest(id, 'read')\n )\n .catch((e: any) => {\n handleError(e, false);\n return false;\n });\n return true;\n }\n return false;\n }\n\n private async DeleteNotification(id?: string): Promise<boolean> {\n let result = false;\n if (id) {\n await this.apiClient?.notificationsApi\n .deleteNotificationsById(mapParametersToDeleteNotificationRequest(id))\n .catch((e: any) => {\n handleError(e, false);\n result = false;\n })\n .then(() => {\n result = true;\n });\n }\n return result;\n }\n\n private ReduceUnreadNotificationCount() {\n if (this.unreadNotificationCount > 0) this.unreadNotificationCount -= 1;\n }\n}\n\nconst NotificationsState = new NotificationState();\n\nexport { NotificationsState };\n"]}
|
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
export const NotificationsStyle = css `
|
|
3
|
-
.
|
|
3
|
+
.destructive-icon {
|
|
4
|
+
color: var(--md-sys-color-error);
|
|
4
5
|
--md-icon-button-icon-color: var(--md-sys-color-error);
|
|
5
6
|
--md-sys-color-on-surface-variant: var(--md-sys-color-error);
|
|
6
7
|
}
|
|
7
|
-
.
|
|
8
|
+
.destructive-icon path {
|
|
9
|
+
fill: var(--md-sys-color-error);
|
|
10
|
+
}
|
|
11
|
+
.active-icon {
|
|
12
|
+
color: var(--ix-sys-primary);
|
|
8
13
|
--md-icon-button-icon-color: var(--ix-sys-primary);
|
|
9
14
|
--md-sys-color-on-surface-variant: var(--ix-sys-primary);
|
|
10
15
|
}
|
|
11
|
-
.
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
.active-icon path {
|
|
17
|
+
fill: var(--ix-sys-primary);
|
|
18
|
+
}
|
|
19
|
+
.inactive-icon {
|
|
20
|
+
color: var(--ix-font-color);
|
|
21
|
+
--md-icon-button-icon-color: var(--ix-font-color);
|
|
22
|
+
--md-sys-color-on-surface-variant: var(--ix-font-color);
|
|
14
23
|
cursor: default;
|
|
24
|
+
opacity: 0.6;
|
|
25
|
+
}
|
|
26
|
+
.inactive-icon path {
|
|
27
|
+
fill: var(--ix-font-color);
|
|
28
|
+
opacity: 0.6;
|
|
29
|
+
}
|
|
30
|
+
ix-icon-button.sharp {
|
|
31
|
+
--md-icon-font: 'Material Symbols Sharp' !important;
|
|
15
32
|
}
|
|
16
33
|
.notification-item-unread,
|
|
17
34
|
.notification-item-read {
|
|
@@ -24,10 +41,13 @@ export const NotificationsStyle = css `
|
|
|
24
41
|
font-weight: bold;
|
|
25
42
|
cursor: pointer;
|
|
26
43
|
align-items: center;
|
|
44
|
+
padding-left: 14px;
|
|
45
|
+
}
|
|
46
|
+
.notification-item-read {
|
|
47
|
+
border-left: 3px solid transparent;
|
|
27
48
|
}
|
|
28
49
|
.notification-item-unread {
|
|
29
50
|
border-left: 3px solid var(--ix-button-confirm-color);
|
|
30
|
-
padding-left: 14px;
|
|
31
51
|
}
|
|
32
52
|
.notification-item-unread:hover,
|
|
33
53
|
.notification-item-read:hover {
|
|
@@ -67,7 +87,13 @@ export const NotificationsStyle = css `
|
|
|
67
87
|
.ix-icon-groups {
|
|
68
88
|
--ix-icon-font-size: 32px;
|
|
69
89
|
--ix-icon-line-height: 32px;
|
|
90
|
+
}
|
|
91
|
+
.ix-icon-groups ix-icon {
|
|
70
92
|
color: var(--md-sys-text-color-primary);
|
|
93
|
+
opacity: 0.6;
|
|
94
|
+
}
|
|
95
|
+
.ix-icon-groups ix-icon path {
|
|
96
|
+
fill: var(--md-sys-text-color-primary);
|
|
71
97
|
}
|
|
72
98
|
:host {
|
|
73
99
|
--ix-drawer-border-radius: 0;
|
|
@@ -75,6 +101,12 @@ export const NotificationsStyle = css `
|
|
|
75
101
|
--ix-draw-width-sm: 50vw;
|
|
76
102
|
--ix-draw-width-lg: 30vw;
|
|
77
103
|
}
|
|
104
|
+
.ix-switch-hover {
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
107
|
+
.ix-switch-hover:hover {
|
|
108
|
+
background-color: rgba(123, 160, 238, 0.1);
|
|
109
|
+
}
|
|
78
110
|
.ix-switch-wrapper {
|
|
79
111
|
margin: 4px;
|
|
80
112
|
padding: 4px;
|
|
@@ -142,6 +174,9 @@ ix-switch {
|
|
|
142
174
|
font-size: 20px;
|
|
143
175
|
line-height: 24px;
|
|
144
176
|
}
|
|
177
|
+
h2 {
|
|
178
|
+
font-family: 'Open Sans', sans-serif;
|
|
179
|
+
}
|
|
145
180
|
h3 {
|
|
146
181
|
font-family: 'Open Sans', sans-serif;
|
|
147
182
|
font-size: 16px;
|
|
@@ -168,5 +203,13 @@ h3 {
|
|
|
168
203
|
padding-right: 1rem;
|
|
169
204
|
position: relative;
|
|
170
205
|
}
|
|
206
|
+
.notification-tooltip {
|
|
207
|
+
transform: translateX(-100%);
|
|
208
|
+
background-color: #040d19;
|
|
209
|
+
white-space: nowrap;
|
|
210
|
+
font-size: 0.75rem;
|
|
211
|
+
z-index: 999;
|
|
212
|
+
color: white;
|
|
213
|
+
}
|
|
171
214
|
`;
|
|
172
215
|
//# sourceMappingURL=notifications-style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications-style.js","sourceRoot":"","sources":["../../src/styles/notifications-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"notifications-style.js","sourceRoot":"","sources":["../../src/styles/notifications-style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoNpC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const NotificationsStyle = css`\n.destructive-icon {\n color: var(--md-sys-color-error);\n --md-icon-button-icon-color: var(--md-sys-color-error);\n --md-sys-color-on-surface-variant: var(--md-sys-color-error);\n}\n.destructive-icon path {\n fill: var(--md-sys-color-error);\n}\n.active-icon {\n color: var(--ix-sys-primary);\n --md-icon-button-icon-color: var(--ix-sys-primary);\n --md-sys-color-on-surface-variant: var(--ix-sys-primary);\n}\n.active-icon path {\n fill: var(--ix-sys-primary);\n}\n.inactive-icon {\n color: var(--ix-font-color);\n --md-icon-button-icon-color: var(--ix-font-color);\n --md-sys-color-on-surface-variant: var(--ix-font-color);\n cursor: default;\n opacity: 0.6;\n}\n.inactive-icon path {\n fill: var(--ix-font-color);\n opacity: 0.6;\n}\nix-icon-button.sharp {\n --md-icon-font: 'Material Symbols Sharp' !important;\n}\n.notification-item-unread,\n.notification-item-read {\n position: relative;\n display: flex;\n flex-direction: row;\n flex-grow: 1;\n padding: 0.5rem 0.75rem 1rem 1rem;\n background-color: white;\n font-weight: bold;\n cursor: pointer;\n align-items: center;\n padding-left: 14px;\n}\n.notification-item-read {\n border-left: 3px solid transparent;\n}\n.notification-item-unread {\n border-left: 3px solid var(--ix-button-confirm-color);\n}\n.notification-item-unread:hover,\n.notification-item-read:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.04);\n}\n.group-container-row {\n display: block;\n font-size: 12px;\n padding: 12px 0px 12px 0px;\n margin-top: 0px;\n margin-bottom: 0px;\n border-bottom: #e1e4e8 inset 1px;\n color: var(--md-sys-text-color-primary);\n font-weight: 400;\n font-size: 15px;\n line-height: 20px;\n letter-spacing: 0.15px;\n}\n.group-name {\n line-height: 24px;\n color: var(--md-sys-text-color-primary);\n}\n.group-item-name {\n display: grid;\n grid-template-columns: 1fr 20%;\n gap: 16px;\n -webkit-box-align: center;\n align-items: center;\n -webkit-box-flex: 1;\n flex-grow: 1;\n padding-top: 5px;\n}\n.notification-items-container {\n padding: 0px;\n}\n.ix-icon-groups {\n --ix-icon-font-size: 32px;\n --ix-icon-line-height: 32px;\n}\n.ix-icon-groups ix-icon {\n color: var(--md-sys-text-color-primary);\n opacity: 0.6;\n}\n.ix-icon-groups ix-icon path {\n fill: var(--md-sys-text-color-primary);\n}\n:host {\n --ix-drawer-border-radius: 0;\n --ix-drawer-padding: 0;\n --ix-draw-width-sm: 50vw;\n --ix-draw-width-lg: 30vw;\n}\n.ix-switch-hover {\n width: 100%;\n}\n.ix-switch-hover:hover {\n background-color: rgba(123, 160, 238, 0.1);\n}\n.ix-switch-wrapper {\n margin: 4px;\n padding: 4px;\n display: flex;\n column-gap: 0.75rem;\n align-items: center;\n}\nix-switch {\n --md-switch-selected-handle-color: var(--ix-sys-primary);\n --md-switch-selected-pressed-handle-color: var(--ix-sys-primary);\n --md-switch-selected-hover-handle-color: var(--ix-sys-primary);\n --md-switch-selected-focus-handle-color: var(--ix-sys-primary);\n --md-switch-selected-track-color: #7ba0ee;\n --md-switch-selected-pressed-track-color: #7ba0ee;\n --md-switch-selected-hover-track-color: #7ba0ee;\n --md-switch-selected-focus-track-color: #7ba0ee;\n --md-switch-track-height: 14px;\n --md-switch-track-width: 36px;\n --md-switch-track-outline-width: 0;\n --md-switch-handle-color: white;\n --md-switch-pressed-handle-color: white;\n --md-switch-hover-handle-color: white;\n --md-switch-focus-handle-color: white;\n --md-switch-handle-width: 20px;\n --md-switch-handle-height: 20px;\n display: flex;\n}\n.filter-dropdown-content,\n.datefilter-dropdown-content {\n display: none;\n position: absolute;\n right: 5%;\n top: 3rem;\n box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);\n z-index: 3;\n transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n border-radius: 3px;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;\n background-color: #ffffff;\n}\n.filter-dropdown-content.active {\n display: inline;\n}\n.datefilter-dropdown-content.active {\n display: inline;\n}\n.modal-text-blue {\n color: var(--ix-sys-primary);\n padding-left: 1.8rem;\n font-weight: bold;\n}\n.unread {\n font-family: 'Open Sans', sans-serif;\n padding: 0 5px;\n font-size: 12px;\n line-height: 16px;\n left: 22px;\n top: 0;\n background: var(--ix-button-cancel-color, #db0028);\n}\n.notification-header {\n font-family: 'Red Hat Display', sans-serif;\n padding: 20px 16px;\n font-weight: 770;\n font-size: 20px;\n line-height: 24px;\n}\nh2 {\n font-family: 'Open Sans', sans-serif;\n}\nh3 {\n font-family: 'Open Sans', sans-serif;\n font-size: 16px;\n font-weight: 400;\n line-height: 20px;\n letter-spacing: 0.15px;\n text-align: left;\n padding: 8px 16px;\n}\n.empty {\n margin: 8px 0px 8px 16px;\n font-family: \"Open Sans\", sans-serif;\n font-style: normal;\n font-size: 12px;\n line-height: 16px;\n letter-spacing: 0.4px;\n color: #092241;\n font-weight: 400;\n}\n.notifification-item ix-icon-button {\n padding: 12px;\n}\n.options {\n padding-right: 1rem;\n position: relative;\n}\n.notification-tooltip {\n transform: translateX(-100%);\n background-color: #040d19;\n white-space: nowrap;\n font-size: 0.75rem;\n z-index: 999;\n color: white;\n}\n`;"]}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent ix-notifications following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Digital Realty",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.23",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"module": "dist/index.js",
|
|
@@ -42,12 +42,13 @@
|
|
|
42
42
|
"@digital-realty/ix-date": "^1.0.29",
|
|
43
43
|
"@digital-realty/ix-dialog": "^1.0.26",
|
|
44
44
|
"@digital-realty/ix-divider": "^1.0.8",
|
|
45
|
-
"@digital-realty/ix-drawer": "^1.0.
|
|
45
|
+
"@digital-realty/ix-drawer": "^1.0.38",
|
|
46
46
|
"@digital-realty/ix-icon": "^1.0.35",
|
|
47
47
|
"@digital-realty/ix-icon-button": "^1.0.39",
|
|
48
48
|
"@digital-realty/ix-switch": "^2.1.9",
|
|
49
49
|
"@digital-realty/ix-toast": "^1.0.27",
|
|
50
50
|
"@digital-realty/theme": "^1.0.29",
|
|
51
|
+
"@floating-ui/dom": "^1.6.8",
|
|
51
52
|
"@material/web": "1.2.0",
|
|
52
53
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
53
54
|
"date-fns": "^3.6.0",
|
|
@@ -136,5 +137,5 @@
|
|
|
136
137
|
"README.md",
|
|
137
138
|
"LICENSE"
|
|
138
139
|
],
|
|
139
|
-
"gitHead": "
|
|
140
|
+
"gitHead": "a882418b34aee93eb7bbf6dd2c614b2a691dd896"
|
|
140
141
|
}
|