jsl-ui 9.22.0 → 9.23.0

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.
@@ -8,7 +8,8 @@ export interface INotificationOptions {
8
8
  style?: string;
9
9
  }
10
10
  export declare class Notification {
11
- static show(options: INotificationOptions): void;
11
+ static show(options: INotificationOptions): string;
12
+ static clearNotification(id: string): void;
12
13
  static clearAll(): void;
13
14
  private static container;
14
15
  private static containerVNode;
@@ -9,10 +9,11 @@ var Notification = /** @class */ (function () {
9
9
  if (Notification.container == null) {
10
10
  Notification.createContainer();
11
11
  }
12
+ var id = helper.newDomGuid();
12
13
  // add
13
14
  var notification = {
14
15
  tag: "div",
15
- attr: { id: helper.newDomGuid(), style: options.style, class: "jsl-notification " + (options.class || "") },
16
+ attr: { id: id, style: options.style, class: "jsl-notification " + (options.class || "") },
16
17
  animation: { attr: "opacity", from: 0, to: 1, duration: 600 },
17
18
  children: [
18
19
  typeof options.content === "string" ? { tag: "div", content: options.content } : options.content
@@ -38,6 +39,11 @@ var Notification = /** @class */ (function () {
38
39
  }
39
40
  };
40
41
  }
42
+ return id;
43
+ };
44
+ Notification.clearNotification = function (id) {
45
+ Notification.containerVNode.children = Notification.containerVNode.children.filter(function (x) { var _a; return ((_a = x.attr) === null || _a === void 0 ? void 0 : _a.id) !== id; });
46
+ Notification.renderer.refresh();
41
47
  };
42
48
  Notification.clearAll = function () {
43
49
  Notification.containerVNode.children = [];