awing-library 2.1.6 → 2.1.7
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/lib/ACM-AXN/Notifications/Constant.js +1 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/ButtonTabs.js +4 -8
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/MenuNotification.js +1 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/index.d.ts +0 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/HeaderInfo/index.js +7 -6
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationEmpty.js +2 -2
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationAvatar.js +2 -2
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/NotificationContent.js +4 -7
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.js +2 -2
- package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/index.js +1 -1
- package/lib/ACM-AXN/Notifications/NotificationDetail/index.d.ts +2 -5
- package/lib/ACM-AXN/Notifications/NotificationDetail/index.js +5 -11
- package/lib/ACM-AXN/Notifications/NotificationPopover/Container.js +1 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/Utils.d.ts +1 -1
- package/lib/translate/en/translation.json +0 -2
- package/lib/translate/vi/translation.json +0 -2
- package/package.json +1 -1
|
@@ -14,10 +14,8 @@ var ButtonTabs = function (props) {
|
|
|
14
14
|
};
|
|
15
15
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { mt: 2, component: "div", children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleUpdateTabs, sx: [
|
|
16
16
|
{
|
|
17
|
-
|
|
18
|
-
fontWeight: 700,
|
|
17
|
+
fontWeight: '600',
|
|
19
18
|
borderRadius: '24px',
|
|
20
|
-
textTransform: 'none',
|
|
21
19
|
color: tabActive === Constant_1.Constants.ALL ? '#FFF' : '#000',
|
|
22
20
|
backgroundColor: tabActive === Constant_1.Constants.ALL ? '#ED1D25' : 'inherit',
|
|
23
21
|
},
|
|
@@ -28,13 +26,11 @@ var ButtonTabs = function (props) {
|
|
|
28
26
|
: 'inherit',
|
|
29
27
|
},
|
|
30
28
|
},
|
|
31
|
-
], "data-tabs": Constant_1.Constants.ALL, children: t('
|
|
29
|
+
], "data-tabs": Constant_1.Constants.ALL, children: t('Common.All') }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: handleUpdateTabs, "data-tabs": Constant_1.Constants.UNREAD, sx: [
|
|
32
30
|
{
|
|
33
|
-
fontSize: '14px',
|
|
34
31
|
marginLeft: '8px',
|
|
35
|
-
fontWeight:
|
|
32
|
+
fontWeight: '600',
|
|
36
33
|
borderRadius: '24px',
|
|
37
|
-
textTransform: 'none',
|
|
38
34
|
color: tabActive === Constant_1.Constants.UNREAD ? '#FFF' : '#000',
|
|
39
35
|
backgroundColor: tabActive === Constant_1.Constants.UNREAD
|
|
40
36
|
? '#ED1D25'
|
|
@@ -47,6 +43,6 @@ var ButtonTabs = function (props) {
|
|
|
47
43
|
: 'inherit',
|
|
48
44
|
},
|
|
49
45
|
},
|
|
50
|
-
], children: t('
|
|
46
|
+
], children: t('Common.Unread') })] }));
|
|
51
47
|
};
|
|
52
48
|
exports.default = ButtonTabs;
|
|
@@ -73,6 +73,6 @@ var MenuNotification = function (props) {
|
|
|
73
73
|
}, children: menuData().map(function (item) { return ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { onClick: selectMenuItem, "data-value": item.value, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { mr: 2, style: {
|
|
74
74
|
display: 'flex',
|
|
75
75
|
justifyContent: 'center',
|
|
76
|
-
}, children: (item === null || item === void 0 ? void 0 : item.icon) && ((0, jsx_runtime_1.jsx)("img", { alt: "", src: item.icon, style: { width: '20px', height: '20px' } })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "inherit",
|
|
76
|
+
}, children: (item === null || item === void 0 ? void 0 : item.icon) && ((0, jsx_runtime_1.jsx)("img", { alt: "", src: item.icon, style: { width: '20px', height: '20px' } })) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "inherit", children: item.title })] }, item.id)); }) })] }));
|
|
77
77
|
};
|
|
78
78
|
exports.default = react_1.default.memo(MenuNotification);
|
|
@@ -20,15 +20,11 @@ var Router_1 = require("../../../../AWING/Router");
|
|
|
20
20
|
var HeaderInfo = function (props) {
|
|
21
21
|
var navigate = (0, Router_1.useNavigate)();
|
|
22
22
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
23
|
-
var valueFilter = props.valueFilter, _a = props.onValueFilter, onValueFilter = _a === void 0 ? function () { return null; } : _a, _b = props.onUpdateStatus, onUpdateStatus = _b === void 0 ? function () { return null; } : _b
|
|
23
|
+
var valueFilter = props.valueFilter, _a = props.onValueFilter, onValueFilter = _a === void 0 ? function () { return null; } : _a, _b = props.onUpdateStatus, onUpdateStatus = _b === void 0 ? function () { return null; } : _b;
|
|
24
24
|
var handleUpdateMenuItem = function (value) {
|
|
25
25
|
if (value === Constant_1.Constants.SELECT_ALL) {
|
|
26
26
|
onUpdateStatus(Constant_1.Constants.ALL);
|
|
27
27
|
}
|
|
28
|
-
else if (value === Constant_1.Constants.NOTIFICATION_SETTING_SCREEN_PATH) {
|
|
29
|
-
navigate("".concat(value));
|
|
30
|
-
onClosePopover();
|
|
31
|
-
}
|
|
32
28
|
else {
|
|
33
29
|
// Chuyển đến trang tương ứng
|
|
34
30
|
navigate("".concat(value));
|
|
@@ -44,10 +40,15 @@ var HeaderInfo = function (props) {
|
|
|
44
40
|
display: 'flex',
|
|
45
41
|
flexDirection: 'row',
|
|
46
42
|
justifyContent: 'space-between',
|
|
47
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, {
|
|
43
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h1", style: {
|
|
44
|
+
fontWeight: '700',
|
|
45
|
+
fontSize: '1.5em',
|
|
46
|
+
}, children: t('Common.Notification') }), (0, jsx_runtime_1.jsx)(MenuNotification_1.default, { onUpdateMenuItem: handleUpdateMenuItem })] }), (0, jsx_runtime_1.jsx)(SearchBox_1.default, { variantPaper: "outlined", onSearch: handleKeyWordPassing, stylePaper: {
|
|
48
47
|
flex: 1,
|
|
49
48
|
width: 'auto',
|
|
50
49
|
maxWidth: '100%',
|
|
50
|
+
borderRadius: '24px',
|
|
51
|
+
padding: '2px 20px 2px 10px',
|
|
51
52
|
} }), (0, jsx_runtime_1.jsx)(ButtonTabs_1.default, { tabActive: valueFilter.tabs, onUpdateTabActive: handleUpdateTabActive })] }));
|
|
52
53
|
};
|
|
53
54
|
exports.default = HeaderInfo;
|
|
@@ -24,9 +24,9 @@ var NotificationEmpty = function (props) {
|
|
|
24
24
|
alignItems: 'center',
|
|
25
25
|
justifyContent: 'space-between',
|
|
26
26
|
}, children: [(0, jsx_runtime_1.jsx)("img", { src: (isSearch ? binoculars_svg_1.default : bell_svg_1.default), alt: isSearch ? 'iconBinoculars' : 'iconBell', style: { width: '80px', height: '80px' } }), (0, jsx_runtime_1.jsx)(material_1.Typography, { style: {
|
|
27
|
-
fontSize: '
|
|
27
|
+
fontSize: '1.3em',
|
|
28
28
|
color: '#65676B',
|
|
29
|
-
fontWeight: 600,
|
|
29
|
+
fontWeight: '600',
|
|
30
30
|
marginTop: '10px',
|
|
31
31
|
textAlign: 'center',
|
|
32
32
|
}, children: isSearch
|
|
@@ -25,8 +25,8 @@ var material_1 = require("@mui/material");
|
|
|
25
25
|
var NotificationAvatar = function (props) {
|
|
26
26
|
var url = props.url, name = props.name;
|
|
27
27
|
var styleAvatar = {
|
|
28
|
-
width: '
|
|
29
|
-
height: '
|
|
28
|
+
width: '56px',
|
|
29
|
+
height: '56px',
|
|
30
30
|
border: '1px solid #0000001a',
|
|
31
31
|
};
|
|
32
32
|
if (!url) {
|
|
@@ -29,26 +29,23 @@ var NotificationContent = function (props) {
|
|
|
29
29
|
textOverflow: 'ellipsis',
|
|
30
30
|
display: '-webkit-box',
|
|
31
31
|
WebkitBoxOrient: 'vertical',
|
|
32
|
-
WebkitLineClamp:
|
|
32
|
+
WebkitLineClamp: 2,
|
|
33
33
|
margin: '0 0 2px 0',
|
|
34
34
|
lineHeight: 1.2,
|
|
35
|
-
fontSize: '
|
|
36
|
-
fontWeight: 400,
|
|
35
|
+
fontSize: '1rem',
|
|
37
36
|
justifyContent: 'space-between',
|
|
38
37
|
},
|
|
39
38
|
{
|
|
40
39
|
'& h1, h2, h3, h4, h5, h6, p, span, b, strong, small, em, i, big': {
|
|
41
40
|
marginTop: 0,
|
|
42
41
|
marginBottom: 0,
|
|
43
|
-
fontSize: '
|
|
44
|
-
fontWeight: 400,
|
|
42
|
+
fontSize: '1rem',
|
|
45
43
|
textAlign: 'justify',
|
|
46
44
|
},
|
|
47
45
|
'& a': {
|
|
48
46
|
color: '#1a0dab',
|
|
49
47
|
textDecoration: 'none',
|
|
50
|
-
fontSize: '
|
|
51
|
-
fontWeight: 400,
|
|
48
|
+
fontSize: '1rem',
|
|
52
49
|
textAlign: 'justify',
|
|
53
50
|
},
|
|
54
51
|
},
|
package/lib/ACM-AXN/Notifications/NotificationDetail/NotificationList/NotificationItem/index.js
CHANGED
|
@@ -25,10 +25,10 @@ var NotificationItem = function (props) {
|
|
|
25
25
|
};
|
|
26
26
|
var handleClickNotification = function () {
|
|
27
27
|
navigate((0, Message_1.getFullDescription)(sagaTransactionType, t, fields).url);
|
|
28
|
-
status === Types_1.NotificationMessageStatus.
|
|
28
|
+
status === Types_1.NotificationMessageStatus.Read &&
|
|
29
29
|
onUpdateStatus({ id: id, status: status });
|
|
30
30
|
};
|
|
31
|
-
var itemStatus = status === Types_1.NotificationMessageStatus.
|
|
31
|
+
var itemStatus = status === Types_1.NotificationMessageStatus.Read;
|
|
32
32
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { color: "inherit", onClick: handleClickNotification, sx: [
|
|
33
33
|
{
|
|
34
34
|
display: 'flex',
|
|
@@ -44,7 +44,7 @@ var NotificationList = function (props) {
|
|
|
44
44
|
var _c = (0, react_1.useState)(notificationMessage), notifications = _c[0], setNotifications = _c[1];
|
|
45
45
|
(0, react_1.useLayoutEffect)(function () {
|
|
46
46
|
setNotifications(valueFilter.tabs === Constant_1.Constants.UNREAD
|
|
47
|
-
? notificationMessage.filter(function (item) { return item.status === Types_1.NotificationMessageStatus.
|
|
47
|
+
? notificationMessage.filter(function (item) { return item.status === Types_1.NotificationMessageStatus.Read; })
|
|
48
48
|
: notificationMessage);
|
|
49
49
|
}, [notificationMessage, valueFilter.tabs]);
|
|
50
50
|
if (!notifications.length && !isLoading) {
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
* @author dauquan1108@gmail.com on 11/27/2023.
|
|
4
4
|
*
|
|
5
5
|
**/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
onClosePopover?: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare const NotificationDetail: (props: NotificationDetailProps) => JSX.Element;
|
|
6
|
+
import React from 'react';
|
|
7
|
+
declare const NotificationDetail: React.FC;
|
|
11
8
|
export default NotificationDetail;
|
|
@@ -61,9 +61,8 @@ var Constant_1 = require("../Constant");
|
|
|
61
61
|
var Hooks_1 = __importDefault(require("../Hooks"));
|
|
62
62
|
var NotificationList_1 = __importDefault(require("./NotificationList"));
|
|
63
63
|
var Types_1 = require("../Types");
|
|
64
|
-
var NotificationDetail = function (
|
|
64
|
+
var NotificationDetail = function () {
|
|
65
65
|
var service = (0, Hooks_1.default)().service;
|
|
66
|
-
var onClosePopover = props.onClosePopover;
|
|
67
66
|
var _a = (0, react_1.useState)({
|
|
68
67
|
textSearch: '',
|
|
69
68
|
tabs: Constant_1.Constants.ALL,
|
|
@@ -72,7 +71,6 @@ var NotificationDetail = function (props) {
|
|
|
72
71
|
var _b = react_1.default.useState(false), isLoading = _b[0], setIsLoading = _b[1];
|
|
73
72
|
var _c = react_1.default.useState(-1), count = _c[0], setCount = _c[1];
|
|
74
73
|
var _d = (0, react_1.useState)([]), notificationMessage = _d[0], setNotificationMessage = _d[1];
|
|
75
|
-
var totalItemCount = (0, react_1.useRef)(0);
|
|
76
74
|
(0, react_1.useEffect)(function () {
|
|
77
75
|
var observer = new IntersectionObserver(handleIntersection);
|
|
78
76
|
var lastItem = document.getElementById('last-Item');
|
|
@@ -87,9 +85,7 @@ var NotificationDetail = function (props) {
|
|
|
87
85
|
};
|
|
88
86
|
}, []);
|
|
89
87
|
(0, react_1.useEffect)(function () {
|
|
90
|
-
if (count >= 0
|
|
91
|
-
(totalItemCount.current > notificationMessage.length ||
|
|
92
|
-
notificationMessage.length === 0)) {
|
|
88
|
+
if (count >= 0) {
|
|
93
89
|
setIsLoading(true);
|
|
94
90
|
service
|
|
95
91
|
.notificationsPaging(count, Constant_1.Constants.PAGE_SIZE_DEFAULT, valueFilter.textSearch, valueFilter.status, [])
|
|
@@ -100,7 +96,6 @@ var NotificationDetail = function (props) {
|
|
|
100
96
|
});
|
|
101
97
|
return __spreadArray(__spreadArray([], prevMessages, true), newItems, true);
|
|
102
98
|
});
|
|
103
|
-
totalItemCount.current = res.totalItemCount;
|
|
104
99
|
})
|
|
105
100
|
.finally(function () {
|
|
106
101
|
setIsLoading(false);
|
|
@@ -117,7 +112,6 @@ var NotificationDetail = function (props) {
|
|
|
117
112
|
var handleValueFilter = function (textSearch, tabs) {
|
|
118
113
|
textSearch.length === 0 ? setCount(0) : setCount(-1);
|
|
119
114
|
setNotificationMessage([]);
|
|
120
|
-
totalItemCount.current = 0;
|
|
121
115
|
setValueFilter({
|
|
122
116
|
textSearch: textSearch,
|
|
123
117
|
tabs: tabs,
|
|
@@ -129,12 +123,12 @@ var NotificationDetail = function (props) {
|
|
|
129
123
|
var handleUpdateStatus = (0, react_1.useCallback)(function (dataSent) {
|
|
130
124
|
if (typeof dataSent === 'string') {
|
|
131
125
|
var isCheckStatus = notificationMessage.some(function (item) {
|
|
132
|
-
return item.status === Types_1.NotificationMessageStatus.
|
|
126
|
+
return item.status === Types_1.NotificationMessageStatus.Read;
|
|
133
127
|
});
|
|
134
128
|
if (isCheckStatus) {
|
|
135
129
|
service.notificationsReadAll().then(function () {
|
|
136
130
|
setNotificationMessage(function (prevNotifications) {
|
|
137
|
-
return prevNotifications.map(function (item) { return (__assign(__assign({}, item), { status: Types_1.NotificationMessageStatus.
|
|
131
|
+
return prevNotifications.map(function (item) { return (__assign(__assign({}, item), { status: Types_1.NotificationMessageStatus.Unread })); });
|
|
138
132
|
});
|
|
139
133
|
});
|
|
140
134
|
}
|
|
@@ -159,6 +153,6 @@ var NotificationDetail = function (props) {
|
|
|
159
153
|
});
|
|
160
154
|
}
|
|
161
155
|
}, [notificationMessage, service]);
|
|
162
|
-
return ((0, jsx_runtime_1.jsxs)(react_i18next_1.I18nextProvider, { i18n: i18n_1.default, children: [(0, jsx_runtime_1.jsx)(Box_1.default, { pt: 2, pl: 2, pr: 2, pb: 1, component: "div", children: (0, jsx_runtime_1.jsx)(HeaderInfo_1.default, { valueFilter: valueFilter,
|
|
156
|
+
return ((0, jsx_runtime_1.jsxs)(react_i18next_1.I18nextProvider, { i18n: i18n_1.default, children: [(0, jsx_runtime_1.jsx)(Box_1.default, { pt: 2, pl: 2, pr: 2, pb: 1, component: "div", children: (0, jsx_runtime_1.jsx)(HeaderInfo_1.default, { valueFilter: valueFilter, onValueFilter: handleValueFilter, onUpdateStatus: handleUpdateStatus }) }), (0, jsx_runtime_1.jsx)(Box_1.default, { pl: 1, pr: 1, pb: 1, component: "div", children: (0, jsx_runtime_1.jsx)(NotificationList_1.default, { isLoading: isLoading, valueFilter: valueFilter, notificationMessage: notificationMessage, onUpdateStatus: handleUpdateStatus }) }), (0, jsx_runtime_1.jsx)(Box_1.default, { id: "last-Item", component: "div", sx: { height: '20px' } })] }));
|
|
163
157
|
};
|
|
164
158
|
exports.default = NotificationDetail;
|
|
@@ -144,6 +144,6 @@ var Container = function () {
|
|
|
144
144
|
backgroundColor: '#c1c1c1',
|
|
145
145
|
},
|
|
146
146
|
},
|
|
147
|
-
], children: (0, jsx_runtime_1.jsx)(NotificationDetail_1.default, {
|
|
147
|
+
], children: (0, jsx_runtime_1.jsx)(NotificationDetail_1.default, {}) }) })] }));
|
|
148
148
|
};
|
|
149
149
|
exports.default = Container;
|
|
@@ -4,7 +4,7 @@ export declare const isObjectType: (value: unknown) => value is object;
|
|
|
4
4
|
export declare const isObject: <T extends object>(value: unknown) => value is T;
|
|
5
5
|
export declare const composeKey: <F extends (...p: any[]) => any, G extends (...p: any[]) => any>(f: F, g: G) => F;
|
|
6
6
|
export declare const concatKey: (parent: string | string[]) => (child: string | string[]) => string[];
|
|
7
|
-
export declare const setObject: <O extends {}>(obj: O, arrKey:
|
|
7
|
+
export declare const setObject: <O extends {}>(obj: O, arrKey: Array<keyof O>, value: unknown) => void;
|
|
8
8
|
export declare const convertTreeArrayToFlatArray: (treeArray: DataObject[]) => any[];
|
|
9
9
|
export declare const convertValueByType: (type: string, val: any) => any;
|
|
10
10
|
export declare const getFieldsValid: (templateDatas: TemplateData[]) => boolean[];
|
|
@@ -659,8 +659,6 @@
|
|
|
659
659
|
"CampaignDefault": "Chiến dịch mặc định"
|
|
660
660
|
},
|
|
661
661
|
"Notification": {
|
|
662
|
-
"All": "Tất cả",
|
|
663
|
-
"Unread": "Chưa đọc",
|
|
664
662
|
"TitleManagement": "Quản trị thông báo",
|
|
665
663
|
"TitleDetail": "Chi tiết người nhận thông báo",
|
|
666
664
|
"TitleAddReceiver": "Thêm người dùng/nhóm người dùng",
|