@ninebone/grid 0.0.20 → 0.0.22

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
@@ -2660,24 +2660,25 @@ class ad {
2660
2660
  }
2661
2661
  }
2662
2662
  Xr = new WeakMap(), Do = new WeakMap(), hs = new WeakMap();
2663
- var He, Dt, $e, Cr, ni, $s, nn, Bo, on, Fo, qo, wh, Ho, zo, an, ln, Uo, Vo, Wo;
2663
+ var qe, Dt, $e, Cr, ni, $s, nn, Bo, on, Fo, qo, wh, Ho, zo, an, ln, Uo, Vo, Wo;
2664
2664
  class ld {
2665
2665
  constructor(C, t) {
2666
- Y(this, He);
2666
+ Y(this, qe);
2667
2667
  Y(this, Dt);
2668
2668
  Y(this, $e);
2669
2669
  Y(this, Cr);
2670
2670
  Y(this, ni);
2671
2671
  Y(this, $s);
2672
2672
  it(this, "initialize", () => {
2673
- tt(this, $s, []), $(f(this, He).template).each((C, t) => {
2673
+ tt(this, $s, []), $(f(this, qe).template).each((C, t) => {
2674
2674
  f(this, $s).push($(t).height());
2675
2675
  }), (f(this, Dt).rawRecords || []).forEach((C) => {
2676
2676
  C.__ng.height = f(this, $s).slice();
2677
2677
  });
2678
2678
  });
2679
2679
  it(this, "set", (C) => {
2680
- this.clear(), this.add(C, !1), console.log(f(this, Dt)), console.log(f(this, Dt).owner), console.log(f(this, Dt).owner.matrix);
2680
+ var t, l, c;
2681
+ this.clear(), this.add(C, !1), console.log(f(this, Dt)), console.log(f(this, Dt).owner.matrix), (c = (l = (t = f(this, qe)) == null ? void 0 : t.owner) == null ? void 0 : l.matrix) == null || c.updateCumulativeHeights();
2681
2682
  });
2682
2683
  it(this, "assign", (C) => {
2683
2684
  this.source = C;
@@ -2699,7 +2700,7 @@ class ld {
2699
2700
  * { "key1": [1,2,...], "key2": [1,2,...], ... }
2700
2701
  */
2701
2702
  it(this, "setFilter", (C) => {
2702
- f(this, He).filtering.on();
2703
+ f(this, qe).filtering.on();
2703
2704
  let t = {};
2704
2705
  if (Array.isArray(C))
2705
2706
  for (let c in C[0])
@@ -2722,12 +2723,12 @@ class ld {
2722
2723
  s.__ng.filtered = !0;
2723
2724
  });
2724
2725
  }
2725
- this.refreshFilter(), f(this, He).shadowRoot.querySelectorAll("ng-filter-button").forEach((c) => {
2726
+ this.refreshFilter(), f(this, qe).shadowRoot.querySelectorAll("ng-filter-button").forEach((c) => {
2726
2727
  c.filterOptions.forEach((o) => {
2727
2728
  o.data = [];
2728
2729
  });
2729
2730
  }), Object.entries(t).forEach(([c, o]) => {
2730
- f(this, He).shadowRoot.querySelectorAll("ng-filter-button").forEach((r) => {
2731
+ f(this, qe).shadowRoot.querySelectorAll("ng-filter-button").forEach((r) => {
2731
2732
  let n = r.filterOptions;
2732
2733
  n.forEach((s) => {
2733
2734
  s.colnm === c && (s.data = o);
@@ -2821,7 +2822,7 @@ class ld {
2821
2822
  var c = {
2822
2823
  v: []
2823
2824
  };
2824
- for (const o of f(this, He).fields.get())
2825
+ for (const o of f(this, qe).fields.get())
2825
2826
  c.v.push(H.nvl(l[o], ""));
2826
2827
  t.push(c);
2827
2828
  }), t;
@@ -2846,16 +2847,16 @@ class ld {
2846
2847
  if (Array.isArray(C)) {
2847
2848
  var t = [];
2848
2849
  for (const r of C) {
2849
- for (var l = {}, c = 0; c < f(this, He).fields.get().length; c++) {
2850
- const n = f(this, He).fields.get()[c];
2850
+ for (var l = {}, c = 0; c < f(this, qe).fields.get().length; c++) {
2851
+ const n = f(this, qe).fields.get()[c];
2851
2852
  l[n] = r.v[c];
2852
2853
  }
2853
2854
  l.__ng = r.__ng, t.push(l);
2854
2855
  }
2855
2856
  return t;
2856
2857
  } else {
2857
- for (var o = C, l = {}, c = 0; c < f(this, He).fields.get().length; c++) {
2858
- const s = f(this, He).fields.get()[c];
2858
+ for (var o = C, l = {}, c = 0; c < f(this, qe).fields.get().length; c++) {
2859
+ const s = f(this, qe).fields.get()[c];
2859
2860
  l[s] = o.v[c];
2860
2861
  }
2861
2862
  return l.__ng = o.__ng, l;
@@ -2866,16 +2867,16 @@ class ld {
2866
2867
  if (Array.isArray(C)) {
2867
2868
  var t = [];
2868
2869
  for (const r of C) {
2869
- for (var l = {}, c = 0; c < f(this, He).fields.get().length; c++) {
2870
- const n = f(this, He).fields.get()[c];
2870
+ for (var l = {}, c = 0; c < f(this, qe).fields.get().length; c++) {
2871
+ const n = f(this, qe).fields.get()[c];
2871
2872
  l[n] = r.v[c];
2872
2873
  }
2873
2874
  l.__ng = r.__ng, t.push(l);
2874
2875
  }
2875
2876
  return t;
2876
2877
  } else {
2877
- for (var o = C, l = {}, c = 0; c < f(this, He).fields.get().length; c++) {
2878
- const s = f(this, He).fields.get()[c];
2878
+ for (var o = C, l = {}, c = 0; c < f(this, qe).fields.get().length; c++) {
2879
+ const s = f(this, qe).fields.get()[c];
2879
2880
  l[s] = o.v[c];
2880
2881
  }
2881
2882
  return l.__ng = o.__ng, l;
@@ -3034,7 +3035,7 @@ class ld {
3034
3035
  var c = C[l], o = !1;
3035
3036
  for (const e in t)
3036
3037
  if (!["__ng", "rowState"].includes(e)) {
3037
- var r = f(this, He).fields.indexOf(e);
3038
+ var r = f(this, qe).fields.indexOf(e);
3038
3039
  if (!(r < 0)) {
3039
3040
  var n = c.v[r], s = t[e];
3040
3041
  c.v[r] = s, n != s && (c.__ng.rowState = H.ROW_STATE.UPDATE, o = !0, f(this, qo).call(this, l, e, n, s));
@@ -3061,7 +3062,7 @@ class ld {
3061
3062
  });
3062
3063
  Y(this, zo, (C, t, l, c, o) => {
3063
3064
  C = parseInt(C), c == null && (c = !0);
3064
- const r = f(this, He).fields.indexOf(t);
3065
+ const r = f(this, qe).fields.indexOf(t);
3065
3066
  if (!(r < 0)) {
3066
3067
  var n = o ? this.getValidDataNF()[C] : this.getValidData()[C], s = n.v[r];
3067
3068
  n.v[r] != l && n.__ng.rowState != H.ROW_STATE.INSERT && (n.__ng.o.hasOwnProperty(t) || (n.__ng.o[t] = s), c && (n.__ng.rowState = H.ROW_STATE.UPDATE, this.onRowStateChanged())), n.v[r] = l, f(this, Dt).owner.refreshData(C), f(this, qo).call(this, C, t, s, l);
@@ -3116,7 +3117,7 @@ class ld {
3116
3117
  if (t < 0 || t >= C.length)
3117
3118
  throw `invalid row : ${t}`;
3118
3119
  if (l != null) {
3119
- var c = f(this, He).fields.indexOf(l);
3120
+ var c = f(this, qe).fields.indexOf(l);
3120
3121
  return c >= 0 ? C[t].v[c] : null;
3121
3122
  }
3122
3123
  var o = t == null ? C : C[t];
@@ -3145,7 +3146,7 @@ class ld {
3145
3146
  * return : 지정된 컬럼명에 해당하는 데이타 값을 배열로 반환
3146
3147
  */
3147
3148
  Y(this, Uo, (C, t) => {
3148
- var l = f(this, He).fields.indexOf(t);
3149
+ var l = f(this, qe).fields.indexOf(t);
3149
3150
  return l < 0 ? [] : C.map((c) => c.v[l]);
3150
3151
  });
3151
3152
  it(this, "getMap", (C) => f(this, Uo).call(this, this.getValidData(), C));
@@ -3169,7 +3170,7 @@ class ld {
3169
3170
  }
3170
3171
  return -1;
3171
3172
  });
3172
- tt(this, He, C), tt(this, Dt, t), tt(this, $e, []), tt(this, Cr, []), tt(this, ni, 0), this.all = {
3173
+ tt(this, qe, C), tt(this, Dt, t), tt(this, $e, []), tt(this, Cr, []), tt(this, ni, 0), this.all = {
3173
3174
  get: (l, c) => f(this, ln).call(this, this.recordsNF(), l, c),
3174
3175
  records: (l) => this.recordsNF(l),
3175
3176
  count: () => this.recordsNF().length,
@@ -3250,7 +3251,7 @@ class ld {
3250
3251
  delete f(this, Dt).rawRecords, tt(this, $e, []), tt(this, Cr, []), f(this, Dt).rawRecords = [], f(this, Dt).viewRecords.reset();
3251
3252
  }
3252
3253
  }
3253
- He = new WeakMap(), Dt = new WeakMap(), $e = new WeakMap(), Cr = new WeakMap(), ni = new WeakMap(), $s = new WeakMap(), nn = new WeakMap(), Bo = new WeakMap(), on = new WeakMap(), Fo = new WeakMap(), qo = new WeakMap(), wh = new WeakMap(), Ho = new WeakMap(), zo = new WeakMap(), an = new WeakMap(), ln = new WeakMap(), Uo = new WeakMap(), Vo = new WeakMap(), Wo = new WeakMap();
3254
+ qe = new WeakMap(), Dt = new WeakMap(), $e = new WeakMap(), Cr = new WeakMap(), ni = new WeakMap(), $s = new WeakMap(), nn = new WeakMap(), Bo = new WeakMap(), on = new WeakMap(), Fo = new WeakMap(), qo = new WeakMap(), wh = new WeakMap(), Ho = new WeakMap(), zo = new WeakMap(), an = new WeakMap(), ln = new WeakMap(), Uo = new WeakMap(), Vo = new WeakMap(), Wo = new WeakMap();
3254
3255
  class hd {
3255
3256
  constructor(C) {
3256
3257
  this.owner = C, this.row = new ad(this), this.data = new ld(C, this), this.setDataSource = (l) => {
@@ -28122,25 +28123,25 @@ const Ti = class Ti extends Mr {
28122
28123
  Hh = new WeakMap(), //static sourceRow = -1;
28123
28124
  it(Ti, "dragData"), it(Ti, "scrollInterval");
28124
28125
  let ir = Ti;
28125
- var qe, na, oa, aa, ps, la, ha, ca, ua;
28126
+ var He, na, oa, aa, ps, la, ha, ca, ua;
28126
28127
  class Ud {
28127
28128
  constructor(C) {
28128
- Y(this, qe);
28129
+ Y(this, He);
28129
28130
  /** attribute 변경에 대한 반응 */
28130
28131
  it(this, "resetEvent", () => {
28131
- $(".ng-table tbody.bindable", f(this, qe).body).off("dragleave", f(this, ha)).off("dragenter", f(this, la)).off("dragover", f(this, aa)).off("drop", f(this, ua)).off("dragend", f(this, ca)).on("dragleave", f(this, ha)).on("dragenter", f(this, la)).on("dragover", f(this, aa)).on("drop", f(this, ua)).on("dragend", f(this, ca));
28132
+ $(".ng-table tbody.bindable", f(this, He).body).off("dragleave", f(this, ha)).off("dragenter", f(this, la)).off("dragover", f(this, aa)).off("drop", f(this, ua)).off("dragend", f(this, ca)).on("dragleave", f(this, ha)).on("dragenter", f(this, la)).on("dragover", f(this, aa)).on("drop", f(this, ua)).on("dragend", f(this, ca));
28132
28133
  });
28133
28134
  Y(this, na, (C) => {
28134
28135
  [".ng-container-left", ".ng-container-body", ".ng-container-right"].forEach((t) => {
28135
- const l = f(this, qe).body.querySelectorAll(`${t} tr[data-row="${C}"]`);
28136
+ const l = f(this, He).body.querySelectorAll(`${t} tr[data-row="${C}"]`);
28136
28137
  H.j.querySelectorAll("th,td", l[0]).addClass("ng-dragover-up");
28137
28138
  });
28138
28139
  });
28139
28140
  Y(this, oa, (C) => {
28140
28141
  [".ng-container-left", ".ng-container-body", ".ng-container-right"].forEach((t) => {
28141
- f(this, qe).body.querySelectorAll(`${t} tr[data-row="${C}"]`).forEach((l, c) => {
28142
+ f(this, He).body.querySelectorAll(`${t} tr[data-row="${C}"]`).forEach((l, c) => {
28142
28143
  l.querySelectorAll("th,td").forEach((o) => {
28143
- c + (o.rowSpan || 1) == f(this, qe).template.length && H.j.querySelectorAll(o).addClass("ng-dragover-down");
28144
+ c + (o.rowSpan || 1) == f(this, He).template.length && H.j.querySelectorAll(o).addClass("ng-dragover-down");
28144
28145
  });
28145
28146
  });
28146
28147
  });
@@ -28151,7 +28152,7 @@ class Ud {
28151
28152
  if (H.j.querySelectorAll("th,td", t.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"), H.j.querySelectorAll("th,td", l.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"), t.id == l.id)
28152
28153
  o < c ? (f(this, na).call(this, o), ir.dragData.targetRow = o) : o > c && (f(this, oa).call(this, o), ir.dragData.targetRow = o - 1);
28153
28154
  else {
28154
- const r = f(this, qe).body.querySelector(`tr[data-row="${o}"]`), s = C.pageY - $(r).offset().top < f(this, qe).view.getRowHeight(o) / 2;
28155
+ const r = f(this, He).body.querySelector(`tr[data-row="${o}"]`), s = C.pageY - $(r).offset().top < f(this, He).view.getRowHeight(o) / 2;
28155
28156
  s ? f(this, na).call(this, o) : f(this, oa).call(this, o), ir.dragData.targetRow = s ? o : o + 1;
28156
28157
  }
28157
28158
  });
@@ -28159,11 +28160,11 @@ class Ud {
28159
28160
  Y(this, la, (C) => {
28160
28161
  C.preventDefault();
28161
28162
  const t = parseInt(C.target.closest("tr").dataset.row);
28162
- [f(this, qe).view.getVisibleFirstRow(), f(this, qe).view.getVisibleLastRow()].includes(t) && setTimeout(() => {
28163
+ [f(this, He).view.getVisibleFirstRow(), f(this, He).view.getVisibleLastRow()].includes(t) && setTimeout(() => {
28163
28164
  if (!f(this, ps)) {
28164
- const l = t == f(this, qe).view.getVisibleLastRow() ? 1 : -1;
28165
+ const l = t == f(this, He).view.getVisibleLastRow() ? 1 : -1;
28165
28166
  tt(this, ps, setInterval(() => {
28166
- f(this, qe).scrollBy(l);
28167
+ f(this, He).scrollBy(l);
28167
28168
  }, ir.scrollInterval));
28168
28169
  }
28169
28170
  });
@@ -28174,13 +28175,13 @@ class Ud {
28174
28175
  Y(this, ca, (C) => {
28175
28176
  });
28176
28177
  Y(this, ua, (C) => {
28177
- C.preventDefault(), clearInterval(f(this, ps)), tt(this, ps, null), f(this, qe).body.querySelectorAll(".ng-container-left .ng-tmp").forEach((a) => {
28178
+ C.preventDefault(), clearInterval(f(this, ps)), tt(this, ps, null), f(this, He).body.querySelectorAll(".ng-container-left .ng-tmp").forEach((a) => {
28178
28179
  $(a).remove();
28179
28180
  });
28180
- const t = H.nvl(document.getElementById(ir.dragData.id), f(this, qe)), l = ir.dragData.row, c = ir.dragData.bind, o = C.target.closest("tr"), r = C.target.getRootNode().host, n = parseInt(o.dataset.row), s = r.body.querySelector("ng-row-drag") ? r.body.querySelector("ng-row-drag").cell.dataset.bind : null;
28181
+ const t = H.nvl(document.getElementById(ir.dragData.id), f(this, He)), l = ir.dragData.row, c = ir.dragData.bind, o = C.target.closest("tr"), r = C.target.getRootNode().host, n = parseInt(o.dataset.row), s = r.body.querySelector("ng-row-drag") ? r.body.querySelector("ng-row-drag").cell.dataset.bind : null;
28181
28182
  if (H.j.querySelectorAll("th,td", t.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"), H.j.querySelectorAll("th,td", r.body).removeClass("ng-dragover-up").removeClass("ng-dragover-down"), t.id == r.id && l == n) return;
28182
28183
  const e = new CustomEvent(H.EVENT.CAN_ROW_MOVE, { bubbles: !0, cancelable: !0, detail: {} });
28183
- if (e.sourceGrid = t, e.targetGrid = r, e.sourceRow = l, e.targetRow = ir.dragData.targetRow, f(this, qe).dispatchEvent(e) && (t.id == r.id ? C.altKey ? f(this, qe).data.insert(f(this, qe).data.get(l), n) : f(this, qe).data.moveRow(l, n) : (r.data.insert(t.data.get(l), ir.dragData.targetRow), C.altKey || t.data.delete(l))), c) {
28184
+ if (e.sourceGrid = t, e.targetGrid = r, e.sourceRow = l, e.targetRow = ir.dragData.targetRow, f(this, He).dispatchEvent(e) && (t.id == r.id ? C.altKey ? f(this, He).data.insert(f(this, He).data.get(l), n) : f(this, He).data.moveRow(l, n) : (r.data.insert(t.data.get(l), ir.dragData.targetRow), C.altKey || t.data.delete(l))), c) {
28184
28185
  const a = t.fields.indexOf(c);
28185
28186
  for (var i = 0; i < t.data.all.count(); i++)
28186
28187
  t.data.all.setRecord(i, a, i + 1);
@@ -28190,14 +28191,14 @@ class Ud {
28190
28191
  for (var i = 0; i < r.data.all.count(); i++)
28191
28192
  r.data.all.setRecord(i, a, i + 1);
28192
28193
  }
28193
- f(this, qe).dataManager.viewRecords.reset();
28194
+ f(this, He).dataManager.viewRecords.reset();
28194
28195
  const u = new CustomEvent(H.EVENT.ROW_MOVED, { bubbles: !0, detail: {} });
28195
- u.sourceGrid = t, u.targetGrid = r, u.sourceRow = l, u.targetRow = ir.dragData.targetRow, f(this, qe).dispatchEvent(u), ir.dragData = null;
28196
+ u.sourceGrid = t, u.targetGrid = r, u.sourceRow = l, u.targetRow = ir.dragData.targetRow, f(this, He).dispatchEvent(u), ir.dragData = null;
28196
28197
  });
28197
- tt(this, qe, C), this.resetEvent();
28198
+ tt(this, He, C), this.resetEvent();
28198
28199
  }
28199
28200
  }
28200
- qe = new WeakMap(), na = new WeakMap(), oa = new WeakMap(), aa = new WeakMap(), ps = new WeakMap(), la = new WeakMap(), ha = new WeakMap(), ca = new WeakMap(), ua = new WeakMap();
28201
+ He = new WeakMap(), na = new WeakMap(), oa = new WeakMap(), aa = new WeakMap(), ps = new WeakMap(), la = new WeakMap(), ha = new WeakMap(), ca = new WeakMap(), ua = new WeakMap();
28201
28202
  customElements.get("ng-row-drag") || customElements.define("ng-row-drag", ir);
28202
28203
  var sr, pr, fi, zh, Uh, da;
28203
28204
  class Vd extends HTMLElement {