impact-ui 4.0.0-alpha.8 → 4.0.0-alpha.9
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/_virtual/BookmarkBorderOutlined.js +4 -0
- package/dist/_virtual/FilterListOutlined.js +4 -0
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index15.js +2 -2
- package/dist/_virtual/index16.js +2 -2
- package/dist/_virtual/index2.js +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/components/Chatbot/bookMarkPanel.js +1 -1
- package/dist/components/Notification/Notification.types.d.ts +35 -5
- package/dist/components/Notification/Notification.types.d.ts.map +1 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationChipsList.d.ts +21 -0
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationChipsList.d.ts.map +1 -0
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationChipsList.js +49 -0
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.d.ts +30 -0
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.d.ts.map +1 -0
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.js +211 -0
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.d.ts +14 -0
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.d.ts.map +1 -0
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.js +299 -0
- package/dist/components/Notification/NotificationBody/NotificationPanelContent.d.ts +9 -0
- package/dist/components/Notification/NotificationBody/NotificationPanelContent.d.ts.map +1 -0
- package/dist/components/Notification/NotificationBody/NotificationPanelContent.js +71 -0
- package/dist/components/Notification/NotificationBody/NotificationTaskList.d.ts +43 -0
- package/dist/components/Notification/NotificationBody/NotificationTaskList.d.ts.map +1 -0
- package/dist/components/Notification/NotificationBody/NotificationTaskList.js +245 -0
- package/dist/components/Notification/NotificationBody/index.d.ts +2 -3
- package/dist/components/Notification/NotificationBody/index.d.ts.map +1 -1
- package/dist/components/Notification/NotificationBody/index.js +21 -11
- package/dist/components/Notification/mockData.d.ts +14 -0
- package/dist/components/Notification/mockData.d.ts.map +1 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/mcp-component-registry.json +193 -18
- package/dist/node_modules/@mui/icons-material/BookmarkBorderOutlined.js +17 -0
- package/dist/node_modules/@mui/icons-material/FilterListOutlined.js +17 -0
- package/dist/node_modules/call-bind/index.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/is-symbol/index.js +1 -1
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/styles/style.css +1 -1
- package/package.json +1 -1
package/dist/_virtual/index14.js
CHANGED
package/dist/_virtual/index15.js
CHANGED
package/dist/_virtual/index16.js
CHANGED
package/dist/_virtual/index2.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
|
@@ -46,7 +46,7 @@ function BookMarkPanel({
|
|
|
46
46
|
}
|
|
47
47
|
)
|
|
48
48
|
] }) }),
|
|
49
|
-
activeTab === "
|
|
49
|
+
activeTab === "preDefined" ? preDefinedQuestions == null ? void 0 : preDefinedQuestions.map((item, idx) => /* @__PURE__ */ jsxs("div", { className: "bookmark-panel-body", children: [
|
|
50
50
|
/* @__PURE__ */ jsx("span", { className: "drag-handle", children: "⋮⋮" }),
|
|
51
51
|
/* @__PURE__ */ jsx("span", { className: "bookmark-question-text", children: item.question }),
|
|
52
52
|
/* @__PURE__ */ jsx("span", { className: "bookmark-menu", children: "⋮" })
|
|
@@ -5,10 +5,36 @@ export interface NotificationTabItem {
|
|
|
5
5
|
label: string;
|
|
6
6
|
value: string;
|
|
7
7
|
}
|
|
8
|
+
export interface NotificationListItemData {
|
|
9
|
+
id: string | number;
|
|
10
|
+
label: string;
|
|
11
|
+
date: Date;
|
|
12
|
+
time: number;
|
|
13
|
+
description: string;
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
read?: boolean;
|
|
16
|
+
status?: 'success' | 'fail' | 'pending';
|
|
17
|
+
badge?: string;
|
|
18
|
+
bookMarked?: boolean;
|
|
19
|
+
showBookMark?: boolean;
|
|
20
|
+
showOverdueIcon?: boolean;
|
|
21
|
+
showFastApproachingIcon?: boolean;
|
|
22
|
+
showNOverdueIcon?: boolean;
|
|
23
|
+
moveToPendingText?: string;
|
|
24
|
+
checkBoxClick?: NotificationListItemHandler;
|
|
25
|
+
handleSelectChange?: NotificationListItemHandler;
|
|
26
|
+
handleMarkCompleted?: NotificationListItemHandler;
|
|
27
|
+
handleMoveToPending?: NotificationListItemHandler;
|
|
28
|
+
handleMarkAsRead?: NotificationListItemHandler;
|
|
29
|
+
handleBookMark?: NotificationListItemHandler;
|
|
30
|
+
handleDeleteNotification?: NotificationListItemHandler;
|
|
31
|
+
handleDownloadNotification?: NotificationListItemHandler;
|
|
32
|
+
}
|
|
33
|
+
export type NotificationListItemHandler = (type?: string, notificationPanels?: NotificationPanelItem[], setNotificationPanels?: (panels: NotificationPanelItem[]) => void, list?: NotificationListItemData) => void;
|
|
8
34
|
export interface NotificationPanelItem {
|
|
9
35
|
id: number;
|
|
10
36
|
value: string;
|
|
11
|
-
notificationList?: ReactNode;
|
|
37
|
+
notificationList?: NotificationListItemData[] | ReactNode;
|
|
12
38
|
handleSettingClick?: () => void;
|
|
13
39
|
filterChip?: unknown;
|
|
14
40
|
selectedFilterChip?: unknown;
|
|
@@ -39,10 +65,10 @@ export interface NotificationProps {
|
|
|
39
65
|
primaryButtonLabel?: string;
|
|
40
66
|
onPrimaryButtonClick?: () => void;
|
|
41
67
|
onSettingButtonClick?: () => void;
|
|
42
|
-
handleSelectAll?: () => void;
|
|
43
|
-
handleMarkReadAll?: () => void;
|
|
44
|
-
handleMoveAllPending?: () => void;
|
|
45
|
-
handleNotificationDeleteAll?: () => void;
|
|
68
|
+
handleSelectAll?: (type?: string, notificationList?: NotificationListItemData[]) => void;
|
|
69
|
+
handleMarkReadAll?: (type?: string, notificationList?: NotificationListItemData[]) => void;
|
|
70
|
+
handleMoveAllPending?: (type?: string, selectedItems?: NotificationListItemData[], selectedOption?: unknown) => void;
|
|
71
|
+
handleNotificationDeleteAll?: (type?: string, selectedItems?: NotificationListItemData[]) => void;
|
|
46
72
|
badgesList?: NotificationBadgeList[];
|
|
47
73
|
notificationTabs?: NotificationTabItem[];
|
|
48
74
|
notificationPanels?: NotificationPanelItem[];
|
|
@@ -67,4 +93,8 @@ export interface NotificationProps {
|
|
|
67
93
|
/** Optional body component (e.g. for testing); defaults to NotificationBody */
|
|
68
94
|
NotificationBodyComponent?: React.ComponentType<Record<string, unknown>>;
|
|
69
95
|
}
|
|
96
|
+
/** @deprecated Use NotificationListItemData */
|
|
97
|
+
export type NotificationItem = NotificationListItemData;
|
|
98
|
+
/** @deprecated Use NotificationPanelItem */
|
|
99
|
+
export type NotificationPanel = NotificationPanelItem;
|
|
70
100
|
//# sourceMappingURL=Notification.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.types.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/Notification.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Notification.types.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/Notification.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC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B,CAAC,EAAE,OAAO,CAAC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,SAAS,CAAC;IAClC,+EAA+E;IAC/E,yBAAyB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC1E;AAED,+CAA+C;AAC/C,MAAM,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAExD,4CAA4C;AAC5C,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC"}
|
package/dist/components/Notification/NotificationBody/NotificationList/NotificationChipsList.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NotificationListItemData } from '../../Notification.types';
|
|
2
|
+
|
|
3
|
+
export interface NotificationChipItem {
|
|
4
|
+
id?: number;
|
|
5
|
+
label: string;
|
|
6
|
+
numberOfTypes?: number;
|
|
7
|
+
handleClick?: () => void;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface NotificationChipsListProps {
|
|
11
|
+
list: NotificationChipItem[];
|
|
12
|
+
currActiveListType: string;
|
|
13
|
+
setCurrActiveListType: (label: string) => void;
|
|
14
|
+
activeBadge?: string;
|
|
15
|
+
showBadgeLoader?: boolean;
|
|
16
|
+
notificationList: NotificationListItemData[];
|
|
17
|
+
expandList: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function NotificationChipsList({ list, currActiveListType, setCurrActiveListType, activeBadge, showBadgeLoader, notificationList, expandList, }: NotificationChipsListProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=NotificationChipsList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationChipsList.d.ts","sourceRoot":"","sources":["../../../../../src/components/Notification/NotificationBody/NotificationList/NotificationChipsList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,MAAM,WAAW,oBAAoB;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,UAAU,0BAA0B;IAClC,IAAI,EAAE,oBAAoB,EAAE,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,wBAAwB,EAAE,CAAC;IAC7C,UAAU,EAAE,OAAO,CAAC;CACrB;AAWD,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,UAAU,GACX,EAAE,0BAA0B,2CA4B5B"}
|
package/dist/components/Notification/NotificationBody/NotificationList/NotificationChipsList.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Badge } from "../../../Badge/index.js";
|
|
3
|
+
import { Loader } from "../../../Loader/index.js";
|
|
4
|
+
function getBadgeLabel(item, notificationList) {
|
|
5
|
+
const baseLabel = item.label || "";
|
|
6
|
+
if (item.numberOfTypes) {
|
|
7
|
+
return `${baseLabel} (${item.numberOfTypes})`;
|
|
8
|
+
}
|
|
9
|
+
const count = notificationList.filter((listItem) => listItem.badge === item.label).length;
|
|
10
|
+
return count > 0 ? `${baseLabel} (${count})` : baseLabel;
|
|
11
|
+
}
|
|
12
|
+
function NotificationChipsList({
|
|
13
|
+
list,
|
|
14
|
+
currActiveListType,
|
|
15
|
+
setCurrActiveListType,
|
|
16
|
+
activeBadge,
|
|
17
|
+
showBadgeLoader,
|
|
18
|
+
notificationList,
|
|
19
|
+
expandList
|
|
20
|
+
}) {
|
|
21
|
+
if (showBadgeLoader) {
|
|
22
|
+
return /* @__PURE__ */ jsx(Loader, { showSkeleton: true, size: "small" });
|
|
23
|
+
}
|
|
24
|
+
const activeLabel = activeBadge != null && activeBadge !== "" ? activeBadge : currActiveListType;
|
|
25
|
+
return /* @__PURE__ */ jsx("div", { className: "impact-notification-task-list-chips", children: /* @__PURE__ */ jsx(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: `impact-notification-task-list-item ${expandList ? "list-item-full-width" : ""}`,
|
|
29
|
+
children: list.map((item, index) => /* @__PURE__ */ jsx(
|
|
30
|
+
Badge,
|
|
31
|
+
{
|
|
32
|
+
color: activeLabel === item.label ? "info" : void 0,
|
|
33
|
+
label: getBadgeLabel(item, notificationList),
|
|
34
|
+
variant: "stroke",
|
|
35
|
+
onClick: () => {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
(_a = item.handleClick) == null ? void 0 : _a.call(item);
|
|
38
|
+
(_b = item.onClick) == null ? void 0 : _b.call(item);
|
|
39
|
+
setCurrActiveListType(item.label);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
item.id ?? index
|
|
43
|
+
))
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
NotificationChipsList
|
|
49
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SelectOption } from '../../../Select/Select.types';
|
|
2
|
+
import { NotificationListItemData, NotificationPanelItem } from '../../Notification.types';
|
|
3
|
+
|
|
4
|
+
export interface NotificationListProps {
|
|
5
|
+
expand?: boolean;
|
|
6
|
+
type: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
notificationList: NotificationListItemData[];
|
|
9
|
+
notificationPanels: NotificationPanelItem[];
|
|
10
|
+
setNotificationPanels?: (panels: NotificationPanelItem[]) => void;
|
|
11
|
+
handleSelectAll?: (type?: string, notificationList?: NotificationListItemData[]) => void;
|
|
12
|
+
handleMarkReadAll?: (type?: string, notificationList?: NotificationListItemData[]) => void;
|
|
13
|
+
handleMoveAllPending?: (type?: string, selectedItems?: NotificationListItemData[], selectedOption?: unknown) => void;
|
|
14
|
+
moveToPendingDropdownOptions?: SelectOption[];
|
|
15
|
+
handleNotificationDeleteAll?: (type?: string, selectedItems?: NotificationListItemData[]) => void;
|
|
16
|
+
showNotificationListLoader?: boolean;
|
|
17
|
+
showBadgeLoader?: boolean;
|
|
18
|
+
displayFormat?: string;
|
|
19
|
+
onNotificationScrollToBottom?: () => void | Promise<void>;
|
|
20
|
+
scrollThreshold?: number;
|
|
21
|
+
isHoverOnCard?: boolean;
|
|
22
|
+
isDeleteAlwaysVisible?: boolean;
|
|
23
|
+
isEmptyState?: boolean;
|
|
24
|
+
emptyStateTitle?: string;
|
|
25
|
+
emptyStateDescription?: string;
|
|
26
|
+
customNotificationJsx?: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export declare function getPanelNotificationList(panel: NotificationPanelItem): NotificationListItemData[];
|
|
29
|
+
export declare function NotificationList({ expand, type, title, notificationList, notificationPanels, setNotificationPanels, handleSelectAll, handleMarkReadAll, handleMoveAllPending, moveToPendingDropdownOptions, handleNotificationDeleteAll, showNotificationListLoader, showBadgeLoader, displayFormat, onNotificationScrollToBottom, scrollThreshold, isHoverOnCard, isDeleteAlwaysVisible, isEmptyState, emptyStateTitle, emptyStateDescription, customNotificationJsx, }: NotificationListProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=NotificationList.d.ts.map
|
package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationList.d.ts","sourceRoot":"","s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AAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzC;AAQD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,qBAAqB,GAAG,wBAAwB,EAAE,CAMjG;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAc,EACd,IAAI,EACJ,KAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,0BAAkC,EAClC,eAAuB,EACvB,aAA4B,EAC5B,4BAA4B,EAC5B,eAAoB,EACpB,aAAqB,EACrB,qBAA6B,EAC7B,YAAoB,EACpB,eAAkD,EAClD,qBAAsE,EACtE,qBAAqB,GACtB,EAAE,qBAAqB,2CAiMvB"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState, useEffect, useCallback } from "react";
|
|
3
|
+
import default_1 from "../../../../node_modules/@mui/icons-material/DeleteOutlineOutlined.js";
|
|
4
|
+
import { getAssetUrl } from "../../../../utils/assetBase.js";
|
|
5
|
+
import { NotificationListItem } from "./NotificationListItem.js";
|
|
6
|
+
import { Button } from "../../../Button/index.js";
|
|
7
|
+
import { Loader } from "../../../Loader/index.js";
|
|
8
|
+
import { Select } from "../../../Select/index.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
const NotificationEmptyStateIcon = getAssetUrl("webp/notificationEmptyStateIcon.webp");
|
|
11
|
+
function isNotificationListData(value) {
|
|
12
|
+
return Array.isArray(value);
|
|
13
|
+
}
|
|
14
|
+
function getPanelNotificationList(panel) {
|
|
15
|
+
const { notificationList } = panel;
|
|
16
|
+
if (!isNotificationListData(notificationList)) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
return notificationList;
|
|
20
|
+
}
|
|
21
|
+
function NotificationList({
|
|
22
|
+
expand = false,
|
|
23
|
+
type,
|
|
24
|
+
title = "",
|
|
25
|
+
notificationList,
|
|
26
|
+
notificationPanels,
|
|
27
|
+
setNotificationPanels,
|
|
28
|
+
handleSelectAll,
|
|
29
|
+
handleMarkReadAll,
|
|
30
|
+
handleMoveAllPending,
|
|
31
|
+
moveToPendingDropdownOptions,
|
|
32
|
+
handleNotificationDeleteAll,
|
|
33
|
+
showNotificationListLoader = false,
|
|
34
|
+
showBadgeLoader = false,
|
|
35
|
+
displayFormat = "MM/DD/YYYY",
|
|
36
|
+
onNotificationScrollToBottom,
|
|
37
|
+
scrollThreshold = 50,
|
|
38
|
+
isHoverOnCard = false,
|
|
39
|
+
isDeleteAlwaysVisible = false,
|
|
40
|
+
isEmptyState = false,
|
|
41
|
+
emptyStateTitle = "Everything looks quiet for now",
|
|
42
|
+
emptyStateDescription = "We'll notify you when something new comes up",
|
|
43
|
+
customNotificationJsx
|
|
44
|
+
}) {
|
|
45
|
+
const isLoading = useRef(false);
|
|
46
|
+
const [moveToPendingOpen, setMoveToPendingOpen] = useState(false);
|
|
47
|
+
const [currentOptions, setCurrentOptions] = useState(
|
|
48
|
+
moveToPendingDropdownOptions ?? []
|
|
49
|
+
);
|
|
50
|
+
const [selectedOptions, setSelectedOptions] = useState([]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
setCurrentOptions(moveToPendingDropdownOptions ?? []);
|
|
53
|
+
}, [moveToPendingDropdownOptions]);
|
|
54
|
+
const handleNotificationScroll = useCallback(
|
|
55
|
+
async (e) => {
|
|
56
|
+
const { scrollTop, scrollHeight, clientHeight } = e.currentTarget;
|
|
57
|
+
const reachedBottom = scrollTop + clientHeight >= scrollHeight - scrollThreshold;
|
|
58
|
+
if (reachedBottom && !isLoading.current) {
|
|
59
|
+
isLoading.current = true;
|
|
60
|
+
try {
|
|
61
|
+
await (onNotificationScrollToBottom == null ? void 0 : onNotificationScrollToBottom());
|
|
62
|
+
} finally {
|
|
63
|
+
isLoading.current = false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
[onNotificationScrollToBottom, scrollThreshold]
|
|
68
|
+
);
|
|
69
|
+
const visibleItems = notificationList.some((item) => item.badge !== void 0) ? notificationList.filter((item) => item.badge === title) : notificationList;
|
|
70
|
+
const selectedCount = notificationList.filter((item) => item.selected).length;
|
|
71
|
+
if (isEmptyState) {
|
|
72
|
+
return /* @__PURE__ */ jsxs("div", { className: "impact-notification-list-empty-state-container", children: [
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
"img",
|
|
75
|
+
{
|
|
76
|
+
alt: "notification-empty-state",
|
|
77
|
+
className: "impact-notification-list-empty-state-icon",
|
|
78
|
+
src: NotificationEmptyStateIcon
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsxs("div", { className: "impact-notification-list-empty-state-content", children: [
|
|
82
|
+
/* @__PURE__ */ jsx("span", { className: "impact-notification-list-empty-state-title", children: emptyStateTitle }),
|
|
83
|
+
/* @__PURE__ */ jsx("span", { className: "impact-notification-list-empty-state-description", children: emptyStateDescription })
|
|
84
|
+
] })
|
|
85
|
+
] });
|
|
86
|
+
}
|
|
87
|
+
if (customNotificationJsx) {
|
|
88
|
+
return /* @__PURE__ */ jsx(Fragment, { children: customNotificationJsx });
|
|
89
|
+
}
|
|
90
|
+
return /* @__PURE__ */ jsxs("div", { className: "impact-notification-list-container", children: [
|
|
91
|
+
/* @__PURE__ */ jsxs("div", { className: "impact-notification-list-header", children: [
|
|
92
|
+
showBadgeLoader ? /* @__PURE__ */ jsx("div", { className: "impact-notification-list-title-loader", children: /* @__PURE__ */ jsx(Loader, { showSkeleton: true, size: "small" }) }) : /* @__PURE__ */ jsx("div", { className: "impact-notification-list-title", children: title }),
|
|
93
|
+
showNotificationListLoader ? /* @__PURE__ */ jsx("div", { className: "impact-notification-list-action-btns-loader", children: /* @__PURE__ */ jsx(Loader, { showSkeleton: true, size: "small" }) }) : /* @__PURE__ */ jsxs("div", { className: "impact-notification-list-action-btns", children: [
|
|
94
|
+
handleSelectAll && /* @__PURE__ */ jsx(
|
|
95
|
+
Button,
|
|
96
|
+
{
|
|
97
|
+
size: "small",
|
|
98
|
+
variant: "url",
|
|
99
|
+
onClick: () => {
|
|
100
|
+
handleSelectAll(type, notificationList);
|
|
101
|
+
},
|
|
102
|
+
children: "Select All"
|
|
103
|
+
}
|
|
104
|
+
),
|
|
105
|
+
handleMarkReadAll && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
106
|
+
/* @__PURE__ */ jsx("span", { className: "impact-notification-separator" }),
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
Button,
|
|
109
|
+
{
|
|
110
|
+
size: "small",
|
|
111
|
+
variant: "url",
|
|
112
|
+
onClick: () => {
|
|
113
|
+
handleMarkReadAll(type, notificationList);
|
|
114
|
+
},
|
|
115
|
+
children: "Mark all as read"
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] }),
|
|
119
|
+
handleMoveAllPending && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
120
|
+
/* @__PURE__ */ jsx("span", { className: "impact-notification-separator" }),
|
|
121
|
+
moveToPendingDropdownOptions ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
122
|
+
/* @__PURE__ */ jsx("p", { style: { fontSize: "12px" }, children: "Move to" }),
|
|
123
|
+
/* @__PURE__ */ jsx(
|
|
124
|
+
Select,
|
|
125
|
+
{
|
|
126
|
+
currentOptions,
|
|
127
|
+
handleChange: (selectedOption) => {
|
|
128
|
+
handleMoveAllPending(
|
|
129
|
+
type,
|
|
130
|
+
notificationList.filter((item) => item.selected),
|
|
131
|
+
selectedOption
|
|
132
|
+
);
|
|
133
|
+
},
|
|
134
|
+
initialOptions: moveToPendingDropdownOptions,
|
|
135
|
+
isDisabled: selectedCount === 0,
|
|
136
|
+
isOpen: moveToPendingOpen,
|
|
137
|
+
minWidth: "140px",
|
|
138
|
+
name: "move-to-pending",
|
|
139
|
+
selectedOptions,
|
|
140
|
+
setCurrentOptions,
|
|
141
|
+
setIsOpen: setMoveToPendingOpen,
|
|
142
|
+
setSelectedOptions: (opts) => {
|
|
143
|
+
setSelectedOptions(opts ?? []);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
)
|
|
147
|
+
] }) : /* @__PURE__ */ jsx(
|
|
148
|
+
Button,
|
|
149
|
+
{
|
|
150
|
+
disabled: selectedCount === 0,
|
|
151
|
+
size: "small",
|
|
152
|
+
variant: "url",
|
|
153
|
+
onClick: () => {
|
|
154
|
+
handleMoveAllPending(
|
|
155
|
+
type,
|
|
156
|
+
notificationList.filter((item) => item.selected)
|
|
157
|
+
);
|
|
158
|
+
},
|
|
159
|
+
children: "Move to pending"
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
] }),
|
|
163
|
+
handleNotificationDeleteAll && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
164
|
+
/* @__PURE__ */ jsx("span", { className: "impact-notification-separator" }),
|
|
165
|
+
/* @__PURE__ */ jsx(
|
|
166
|
+
Button,
|
|
167
|
+
{
|
|
168
|
+
disabled: selectedCount === 0,
|
|
169
|
+
icon: /* @__PURE__ */ jsx(default_1, {}),
|
|
170
|
+
size: "medium",
|
|
171
|
+
variant: "text",
|
|
172
|
+
onClick: () => {
|
|
173
|
+
handleNotificationDeleteAll(
|
|
174
|
+
type,
|
|
175
|
+
notificationList.filter((item) => item.selected)
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
] })
|
|
181
|
+
] })
|
|
182
|
+
] }),
|
|
183
|
+
showNotificationListLoader ? /* @__PURE__ */ jsx("div", { className: "impact-notification-list-loader-container", children: /* @__PURE__ */ jsx(Loader, { showSkeleton: true, size: "large" }) }) : /* @__PURE__ */ jsx(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
className: "impact-notification-list-items-container",
|
|
187
|
+
style: {
|
|
188
|
+
height: expand ? "calc(100% - 230px)" : "calc(100% - 280px)"
|
|
189
|
+
},
|
|
190
|
+
onScroll: handleNotificationScroll,
|
|
191
|
+
children: visibleItems.map((list, index) => /* @__PURE__ */ jsx(
|
|
192
|
+
NotificationListItem,
|
|
193
|
+
{
|
|
194
|
+
displayFormat,
|
|
195
|
+
isDeleteAlwaysVisible,
|
|
196
|
+
isHoverOnCard,
|
|
197
|
+
list,
|
|
198
|
+
notificationPanels,
|
|
199
|
+
setNotificationPanels,
|
|
200
|
+
type
|
|
201
|
+
},
|
|
202
|
+
list.id ?? index
|
|
203
|
+
))
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
] });
|
|
207
|
+
}
|
|
208
|
+
export {
|
|
209
|
+
NotificationList,
|
|
210
|
+
getPanelNotificationList
|
|
211
|
+
};
|
package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NotificationListItemData, NotificationPanelItem } from '../../Notification.types';
|
|
2
|
+
|
|
3
|
+
interface NotificationListItemProps {
|
|
4
|
+
list: NotificationListItemData;
|
|
5
|
+
type: string;
|
|
6
|
+
notificationPanels: NotificationPanelItem[];
|
|
7
|
+
setNotificationPanels?: (panels: NotificationPanelItem[]) => void;
|
|
8
|
+
displayFormat: string;
|
|
9
|
+
isHoverOnCard?: boolean;
|
|
10
|
+
isDeleteAlwaysVisible?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function NotificationListItem({ list, type, notificationPanels, setNotificationPanels, displayFormat, isHoverOnCard, isDeleteAlwaysVisible, }: NotificationListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=NotificationListItem.d.ts.map
|
package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotificationListItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Notification/NotificationBody/NotificationList/NotificationListItem.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,wBAAwB,EAExB,qBAAqB,EACtB,MAAM,0BAA0B,CAAC;AAMlC,UAAU,yBAAyB;IACjC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;IAC5C,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,KAAK,IAAI,CAAC;IAClE,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AA6CD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,IAAI,EACJ,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,aAAqB,EACrB,qBAA6B,GAC9B,EAAE,yBAAyB,2CAsQ3B"}
|