ninegrid2 6.244.0 → 6.245.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.
@@ -18002,7 +18002,6 @@ class ngFilterPanel extends HTMLElement
18002
18002
  connectedCallback() {
18003
18003
 
18004
18004
  this.#owner = this.getRootNode().host;
18005
- console.log("========================", this.#owner);
18006
18005
 
18007
18006
  const cssPath = this.getRootNode().host.closest("nine-grid").getAttribute("css-path") || "";
18008
18007
 
@@ -18041,25 +18040,21 @@ class ngFilterPanel extends HTMLElement
18041
18040
  </div>
18042
18041
  `;
18043
18042
 
18044
- $(this.shadowRoot).find("input[type=text]") .on("input", this.#onInput);
18045
- $(this.shadowRoot).find("input[type=checkbox]") .on("change", this.#onSelectAll);
18046
- $(this.shadowRoot).find("#btnOk") .on("click", this.#onOk);
18047
- $(this.shadowRoot).find("#btnCancel") .on("click", this.#onCancel);
18048
-
18049
- //$(this).on("mousedown", e => { e.preventDefault(); e.stopPropagation(); });
18050
- //$(this).on("mousedown", e => { e.stopPropagation(); });
18043
+ this.shadowRoot.querySelector("input[type=text]").addEventListener("input", this.#onInput);
18044
+ this.shadowRoot.querySelector("input[type=checkbox]").addEventListener("change", this.#onSelectAll);
18045
+ this.shadowRoot.querySelector("#btnOk").addEventListener("click", this.#onOk);
18046
+ this.shadowRoot.querySelector("#btnCancel").addEventListener("click", this.#onCancel);
18051
18047
  };
18052
18048
 
18053
18049
  #onOk = (e) => {
18054
18050
 
18055
18051
  const grd = this.shadowRoot.querySelector("nine-grid");
18056
18052
 
18057
- //ninegrid.j.querySelectorAll(grd).addClass("loading");
18058
- //ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
18059
18053
  this.classList.add("loading");
18060
18054
 
18061
18055
  setTimeout(() => {
18062
18056
 
18057
+ /**
18063
18058
  const LVL_IDX = grd.fields.indexOf("LVL");
18064
18059
  const CHK_IDX = grd.fields.indexOf("CHK");
18065
18060
  const COLNM_IDX = grd.fields.indexOf("COLNM");
@@ -18077,13 +18072,18 @@ class ngFilterPanel extends HTMLElement
18077
18072
  data : [...new Set(grd.data.getValidData().filter(m => { return m.v[CHK_IDX] == "Y" && m.v[COLNM_IDX] == v; }).map(m => { return m.v[DATA_IDX] || ''; }))].sort((a,b) => { return a > b ? 1 : -1; }),
18078
18073
  });
18079
18074
  });
18080
- }
18075
+ } */
18076
+ const [LVL_IDX, CHK_IDX, COLNM_IDX, DATA_IDX] = ["LVL", "CHK", "COLNM", "DATA"].map(k => grd.fields.indexOf(k));
18077
+ const checked = grd.data.getValidDataNF().filter(m => m.v[LVL_IDX] === 2 && m.v[CHK_IDX] === "Y");
18078
+ const filterOptions = checked.length > 0 ? [...new Set(checked.map(m => m.v[COLNM_IDX]))].map(v => ({
18079
+ colnm: v,
18080
+ data: [...new Set(grd.data.getValidData().filter(m => m.v[CHK_IDX] === "Y" && m.v[COLNM_IDX] === v).map(m => m.v[DATA_IDX] || ''))].sort()
18081
+ })) : [];
18081
18082
 
18082
- //console.log(filterOptions);
18083
- //console.log(this.#target, this.#target.button, filterOptions)
18084
18083
 
18085
18084
  this.#button.filterOptions = filterOptions;
18086
18085
 
18086
+ /**
18087
18087
  var oParam = {};
18088
18088
 
18089
18089
  this.#owner.body.querySelectorAll("ng-filter-button").forEach(el => {
@@ -18093,20 +18093,28 @@ class ngFilterPanel extends HTMLElement
18093
18093
  el.filterOptions.forEach(filterOptions => {
18094
18094
  if (filterOptions.data.length > 0) oParam[filterOptions.colnm] = filterOptions.data;
18095
18095
  });
18096
- });
18096
+ }); */
18097
+
18098
+ const oParam = Object.fromEntries(
18099
+ [...this.#owner.body.querySelectorAll("ng-filter-button")]
18100
+ .flatMap(el => el.filterOptions)
18101
+ .filter(opt => opt.data.length > 0)
18102
+ .map(opt => [opt.colnm, opt.data])
18103
+ );
18097
18104
 
18098
18105
  this.#owner.filtering.set(oParam);
18099
-
18100
18106
  this.classList.remove("loading");
18101
18107
  });
18102
18108
 
18103
- $(this).hide();
18109
+ //$(this).hide();
18110
+ this.style.display = 'none';
18104
18111
  };
18105
18112
 
18106
18113
 
18107
18114
 
18108
18115
  #onCancel = (e) => {
18109
- $(this).hide();
18116
+ //$(this).hide();
18117
+ this.style.display = 'none';
18110
18118
  };
18111
18119
 
18112
18120
  #onSelectAll = (e) => {
@@ -18000,7 +18000,6 @@ class ngFilterPanel extends HTMLElement
18000
18000
  connectedCallback() {
18001
18001
 
18002
18002
  this.#owner = this.getRootNode().host;
18003
- console.log("========================", this.#owner);
18004
18003
 
18005
18004
  const cssPath = this.getRootNode().host.closest("nine-grid").getAttribute("css-path") || "";
18006
18005
 
@@ -18039,25 +18038,21 @@ class ngFilterPanel extends HTMLElement
18039
18038
  </div>
18040
18039
  `;
18041
18040
 
18042
- $(this.shadowRoot).find("input[type=text]") .on("input", this.#onInput);
18043
- $(this.shadowRoot).find("input[type=checkbox]") .on("change", this.#onSelectAll);
18044
- $(this.shadowRoot).find("#btnOk") .on("click", this.#onOk);
18045
- $(this.shadowRoot).find("#btnCancel") .on("click", this.#onCancel);
18046
-
18047
- //$(this).on("mousedown", e => { e.preventDefault(); e.stopPropagation(); });
18048
- //$(this).on("mousedown", e => { e.stopPropagation(); });
18041
+ this.shadowRoot.querySelector("input[type=text]").addEventListener("input", this.#onInput);
18042
+ this.shadowRoot.querySelector("input[type=checkbox]").addEventListener("change", this.#onSelectAll);
18043
+ this.shadowRoot.querySelector("#btnOk").addEventListener("click", this.#onOk);
18044
+ this.shadowRoot.querySelector("#btnCancel").addEventListener("click", this.#onCancel);
18049
18045
  };
18050
18046
 
18051
18047
  #onOk = (e) => {
18052
18048
 
18053
18049
  const grd = this.shadowRoot.querySelector("nine-grid");
18054
18050
 
18055
- //ninegrid.j.querySelectorAll(grd).addClass("loading");
18056
- //ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
18057
18051
  this.classList.add("loading");
18058
18052
 
18059
18053
  setTimeout(() => {
18060
18054
 
18055
+ /**
18061
18056
  const LVL_IDX = grd.fields.indexOf("LVL");
18062
18057
  const CHK_IDX = grd.fields.indexOf("CHK");
18063
18058
  const COLNM_IDX = grd.fields.indexOf("COLNM");
@@ -18075,13 +18070,18 @@ class ngFilterPanel extends HTMLElement
18075
18070
  data : [...new Set(grd.data.getValidData().filter(m => { return m.v[CHK_IDX] == "Y" && m.v[COLNM_IDX] == v; }).map(m => { return m.v[DATA_IDX] || ''; }))].sort((a,b) => { return a > b ? 1 : -1; }),
18076
18071
  });
18077
18072
  });
18078
- }
18073
+ } */
18074
+ const [LVL_IDX, CHK_IDX, COLNM_IDX, DATA_IDX] = ["LVL", "CHK", "COLNM", "DATA"].map(k => grd.fields.indexOf(k));
18075
+ const checked = grd.data.getValidDataNF().filter(m => m.v[LVL_IDX] === 2 && m.v[CHK_IDX] === "Y");
18076
+ const filterOptions = checked.length > 0 ? [...new Set(checked.map(m => m.v[COLNM_IDX]))].map(v => ({
18077
+ colnm: v,
18078
+ data: [...new Set(grd.data.getValidData().filter(m => m.v[CHK_IDX] === "Y" && m.v[COLNM_IDX] === v).map(m => m.v[DATA_IDX] || ''))].sort()
18079
+ })) : [];
18079
18080
 
18080
- //console.log(filterOptions);
18081
- //console.log(this.#target, this.#target.button, filterOptions)
18082
18081
 
18083
18082
  this.#button.filterOptions = filterOptions;
18084
18083
 
18084
+ /**
18085
18085
  var oParam = {};
18086
18086
 
18087
18087
  this.#owner.body.querySelectorAll("ng-filter-button").forEach(el => {
@@ -18091,20 +18091,28 @@ class ngFilterPanel extends HTMLElement
18091
18091
  el.filterOptions.forEach(filterOptions => {
18092
18092
  if (filterOptions.data.length > 0) oParam[filterOptions.colnm] = filterOptions.data;
18093
18093
  });
18094
- });
18094
+ }); */
18095
+
18096
+ const oParam = Object.fromEntries(
18097
+ [...this.#owner.body.querySelectorAll("ng-filter-button")]
18098
+ .flatMap(el => el.filterOptions)
18099
+ .filter(opt => opt.data.length > 0)
18100
+ .map(opt => [opt.colnm, opt.data])
18101
+ );
18095
18102
 
18096
18103
  this.#owner.filtering.set(oParam);
18097
-
18098
18104
  this.classList.remove("loading");
18099
18105
  });
18100
18106
 
18101
- $(this).hide();
18107
+ //$(this).hide();
18108
+ this.style.display = 'none';
18102
18109
  };
18103
18110
 
18104
18111
 
18105
18112
 
18106
18113
  #onCancel = (e) => {
18107
- $(this).hide();
18114
+ //$(this).hide();
18115
+ this.style.display = 'none';
18108
18116
  };
18109
18117
 
18110
18118
  #onSelectAll = (e) => {
@@ -179,7 +179,6 @@ class ngFilterPanel extends HTMLElement
179
179
  connectedCallback() {
180
180
 
181
181
  this.#owner = this.getRootNode().host;
182
- console.log("========================", this.#owner)
183
182
 
184
183
  const cssPath = this.getRootNode().host.closest("nine-grid").getAttribute("css-path") || "";
185
184
 
@@ -218,25 +217,21 @@ class ngFilterPanel extends HTMLElement
218
217
  </div>
219
218
  `;
220
219
 
221
- $(this.shadowRoot).find("input[type=text]") .on("input", this.#onInput);
222
- $(this.shadowRoot).find("input[type=checkbox]") .on("change", this.#onSelectAll);
223
- $(this.shadowRoot).find("#btnOk") .on("click", this.#onOk);
224
- $(this.shadowRoot).find("#btnCancel") .on("click", this.#onCancel);
225
-
226
- //$(this).on("mousedown", e => { e.preventDefault(); e.stopPropagation(); });
227
- //$(this).on("mousedown", e => { e.stopPropagation(); });
220
+ this.shadowRoot.querySelector("input[type=text]").addEventListener("input", this.#onInput);
221
+ this.shadowRoot.querySelector("input[type=checkbox]").addEventListener("change", this.#onSelectAll);
222
+ this.shadowRoot.querySelector("#btnOk").addEventListener("click", this.#onOk);
223
+ this.shadowRoot.querySelector("#btnCancel").addEventListener("click", this.#onCancel);
228
224
  };
229
225
 
230
226
  #onOk = (e) => {
231
227
 
232
228
  const grd = this.shadowRoot.querySelector("nine-grid");
233
229
 
234
- //ninegrid.j.querySelectorAll(grd).addClass("loading");
235
- //ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
236
230
  this.classList.add("loading");
237
231
 
238
232
  setTimeout(() => {
239
233
 
234
+ /**
240
235
  const LVL_IDX = grd.fields.indexOf("LVL");
241
236
  const CHK_IDX = grd.fields.indexOf("CHK");
242
237
  const COLNM_IDX = grd.fields.indexOf("COLNM");
@@ -254,13 +249,18 @@ class ngFilterPanel extends HTMLElement
254
249
  data : [...new Set(grd.data.getValidData().filter(m => { return m.v[CHK_IDX] == "Y" && m.v[COLNM_IDX] == v; }).map(m => { return m.v[DATA_IDX] || ''; }))].sort((a,b) => { return a > b ? 1 : -1; }),
255
250
  });
256
251
  });
257
- }
252
+ } */
253
+ const [LVL_IDX, CHK_IDX, COLNM_IDX, DATA_IDX] = ["LVL", "CHK", "COLNM", "DATA"].map(k => grd.fields.indexOf(k));
254
+ const checked = grd.data.getValidDataNF().filter(m => m.v[LVL_IDX] === 2 && m.v[CHK_IDX] === "Y");
255
+ const filterOptions = checked.length > 0 ? [...new Set(checked.map(m => m.v[COLNM_IDX]))].map(v => ({
256
+ colnm: v,
257
+ data: [...new Set(grd.data.getValidData().filter(m => m.v[CHK_IDX] === "Y" && m.v[COLNM_IDX] === v).map(m => m.v[DATA_IDX] || ''))].sort()
258
+ })) : [];
258
259
 
259
- //console.log(filterOptions);
260
- //console.log(this.#target, this.#target.button, filterOptions)
261
260
 
262
261
  this.#button.filterOptions = filterOptions;
263
262
 
263
+ /**
264
264
  var oParam = {};
265
265
 
266
266
  this.#owner.body.querySelectorAll("ng-filter-button").forEach(el => {
@@ -270,20 +270,28 @@ class ngFilterPanel extends HTMLElement
270
270
  el.filterOptions.forEach(filterOptions => {
271
271
  if (filterOptions.data.length > 0) oParam[filterOptions.colnm] = filterOptions.data;
272
272
  });
273
- });
273
+ }); */
274
+
275
+ const oParam = Object.fromEntries(
276
+ [...this.#owner.body.querySelectorAll("ng-filter-button")]
277
+ .flatMap(el => el.filterOptions)
278
+ .filter(opt => opt.data.length > 0)
279
+ .map(opt => [opt.colnm, opt.data])
280
+ );
274
281
 
275
282
  this.#owner.filtering.set(oParam);
276
-
277
283
  this.classList.remove("loading");
278
284
  });
279
285
 
280
- $(this).hide();
286
+ //$(this).hide();
287
+ this.style.display = 'none';
281
288
  };
282
289
 
283
290
 
284
291
 
285
292
  #onCancel = (e) => {
286
- $(this).hide();
293
+ //$(this).hide();
294
+ this.style.display = 'none';
287
295
  };
288
296
 
289
297
  #onSelectAll = (e) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.244.0",
4
+ "version": "6.245.0",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
7
7
  "import": "./dist/index.js",
@@ -179,7 +179,6 @@ class ngFilterPanel extends HTMLElement
179
179
  connectedCallback() {
180
180
 
181
181
  this.#owner = this.getRootNode().host;
182
- console.log("========================", this.#owner)
183
182
 
184
183
  const cssPath = this.getRootNode().host.closest("nine-grid").getAttribute("css-path") || "";
185
184
 
@@ -218,25 +217,21 @@ class ngFilterPanel extends HTMLElement
218
217
  </div>
219
218
  `;
220
219
 
221
- $(this.shadowRoot).find("input[type=text]") .on("input", this.#onInput);
222
- $(this.shadowRoot).find("input[type=checkbox]") .on("change", this.#onSelectAll);
223
- $(this.shadowRoot).find("#btnOk") .on("click", this.#onOk);
224
- $(this.shadowRoot).find("#btnCancel") .on("click", this.#onCancel);
225
-
226
- //$(this).on("mousedown", e => { e.preventDefault(); e.stopPropagation(); });
227
- //$(this).on("mousedown", e => { e.stopPropagation(); });
220
+ this.shadowRoot.querySelector("input[type=text]").addEventListener("input", this.#onInput);
221
+ this.shadowRoot.querySelector("input[type=checkbox]").addEventListener("change", this.#onSelectAll);
222
+ this.shadowRoot.querySelector("#btnOk").addEventListener("click", this.#onOk);
223
+ this.shadowRoot.querySelector("#btnCancel").addEventListener("click", this.#onCancel);
228
224
  };
229
225
 
230
226
  #onOk = (e) => {
231
227
 
232
228
  const grd = this.shadowRoot.querySelector("nine-grid");
233
229
 
234
- //ninegrid.j.querySelectorAll(grd).addClass("loading");
235
- //ninegrid.j.querySelectorAll(this.#target.owner).addClass("loading");
236
230
  this.classList.add("loading");
237
231
 
238
232
  setTimeout(() => {
239
233
 
234
+ /**
240
235
  const LVL_IDX = grd.fields.indexOf("LVL");
241
236
  const CHK_IDX = grd.fields.indexOf("CHK");
242
237
  const COLNM_IDX = grd.fields.indexOf("COLNM");
@@ -254,13 +249,18 @@ class ngFilterPanel extends HTMLElement
254
249
  data : [...new Set(grd.data.getValidData().filter(m => { return m.v[CHK_IDX] == "Y" && m.v[COLNM_IDX] == v; }).map(m => { return m.v[DATA_IDX] || ''; }))].sort((a,b) => { return a > b ? 1 : -1; }),
255
250
  });
256
251
  });
257
- }
252
+ } */
253
+ const [LVL_IDX, CHK_IDX, COLNM_IDX, DATA_IDX] = ["LVL", "CHK", "COLNM", "DATA"].map(k => grd.fields.indexOf(k));
254
+ const checked = grd.data.getValidDataNF().filter(m => m.v[LVL_IDX] === 2 && m.v[CHK_IDX] === "Y");
255
+ const filterOptions = checked.length > 0 ? [...new Set(checked.map(m => m.v[COLNM_IDX]))].map(v => ({
256
+ colnm: v,
257
+ data: [...new Set(grd.data.getValidData().filter(m => m.v[CHK_IDX] === "Y" && m.v[COLNM_IDX] === v).map(m => m.v[DATA_IDX] || ''))].sort()
258
+ })) : [];
258
259
 
259
- //console.log(filterOptions);
260
- //console.log(this.#target, this.#target.button, filterOptions)
261
260
 
262
261
  this.#button.filterOptions = filterOptions;
263
262
 
263
+ /**
264
264
  var oParam = {};
265
265
 
266
266
  this.#owner.body.querySelectorAll("ng-filter-button").forEach(el => {
@@ -270,20 +270,28 @@ class ngFilterPanel extends HTMLElement
270
270
  el.filterOptions.forEach(filterOptions => {
271
271
  if (filterOptions.data.length > 0) oParam[filterOptions.colnm] = filterOptions.data;
272
272
  });
273
- });
273
+ }); */
274
+
275
+ const oParam = Object.fromEntries(
276
+ [...this.#owner.body.querySelectorAll("ng-filter-button")]
277
+ .flatMap(el => el.filterOptions)
278
+ .filter(opt => opt.data.length > 0)
279
+ .map(opt => [opt.colnm, opt.data])
280
+ );
274
281
 
275
282
  this.#owner.filtering.set(oParam);
276
-
277
283
  this.classList.remove("loading");
278
284
  });
279
285
 
280
- $(this).hide();
286
+ //$(this).hide();
287
+ this.style.display = 'none';
281
288
  };
282
289
 
283
290
 
284
291
 
285
292
  #onCancel = (e) => {
286
- $(this).hide();
293
+ //$(this).hide();
294
+ this.style.display = 'none';
287
295
  };
288
296
 
289
297
  #onSelectAll = (e) => {