@ninebone/table 0.0.619 β 0.0.621
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-table.js +41 -41
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -4
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -425,9 +425,9 @@ const Ie = class Ie {
|
|
|
425
425
|
return t(this, _);
|
|
426
426
|
M.log("#measureAndCacheHeight");
|
|
427
427
|
const e = t(this, D).get(".ng-container-body");
|
|
428
|
-
if (
|
|
428
|
+
if (!e || e.length === 0) return 24;
|
|
429
429
|
const s = i.querySelector("tbody.bindable-tbody");
|
|
430
|
-
if (!s) return 24;
|
|
430
|
+
if (M.log(i), !s) return 24;
|
|
431
431
|
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
432
432
|
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
433
433
|
e.forEach((g) => {
|
|
@@ -1173,7 +1173,7 @@ const We = class We {
|
|
|
1173
1173
|
};
|
|
1174
1174
|
kt = new WeakMap(), ht = new WeakMap(), c(We, "ngRow");
|
|
1175
1175
|
let ue = We;
|
|
1176
|
-
var N, k, W, dt, Jt, Y, Qt, it,
|
|
1176
|
+
var N, k, W, dt, Jt, Y, Qt, it, Lt, te, ee, ft;
|
|
1177
1177
|
const O = class O {
|
|
1178
1178
|
constructor(i, e) {
|
|
1179
1179
|
d(this, N);
|
|
@@ -1189,7 +1189,7 @@ const O = class O {
|
|
|
1189
1189
|
var s;
|
|
1190
1190
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1191
1191
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1192
|
-
e.__ng || (e.__ng = t(this,
|
|
1192
|
+
e.__ng || (e.__ng = t(this, Lt).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1193
1193
|
});
|
|
1194
1194
|
}, "#initialize"));
|
|
1195
1195
|
d(this, it, /* @__PURE__ */ c(() => {
|
|
@@ -1214,7 +1214,7 @@ const O = class O {
|
|
|
1214
1214
|
E(this, "set", /* @__PURE__ */ c((i) => {
|
|
1215
1215
|
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1216
1216
|
}, "set"));
|
|
1217
|
-
d(this,
|
|
1217
|
+
d(this, Lt, /* @__PURE__ */ c(() => ({
|
|
1218
1218
|
rowState: O.ROW_STATE.EMPTY,
|
|
1219
1219
|
deleted: !1,
|
|
1220
1220
|
filtered: !1,
|
|
@@ -1242,7 +1242,7 @@ const O = class O {
|
|
|
1242
1242
|
}), s;
|
|
1243
1243
|
}, "#json2Array"));
|
|
1244
1244
|
d(this, ee, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1245
|
-
e.__ng = t(this,
|
|
1245
|
+
e.__ng = t(this, Lt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1246
1246
|
}), i), "#defaultInsert"));
|
|
1247
1247
|
E(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1248
1248
|
i === void 0 && (i = {});
|
|
@@ -1316,7 +1316,7 @@ const O = class O {
|
|
|
1316
1316
|
return this.length;
|
|
1317
1317
|
}
|
|
1318
1318
|
};
|
|
1319
|
-
N = new WeakMap(), k = new WeakMap(), W = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(),
|
|
1319
|
+
N = new WeakMap(), k = new WeakMap(), W = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Lt = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), c(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1320
1320
|
E(O, "ROW_STATE", {
|
|
1321
1321
|
EMPTY: "EMPTY",
|
|
1322
1322
|
NORMAL: "NORMAL",
|
|
@@ -1348,31 +1348,31 @@ const Oe = class Oe {
|
|
|
1348
1348
|
};
|
|
1349
1349
|
rt = new WeakMap(), c(Oe, "ngDataManager");
|
|
1350
1350
|
let be = Oe;
|
|
1351
|
-
var ut,
|
|
1351
|
+
var ut, C, Ct, se;
|
|
1352
1352
|
const ze = class ze {
|
|
1353
1353
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1354
1354
|
constructor(i) {
|
|
1355
1355
|
d(this, ut);
|
|
1356
|
-
d(this,
|
|
1356
|
+
d(this, C, []);
|
|
1357
1357
|
E(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1358
1358
|
i.forEach((s) => {
|
|
1359
|
-
t(this,
|
|
1360
|
-
}), t(this,
|
|
1359
|
+
t(this, C).some((r) => r.name === s) || t(this, C).push({ name: s, type: e });
|
|
1360
|
+
}), t(this, Ct).call(this);
|
|
1361
1361
|
}, "add"));
|
|
1362
|
-
d(this,
|
|
1362
|
+
d(this, Ct, /* @__PURE__ */ c(() => {
|
|
1363
1363
|
const i = /* @__PURE__ */ new Map();
|
|
1364
|
-
t(this,
|
|
1364
|
+
t(this, C).forEach((e) => {
|
|
1365
1365
|
i.set(e.name, e.type);
|
|
1366
|
-
}), y(this,
|
|
1366
|
+
}), y(this, C, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(this, C, t(this, C).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, C).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1367
1367
|
}, "#adjust"));
|
|
1368
1368
|
d(this, se, /* @__PURE__ */ c(() => {
|
|
1369
|
-
y(this,
|
|
1369
|
+
y(this, C, []), M.log(t(this, ut).querySelectorAll("table"));
|
|
1370
1370
|
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1371
1371
|
if (!(!i || i.length === 0)) {
|
|
1372
1372
|
for (const e of i)
|
|
1373
1373
|
M.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1374
1374
|
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1375
|
-
n && t(this,
|
|
1375
|
+
n && t(this, C).push({ name: n, type: o });
|
|
1376
1376
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1377
1377
|
$(`[${s}]`, e).each((r, n) => {
|
|
1378
1378
|
var o = n.getAttribute(s);
|
|
@@ -1389,37 +1389,37 @@ const ze = class ze {
|
|
|
1389
1389
|
if (a.trim() != "") {
|
|
1390
1390
|
const h = a.search(/[^_A-Za-z0-9]/g);
|
|
1391
1391
|
let l = "";
|
|
1392
|
-
h >= 0 ? l = a.substring(0, h) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this,
|
|
1392
|
+
h >= 0 ? l = a.substring(0, h) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, C).push({ name: l, type: "string" });
|
|
1393
1393
|
}
|
|
1394
1394
|
});
|
|
1395
1395
|
});
|
|
1396
1396
|
});
|
|
1397
|
-
t(this,
|
|
1397
|
+
t(this, Ct).call(this);
|
|
1398
1398
|
}
|
|
1399
1399
|
}, "#init"));
|
|
1400
1400
|
y(this, ut, i), t(this, se).call(this);
|
|
1401
1401
|
}
|
|
1402
1402
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1403
1403
|
get() {
|
|
1404
|
-
return t(this,
|
|
1404
|
+
return t(this, C).map((i) => i.name);
|
|
1405
1405
|
}
|
|
1406
1406
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1407
1407
|
getFields() {
|
|
1408
|
-
return t(this,
|
|
1408
|
+
return t(this, C);
|
|
1409
1409
|
}
|
|
1410
1410
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1411
1411
|
getType(i) {
|
|
1412
|
-
const e = t(this,
|
|
1412
|
+
const e = t(this, C).find((s) => s.name === i);
|
|
1413
1413
|
return e ? e.type : "string";
|
|
1414
1414
|
}
|
|
1415
1415
|
indexOf(i) {
|
|
1416
|
-
return t(this,
|
|
1416
|
+
return t(this, C).findIndex((e) => e.name === i);
|
|
1417
1417
|
}
|
|
1418
1418
|
includes(i) {
|
|
1419
|
-
return t(this,
|
|
1419
|
+
return t(this, C).some((e) => e.name === i);
|
|
1420
1420
|
}
|
|
1421
1421
|
};
|
|
1422
|
-
ut = new WeakMap(),
|
|
1422
|
+
ut = new WeakMap(), C = new WeakMap(), Ct = new WeakMap(), se = new WeakMap(), c(ze, "ngFields");
|
|
1423
1423
|
let ye = ze;
|
|
1424
1424
|
var nt, ie, re;
|
|
1425
1425
|
const Be = class Be extends HTMLElement {
|
|
@@ -1468,11 +1468,11 @@ const mt = class mt extends HTMLElement {
|
|
|
1468
1468
|
};
|
|
1469
1469
|
c(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1470
1470
|
let me = mt;
|
|
1471
|
-
var
|
|
1471
|
+
var L, Ht, p, qe, Re, Te, ke, Le;
|
|
1472
1472
|
const De = class De extends me {
|
|
1473
1473
|
constructor() {
|
|
1474
1474
|
super();
|
|
1475
|
-
d(this,
|
|
1475
|
+
d(this, L);
|
|
1476
1476
|
d(this, Ht);
|
|
1477
1477
|
d(this, p);
|
|
1478
1478
|
d(this, qe);
|
|
@@ -1495,12 +1495,12 @@ const De = class De extends me {
|
|
|
1495
1495
|
return ninegrid.nvl(e, "");
|
|
1496
1496
|
} else
|
|
1497
1497
|
try {
|
|
1498
|
-
return t(this,
|
|
1498
|
+
return t(this, L).exprFunction(t(this, p).dataset.expr).call(this, null, -1, t(this, L).data);
|
|
1499
1499
|
} catch {
|
|
1500
1500
|
}
|
|
1501
1501
|
}, "getDisplayText"));
|
|
1502
|
-
d(this,
|
|
1503
|
-
if (!(!t(this,
|
|
1502
|
+
d(this, Le, /* @__PURE__ */ c(() => {
|
|
1503
|
+
if (!(!t(this, L) || !t(this, L).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1504
1504
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1505
1505
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1506
1506
|
var s = t(this, p).closest("tr"), r = [];
|
|
@@ -1509,12 +1509,12 @@ const De = class De extends me {
|
|
|
1509
1509
|
R && I.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
|
|
1510
1510
|
}), r.sort();
|
|
1511
1511
|
var n = !1;
|
|
1512
|
-
if (parseInt(s.sectionRowIndex / t(this,
|
|
1512
|
+
if (parseInt(s.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1513
1513
|
for (var o of r) {
|
|
1514
1514
|
if (o > e) break;
|
|
1515
|
-
var a = parseInt(t(this, p).dataset.row), h = a - 1, l = t(this, p).closest("tr").data, f = t(this,
|
|
1515
|
+
var a = parseInt(t(this, p).dataset.row), h = a - 1, l = t(this, p).closest("tr").data, f = t(this, L).data.get(h);
|
|
1516
1516
|
t(this, p).dataset.matrixRow;
|
|
1517
|
-
var u = t(this,
|
|
1517
|
+
var u = t(this, L).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, h) : f[u.dataset.bind];
|
|
1518
1518
|
if (g != b) {
|
|
1519
1519
|
n = !0;
|
|
1520
1520
|
break;
|
|
@@ -1523,7 +1523,7 @@ const De = class De extends me {
|
|
|
1523
1523
|
else
|
|
1524
1524
|
n = !0;
|
|
1525
1525
|
n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, p)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, p)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, p)).addClass("hidden"));
|
|
1526
|
-
var m = parseInt(t(this, p).dataset.matrixRow), x = m - 1, A = t(this,
|
|
1526
|
+
var m = parseInt(t(this, p).dataset.matrixRow), x = m - 1, A = t(this, L).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1527
1527
|
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1528
1528
|
}
|
|
1529
1529
|
}
|
|
@@ -1533,7 +1533,7 @@ const De = class De extends me {
|
|
|
1533
1533
|
try {
|
|
1534
1534
|
r = parseInt(r);
|
|
1535
1535
|
const o = e.replace("()", "");
|
|
1536
|
-
return t(this,
|
|
1536
|
+
return t(this, L)[o] ? t(this, L)[o].call(this, s, r, t(this, p)) : t(this, L).exprFunction(e).call(this, s, r, t(this, L).data);
|
|
1537
1537
|
} catch {
|
|
1538
1538
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1539
1539
|
}
|
|
@@ -1542,16 +1542,16 @@ const De = class De extends me {
|
|
|
1542
1542
|
}, "getExprValue"));
|
|
1543
1543
|
}
|
|
1544
1544
|
connectedCallback() {
|
|
1545
|
-
super.connectedCallback(), y(this,
|
|
1545
|
+
super.connectedCallback(), y(this, L, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this, Ht, t(this, p).closest("tr"));
|
|
1546
1546
|
}
|
|
1547
1547
|
get value() {
|
|
1548
|
-
var e = !t(this,
|
|
1548
|
+
var e = !t(this, L) || !t(this, L).dataManager || !t(this, p) || !t(this, p).dataset || !t(this, p).dataset.row || !t(this, p).dataset.bind ? "" : t(this, p).closest("tr").data[t(this, p).dataset.bind];
|
|
1549
1549
|
return e ?? "";
|
|
1550
1550
|
}
|
|
1551
1551
|
set value(e) {
|
|
1552
1552
|
var s = parseInt(t(this, p).dataset.row);
|
|
1553
1553
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1554
|
-
s < 0 ? t(this,
|
|
1554
|
+
s < 0 ? t(this, L).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, r) : t(this, L).data.setValue(s, t(this, p).dataset.bind, e, r);
|
|
1555
1555
|
}
|
|
1556
1556
|
get row() {
|
|
1557
1557
|
return parseInt(t(this, p).dataset.row);
|
|
@@ -1564,7 +1564,7 @@ const De = class De extends me {
|
|
|
1564
1564
|
return parseInt(t(this, p).dataset.row), t(this, Ht).data[e];
|
|
1565
1565
|
}
|
|
1566
1566
|
};
|
|
1567
|
-
|
|
1567
|
+
L = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Le = new WeakMap(), c(De, "CellElement");
|
|
1568
1568
|
let ve = De;
|
|
1569
1569
|
const Pe = class Pe extends ve {
|
|
1570
1570
|
constructor() {
|
|
@@ -1579,7 +1579,7 @@ const Pe = class Pe extends ve {
|
|
|
1579
1579
|
};
|
|
1580
1580
|
c(Pe, "EditableCellElement");
|
|
1581
1581
|
let xe = Pe;
|
|
1582
|
-
var Mt, ot, gt, bt, ne, U,
|
|
1582
|
+
var Mt, ot, gt, bt, ne, U, Ce;
|
|
1583
1583
|
const je = class je extends xe {
|
|
1584
1584
|
constructor() {
|
|
1585
1585
|
super();
|
|
@@ -1623,7 +1623,7 @@ const je = class je extends xe {
|
|
|
1623
1623
|
if (!v) this.reset();
|
|
1624
1624
|
};
|
|
1625
1625
|
*/
|
|
1626
|
-
d(this,
|
|
1626
|
+
d(this, Ce, /* @__PURE__ */ c((e) => {
|
|
1627
1627
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1628
1628
|
if (t(this, ot) == "number") {
|
|
1629
1629
|
let n = [];
|
|
@@ -1651,7 +1651,7 @@ const je = class je extends xe {
|
|
|
1651
1651
|
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1652
1652
|
}
|
|
1653
1653
|
};
|
|
1654
|
-
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(),
|
|
1654
|
+
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Ce = new WeakMap(), c(je, "CellInputText");
|
|
1655
1655
|
let we = je;
|
|
1656
1656
|
customElements.get("cell-input-text");
|
|
1657
1657
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|