namirasoft-site-react 1.4.321 → 1.4.323
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/components/NSBarNotification.d.ts +2 -1
- package/dist/components/NSBarNotification.js +1 -1
- package/dist/components/NSBarNotification.js.map +1 -1
- package/dist/routing/NSNotifier.d.ts +1 -0
- package/dist/routing/NSNotifier.js +20 -9
- package/dist/routing/NSNotifier.js.map +1 -1
- package/package.json +2 -2
- package/src/components/NSBarNotification.tsx +5 -3
- package/src/routing/NSNotifier.ts +22 -9
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IBaseComponentProps } from "../props/IBaseComponentProps";
|
|
2
2
|
export interface NSBarNotificationProps extends IBaseComponentProps {
|
|
3
|
+
id: string;
|
|
3
4
|
text: string;
|
|
4
5
|
type: NotificationType;
|
|
5
6
|
color: NSBarNotificationColor;
|
|
6
|
-
|
|
7
|
+
expired_at?: Date;
|
|
7
8
|
}
|
|
8
9
|
export interface NSBarNotificationState {
|
|
9
10
|
show: boolean;
|
|
@@ -23,7 +23,6 @@ export function NSBarNotification(props) {
|
|
|
23
23
|
let src = "";
|
|
24
24
|
function onClose() {
|
|
25
25
|
setState({ show: false });
|
|
26
|
-
props.onClose();
|
|
27
26
|
}
|
|
28
27
|
switch (type) {
|
|
29
28
|
case "Error":
|
|
@@ -45,4 +44,5 @@ export function NSBarNotification(props) {
|
|
|
45
44
|
return (_jsx(_Fragment, { children: state.show &&
|
|
46
45
|
_jsx(_Fragment, { children: _jsxs("div", { id: props.id, className: `${Styles.ns_messenger} ${className}`, style: props.style, children: [_jsx("p", { className: `mb-0 ns-font-16-normal`, children: props.text }), _jsx("img", { className: Styles.ns_exit_icon, src: src, alt: "exit", width: 32, height: 32, onClick: onClose })] }) }) }));
|
|
47
46
|
}
|
|
47
|
+
;
|
|
48
48
|
//# sourceMappingURL=NSBarNotification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBarNotification.js","sourceRoot":"","sources":["../../src/components/NSBarNotification.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"NSBarNotification.js","sourceRoot":"","sources":["../../src/components/NSBarNotification.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAgBhC,MAAM,CAAN,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAE9B,uCAAa,CAAA;IACb,uCAAa,CAAA;IACb,yCAAe,CAAA;IACf,2CAAiB,CAAA;IACjB,qCAAW,CAAA;AACf,CAAC,EAPW,sBAAsB,KAAtB,sBAAsB,QAOjC;AAED,MAAM,CAAN,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAExB,+CAA2B,CAAA;IAC3B,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;IACnB,mCAAe,CAAA;AACnB,CAAC,EANW,gBAAgB,KAAhB,gBAAgB,QAM3B;AAED,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAE3D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAyB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3E,IAAI,SAAS,GAAG,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IACrE,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACtB,IAAI,GAAG,GAAG,EAAE,CAAC;IAEb,SAAS,OAAO;QAEZ,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED,QAAQ,IAAI,EACZ,CAAC;QACG,KAAK,OAAO;YACR,GAAG,GAAG,6DAA6D,CAAC;YACpE,MAAM;QACV,KAAK,SAAS;YACV,GAAG,GAAG,+DAA+D,CAAC;YACtE,MAAM;QACV,KAAK,SAAS;YACV,GAAG,GAAG,+DAA+D,CAAC;YACtE,MAAM;QACV,KAAK,aAAa;YACd,GAAG,GAAG,4DAA4D,CAAC;IAC3E,CAAC;IAED,IAAI,KAAK,CAAC,IAAI;QACV,UAAU,CAAC,GAAG,EAAE;YAEZ,OAAO,EAAE,CAAC;QACd,CAAC,EAAE,IAAI,CAAC,CAAC;IAEb,OAAO,CACH,4BAEQ,KAAK,CAAC,IAAI;YACV,4BACI,eAAK,EAAE,EAAE,KAAK,CAAC,EAAE,EACb,SAAS,EAAE,GAAG,MAAM,CAAC,YAAY,IAAI,SAAS,EAAE,EAChD,KAAK,EAAE,KAAK,CAAC,KAAK,aAElB,YAAG,SAAS,EAAE,wBAAwB,YAAG,KAAK,CAAC,IAAI,GAAK,EACxD,cACI,SAAS,EAAE,MAAM,CAAC,YAAY,EAC9B,GAAG,EAAE,GAAG,EACR,GAAG,EAAC,MAAM,EACV,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,OAAO,EAAE,OAAO,GAClB,IACA,GACP,GAER,CACN,CAAA;AACL,CAAC;AAAA,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { IStorage } from "namirasoft-core";
|
|
|
3
3
|
export declare class NSNotifier {
|
|
4
4
|
private storage;
|
|
5
5
|
private setState;
|
|
6
|
+
timeout: number;
|
|
6
7
|
constructor(storage: IStorage, setState: () => void);
|
|
7
8
|
getNotifications(): NSBarNotificationProps[];
|
|
8
9
|
setNotifications(notifications: NSBarNotificationProps[]): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { NSBarNotificationColor, NotificationType } from "../components/NSBarNotification";
|
|
3
|
-
import { BaseUUID } from "namirasoft-core";
|
|
3
|
+
import { BaseUUID, TimeOperation } from "namirasoft-core";
|
|
4
4
|
export class NSNotifier {
|
|
5
5
|
constructor(storage, setState) {
|
|
6
|
+
this.timeout = 5000;
|
|
6
7
|
this.storage = storage;
|
|
7
8
|
this.setState = setState;
|
|
8
9
|
this.getNotifications = this.getNotifications.bind(this);
|
|
@@ -15,12 +16,22 @@ export class NSNotifier {
|
|
|
15
16
|
this.onError = this.onError.bind(this);
|
|
16
17
|
}
|
|
17
18
|
getNotifications() {
|
|
19
|
+
let ans = [];
|
|
18
20
|
let value = this.storage.get("ns-notifications", "");
|
|
19
21
|
if (value)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
ans = JSON.parse(value);
|
|
23
|
+
ans.filter(x => {
|
|
24
|
+
if (x.expired_at)
|
|
25
|
+
return x.expired_at < new Date();
|
|
26
|
+
return false;
|
|
27
|
+
});
|
|
28
|
+
return ans;
|
|
22
29
|
}
|
|
23
30
|
setNotifications(notifications) {
|
|
31
|
+
notifications.forEach(n => {
|
|
32
|
+
if (n.expired_at)
|
|
33
|
+
n.expired_at = TimeOperation.millisecondsLater(this.timeout, new Date());
|
|
34
|
+
});
|
|
24
35
|
this.storage.set("ns-notifications", JSON.stringify(notifications));
|
|
25
36
|
this.setState();
|
|
26
37
|
}
|
|
@@ -34,21 +45,21 @@ export class NSNotifier {
|
|
|
34
45
|
notifications.push(message);
|
|
35
46
|
this.setNotifications(notifications);
|
|
36
47
|
setTimeout(() => {
|
|
37
|
-
message.
|
|
38
|
-
},
|
|
48
|
+
this.delNotification(message.id);
|
|
49
|
+
}, this.timeout);
|
|
39
50
|
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
|
40
51
|
}
|
|
41
52
|
onInformation(text) {
|
|
42
53
|
let id = BaseUUID.uuid();
|
|
43
|
-
this.notify({ id, text, type: NotificationType.Information, color: NSBarNotificationColor.GRAY
|
|
54
|
+
this.notify({ id, text, type: NotificationType.Information, color: NSBarNotificationColor.GRAY });
|
|
44
55
|
}
|
|
45
56
|
onSuccess(text) {
|
|
46
57
|
let id = BaseUUID.uuid();
|
|
47
|
-
this.notify({ id, text, type: NotificationType.Success, color: NSBarNotificationColor.GREEN
|
|
58
|
+
this.notify({ id, text, type: NotificationType.Success, color: NSBarNotificationColor.GREEN });
|
|
48
59
|
}
|
|
49
60
|
onWarning(text) {
|
|
50
61
|
let id = BaseUUID.uuid();
|
|
51
|
-
this.notify({ id, text, type: NotificationType.Warning, color: NSBarNotificationColor.YELLOW
|
|
62
|
+
this.notify({ id, text, type: NotificationType.Warning, color: NSBarNotificationColor.YELLOW });
|
|
52
63
|
}
|
|
53
64
|
onError(error) {
|
|
54
65
|
var _a;
|
|
@@ -62,7 +73,7 @@ export class NSNotifier {
|
|
|
62
73
|
}
|
|
63
74
|
else
|
|
64
75
|
text = error;
|
|
65
|
-
this.notify({ id, text, type: NotificationType.Error, color: NSBarNotificationColor.RED
|
|
76
|
+
this.notify({ id, text, type: NotificationType.Error, color: NSBarNotificationColor.RED });
|
|
66
77
|
}
|
|
67
78
|
}
|
|
68
79
|
//# sourceMappingURL=NSNotifier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSNotifier.js","sourceRoot":"","sources":["../../src/routing/NSNotifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAA0B,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnH,OAAO,EAAE,QAAQ,EAAY,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"NSNotifier.js","sourceRoot":"","sources":["../../src/routing/NSNotifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAA0B,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnH,OAAO,EAAE,QAAQ,EAAY,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEpE,MAAM,OAAO,UAAU;IAKnB,YAAY,OAAiB,EAAE,QAAoB;QAD5C,YAAO,GAAW,IAAI,CAAC;QAG1B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9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.4.
|
|
11
|
+
"version": "1.4.323",
|
|
12
12
|
"author": "Amir Abolhasani",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"react-dom": "^18.3.1",
|
|
49
49
|
"react-phone-input-2": "^2.15.1",
|
|
50
50
|
"react-phone-number-input": "^3.4.12",
|
|
51
|
-
"react-router-dom": "^7.
|
|
51
|
+
"react-router-dom": "^7.4.0",
|
|
52
52
|
"react-scripts": "^5.0.1",
|
|
53
53
|
"styled-components": "^6.1.16",
|
|
54
54
|
"xlsx": "^0.18.5"
|
|
@@ -4,15 +4,18 @@ import { useState } from "react"
|
|
|
4
4
|
|
|
5
5
|
export interface NSBarNotificationProps extends IBaseComponentProps
|
|
6
6
|
{
|
|
7
|
+
id: string;
|
|
7
8
|
text: string;
|
|
8
9
|
type: NotificationType;
|
|
9
10
|
color: NSBarNotificationColor;
|
|
10
|
-
|
|
11
|
+
expired_at?: Date;
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
export interface NSBarNotificationState
|
|
13
15
|
{
|
|
14
16
|
show: boolean
|
|
15
17
|
}
|
|
18
|
+
|
|
16
19
|
export enum NSBarNotificationColor
|
|
17
20
|
{
|
|
18
21
|
GRAY = "GRAY",
|
|
@@ -40,7 +43,6 @@ export function NSBarNotification(props: NSBarNotificationProps)
|
|
|
40
43
|
function onClose()
|
|
41
44
|
{
|
|
42
45
|
setState({ show: false });
|
|
43
|
-
props.onClose();
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
switch (type)
|
|
@@ -87,4 +89,4 @@ export function NSBarNotification(props: NSBarNotificationProps)
|
|
|
87
89
|
}
|
|
88
90
|
</>
|
|
89
91
|
)
|
|
90
|
-
}
|
|
92
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { NSBarNotificationColor, NSBarNotificationProps, NotificationType } from "../components/NSBarNotification";
|
|
3
|
-
import { BaseUUID, IStorage } from "namirasoft-core";
|
|
3
|
+
import { BaseUUID, IStorage, TimeOperation } from "namirasoft-core";
|
|
4
4
|
|
|
5
5
|
export class NSNotifier
|
|
6
6
|
{
|
|
7
7
|
private storage: IStorage;
|
|
8
8
|
private setState: () => void;
|
|
9
|
+
public timeout: number = 5000;
|
|
9
10
|
constructor(storage: IStorage, setState: () => void)
|
|
10
11
|
{
|
|
11
12
|
this.storage = storage;
|
|
@@ -21,13 +22,25 @@ export class NSNotifier
|
|
|
21
22
|
}
|
|
22
23
|
getNotifications(): NSBarNotificationProps[]
|
|
23
24
|
{
|
|
25
|
+
let ans: NSBarNotificationProps[] = [];
|
|
24
26
|
let value = this.storage.get("ns-notifications", "");
|
|
25
27
|
if (value)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
ans = JSON.parse(value);
|
|
29
|
+
ans.filter(x =>
|
|
30
|
+
{
|
|
31
|
+
if (x.expired_at)
|
|
32
|
+
return x.expired_at < new Date();
|
|
33
|
+
return false;
|
|
34
|
+
})
|
|
35
|
+
return ans;
|
|
28
36
|
}
|
|
29
37
|
setNotifications(notifications: NSBarNotificationProps[]): void
|
|
30
38
|
{
|
|
39
|
+
notifications.forEach(n =>
|
|
40
|
+
{
|
|
41
|
+
if (n.expired_at)
|
|
42
|
+
n.expired_at = TimeOperation.millisecondsLater(this.timeout, new Date());
|
|
43
|
+
});
|
|
31
44
|
this.storage.set("ns-notifications", JSON.stringify(notifications));
|
|
32
45
|
this.setState();
|
|
33
46
|
}
|
|
@@ -44,24 +57,24 @@ export class NSNotifier
|
|
|
44
57
|
this.setNotifications(notifications);
|
|
45
58
|
setTimeout(() =>
|
|
46
59
|
{
|
|
47
|
-
message.
|
|
48
|
-
},
|
|
60
|
+
this.delNotification(message.id);
|
|
61
|
+
}, this.timeout);
|
|
49
62
|
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });
|
|
50
63
|
}
|
|
51
64
|
onInformation(text: string)
|
|
52
65
|
{
|
|
53
66
|
let id = BaseUUID.uuid();
|
|
54
|
-
this.notify({ id, text, type: NotificationType.Information, color: NSBarNotificationColor.GRAY
|
|
67
|
+
this.notify({ id, text, type: NotificationType.Information, color: NSBarNotificationColor.GRAY });
|
|
55
68
|
}
|
|
56
69
|
onSuccess(text: string)
|
|
57
70
|
{
|
|
58
71
|
let id = BaseUUID.uuid();
|
|
59
|
-
this.notify({ id, text, type: NotificationType.Success, color: NSBarNotificationColor.GREEN
|
|
72
|
+
this.notify({ id, text, type: NotificationType.Success, color: NSBarNotificationColor.GREEN });
|
|
60
73
|
}
|
|
61
74
|
onWarning(text: string)
|
|
62
75
|
{
|
|
63
76
|
let id = BaseUUID.uuid();
|
|
64
|
-
this.notify({ id, text, type: NotificationType.Warning, color: NSBarNotificationColor.YELLOW
|
|
77
|
+
this.notify({ id, text, type: NotificationType.Warning, color: NSBarNotificationColor.YELLOW });
|
|
65
78
|
}
|
|
66
79
|
onError(error: Error | string)
|
|
67
80
|
{
|
|
@@ -76,6 +89,6 @@ export class NSNotifier
|
|
|
76
89
|
}
|
|
77
90
|
else
|
|
78
91
|
text = error;
|
|
79
|
-
this.notify({ id, text, type: NotificationType.Error, color: NSBarNotificationColor.RED
|
|
92
|
+
this.notify({ id, text, type: NotificationType.Error, color: NSBarNotificationColor.RED });
|
|
80
93
|
}
|
|
81
94
|
}
|