@sonhero/sapp-notification 1.3.1
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/README.md +84 -0
- package/dist/assets/icons/index.d.ts +10 -0
- package/dist/common/base/FooterDrawer.d.ts +10 -0
- package/dist/common/base/NoData.d.ts +3 -0
- package/dist/common/base/SappDrawer.d.ts +16 -0
- package/dist/common/base/SappTabs.d.ts +13 -0
- package/dist/components/notification/ItemNotification.d.ts +19 -0
- package/dist/components/notification/MarkNotification.d.ts +10 -0
- package/dist/components/notification/NotifyDetail.d.ts +8 -0
- package/dist/constants/index.d.ts +13 -0
- package/dist/index.css +202866 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +852 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +849 -0
- package/dist/index.modern.js.map +1 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/types/Notification.d.ts +44 -0
- package/dist/utils/index.d.ts +3 -0
- package/package.json +80 -0
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# sapp-notification-package
|
|
2
|
+
|
|
3
|
+
> Made with create-react-library
|
|
4
|
+
|
|
5
|
+
[](https://standardjs.com)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i @sapp-fe/sapp-notification
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Development
|
|
14
|
+
|
|
15
|
+
- Sử dụng Node.js từ version 20 trở lên, khuyến nghị v22.14.0.
|
|
16
|
+
- Cài đặt dependencies:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
yarn install
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
- Chạy package ở chế độ watch:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
yarn start
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- Build package:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
yarn build
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
Import component trong project sử dụng package:
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import SappNotificationComponent from '@sapp-fe/sapp-notification'
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Không cần import CSS riêng như `@sapp-fe/sapp-notification/dist/index.css`. Package sẽ tự nhúng CSS khi component được import.
|
|
43
|
+
|
|
44
|
+
Ví dụ:
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
{openNotification && (
|
|
48
|
+
<SappNotificationComponent
|
|
49
|
+
notifyDetail={notifyDetail}
|
|
50
|
+
tabs={tabs}
|
|
51
|
+
selectedTab={selectedTab}
|
|
52
|
+
setSelectedTab={setSelectedTab}
|
|
53
|
+
handleMarkAll={handleMarkAll}
|
|
54
|
+
handleMarkById={handleMarkById}
|
|
55
|
+
handleUnMarkById={handleUnMarkById}
|
|
56
|
+
handleBack={handleBack}
|
|
57
|
+
isViewDetail={isViewDetail}
|
|
58
|
+
setOpenNotification={setOpenNotification}
|
|
59
|
+
openNotification={openNotification}
|
|
60
|
+
handleViewDetail={handleViewDetail}
|
|
61
|
+
notifyLists={notifyLists}
|
|
62
|
+
notificationUnread={notificationUnread}
|
|
63
|
+
scrollRef={scrollRef}
|
|
64
|
+
/>
|
|
65
|
+
)}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Local link
|
|
69
|
+
|
|
70
|
+
Trong thư mục package:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
yarn link
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Trong project sử dụng package:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
yarn link @sapp-fe/sapp-notification
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT © 2025 sapp
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
declare const CloseIconV2: FC<React.SVGProps<SVGSVGElement>>;
|
|
3
|
+
declare const ArrowLeftIcon: FC<React.SVGProps<SVGSVGElement>>;
|
|
4
|
+
declare const MarkIconV2: FC<React.SVGProps<SVGSVGElement>>;
|
|
5
|
+
declare const NotificationDots: FC<React.SVGProps<SVGSVGElement>>;
|
|
6
|
+
declare const MarkIcon: FC<React.SVGProps<SVGSVGElement>>;
|
|
7
|
+
declare const EllipseIcon: FC<React.SVGProps<SVGSVGElement>>;
|
|
8
|
+
declare const DotIcon: FC<React.SVGProps<SVGSVGElement>>;
|
|
9
|
+
declare const NoDataIcon: FC<React.SVGProps<SVGSVGElement>>;
|
|
10
|
+
export { ArrowLeftIcon, EllipseIcon, CloseIconV2, MarkIcon, MarkIconV2, NotificationDots, DotIcon, NoDataIcon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
content: ReactNode;
|
|
4
|
+
icon: ReactNode;
|
|
5
|
+
action: () => void;
|
|
6
|
+
classNameText?: string;
|
|
7
|
+
classNameBg?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const FooterDrawer: ({ content, icon, action, classNameText, classNameBg, }: IProps) => React.JSX.Element;
|
|
10
|
+
export default FooterDrawer;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DrawerProps } from 'antd';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
interface IProps extends DrawerProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
handleCancel?: () => void;
|
|
6
|
+
handleBack?: () => void;
|
|
7
|
+
width?: number | string;
|
|
8
|
+
title: string;
|
|
9
|
+
isShowBtnClose?: boolean;
|
|
10
|
+
isShowFooter?: boolean;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
isDesktopView?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const SappDrawer: ({ open, handleBack, handleCancel, width, title, children, isShowBtnClose, isShowFooter, loading, className, isDesktopView, ...props }: IProps) => React.JSX.Element;
|
|
16
|
+
export default SappDrawer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ITabsTeacher {
|
|
3
|
+
id: number;
|
|
4
|
+
title: string;
|
|
5
|
+
}
|
|
6
|
+
interface SappTabsProps {
|
|
7
|
+
tabs: ITabsTeacher[];
|
|
8
|
+
selected: number;
|
|
9
|
+
setSelected: React.Dispatch<React.SetStateAction<number>>;
|
|
10
|
+
bordered?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const SappTabs: React.FC<SappTabsProps>;
|
|
13
|
+
export default SappTabs;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { INotifications } from '../../types/Notification';
|
|
3
|
+
interface IProps {
|
|
4
|
+
notifyLists: INotifications[];
|
|
5
|
+
notificationUnread: number;
|
|
6
|
+
handleViewDetail: (id: string, redirect: string, content: string, tag: string) => Promise<void>;
|
|
7
|
+
handleMarkById: (ids: string[]) => void;
|
|
8
|
+
handleUnMarkById: (ids: string[]) => void;
|
|
9
|
+
scrollRef: React.RefObject<HTMLDivElement>;
|
|
10
|
+
handleViewNotification: (link: string) => void;
|
|
11
|
+
isDesktopView?: boolean;
|
|
12
|
+
currentTabKey?: string | number;
|
|
13
|
+
isLoading?: boolean;
|
|
14
|
+
isFirstLoad?: boolean;
|
|
15
|
+
textMainColor?: string;
|
|
16
|
+
isMobileView?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const ItemNotification: React.MemoExoticComponent<({ notifyLists, notificationUnread, handleViewDetail, handleMarkById, handleUnMarkById, scrollRef, handleViewNotification, isDesktopView, currentTabKey, isLoading, isFirstLoad, textMainColor, isMobileView, }: IProps) => React.JSX.Element>;
|
|
19
|
+
export default ItemNotification;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { INotifications } from '../../types/Notification';
|
|
3
|
+
interface MarkNotificationProps {
|
|
4
|
+
notifyItem: INotifications;
|
|
5
|
+
handleMarkById: (ids: string[]) => void;
|
|
6
|
+
handleUnMarkById: (ids: string[]) => void;
|
|
7
|
+
colorBgTooltip?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const MarkNotification: React.FC<MarkNotificationProps>;
|
|
10
|
+
export default MarkNotification;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NotificationState } from '../../types/Notification';
|
|
3
|
+
interface NotifyDetailProps {
|
|
4
|
+
notifyDetail: NotificationState;
|
|
5
|
+
isMobileView: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const NotifyDetail: React.FC<NotifyDetailProps>;
|
|
8
|
+
export default NotifyDetail;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const ANIMATION_NOTIFICATION: {
|
|
2
|
+
DURATION: number;
|
|
3
|
+
DATA_AOS: string;
|
|
4
|
+
};
|
|
5
|
+
export declare enum DATE_FORMAT {
|
|
6
|
+
DATE_TIME = "HH:mm | DD/MM/YYYY",
|
|
7
|
+
DATE_TIME_DASH = "HH:mm - DD/MM/YYYY",
|
|
8
|
+
DATE = "DD/MM/YYYY"
|
|
9
|
+
}
|
|
10
|
+
export declare const ANIMATION: {
|
|
11
|
+
DURATION: number;
|
|
12
|
+
DATA_AOS: string;
|
|
13
|
+
};
|