@etsoo/notificationbase 1.0.95 → 1.0.96
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/Notification.d.ts
CHANGED
|
@@ -72,6 +72,14 @@ export interface NotifictionRenderSetup {
|
|
|
72
72
|
export interface NotificationReturn<T> {
|
|
73
73
|
(value: T): boolean | void | PromiseLike<boolean | void>;
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* On prompt return callback
|
|
77
|
+
* return false will prevent default action
|
|
78
|
+
* return tuple second parameter is the error message to show
|
|
79
|
+
*/
|
|
80
|
+
export interface NotificationPromptReturn<T> extends NotificationReturn<T> {
|
|
81
|
+
(value: T): boolean | [boolean, string?] | void | PromiseLike<boolean | [boolean, string?] | void>;
|
|
82
|
+
}
|
|
75
83
|
/**
|
|
76
84
|
* Notification message parameters
|
|
77
85
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INotificaseBase, INotification, NotificationAlign, NotificationCallProps, NotificationContent, NotificationMessageType, NotificationParameters, NotificationReturn } from './Notification';
|
|
1
|
+
import { INotificaseBase, INotification, NotificationAlign, NotificationCallProps, NotificationContent, NotificationMessageType, NotificationParameters, NotificationPromptReturn, NotificationReturn } from './Notification';
|
|
2
2
|
/**
|
|
3
3
|
* Notification action
|
|
4
4
|
*/
|
|
@@ -95,7 +95,7 @@ export interface INotifier<UI, C extends NotificationCallProps> {
|
|
|
95
95
|
* @param title Title
|
|
96
96
|
* @param props More properties
|
|
97
97
|
*/
|
|
98
|
-
prompt<T = string>(message: NotificationContent<UI>, callback:
|
|
98
|
+
prompt<T = string>(message: NotificationContent<UI>, callback: NotificationPromptReturn<T>, title?: NotificationContent<UI>, props?: C): INotification<UI, C>;
|
|
99
99
|
/**
|
|
100
100
|
* Show loading
|
|
101
101
|
* @param title Title
|
|
@@ -218,7 +218,7 @@ export declare abstract class NotificationContainer<UI, C extends NotificationCa
|
|
|
218
218
|
* @param title Title
|
|
219
219
|
* @param props More properties
|
|
220
220
|
*/
|
|
221
|
-
prompt<T>(message: NotificationContent<UI>, callback:
|
|
221
|
+
prompt<T>(message: NotificationContent<UI>, callback: NotificationPromptReturn<T>, title?: string, props?: C): INotification<UI, C>;
|
|
222
222
|
/**
|
|
223
223
|
* Show loading
|
|
224
224
|
* @param title Title
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/notificationbase",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.96",
|
|
4
4
|
"description": "TypeScript notification component for extending with all features described and partially implemented",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -45,16 +45,16 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/ETSOO/NotificationBase#readme",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@etsoo/shared": "^1.0.
|
|
48
|
+
"@etsoo/shared": "^1.0.97"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@babel/core": "^7.16.
|
|
52
|
-
"@babel/plugin-transform-runtime": "^7.16.
|
|
53
|
-
"@babel/preset-env": "^7.16.
|
|
54
|
-
"@babel/runtime-corejs3": "^7.16.
|
|
55
|
-
"@types/jest": "^27.0
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "^5.8.
|
|
57
|
-
"@typescript-eslint/parser": "^5.8.
|
|
51
|
+
"@babel/core": "^7.16.7",
|
|
52
|
+
"@babel/plugin-transform-runtime": "^7.16.7",
|
|
53
|
+
"@babel/preset-env": "^7.16.7",
|
|
54
|
+
"@babel/runtime-corejs3": "^7.16.7",
|
|
55
|
+
"@types/jest": "^27.4.0",
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
|
57
|
+
"@typescript-eslint/parser": "^5.8.1",
|
|
58
58
|
"babel-jest": "^27.4.5",
|
|
59
59
|
"eslint": "^8.5.0",
|
|
60
60
|
"eslint-config-airbnb-base": "^15.0.0",
|
package/src/Notification.ts
CHANGED
|
@@ -77,6 +77,19 @@ export interface NotificationReturn<T> {
|
|
|
77
77
|
(value: T): boolean | void | PromiseLike<boolean | void>;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* On prompt return callback
|
|
82
|
+
* return false will prevent default action
|
|
83
|
+
* return tuple second parameter is the error message to show
|
|
84
|
+
*/
|
|
85
|
+
export interface NotificationPromptReturn<T> extends NotificationReturn<T> {
|
|
86
|
+
(value: T):
|
|
87
|
+
| boolean
|
|
88
|
+
| [boolean, string?]
|
|
89
|
+
| void
|
|
90
|
+
| PromiseLike<boolean | [boolean, string?] | void>;
|
|
91
|
+
}
|
|
92
|
+
|
|
80
93
|
/**
|
|
81
94
|
* Notification message parameters
|
|
82
95
|
*/
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
NotificationMessageType,
|
|
8
8
|
NotificationModalType,
|
|
9
9
|
NotificationParameters,
|
|
10
|
+
NotificationPromptReturn,
|
|
10
11
|
NotificationReturn,
|
|
11
12
|
NotificationType
|
|
12
13
|
} from './Notification';
|
|
@@ -140,7 +141,7 @@ export interface INotifier<UI, C extends NotificationCallProps> {
|
|
|
140
141
|
*/
|
|
141
142
|
prompt<T = string>(
|
|
142
143
|
message: NotificationContent<UI>,
|
|
143
|
-
callback:
|
|
144
|
+
callback: NotificationPromptReturn<T>,
|
|
144
145
|
title?: NotificationContent<UI>,
|
|
145
146
|
props?: C
|
|
146
147
|
): INotification<UI, C>;
|
|
@@ -457,7 +458,7 @@ export abstract class NotificationContainer<UI, C extends NotificationCallProps>
|
|
|
457
458
|
*/
|
|
458
459
|
prompt<T>(
|
|
459
460
|
message: NotificationContent<UI>,
|
|
460
|
-
callback:
|
|
461
|
+
callback: NotificationPromptReturn<T>,
|
|
461
462
|
title?: string,
|
|
462
463
|
props?: C
|
|
463
464
|
) {
|