ninegrid2 6.301.0 → 6.302.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.
@@ -63,7 +63,7 @@ class aiMessage extends HTMLElement
63
63
  grd.data.source = [ {doc_id: 1, doc_nm : 'aa'}, {doc_id: 1, doc_nm : 'aa'} ];
64
64
  }, 500);
65
65
 
66
-
66
+
67
67
  this.shadowRoot.querySelector(".more a").addEventListener("click", () => {
68
68
  alert(this.#message);
69
69
  });
@@ -144,6 +144,43 @@ class aiMyMessage extends HTMLElement
144
144
  };
145
145
  }
146
146
 
147
+ class aiChat extends HTMLElement
148
+ {
149
+ constructor() {
150
+ super();
151
+ this.attachShadow({ mode: 'open' });
152
+ }
153
+
154
+ connectedCallback() {
155
+ const message = this.getAttribute("message");
156
+
157
+ this.shadowRoot.innerHTML = `
158
+ <style>
159
+ @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/aiMessage.css";
160
+ ${ninegrid.getCustomPath(this,"aiMessage.css")}
161
+ </style>
162
+
163
+ <div class="chat-body">
164
+ </div>
165
+ `;
166
+
167
+ this.#init();
168
+ };
169
+
170
+ #init = () => {
171
+
172
+ };
173
+
174
+ add = (sender, message, data) => {
175
+ const target = this.shadowRoot.querySelector(".chat-body");
176
+
177
+ const el = document.createElement("nx-ai-my-message");
178
+ el.setAttribute("message", message);
179
+ target.appendChild(el);
180
+ };
181
+ }
182
+
147
183
  customElements.define("nx-ai-message", aiMessage);
148
184
  customElements.define("nx-ai-ing-message", aiIngMessage);
149
185
  customElements.define("nx-ai-my-message", aiMyMessage);
186
+ customElements.define("nx-ai-chat", aiChat);
@@ -27349,7 +27349,7 @@ class aiMessage extends HTMLElement
27349
27349
  grd.data.source = [ {doc_id: 1, doc_nm : 'aa'}, {doc_id: 1, doc_nm : 'aa'} ];
27350
27350
  }, 500);
27351
27351
 
27352
-
27352
+
27353
27353
  this.shadowRoot.querySelector(".more a").addEventListener("click", () => {
27354
27354
  alert(this.#message);
27355
27355
  });
@@ -27430,9 +27430,46 @@ class aiMyMessage extends HTMLElement
27430
27430
  };
27431
27431
  }
27432
27432
 
27433
+ class aiChat extends HTMLElement
27434
+ {
27435
+ constructor() {
27436
+ super();
27437
+ this.attachShadow({ mode: 'open' });
27438
+ }
27439
+
27440
+ connectedCallback() {
27441
+ this.getAttribute("message");
27442
+
27443
+ this.shadowRoot.innerHTML = `
27444
+ <style>
27445
+ @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/aiMessage.css";
27446
+ ${ninegrid.getCustomPath(this,"aiMessage.css")}
27447
+ </style>
27448
+
27449
+ <div class="chat-body">
27450
+ </div>
27451
+ `;
27452
+
27453
+ this.#init();
27454
+ };
27455
+
27456
+ #init = () => {
27457
+
27458
+ };
27459
+
27460
+ add = (sender, message, data) => {
27461
+ const target = this.shadowRoot.querySelector(".chat-body");
27462
+
27463
+ const el = document.createElement("nx-ai-my-message");
27464
+ el.setAttribute("message", message);
27465
+ target.appendChild(el);
27466
+ };
27467
+ }
27468
+
27433
27469
  customElements.define("nx-ai-message", aiMessage);
27434
27470
  customElements.define("nx-ai-ing-message", aiIngMessage);
27435
27471
  customElements.define("nx-ai-my-message", aiMyMessage);
27472
+ customElements.define("nx-ai-chat", aiChat);
27436
27473
 
27437
27474
  //import $ from "https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js";
27438
27475
 
@@ -27347,7 +27347,7 @@ class aiMessage extends HTMLElement
27347
27347
  grd.data.source = [ {doc_id: 1, doc_nm : 'aa'}, {doc_id: 1, doc_nm : 'aa'} ];
27348
27348
  }, 500);
27349
27349
 
27350
-
27350
+
27351
27351
  this.shadowRoot.querySelector(".more a").addEventListener("click", () => {
27352
27352
  alert(this.#message);
27353
27353
  });
@@ -27428,9 +27428,46 @@ class aiMyMessage extends HTMLElement
27428
27428
  };
27429
27429
  }
27430
27430
 
27431
+ class aiChat extends HTMLElement
27432
+ {
27433
+ constructor() {
27434
+ super();
27435
+ this.attachShadow({ mode: 'open' });
27436
+ }
27437
+
27438
+ connectedCallback() {
27439
+ this.getAttribute("message");
27440
+
27441
+ this.shadowRoot.innerHTML = `
27442
+ <style>
27443
+ @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/aiMessage.css";
27444
+ ${ninegrid.getCustomPath(this,"aiMessage.css")}
27445
+ </style>
27446
+
27447
+ <div class="chat-body">
27448
+ </div>
27449
+ `;
27450
+
27451
+ this.#init();
27452
+ };
27453
+
27454
+ #init = () => {
27455
+
27456
+ };
27457
+
27458
+ add = (sender, message, data) => {
27459
+ const target = this.shadowRoot.querySelector(".chat-body");
27460
+
27461
+ const el = document.createElement("nx-ai-my-message");
27462
+ el.setAttribute("message", message);
27463
+ target.appendChild(el);
27464
+ };
27465
+ }
27466
+
27431
27467
  customElements.define("nx-ai-message", aiMessage);
27432
27468
  customElements.define("nx-ai-ing-message", aiIngMessage);
27433
27469
  customElements.define("nx-ai-my-message", aiMyMessage);
27470
+ customElements.define("nx-ai-chat", aiChat);
27434
27471
 
27435
27472
  //import $ from "https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js";
27436
27473
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.301.0",
4
+ "version": "6.302.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -63,7 +63,7 @@ class aiMessage extends HTMLElement
63
63
  grd.data.source = [ {doc_id: 1, doc_nm : 'aa'}, {doc_id: 1, doc_nm : 'aa'} ];
64
64
  }, 500);
65
65
 
66
-
66
+
67
67
  this.shadowRoot.querySelector(".more a").addEventListener("click", () => {
68
68
  alert(this.#message);
69
69
  });
@@ -144,6 +144,43 @@ class aiMyMessage extends HTMLElement
144
144
  };
145
145
  }
146
146
 
147
+ class aiChat extends HTMLElement
148
+ {
149
+ constructor() {
150
+ super();
151
+ this.attachShadow({ mode: 'open' });
152
+ }
153
+
154
+ connectedCallback() {
155
+ const message = this.getAttribute("message");
156
+
157
+ this.shadowRoot.innerHTML = `
158
+ <style>
159
+ @import "https://cdn.jsdelivr.net/npm/ninegrid@${ninegrid.version}/dist/css/aiMessage.css";
160
+ ${ninegrid.getCustomPath(this,"aiMessage.css")}
161
+ </style>
162
+
163
+ <div class="chat-body">
164
+ </div>
165
+ `;
166
+
167
+ this.#init();
168
+ };
169
+
170
+ #init = () => {
171
+
172
+ };
173
+
174
+ add = (sender, message, data) => {
175
+ const target = this.shadowRoot.querySelector(".chat-body");
176
+
177
+ const el = document.createElement("nx-ai-my-message");
178
+ el.setAttribute("message", message);
179
+ target.appendChild(el);
180
+ };
181
+ }
182
+
147
183
  customElements.define("nx-ai-message", aiMessage);
148
184
  customElements.define("nx-ai-ing-message", aiIngMessage);
149
185
  customElements.define("nx-ai-my-message", aiMyMessage);
186
+ customElements.define("nx-ai-chat", aiChat);