@ninebone/grid 0.0.75 → 0.0.76

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.
package/dist/nine-grid.js CHANGED
@@ -2266,26 +2266,26 @@ class sd extends Bu.constructor {
2266
2266
  }
2267
2267
  }
2268
2268
  const id = new sd();
2269
- var ih, Zi, Le, rr, Ro, Ns, ri, Ji, nh, oh, ah, lh, hu;
2269
+ var ih, Zi, Le, tr, Ro, Ns, ri, Ji, nh, oh, ah, lh, hu;
2270
2270
  class nd extends Si {
2271
2271
  constructor() {
2272
2272
  super();
2273
2273
  Y(this, ih, 10);
2274
2274
  Y(this, Zi);
2275
2275
  Y(this, Le);
2276
- Y(this, rr);
2276
+ Y(this, tr);
2277
2277
  Y(this, Ro);
2278
2278
  Y(this, Ns);
2279
2279
  Y(this, ri);
2280
2280
  Y(this, Ji);
2281
2281
  it(this, "dataRefresh", (t) => {
2282
- f(this, rr) && (f(this, nh).call(this) ? H.j.querySelectorAll(this).removeClass("invalid") : H.j.querySelectorAll(this).addClass("invalid")), f(this, Zi).innerHTML = this.getDisplayText() || "Select", t || this.reset();
2282
+ f(this, tr) && (f(this, nh).call(this) ? H.j.querySelectorAll(this).removeClass("invalid") : H.j.querySelectorAll(this).addClass("invalid")), f(this, Zi).innerHTML = this.getDisplayText() || "Select", t || this.reset();
2283
2283
  });
2284
2284
  Y(this, nh, () => {
2285
2285
  if (H.isNull(this.value)) return !0;
2286
2286
  var t = this.multi ? this.value.split(this.multiSeparator) : [this.value];
2287
2287
  for (var l of t) {
2288
- var c = f(this, rr).findIndex((o) => l == o[f(this, Ns)]);
2288
+ var c = f(this, tr).findIndex((o) => l == o[f(this, Ns)]);
2289
2289
  if (c < 0) return !1;
2290
2290
  }
2291
2291
  return !0;
@@ -2298,11 +2298,11 @@ class nd extends Si {
2298
2298
  }
2299
2299
  });
2300
2300
  Y(this, ah, (t) => {
2301
- if (console.log(f(this, rr)), !!f(this, rr)) {
2302
- console.log(f(this, rr)), f(this, Le).col = this.cell.dataset.col, f(this, Le).row = this.cell.closest("tr").sectionRowIndex, f(this, rr).length > f(this, ih) ? H.j.querySelectorAll(f(this, Le)).addClass("expand") : H.j.querySelectorAll(f(this, Le)).removeClass("expand"), this.multi ? H.j.querySelectorAll(f(this, Le)).addClass("multi") : H.j.querySelectorAll(f(this, Le)).removeClass("multi"), f(this, Le).refresh(this, f(this, rr), f(this, Ns), f(this, Ji));
2301
+ if (console.log(f(this, tr)), !!f(this, tr)) {
2302
+ console.log(f(this, tr)), f(this, Le).col = this.cell.dataset.col, f(this, Le).row = this.cell.closest("tr").sectionRowIndex, f(this, tr).length > f(this, ih) ? H.j.querySelectorAll(f(this, Le)).addClass("expand") : H.j.querySelectorAll(f(this, Le)).removeClass("expand"), this.multi ? H.j.querySelectorAll(f(this, Le)).addClass("multi") : H.j.querySelectorAll(f(this, Le)).removeClass("multi"), f(this, Le).refresh(this, f(this, tr), f(this, Ns), f(this, Ji));
2303
2303
  var l = $(".btn1", this.shadowRoot).offset().left - $(this.owner).offset().left;
2304
2304
  l + $(f(this, Le)).width() > $(this.owner).width() && (l = $(".btn2", this.shadowRoot).offset().left - $(this.owner).offset().left - $(f(this, Le)).width() + 8), l < 0 && (l = 0);
2305
- var c = Math.min(f(this, rr).length, f(this, Ro)) * 26;
2305
+ var c = Math.min(f(this, tr).length, f(this, Ro)) * 26;
2306
2306
  this.multi ? (H.j.querySelectorAll(f(this, Le)).hasClass("expand") && (c += 12, c += 3, c += 24), c += 2, c += 3, c += 25) : (H.j.querySelectorAll(f(this, Le)).hasClass("expand") && (c += 12, c += 3, c += 24), c += 3);
2307
2307
  var o = $(".btn1", this.shadowRoot).offset().top + $(".btn1", this.shadowRoot).height() - $(this.owner).offset().top + 3;
2308
2308
  o + c > $(this.owner).height() && (o -= c + $(".btn1", this.shadowRoot).height() + 6);
@@ -2323,13 +2323,13 @@ class nd extends Si {
2323
2323
  connectedCallback() {
2324
2324
  this.multi = this.getAttribute("multi") == "true", this.multiSeparator = this.getAttribute("multi-separator") || ",", tt(this, Ro, this.getAttribute("rows") || 5), tt(this, Ns, this.getAttribute("code") || "code"), tt(this, ri, this.getAttribute("codename") || "codename"), tt(this, Ji, (this.getAttribute("items") || f(this, ri) || "").split(",")), f(this, Ji).unshift("CHK");
2325
2325
  var t = this.querySelector("datalist");
2326
- id.log(t), t && (tt(this, rr, []), t.querySelectorAll("option").forEach((n) => {
2326
+ t && (tt(this, tr, []), t.querySelectorAll("option").forEach((n) => {
2327
2327
  const s = n.getAttribute(f(this, Ns)), e = n.getAttribute(f(this, ri));
2328
- s && e && f(this, rr).push({
2328
+ s && e && f(this, tr).push({
2329
2329
  [f(this, Ns)]: s,
2330
2330
  [f(this, ri)]: e
2331
2331
  });
2332
- })), this.shadowRoot.innerHTML = `
2332
+ })), id.log(f(this, tr)), this.shadowRoot.innerHTML = `
2333
2333
  <style>
2334
2334
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ngCombo.css";
2335
2335
  ${H.getCustomPath(this, "ngCombo.css")}
@@ -2339,7 +2339,7 @@ class nd extends Si {
2339
2339
  <button class="btn2" tabindex="-1"></button>
2340
2340
  `, super.connectedCallback();
2341
2341
  const l = this.closest("th,td"), c = this.getAttribute("data-source");
2342
- c && this.owner && this.owner.exprFunction && (this.owner[c] ? tt(this, rr, this.owner[c]) : tt(this, rr, this.owner.exprFunction(c).call(this, this.owner.data.get(this.cell.dataset.row), this.cell.dataset.row))), l && l.dataset && f(this, rr) && !l.dataset.expr && (l.dataset.expr = "comboExpr()"), f(this, oh).call(this), f(this, Le), tt(this, Zi, this.shadowRoot.querySelector(".btn1"));
2342
+ c && this.owner && this.owner.exprFunction && (this.owner[c] ? tt(this, tr, this.owner[c]) : tt(this, tr, this.owner.exprFunction(c).call(this, this.owner.data.get(this.cell.dataset.row), this.cell.dataset.row))), l && l.dataset && f(this, tr) && !l.dataset.expr && (l.dataset.expr = "comboExpr()"), f(this, oh).call(this), f(this, Le), tt(this, Zi, this.shadowRoot.querySelector(".btn1"));
2343
2343
  var o = this.closest("th,td").dataset.col, r = this.closest("tr").sectionRowIndex;
2344
2344
  $(this.cell).on("keydown", (n) => {
2345
2345
  n.code == "Enter" && $(f(this, Zi)).trigger("click");
@@ -2348,10 +2348,10 @@ class nd extends Si {
2348
2348
  });
2349
2349
  }
2350
2350
  get dataSource() {
2351
- return f(this, rr);
2351
+ return f(this, tr);
2352
2352
  }
2353
2353
  }
2354
- ih = new WeakMap(), Zi = new WeakMap(), Le = new WeakMap(), rr = new WeakMap(), Ro = new WeakMap(), Ns = new WeakMap(), ri = new WeakMap(), Ji = new WeakMap(), nh = new WeakMap(), oh = new WeakMap(), ah = new WeakMap(), lh = new WeakMap(), hu = new WeakMap();
2354
+ ih = new WeakMap(), Zi = new WeakMap(), Le = new WeakMap(), tr = new WeakMap(), Ro = new WeakMap(), Ns = new WeakMap(), ri = new WeakMap(), Ji = new WeakMap(), nh = new WeakMap(), oh = new WeakMap(), ah = new WeakMap(), lh = new WeakMap(), hu = new WeakMap();
2355
2355
  var Mo, Pe, Os, si, Qi, hh, Io, ch, No, tn, cu, uh, dh;
2356
2356
  class od extends HTMLElement {
2357
2357
  constructor() {
@@ -27666,7 +27666,7 @@ class Fd extends HTMLElement {
27666
27666
  }
27667
27667
  Lt = new WeakMap(), Qo = new WeakMap(), $h = new WeakMap();
27668
27668
  customElements.get("ng-menu") || customElements.define("ng-menu", Fd);
27669
- var Be, ta, ea, Er, ra, ze, tr, Ps, Lh, vn, Ph;
27669
+ var Be, ta, ea, Er, ra, ze, er, Ps, Lh, vn, Ph;
27670
27670
  class qd extends HTMLElement {
27671
27671
  constructor() {
27672
27672
  super();
@@ -27676,7 +27676,7 @@ class qd extends HTMLElement {
27676
27676
  Y(this, Er);
27677
27677
  Y(this, ra);
27678
27678
  Y(this, ze);
27679
- Y(this, tr);
27679
+ Y(this, er);
27680
27680
  Y(this, Ps);
27681
27681
  it(this, "refreshTotal", () => {
27682
27682
  });
@@ -27686,7 +27686,7 @@ class qd extends HTMLElement {
27686
27686
  }), f(this, Be).data.resetRecords();
27687
27687
  });
27688
27688
  Y(this, vn, () => {
27689
- this.type == H.PAGINGTYPE.CLIENT ? $("span", this).eq(1).html(`<b>Total</b> : ${f(this, Be).data.countNF().toLocaleString()}`) : this.type == H.PAGINGTYPE.SERVER ? $("span", this).eq(1).html(`<b>Total</b> : ${f(this, Ps).toLocaleString()}`) : this.type == H.PAGINGTYPE.NONE && $("span", this).eq(1).html(`<b>Total</b> : ${f(this, Ps).toLocaleString()}`), f(this, tr) == 0 ? $("span", this).eq(0).html("") : $("span", this).eq(0).html(`${f(this, ze).toLocaleString()} <i>of</i> ${f(this, tr).toLocaleString()}`), H.j.querySelectorAll(".ng-paging-first", this).attr("disabled", f(this, ze) == 1 || f(this, tr) < 1), H.j.querySelectorAll(".ng-paging-prev", this).attr("disabled", f(this, ze) == 1 || f(this, tr) < 1), H.j.querySelectorAll(".ng-paging-next", this).attr("disabled", f(this, ze) == f(this, tr) || f(this, tr) < 1), H.j.querySelectorAll(".ng-paging-last", this).attr("disabled", f(this, ze) == f(this, tr) || f(this, tr) < 1);
27689
+ this.type == H.PAGINGTYPE.CLIENT ? $("span", this).eq(1).html(`<b>Total</b> : ${f(this, Be).data.countNF().toLocaleString()}`) : this.type == H.PAGINGTYPE.SERVER ? $("span", this).eq(1).html(`<b>Total</b> : ${f(this, Ps).toLocaleString()}`) : this.type == H.PAGINGTYPE.NONE && $("span", this).eq(1).html(`<b>Total</b> : ${f(this, Ps).toLocaleString()}`), f(this, er) == 0 ? $("span", this).eq(0).html("") : $("span", this).eq(0).html(`${f(this, ze).toLocaleString()} <i>of</i> ${f(this, er).toLocaleString()}`), H.j.querySelectorAll(".ng-paging-first", this).attr("disabled", f(this, ze) == 1 || f(this, er) < 1), H.j.querySelectorAll(".ng-paging-prev", this).attr("disabled", f(this, ze) == 1 || f(this, er) < 1), H.j.querySelectorAll(".ng-paging-next", this).attr("disabled", f(this, ze) == f(this, er) || f(this, er) < 1), H.j.querySelectorAll(".ng-paging-last", this).attr("disabled", f(this, ze) == f(this, er) || f(this, er) < 1);
27690
27690
  });
27691
27691
  Y(this, Ph, () => {
27692
27692
  this.type == H.PAGINGTYPE.CLIENT ? this.movePage(Math.ceil(f(this, Be).data.countNF() / f(this, Er))) : this.type == H.PAGINGTYPE.SERVER && this.movePage(Math.ceil(f(this, Ps) / f(this, Er)));
@@ -27695,9 +27695,9 @@ class qd extends HTMLElement {
27695
27695
  if (!(!f(this, Be) || !f(this, Be).data || isNaN(t))) {
27696
27696
  if (this.type == H.PAGINGTYPE.SERVER && (H.j.querySelectorAll(".ng-paging-first", this).attr("disabled", !0), H.j.querySelectorAll(".ng-paging-prev", this).attr("disabled", !0), H.j.querySelectorAll(".ng-paging-next", this).attr("disabled", !0), H.j.querySelectorAll(".ng-paging-last", this).attr("disabled", !0)), tt(this, ra, f(this, ze)), tt(this, ze, t), this.type == H.PAGINGTYPE.CLIENT) {
27697
27697
  var l = f(this, Be).data.getValidDataNF();
27698
- if (tt(this, tr, Math.ceil(l.length / f(this, Er))), l.length == 0)
27699
- tt(this, tr, 0);
27700
- else if (t < 1 || t > f(this, tr)) throw `1invalid page ${t} of ${f(this, tr)}`;
27698
+ if (tt(this, er, Math.ceil(l.length / f(this, Er))), l.length == 0)
27699
+ tt(this, er, 0);
27700
+ else if (t < 1 || t > f(this, er)) throw `1invalid page ${t} of ${f(this, er)}`;
27701
27701
  f(this, vn).call(this), l.map((o) => {
27702
27702
  o.__ng.paging = !1;
27703
27703
  });
@@ -27724,7 +27724,7 @@ class qd extends HTMLElement {
27724
27724
  }
27725
27725
  f(this, vn).call(this);
27726
27726
  });
27727
- tt(this, Be, this.getRootNode().host.getRootNode().host), tt(this, ze, 0), tt(this, tr, 0), tt(this, Ps, 0), this.onpagechanged = new CustomEvent("pagechanged", { bubbles: !0, detail: {} });
27727
+ tt(this, Be, this.getRootNode().host.getRootNode().host), tt(this, ze, 0), tt(this, er, 0), tt(this, Ps, 0), this.onpagechanged = new CustomEvent("pagechanged", { bubbles: !0, detail: {} });
27728
27728
  }
27729
27729
  connectedCallback() {
27730
27730
  this.innerHTML = `
@@ -27762,10 +27762,10 @@ class qd extends HTMLElement {
27762
27762
  tt(this, ze, t);
27763
27763
  }
27764
27764
  get totalCount() {
27765
- return f(this, tr);
27765
+ return f(this, er);
27766
27766
  }
27767
27767
  set totalCount(t) {
27768
- tt(this, Ps, t), f(this, ze) <= 0 && tt(this, ze, 1), tt(this, tr, Math.ceil(t / f(this, Er))), f(this, vn).call(this);
27768
+ tt(this, Ps, t), f(this, ze) <= 0 && tt(this, ze, 1), tt(this, er, Math.ceil(t / f(this, Er))), f(this, vn).call(this);
27769
27769
  }
27770
27770
  get linesPerPage() {
27771
27771
  return f(this, Er);
@@ -27800,7 +27800,7 @@ class qd extends HTMLElement {
27800
27800
  tt(this, ea, t);
27801
27801
  }
27802
27802
  }
27803
- Be = new WeakMap(), ta = new WeakMap(), ea = new WeakMap(), Er = new WeakMap(), ra = new WeakMap(), ze = new WeakMap(), tr = new WeakMap(), Ps = new WeakMap(), Lh = new WeakMap(), vn = new WeakMap(), Ph = new WeakMap();
27803
+ Be = new WeakMap(), ta = new WeakMap(), ea = new WeakMap(), Er = new WeakMap(), ra = new WeakMap(), ze = new WeakMap(), er = new WeakMap(), Ps = new WeakMap(), Lh = new WeakMap(), vn = new WeakMap(), Ph = new WeakMap();
27804
27804
  customElements.get("ng-paging") || customElements.define("ng-paging", qd);
27805
27805
  var ci, sa;
27806
27806
  class Hd extends Mr {
@@ -27976,18 +27976,18 @@ class Vd extends Mr {
27976
27976
  }
27977
27977
  }
27978
27978
  Fh = new WeakMap();
27979
- var er, or, di;
27979
+ var rr, or, di;
27980
27980
  class Wd extends HTMLElement {
27981
27981
  constructor() {
27982
27982
  super();
27983
- Y(this, er);
27983
+ Y(this, rr);
27984
27984
  Y(this, or);
27985
27985
  Y(this, di);
27986
27986
  it(this, "popup", (t) => {
27987
- var l = f(this, er).body.querySelector(`tr[data-row="${t}"]`).data;
27988
- tt(this, di, l.__ng._[H.ROW.INDEX]), $(".title", this.shadowRoot).html(f(this, er).getAttribute("caption") || "Details"), $(".sub-title", this.shadowRoot).html(`(${(Number(t) + 1).toLocaleString()} of ${f(this, er).data.count().toLocaleString()})`);
27989
- var c = $("colgroup", f(this, or)), o = 500, r = $(".ng-container-body thead tr", f(this, er).body).not(".col-indicator-rowgroup").length, n = f(this, er).template.length, s = 0;
27990
- $(`tr [data-row=${t}]`, f(this, er).body).not(".dummy").not(".first").not(".last").each((h, p) => {
27987
+ var l = f(this, rr).body.querySelector(`tr[data-row="${t}"]`).data;
27988
+ tt(this, di, l.__ng._[H.ROW.INDEX]), $(".title", this.shadowRoot).html(f(this, rr).getAttribute("caption") || "Details"), $(".sub-title", this.shadowRoot).html(`(${(Number(t) + 1).toLocaleString()} of ${f(this, rr).data.count().toLocaleString()})`);
27989
+ var c = $("colgroup", f(this, or)), o = 500, r = $(".ng-container-body thead tr", f(this, rr).body).not(".col-indicator-rowgroup").length, n = f(this, rr).template.length, s = 0;
27990
+ $(`tr [data-row=${t}]`, f(this, rr).body).not(".dummy").not(".first").not(".last").each((h, p) => {
27991
27991
  s = Math.max(s, parseInt(p.getAttribute("data-col")) + parseInt(p.getAttribute("colspan") || 1));
27992
27992
  });
27993
27993
  for (var e = 0; e < r; e++) {
@@ -28001,14 +28001,14 @@ class Wd extends HTMLElement {
28001
28001
  for (var e = 0; e < s; e++) {
28002
28002
  let p = $("<tr></tr>");
28003
28003
  for (var u = 0; u < r; u++) {
28004
- const m = f(this, er).body.querySelectorAll(`thead [data-col="${e}"]:not(.dummy):not(.first):not(.last):not(.col-indicator)`)[u];
28004
+ const m = f(this, rr).body.querySelectorAll(`thead [data-col="${e}"]:not(.dummy):not(.first):not(.last):not(.col-indicator)`)[u];
28005
28005
  if (m) {
28006
28006
  const d = m.getAttribute("rowspan") || 1, b = m.getAttribute("colspan") || 1, g = m.cloneNode(!0);
28007
28007
  g.setAttribute("rowspan", b), g.setAttribute("colspan", d), g.removeAttribute("fixed"), $(g).height($(m).height()), p.append(g);
28008
28008
  }
28009
28009
  }
28010
28010
  for (var u = 0; u < n; u++) {
28011
- const d = f(this, er).body.querySelectorAll(`[data-row="${t}"][data-col="${e}"]:not(.dummy):not(.first):not(.last)`)[u];
28011
+ const d = f(this, rr).body.querySelectorAll(`[data-row="${t}"][data-col="${e}"]:not(.dummy):not(.first):not(.last)`)[u];
28012
28012
  if (d) {
28013
28013
  const b = d.getAttribute("rowspan") || 1, g = d.getAttribute("colspan") || 1;
28014
28014
  if ($("ng-row-indicator,ng-row-state,ng-row-pin,ng-row-detail", d).length > 0) {
@@ -28019,7 +28019,7 @@ class Wd extends HTMLElement {
28019
28019
  S.setAttribute("data-row", 0), S.setAttribute("rowspan", g), S.setAttribute("colspan", b), S.removeAttribute("fixed"), p.append(S);
28020
28020
  for (const E of d.children) {
28021
28021
  const I = E.getAttribute("data-source");
28022
- I && (f(this, or)[I] = f(this, er)[I]);
28022
+ I && (f(this, or)[I] = f(this, rr)[I]);
28023
28023
  }
28024
28024
  }
28025
28025
  }
@@ -28032,14 +28032,14 @@ class Wd extends HTMLElement {
28032
28032
  d.dataset.col = a, a += d.colSpan || 1;
28033
28033
  });
28034
28034
  }), f(this, or).shadowRoot.querySelector(".ng-body").style.height = "100vh", f(this, or).createTemplate(), this.shadowRoot.querySelector("dialog").showModal(), setTimeout(() => {
28035
- f(this, or).data.source = [Object.assign({}, f(this, er).data.getNF(f(this, di)))];
28035
+ f(this, or).data.source = [Object.assign({}, f(this, rr).data.getNF(f(this, di)))];
28036
28036
  });
28037
28037
  });
28038
28038
  this.attachShadow({ mode: "open" });
28039
28039
  }
28040
28040
  connectedCallback() {
28041
- tt(this, er, this.getRootNode().host);
28042
- const t = f(this, er).getAttribute("css-path") || "";
28041
+ tt(this, rr, this.getRootNode().host);
28042
+ const t = f(this, rr).getAttribute("css-path") || "";
28043
28043
  this.shadowRoot.innerHTML = `
28044
28044
  <style>
28045
28045
  @import "https://cdn.jsdelivr.net/npm/ninegrid2@${H.version}/dist/css/ninegrid.css";
@@ -28058,10 +28058,10 @@ class Wd extends HTMLElement {
28058
28058
  </table>
28059
28059
  </nine-grid>
28060
28060
  </nx-dialog>
28061
- `, tt(this, or, this.shadowRoot.querySelector("nine-grid")), f(this, or).fields.add(f(this, er).fields.get()), $(".reset", this.shadowRoot).on("click", (l) => {
28062
- f(this, or).data.set(f(this, er).data.getNF(f(this, di)));
28061
+ `, tt(this, or, this.shadowRoot.querySelector("nine-grid")), f(this, or).fields.add(f(this, rr).fields.get()), $(".reset", this.shadowRoot).on("click", (l) => {
28062
+ f(this, or).data.set(f(this, rr).data.getNF(f(this, di)));
28063
28063
  }), $(".apply", this.shadowRoot).on("click", (l) => {
28064
- f(this, er).data.all.update(f(this, or).data.get(0), f(this, di)), this.shadowRoot.querySelector("dialog").close();
28064
+ f(this, rr).data.all.update(f(this, or).data.get(0), f(this, di)), this.shadowRoot.querySelector("dialog").close();
28065
28065
  }), $(".close", this.shadowRoot).onFirst("click", (l) => {
28066
28066
  f(this, or).data.isChanged() && (l.stopImmediatePropagation(), H.confirm(`There is changed data.
28067
28067
  Do you want to save it?`, "SAVE", { class: "rgb", "true-text": "Yes", "false-text": "No" }).then((c) => {
@@ -28070,7 +28070,7 @@ Do you want to save it?`, "SAVE", { class: "rgb", "true-text": "Yes", "false-tex
28070
28070
  });
28071
28071
  }
28072
28072
  }
28073
- er = new WeakMap(), or = new WeakMap(), di = new WeakMap();
28073
+ rr = new WeakMap(), or = new WeakMap(), di = new WeakMap();
28074
28074
  customElements.get("ng-row-detail") || customElements.define("ng-row-detail", Vd);
28075
28075
  customElements.get("ng-row-detail-popup") || customElements.define("ng-row-detail-popup", Wd);
28076
28076
  var qh;