@etsoo/notificationbase 1.1.35 → 1.1.36

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.
@@ -84,7 +84,7 @@ export class Notification {
84
84
  else
85
85
  this.align = NotificationAlign.Center;
86
86
  // Display as modal will lasts otherwise 5 seconds to dismiss it
87
- this.timespan = timespan !== null && timespan !== void 0 ? timespan : (this.modal ? 0 : 5);
87
+ this.timespan = timespan ?? (this.modal ? 0 : 5);
88
88
  }
89
89
  /**
90
90
  * Dismiss it
@@ -156,7 +156,7 @@ export class NotificationContainer {
156
156
  // Setup
157
157
  const n = {
158
158
  inputProps: props,
159
- type: type !== null && type !== void 0 ? type : NotificationType.Error,
159
+ type: type ?? NotificationType.Error,
160
160
  title,
161
161
  content: error,
162
162
  onReturn: callback
@@ -188,13 +188,12 @@ export class NotificationContainer {
188
188
  * @param force Force to hide, otherwise, only the last one
189
189
  */
190
190
  hideLoading(force) {
191
- var _a;
192
191
  // Deduct to count
193
192
  this.loadingCount--;
194
193
  if (force)
195
194
  this.loadingCount = 0;
196
195
  if (this.loadingCount === 0) {
197
- (_a = this.lastLoading) === null || _a === void 0 ? void 0 : _a.dismiss();
196
+ this.lastLoading?.dismiss();
198
197
  this.lastLoading = undefined;
199
198
  }
200
199
  }
@@ -208,7 +207,7 @@ export class NotificationContainer {
208
207
  */
209
208
  message(type, message, title, parameters, props) {
210
209
  // Destruct
211
- const { align, timespan, callback, modal } = parameters !== null && parameters !== void 0 ? parameters : {};
210
+ const { align, timespan, callback, modal } = parameters ?? {};
212
211
  // Setup
213
212
  const n = {
214
213
  type,
@@ -252,7 +251,7 @@ export class NotificationContainer {
252
251
  // Setup
253
252
  const n = {
254
253
  type: NotificationType.Loading,
255
- content: title !== null && title !== void 0 ? title : ''
254
+ content: title ?? ''
256
255
  };
257
256
  // Add to the collection
258
257
  // Keep the reference
@@ -287,7 +286,7 @@ export class NotificationContainer {
287
286
  */
288
287
  succeed(message, title, callback, timespan, props) {
289
288
  // Default to zero for constant
290
- timespan !== null && timespan !== void 0 ? timespan : (timespan = 0);
289
+ timespan ?? (timespan = 0);
291
290
  // Create as message
292
291
  return this.message(NotificationMessageType.Success, message, title, {
293
292
  align: NotificationAlign.Center,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/notificationbase",
3
- "version": "1.1.35",
3
+ "version": "1.1.36",
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,13 +45,13 @@
45
45
  },
46
46
  "homepage": "https://github.com/ETSOO/NotificationBase#readme",
47
47
  "dependencies": {
48
- "@etsoo/shared": "^1.2.26"
48
+ "@etsoo/shared": "^1.2.27"
49
49
  },
50
50
  "devDependencies": {
51
- "@babel/core": "^7.23.9",
52
- "@babel/plugin-transform-runtime": "^7.23.9",
53
- "@babel/preset-env": "^7.23.9",
54
- "@babel/runtime-corejs3": "^7.23.9",
51
+ "@babel/core": "^7.24.0",
52
+ "@babel/plugin-transform-runtime": "^7.24.0",
53
+ "@babel/preset-env": "^7.24.0",
54
+ "@babel/runtime-corejs3": "^7.24.0",
55
55
  "@types/jest": "^29.5.12",
56
56
  "babel-jest": "^29.7.0",
57
57
  "jest": "^29.7.0",
package/tsconfig.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
- "target": "ES2019",
4
+ "target": "ES2020",
5
5
  "module": "ESNext",
6
6
  "moduleResolution": "node",
7
7
  "isolatedModules": true,