wj-elements 0.1.102 → 0.1.103

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.
@@ -34,9 +34,7 @@ class Button extends WJElement {
34
34
  * @param {Event} e - The event
35
35
  */
36
36
  __publicField(this, "eventDialogOpen", (e) => {
37
- event.dispatchCustomEvent(this, this.dialog, {
38
- bubbles: true
39
- });
37
+ event.dispatchCustomEvent(this, this.dialog);
40
38
  });
41
39
  /**
42
40
  * Toggle states method
@@ -67,8 +67,8 @@ class Dialog extends WJElement {
67
67
  let close = document.createElement("wje-button");
68
68
  close.setAttribute("fill", "link");
69
69
  close.setAttribute("size", "small");
70
- close.addEventListener("click", () => {
71
- this.close();
70
+ close.addEventListener("click", (e) => {
71
+ this.close(e);
72
72
  });
73
73
  close.appendChild(icon);
74
74
  let header = document.createElement("div");
@@ -100,19 +100,21 @@ class Dialog extends WJElement {
100
100
  dialog.appendChild(body);
101
101
  dialog.appendChild(footer);
102
102
  }
103
- close() {
104
- this.onClose();
103
+ close(e) {
104
+ this.onClose(e);
105
105
  }
106
106
  afterDraw(context, store, params) {
107
107
  if (params.trigger) {
108
108
  event.addListener(document, params.trigger, null, this.onOpen);
109
109
  }
110
+ this.dialog.addEventListener("close", this.onClose);
110
111
  }
111
112
  beforeDisconnect() {
112
113
  var _a, _b;
113
114
  if ((_a = this.params) == null ? void 0 : _a.trigger) {
114
115
  event.removeListener(document, (_b = this.params) == null ? void 0 : _b.trigger, null, this.onOpen);
115
116
  }
117
+ this.dialog.removeEventListener("close", this.onClose);
116
118
  }
117
119
  beforeOpen() {
118
120
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wj-elements",
3
3
  "description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
4
- "version": "0.1.102",
4
+ "version": "0.1.103",
5
5
  "homepage": "https://github.com/lencys/wj-elements",
6
6
  "author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
7
7
  "license": "MIT",