@iyulab/flex-table 0.58.0 → 0.60.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.
- package/CHANGELOG.md +39 -0
- package/README.md +28 -6
- package/dist/array/index.d.ts +3 -0
- package/dist/array/index.js +46 -38
- package/dist/array/source.d.ts +3 -0
- package/dist/array/types.d.ts +3 -0
- package/dist/array/view.d.ts +6 -0
- package/dist/core/fetch-all.d.ts +14 -0
- package/dist/core/source-error.d.ts +13 -1
- package/dist/events.d.ts +14 -4
- package/dist/fetch-all-J37bOtgc.js +86 -0
- package/dist/{flex-table-B1W8VEBa.js → flex-table-kM69-hSo.js} +157 -145
- package/dist/flex-table.d.ts +22 -9
- package/dist/flex-table.js +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/{locale-Cfm-vJji.js → locale-D9g0ksXq.js} +4 -2
- package/dist/locale.d.ts +1 -1
- package/dist/odata/index.d.ts +4 -0
- package/dist/odata/index.js +5 -5
- package/dist/odata/query.d.ts +7 -3
- package/dist/odata/source.d.ts +9 -0
- package/dist/odata/types.d.ts +3 -0
- package/dist/react.d.ts +2 -0
- package/dist/react.js +75 -62
- package/dist/source-DNPtWmC3.js +202 -0
- package/dist/{view-DiLr-TdY.js → view-BtoXdUGF.js} +13 -2
- package/package.json +2 -2
- package/skills/iyulab-flex-table/SKILL.md +2 -1
- package/skills/iyulab-flex-table/references/api.md +9 -5
- package/skills/iyulab-flex-table/references/react.md +2 -1
- package/dist/query-Dw4iO0ir.js +0 -37
- package/dist/source-DOue0Ti3.js +0 -223
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e } from "./locale-
|
|
1
|
+
import { n as e } from "./locale-D9g0ksXq.js";
|
|
2
2
|
import { n as t, t as n } from "./sorting-CjfjRxwL.js";
|
|
3
3
|
import { LitElement as r, css as i, html as a, nothing as o } from "lit";
|
|
4
4
|
import { customElement as s, property as c, state as l } from "lit/decorators.js";
|
|
@@ -8,8 +8,9 @@ import { decodeTsv as g, encodeTsv as _ } from "@iyulab/components/dist/utilitie
|
|
|
8
8
|
import "@iyulab/components/dist/components/date-picker/UDatePicker.js";
|
|
9
9
|
import { isImeComposing as v } from "@iyulab/components/dist/utilities/keyboard.js";
|
|
10
10
|
import { copyFromKey as y, isTextEntry as b, pasteFromKey as x } from "@iyulab/components/dist/utilities/clipboard.js";
|
|
11
|
+
import { isFromControl as S } from "@iyulab/components/dist/utilities/elements.js";
|
|
11
12
|
//#region src/styles/flex-table.styles.ts
|
|
12
|
-
var
|
|
13
|
+
var C = i`
|
|
13
14
|
/* --- Theme Variables (Light defaults) --- */
|
|
14
15
|
:host {
|
|
15
16
|
--ft-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
@@ -1028,13 +1029,13 @@ var S = i`
|
|
|
1028
1029
|
`;
|
|
1029
1030
|
//#endregion
|
|
1030
1031
|
//#region src/renderers/format.ts
|
|
1031
|
-
function
|
|
1032
|
-
return e == null ? "" : typeof t == "function" ? t(e) :
|
|
1032
|
+
function w(e, t) {
|
|
1033
|
+
return e == null ? "" : typeof t == "function" ? t(e) : T(t) ? ee(e, t) : E(e, t);
|
|
1033
1034
|
}
|
|
1034
|
-
function
|
|
1035
|
+
function T(e) {
|
|
1035
1036
|
return /[yMdHhms]/.test(e);
|
|
1036
1037
|
}
|
|
1037
|
-
function
|
|
1038
|
+
function E(e, t) {
|
|
1038
1039
|
let n = typeof e == "number" ? e : Number(e);
|
|
1039
1040
|
if (isNaN(n)) return String(e);
|
|
1040
1041
|
let r = t.endsWith("%"), i = t.match(/^([^#0.,%]+)/), a = i ? i[1] : "", o = t.replace(/^[^#0.,%]+/, "").replace(/%$/, ""), s = o.match(/\.([0#]+)$/), c = s ? s[1].length : 0, l = {
|
|
@@ -1047,7 +1048,7 @@ function T(e, t) {
|
|
|
1047
1048
|
style: "percent"
|
|
1048
1049
|
}).format(n) : (d = new Intl.NumberFormat(u.get(), l).format(n), a && (d = a + d)), d + "";
|
|
1049
1050
|
}
|
|
1050
|
-
function
|
|
1051
|
+
function ee(e, t) {
|
|
1051
1052
|
let n;
|
|
1052
1053
|
if (e instanceof Date) n = e;
|
|
1053
1054
|
else if (typeof e == "string" || typeof e == "number") n = new Date(e);
|
|
@@ -1059,25 +1060,25 @@ function E(e, t) {
|
|
|
1059
1060
|
//#endregion
|
|
1060
1061
|
//#region src/renderers/cell-renderer.ts
|
|
1061
1062
|
function D(e, t, n) {
|
|
1062
|
-
return n.render ? n.render(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) :
|
|
1063
|
+
return n.render ? n.render(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) : w(e, n.format) : te(e, n);
|
|
1063
1064
|
}
|
|
1064
|
-
function
|
|
1065
|
+
function te(e, t) {
|
|
1065
1066
|
if (e == null) return "";
|
|
1066
1067
|
switch (t.type) {
|
|
1067
|
-
case "number": return
|
|
1068
|
+
case "number": return ie(e);
|
|
1068
1069
|
case "boolean": return a`<span class="ft-bool">${e ? "✔" : ""}</span>`;
|
|
1069
|
-
case "date": return
|
|
1070
|
-
case "datetime": return
|
|
1071
|
-
case "select": return
|
|
1070
|
+
case "date": return ae(e);
|
|
1071
|
+
case "datetime": return oe(e);
|
|
1072
|
+
case "select": return ne(e, t);
|
|
1072
1073
|
default: return String(e);
|
|
1073
1074
|
}
|
|
1074
1075
|
}
|
|
1075
|
-
function
|
|
1076
|
+
function ne(e, t) {
|
|
1076
1077
|
if (!t.options || t.options.length === 0 || typeof t.options[0] == "string") return e == null ? "" : String(e);
|
|
1077
1078
|
let n = t.options.find((t) => t.value === e);
|
|
1078
1079
|
return n ? n.label : e == null ? "" : String(e);
|
|
1079
1080
|
}
|
|
1080
|
-
var
|
|
1081
|
+
var re = {
|
|
1081
1082
|
year: "numeric",
|
|
1082
1083
|
month: "numeric",
|
|
1083
1084
|
day: "numeric",
|
|
@@ -1085,18 +1086,18 @@ var ne = {
|
|
|
1085
1086
|
minute: "numeric",
|
|
1086
1087
|
second: "numeric"
|
|
1087
1088
|
};
|
|
1088
|
-
function
|
|
1089
|
+
function ie(e) {
|
|
1089
1090
|
return typeof e == "number" ? Number.isInteger(e) ? f(e) : f(e, { minimumFractionDigits: 1 }) : String(e);
|
|
1090
1091
|
}
|
|
1091
|
-
function
|
|
1092
|
+
function ae(e) {
|
|
1092
1093
|
return e instanceof Date || typeof e == "string" ? d(e) : String(e);
|
|
1093
1094
|
}
|
|
1094
|
-
function
|
|
1095
|
-
return e instanceof Date || typeof e == "string" ? d(e,
|
|
1095
|
+
function oe(e) {
|
|
1096
|
+
return e instanceof Date || typeof e == "string" ? d(e, re) : String(e);
|
|
1096
1097
|
}
|
|
1097
1098
|
//#endregion
|
|
1098
1099
|
//#region src/core/selection.ts
|
|
1099
|
-
function
|
|
1100
|
+
function se(e) {
|
|
1100
1101
|
return {
|
|
1101
1102
|
startRow: Math.min(e.startRow, e.endRow),
|
|
1102
1103
|
startCol: Math.min(e.startCol, e.endCol),
|
|
@@ -1104,7 +1105,7 @@ function oe(e) {
|
|
|
1104
1105
|
endCol: Math.max(e.startCol, e.endCol)
|
|
1105
1106
|
};
|
|
1106
1107
|
}
|
|
1107
|
-
var
|
|
1108
|
+
var ce = class {
|
|
1108
1109
|
constructor() {
|
|
1109
1110
|
this.activeCell = null, this.rangeAnchor = null, this.range = null, this.extraRanges = [], this._rowCount = 0, this._colCount = 0;
|
|
1110
1111
|
}
|
|
@@ -1131,7 +1132,7 @@ var se = class {
|
|
|
1131
1132
|
return e < 0 || e >= this._rowCount || t < 0 || t >= this._colCount ? this.activeCell : (!this.rangeAnchor && this.activeCell && (this.rangeAnchor = { ...this.activeCell }), this.activeCell = {
|
|
1132
1133
|
row: e,
|
|
1133
1134
|
col: t
|
|
1134
|
-
}, this.rangeAnchor && (this.range =
|
|
1135
|
+
}, this.rangeAnchor && (this.range = se({
|
|
1135
1136
|
startRow: this.rangeAnchor.row,
|
|
1136
1137
|
startCol: this.rangeAnchor.col,
|
|
1137
1138
|
endRow: e,
|
|
@@ -1202,7 +1203,7 @@ var se = class {
|
|
|
1202
1203
|
shiftMoveRight() {
|
|
1203
1204
|
return this.activeCell ? this.setActiveWithRange(this.activeCell.row, this.activeCell.col + 1) : null;
|
|
1204
1205
|
}
|
|
1205
|
-
},
|
|
1206
|
+
}, le = class {
|
|
1206
1207
|
constructor() {
|
|
1207
1208
|
this.current = null;
|
|
1208
1209
|
}
|
|
@@ -1291,7 +1292,7 @@ var se = class {
|
|
|
1291
1292
|
};
|
|
1292
1293
|
//#endregion
|
|
1293
1294
|
//#region src/core/filtering.ts
|
|
1294
|
-
function
|
|
1295
|
+
function ue(e, t, n) {
|
|
1295
1296
|
if (t.length === 0) return Array.from({ length: e.length }, (e, t) => t);
|
|
1296
1297
|
let r = [];
|
|
1297
1298
|
for (let i = 0; i < e.length; i++) {
|
|
@@ -1310,9 +1311,9 @@ function k(e, t, n) {
|
|
|
1310
1311
|
}
|
|
1311
1312
|
//#endregion
|
|
1312
1313
|
//#region src/core/undo.ts
|
|
1313
|
-
var
|
|
1314
|
+
var de = 100, k = class {
|
|
1314
1315
|
constructor() {
|
|
1315
|
-
this._undoStack = [], this._redoStack = [], this._maxSize =
|
|
1316
|
+
this._undoStack = [], this._redoStack = [], this._maxSize = de;
|
|
1316
1317
|
}
|
|
1317
1318
|
get maxSize() {
|
|
1318
1319
|
return this._maxSize;
|
|
@@ -1349,7 +1350,7 @@ var le = 100, A = class {
|
|
|
1349
1350
|
};
|
|
1350
1351
|
//#endregion
|
|
1351
1352
|
//#region src/clipboard/clipboard.ts
|
|
1352
|
-
function
|
|
1353
|
+
function fe(e, t, n) {
|
|
1353
1354
|
let r = [];
|
|
1354
1355
|
for (let i = n.startRow; i <= n.endRow; i++) {
|
|
1355
1356
|
let a = e[i], o = [];
|
|
@@ -1361,7 +1362,7 @@ function ue(e, t, n) {
|
|
|
1361
1362
|
}
|
|
1362
1363
|
return _(r);
|
|
1363
1364
|
}
|
|
1364
|
-
function
|
|
1365
|
+
function A(e, t) {
|
|
1365
1366
|
if (e === "") return null;
|
|
1366
1367
|
switch (t.type) {
|
|
1367
1368
|
case "number": {
|
|
@@ -1376,19 +1377,19 @@ function j(e, t) {
|
|
|
1376
1377
|
default: return e;
|
|
1377
1378
|
}
|
|
1378
1379
|
}
|
|
1379
|
-
function
|
|
1380
|
+
function j(e) {
|
|
1380
1381
|
let t = String(e);
|
|
1381
1382
|
if (!Number.isFinite(e) || t.includes("e")) return t;
|
|
1382
1383
|
let n = new Intl.NumberFormat(u.get()).formatToParts(1.5).find((e) => e.type === "decimal")?.value;
|
|
1383
1384
|
return n && n !== "." ? t.replace(".", n) : t;
|
|
1384
1385
|
}
|
|
1385
|
-
function
|
|
1386
|
+
function pe(e) {
|
|
1386
1387
|
if (e == null || e === "") return "";
|
|
1387
1388
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? "" : `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
1388
1389
|
let t = String(e), n = /^(\d{4}-\d{2}-\d{2})(?:$|T)/.exec(t);
|
|
1389
1390
|
return n ? n[1] : t;
|
|
1390
1391
|
}
|
|
1391
|
-
function
|
|
1392
|
+
function me(e) {
|
|
1392
1393
|
if (e == null || e === "") return "";
|
|
1393
1394
|
let t = e instanceof Date ? "" : String(e), n = /^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})(?::\d{2}(?:\.\d+)?)?$/.exec(t);
|
|
1394
1395
|
if (n) return `${n[1]} ${n[2]}`;
|
|
@@ -1399,7 +1400,7 @@ function fe(e) {
|
|
|
1399
1400
|
}
|
|
1400
1401
|
//#endregion
|
|
1401
1402
|
//#region src/export/xlsx-writer.ts
|
|
1402
|
-
var
|
|
1403
|
+
var he = (() => {
|
|
1403
1404
|
let e = /* @__PURE__ */ new Uint32Array(256);
|
|
1404
1405
|
for (let t = 0; t < 256; t++) {
|
|
1405
1406
|
let n = t;
|
|
@@ -1408,23 +1409,23 @@ var pe = (() => {
|
|
|
1408
1409
|
}
|
|
1409
1410
|
return e;
|
|
1410
1411
|
})();
|
|
1411
|
-
function
|
|
1412
|
+
function ge(e) {
|
|
1412
1413
|
let t = 4294967295;
|
|
1413
|
-
for (let n = 0; n < e.length; n++) t =
|
|
1414
|
+
for (let n = 0; n < e.length; n++) t = he[(t ^ e[n]) & 255] ^ t >>> 8;
|
|
1414
1415
|
return (t ^ 4294967295) >>> 0;
|
|
1415
1416
|
}
|
|
1416
|
-
var
|
|
1417
|
-
function
|
|
1418
|
-
return
|
|
1417
|
+
var M = new TextEncoder();
|
|
1418
|
+
function _e(e) {
|
|
1419
|
+
return N(e.map((e) => ({
|
|
1419
1420
|
...e,
|
|
1420
1421
|
body: e.data,
|
|
1421
1422
|
method: 0
|
|
1422
1423
|
})));
|
|
1423
1424
|
}
|
|
1424
|
-
async function
|
|
1425
|
+
async function ve(e) {
|
|
1425
1426
|
let t = [];
|
|
1426
1427
|
for (let n of e) {
|
|
1427
|
-
let e = await
|
|
1428
|
+
let e = await ye(n.data);
|
|
1428
1429
|
t.push(e.length < n.data.length ? {
|
|
1429
1430
|
...n,
|
|
1430
1431
|
body: e,
|
|
@@ -1435,9 +1436,9 @@ async function ge(e) {
|
|
|
1435
1436
|
method: 0
|
|
1436
1437
|
});
|
|
1437
1438
|
}
|
|
1438
|
-
return
|
|
1439
|
+
return N(t);
|
|
1439
1440
|
}
|
|
1440
|
-
async function
|
|
1441
|
+
async function ye(e) {
|
|
1441
1442
|
let t = new CompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
|
|
1442
1443
|
n.write(e), n.close();
|
|
1443
1444
|
let i = [];
|
|
@@ -1446,52 +1447,52 @@ async function _e(e) {
|
|
|
1446
1447
|
if (e) break;
|
|
1447
1448
|
i.push(t);
|
|
1448
1449
|
}
|
|
1449
|
-
return
|
|
1450
|
+
return P(i);
|
|
1450
1451
|
}
|
|
1451
|
-
function
|
|
1452
|
+
function N(e) {
|
|
1452
1453
|
let t = [], n = [], r = 0;
|
|
1453
1454
|
for (let i of e) {
|
|
1454
|
-
let e =
|
|
1455
|
+
let e = M.encode(i.name), a = ge(i.data), o = i.data.length, s = i.body.length, c = i.method === 8 ? 20 : 10, l = new ArrayBuffer(30 + e.length), u = new DataView(l);
|
|
1455
1456
|
u.setUint32(0, 67324752, !0), u.setUint16(4, c, !0), u.setUint16(6, 0, !0), u.setUint16(8, i.method, !0), u.setUint16(10, 0, !0), u.setUint16(12, 33, !0), u.setUint32(14, a, !0), u.setUint32(18, s, !0), u.setUint32(22, o, !0), u.setUint16(26, e.length, !0), u.setUint16(28, 0, !0), new Uint8Array(l, 30).set(e), t.push(new Uint8Array(l)), t.push(i.body);
|
|
1456
1457
|
let d = new ArrayBuffer(46 + e.length), f = new DataView(d);
|
|
1457
1458
|
f.setUint32(0, 33639248, !0), f.setUint16(4, 20, !0), f.setUint16(6, c, !0), f.setUint16(8, 0, !0), f.setUint16(10, i.method, !0), f.setUint16(12, 0, !0), f.setUint16(14, 33, !0), f.setUint32(16, a, !0), f.setUint32(20, s, !0), f.setUint32(24, o, !0), f.setUint16(28, e.length, !0), f.setUint16(30, 0, !0), f.setUint16(32, 0, !0), f.setUint16(34, 0, !0), f.setUint16(36, 0, !0), f.setUint32(38, 0, !0), f.setUint32(42, r, !0), new Uint8Array(d, 46).set(e), n.push(new Uint8Array(d)), r += 30 + e.length + s;
|
|
1458
1459
|
}
|
|
1459
|
-
let i =
|
|
1460
|
-
return o.setUint32(0, 101010256, !0), o.setUint16(4, 0, !0), o.setUint16(6, 0, !0), o.setUint16(8, e.length, !0), o.setUint16(10, e.length, !0), o.setUint32(12, i.length, !0), o.setUint32(16, r, !0), o.setUint16(20, 0, !0),
|
|
1460
|
+
let i = P(n), a = /* @__PURE__ */ new ArrayBuffer(22), o = new DataView(a);
|
|
1461
|
+
return o.setUint32(0, 101010256, !0), o.setUint16(4, 0, !0), o.setUint16(6, 0, !0), o.setUint16(8, e.length, !0), o.setUint16(10, e.length, !0), o.setUint32(12, i.length, !0), o.setUint32(16, r, !0), o.setUint16(20, 0, !0), P([
|
|
1461
1462
|
...t,
|
|
1462
1463
|
i,
|
|
1463
1464
|
new Uint8Array(a)
|
|
1464
1465
|
]);
|
|
1465
1466
|
}
|
|
1466
|
-
function
|
|
1467
|
+
function P(e) {
|
|
1467
1468
|
let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
|
|
1468
1469
|
for (let t of e) n.set(t, r), r += t.length;
|
|
1469
1470
|
return n;
|
|
1470
1471
|
}
|
|
1471
|
-
function
|
|
1472
|
+
function F(e) {
|
|
1472
1473
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1473
1474
|
}
|
|
1474
|
-
function
|
|
1475
|
+
function be(e) {
|
|
1475
1476
|
let t = "";
|
|
1476
1477
|
for (e++; e > 0;) t = String.fromCharCode(64 + (e % 26 || 26)) + t, e = Math.floor((e - 1) / 26);
|
|
1477
1478
|
return t;
|
|
1478
1479
|
}
|
|
1479
|
-
function
|
|
1480
|
-
return
|
|
1480
|
+
function I(e, t) {
|
|
1481
|
+
return be(t) + (e + 1);
|
|
1481
1482
|
}
|
|
1482
|
-
function
|
|
1483
|
+
function xe(e) {
|
|
1483
1484
|
let t = Date.UTC(1899, 11, 30);
|
|
1484
1485
|
return (e.getTime() - t) / 864e5;
|
|
1485
1486
|
}
|
|
1486
|
-
var
|
|
1487
|
-
function
|
|
1488
|
-
let n = [], r = t.map((e, t) => `<c r="${
|
|
1487
|
+
var Se = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\n <Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/>\n <Default Extension=\"xml\" ContentType=\"application/xml\"/>\n <Override PartName=\"/xl/workbook.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\"/>\n <Override PartName=\"/xl/worksheets/sheet1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\"/>\n <Override PartName=\"/xl/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\"/>\n</Types>", Ce = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n <Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"xl/workbook.xml\"/>\n</Relationships>", we = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<workbook xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">\n <sheets><sheet name=\"Sheet1\" sheetId=\"1\" r:id=\"rId1\"/></sheets>\n</workbook>", Te = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n <Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\" Target=\"worksheets/sheet1.xml\"/>\n <Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\"/>\n</Relationships>", Ee = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<styleSheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\">\n <numFmts count=\"1\"><numFmt numFmtId=\"164\" formatCode=\"yyyy-mm-dd\"/></numFmts>\n <fonts count=\"2\">\n <font><sz val=\"11\"/><name val=\"Calibri\"/></font>\n <font><sz val=\"11\"/><b/><name val=\"Calibri\"/></font>\n </fonts>\n <fills count=\"2\">\n <fill><patternFill patternType=\"none\"/></fill>\n <fill><patternFill patternType=\"gray125\"/></fill>\n </fills>\n <borders count=\"1\"><border><left/><right/><top/><bottom/><diagonal/></border></borders>\n <cellStyleXfs count=\"1\"><xf numFmtId=\"0\" fontId=\"0\" fillId=\"0\" borderId=\"0\"/></cellStyleXfs>\n <cellXfs count=\"3\">\n <xf numFmtId=\"0\" fontId=\"0\" fillId=\"0\" borderId=\"0\" xfId=\"0\"/>\n <xf numFmtId=\"164\" fontId=\"0\" fillId=\"0\" borderId=\"0\" xfId=\"0\" applyNumberFormat=\"1\"/>\n <xf numFmtId=\"0\" fontId=\"1\" fillId=\"0\" borderId=\"0\" xfId=\"0\" applyFont=\"1\"/>\n </cellXfs>\n</styleSheet>";
|
|
1488
|
+
function De(e, t) {
|
|
1489
|
+
let n = [], r = t.map((e, t) => `<c r="${I(0, t)}" t="str" s="2"><v>${F(e.label)}</v></c>`);
|
|
1489
1490
|
return n.push(`<row r="1">${r.join("")}</row>`), e.forEach((e, r) => {
|
|
1490
1491
|
let i = t.map((t, n) => {
|
|
1491
|
-
let i =
|
|
1492
|
+
let i = I(r + 1, n), a = e[t.key];
|
|
1492
1493
|
if (a == null) return `<c r="${i}" t="str"><v></v></c>`;
|
|
1493
1494
|
let o = t.type ?? "text";
|
|
1494
|
-
return o === "number" && typeof a == "number" ? `<c r="${i}"><v>${a}</v></c>` : (o === "date" || o === "datetime") && a instanceof Date ? `<c r="${i}" s="1"><v>${
|
|
1495
|
+
return o === "number" && typeof a == "number" ? `<c r="${i}"><v>${a}</v></c>` : (o === "date" || o === "datetime") && a instanceof Date ? `<c r="${i}" s="1"><v>${xe(a).toFixed(6)}</v></c>` : o === "boolean" ? `<c r="${i}" t="b"><v>${+!!a}</v></c>` : `<c r="${i}" t="str"><v>${F(String(a))}</v></c>`;
|
|
1495
1496
|
});
|
|
1496
1497
|
n.push(`<row r="${r + 2}">${i.join("")}</row>`);
|
|
1497
1498
|
}), `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
@@ -1499,65 +1500,65 @@ function Te(e, t) {
|
|
|
1499
1500
|
<sheetData>${n.join("")}</sheetData>
|
|
1500
1501
|
</worksheet>`;
|
|
1501
1502
|
}
|
|
1502
|
-
function
|
|
1503
|
-
return
|
|
1503
|
+
function Oe(e, t) {
|
|
1504
|
+
return _e(L(e, t));
|
|
1504
1505
|
}
|
|
1505
|
-
function
|
|
1506
|
-
return
|
|
1506
|
+
function ke(e, t) {
|
|
1507
|
+
return ve(L(e, t));
|
|
1507
1508
|
}
|
|
1508
|
-
function
|
|
1509
|
-
let n =
|
|
1509
|
+
function L(e, t) {
|
|
1510
|
+
let n = De(e, t);
|
|
1510
1511
|
return [
|
|
1511
1512
|
{
|
|
1512
1513
|
name: "[Content_Types].xml",
|
|
1513
|
-
data:
|
|
1514
|
+
data: M.encode(Se)
|
|
1514
1515
|
},
|
|
1515
1516
|
{
|
|
1516
1517
|
name: "_rels/.rels",
|
|
1517
|
-
data:
|
|
1518
|
+
data: M.encode(Ce)
|
|
1518
1519
|
},
|
|
1519
1520
|
{
|
|
1520
1521
|
name: "xl/workbook.xml",
|
|
1521
|
-
data:
|
|
1522
|
+
data: M.encode(we)
|
|
1522
1523
|
},
|
|
1523
1524
|
{
|
|
1524
1525
|
name: "xl/_rels/workbook.xml.rels",
|
|
1525
|
-
data:
|
|
1526
|
+
data: M.encode(Te)
|
|
1526
1527
|
},
|
|
1527
1528
|
{
|
|
1528
1529
|
name: "xl/worksheets/sheet1.xml",
|
|
1529
|
-
data:
|
|
1530
|
+
data: M.encode(n)
|
|
1530
1531
|
},
|
|
1531
1532
|
{
|
|
1532
1533
|
name: "xl/styles.xml",
|
|
1533
|
-
data:
|
|
1534
|
+
data: M.encode(Ee)
|
|
1534
1535
|
}
|
|
1535
1536
|
];
|
|
1536
1537
|
}
|
|
1537
1538
|
//#endregion
|
|
1538
1539
|
//#region src/export/export.ts
|
|
1539
|
-
function
|
|
1540
|
+
function R(e, t, n) {
|
|
1540
1541
|
switch (n) {
|
|
1541
|
-
case "csv": return
|
|
1542
|
-
case "tsv": return
|
|
1543
|
-
case "json": return
|
|
1544
|
-
case "xlsx": return
|
|
1542
|
+
case "csv": return B(e, t, ",");
|
|
1543
|
+
case "tsv": return B(e, t, " ");
|
|
1544
|
+
case "json": return je(e, t);
|
|
1545
|
+
case "xlsx": return Oe(e, t);
|
|
1545
1546
|
}
|
|
1546
1547
|
}
|
|
1547
|
-
async function
|
|
1548
|
-
let r = n === "xlsx" ? await
|
|
1549
|
-
return new Blob([r], { type:
|
|
1548
|
+
async function z(e, t, n) {
|
|
1549
|
+
let r = n === "xlsx" ? await ke(e, t) : R(e, t, n);
|
|
1550
|
+
return new Blob([r], { type: Pe(n) });
|
|
1550
1551
|
}
|
|
1551
|
-
function
|
|
1552
|
+
function Ae(e, t) {
|
|
1552
1553
|
return e == null ? "" : (t.type === "date" || t.type === "datetime") && e instanceof Date ? e.toISOString() : String(e);
|
|
1553
1554
|
}
|
|
1554
|
-
function
|
|
1555
|
-
return [t.map((e) =>
|
|
1555
|
+
function B(e, t, n) {
|
|
1556
|
+
return [t.map((e) => V(e.label, n)).join(n), ...e.map((e) => t.map((t) => V(Ae(e[t.key], t), n)).join(n))].join("\n");
|
|
1556
1557
|
}
|
|
1557
|
-
function
|
|
1558
|
+
function V(e, t) {
|
|
1558
1559
|
return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? "\"" + e.replace(/"/g, "\"\"") + "\"" : e;
|
|
1559
1560
|
}
|
|
1560
|
-
function
|
|
1561
|
+
function je(e, t) {
|
|
1561
1562
|
let n = e.map((e) => {
|
|
1562
1563
|
let n = {};
|
|
1563
1564
|
for (let r of t) {
|
|
@@ -1568,35 +1569,35 @@ function ke(e, t) {
|
|
|
1568
1569
|
});
|
|
1569
1570
|
return JSON.stringify(n, null, 2);
|
|
1570
1571
|
}
|
|
1571
|
-
function
|
|
1572
|
+
function H(e, t) {
|
|
1572
1573
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
1573
1574
|
r.href = n, r.download = t, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), setTimeout(() => URL.revokeObjectURL(n), 100);
|
|
1574
1575
|
}
|
|
1575
|
-
var
|
|
1576
|
+
var Me = {
|
|
1576
1577
|
csv: "text/csv;charset=utf-8",
|
|
1577
1578
|
tsv: "text/tab-separated-values;charset=utf-8",
|
|
1578
1579
|
json: "application/json;charset=utf-8",
|
|
1579
1580
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
1580
|
-
},
|
|
1581
|
+
}, Ne = {
|
|
1581
1582
|
csv: ".csv",
|
|
1582
1583
|
tsv: ".tsv",
|
|
1583
1584
|
json: ".json",
|
|
1584
1585
|
xlsx: ".xlsx"
|
|
1585
1586
|
};
|
|
1586
|
-
function Ne(e) {
|
|
1587
|
-
return je[e];
|
|
1588
|
-
}
|
|
1589
1587
|
function Pe(e) {
|
|
1590
1588
|
return Me[e];
|
|
1591
1589
|
}
|
|
1590
|
+
function Fe(e) {
|
|
1591
|
+
return Ne[e];
|
|
1592
|
+
}
|
|
1592
1593
|
//#endregion
|
|
1593
1594
|
//#region src/export/xlsx-reader.ts
|
|
1594
|
-
function
|
|
1595
|
+
function Ie(e) {
|
|
1595
1596
|
for (let t = e.byteLength - 22; t >= 0; t--) if (e.getUint32(t, !0) === 101010256) return t;
|
|
1596
1597
|
throw Error("XLSX: End of central directory not found — not a valid ZIP file");
|
|
1597
1598
|
}
|
|
1598
|
-
function
|
|
1599
|
-
let t =
|
|
1599
|
+
function Le(e) {
|
|
1600
|
+
let t = Ie(e), n = e.getUint32(t + 16, !0), r = e.getUint32(t + 12, !0), i = new TextDecoder("utf-8"), a = [], o = n, s = n + r;
|
|
1600
1601
|
for (; o < s && e.getUint32(o, !0) === 33639248;) {
|
|
1601
1602
|
let t = e.getUint16(o + 10, !0), n = e.getUint32(o + 20, !0), r = e.getUint32(o + 24, !0), s = e.getUint16(o + 28, !0), c = e.getUint16(o + 30, !0), l = e.getUint16(o + 32, !0), u = e.getUint32(o + 42, !0), d = i.decode(new Uint8Array(e.buffer, o + 46, s));
|
|
1602
1603
|
a.push({
|
|
@@ -1609,7 +1610,7 @@ function Ie(e) {
|
|
|
1609
1610
|
}
|
|
1610
1611
|
return a;
|
|
1611
1612
|
}
|
|
1612
|
-
async function
|
|
1613
|
+
async function Re(e) {
|
|
1613
1614
|
let t = new DecompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
|
|
1614
1615
|
n.write(e), n.close();
|
|
1615
1616
|
let i = [];
|
|
@@ -1622,28 +1623,28 @@ async function Le(e) {
|
|
|
1622
1623
|
for (let e of i) o.set(e, s), s += e.length;
|
|
1623
1624
|
return o;
|
|
1624
1625
|
}
|
|
1625
|
-
async function
|
|
1626
|
+
async function ze(e, t) {
|
|
1626
1627
|
let n = t.localHeaderOffset, r = e.getUint16(n + 26, !0), i = e.getUint16(n + 28, !0), a = n + 30 + r + i, o = new Uint8Array(e.buffer, a, t.compressedSize);
|
|
1627
1628
|
if (t.compressionMethod === 0) return o.slice();
|
|
1628
|
-
if (t.compressionMethod === 8) return
|
|
1629
|
+
if (t.compressionMethod === 8) return Re(o);
|
|
1629
1630
|
throw Error(`XLSX: Unsupported compression method ${t.compressionMethod}`);
|
|
1630
1631
|
}
|
|
1631
|
-
async function
|
|
1632
|
-
let t = new DataView(e), n =
|
|
1633
|
-
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await
|
|
1632
|
+
async function Be(e) {
|
|
1633
|
+
let t = new DataView(e), n = Le(t), r = /* @__PURE__ */ new Map();
|
|
1634
|
+
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await ze(t, e));
|
|
1634
1635
|
return r;
|
|
1635
1636
|
}
|
|
1636
|
-
var
|
|
1637
|
+
var Ve = new TextDecoder("utf-8");
|
|
1637
1638
|
function U(e) {
|
|
1638
|
-
let t =
|
|
1639
|
+
let t = Ve.decode(e);
|
|
1639
1640
|
return new DOMParser().parseFromString(t, "application/xml");
|
|
1640
1641
|
}
|
|
1641
|
-
function
|
|
1642
|
+
function He(e) {
|
|
1642
1643
|
if (!e) return [];
|
|
1643
1644
|
let t = U(e);
|
|
1644
1645
|
return Array.from(t.querySelectorAll("si")).map((e) => Array.from(e.querySelectorAll("t")).map((e) => e.textContent ?? "").join(""));
|
|
1645
1646
|
}
|
|
1646
|
-
var
|
|
1647
|
+
var Ue = /* @__PURE__ */ new Set([
|
|
1647
1648
|
14,
|
|
1648
1649
|
15,
|
|
1649
1650
|
16,
|
|
@@ -1663,29 +1664,29 @@ var He = /* @__PURE__ */ new Set([
|
|
|
1663
1664
|
57,
|
|
1664
1665
|
58
|
|
1665
1666
|
]);
|
|
1666
|
-
function
|
|
1667
|
+
function We(e) {
|
|
1667
1668
|
let t = e.replace(/"[^"]*"/g, "").replace(/\\./g, "").replace(/\[[^\]]*\]/g, "").split(";")[0];
|
|
1668
1669
|
return /[dy]/i.test(t);
|
|
1669
1670
|
}
|
|
1670
|
-
function
|
|
1671
|
+
function Ge(e) {
|
|
1671
1672
|
let t = /* @__PURE__ */ new Set();
|
|
1672
1673
|
if (!e) return t;
|
|
1673
1674
|
let n = U(e), r = /* @__PURE__ */ new Map();
|
|
1674
1675
|
for (let e of Array.from(n.querySelectorAll("numFmts > numFmt"))) r.set(parseInt(e.getAttribute("numFmtId") ?? "", 10), e.getAttribute("formatCode") ?? "");
|
|
1675
1676
|
return Array.from(n.querySelectorAll("cellXfs > xf")).forEach((e, n) => {
|
|
1676
1677
|
let i = parseInt(e.getAttribute("numFmtId") ?? "0", 10), a = r.get(i);
|
|
1677
|
-
(a === void 0 ?
|
|
1678
|
+
(a === void 0 ? Ue.has(i) : We(a)) && t.add(n);
|
|
1678
1679
|
}), t;
|
|
1679
1680
|
}
|
|
1680
|
-
function
|
|
1681
|
+
function Ke(e) {
|
|
1681
1682
|
if (!e) return !1;
|
|
1682
1683
|
let t = U(e).querySelector("workbookPr")?.getAttribute("date1904");
|
|
1683
1684
|
return t === "1" || t === "true";
|
|
1684
1685
|
}
|
|
1685
|
-
function
|
|
1686
|
+
function qe(e, t) {
|
|
1686
1687
|
return new Date((t ? Date.UTC(1904, 0, 1) : Date.UTC(1899, 11, 30)) + Math.floor(e) * 864e5).toISOString().slice(0, 10);
|
|
1687
1688
|
}
|
|
1688
|
-
function
|
|
1689
|
+
function Je(e, t, n, r) {
|
|
1689
1690
|
let i = U(e).querySelectorAll("row");
|
|
1690
1691
|
if (i.length === 0) return [];
|
|
1691
1692
|
let a = 0, o = /* @__PURE__ */ new Map();
|
|
@@ -1693,7 +1694,7 @@ function qe(e, t, n, r) {
|
|
|
1693
1694
|
let i = parseInt(e.getAttribute("r") ?? "1", 10) - 1, s = /* @__PURE__ */ new Map();
|
|
1694
1695
|
o.set(i, s);
|
|
1695
1696
|
for (let i of e.querySelectorAll("c")) {
|
|
1696
|
-
let e =
|
|
1697
|
+
let e = Ye(i.getAttribute("r") ?? "");
|
|
1697
1698
|
e > a && (a = e);
|
|
1698
1699
|
let o = i.getAttribute("t") ?? "", c = i.getAttribute("s") ?? "", l = i.querySelector("v")?.textContent ?? "", u = i.querySelector("is > t")?.textContent ?? null, d;
|
|
1699
1700
|
if (o === "s") d = t[parseInt(l, 10)] ?? "";
|
|
@@ -1702,7 +1703,7 @@ function qe(e, t, n, r) {
|
|
|
1702
1703
|
else if (l === "") d = "";
|
|
1703
1704
|
else {
|
|
1704
1705
|
let e = parseFloat(l);
|
|
1705
|
-
d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ?
|
|
1706
|
+
d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ? qe(e, r) : l;
|
|
1706
1707
|
}
|
|
1707
1708
|
s.set(e, d);
|
|
1708
1709
|
}
|
|
@@ -1716,13 +1717,13 @@ function qe(e, t, n, r) {
|
|
|
1716
1717
|
}
|
|
1717
1718
|
return c;
|
|
1718
1719
|
}
|
|
1719
|
-
function
|
|
1720
|
+
function Ye(e) {
|
|
1720
1721
|
let t = 0, n = 0;
|
|
1721
1722
|
for (; n < e.length && e[n] >= "A" && e[n] <= "Z";) t = t * 26 + (e.charCodeAt(n) - 64), n++;
|
|
1722
1723
|
return t - 1;
|
|
1723
1724
|
}
|
|
1724
|
-
async function
|
|
1725
|
-
let t = await
|
|
1725
|
+
async function Xe(e) {
|
|
1726
|
+
let t = await Be(e), n = He(t.get("xl/sharedStrings.xml")), r = t.get("xl/worksheets/sheet1.xml");
|
|
1726
1727
|
if (!r) {
|
|
1727
1728
|
for (let [e, n] of t) if (e.toLowerCase().includes("worksheets/sheet")) {
|
|
1728
1729
|
r = n;
|
|
@@ -1730,7 +1731,7 @@ async function Ye(e) {
|
|
|
1730
1731
|
}
|
|
1731
1732
|
}
|
|
1732
1733
|
if (!r) throw Error("XLSX: No worksheet found");
|
|
1733
|
-
let i =
|
|
1734
|
+
let i = Ge(t.get("xl/styles.xml")), a = Ke(t.get("xl/workbook.xml")), o = Je(r, n, i, a);
|
|
1734
1735
|
return o.length === 0 ? {
|
|
1735
1736
|
headers: [],
|
|
1736
1737
|
rows: []
|
|
@@ -1761,9 +1762,9 @@ var K = {
|
|
|
1761
1762
|
lt: "<",
|
|
1762
1763
|
gte: "≥",
|
|
1763
1764
|
lte: "≤"
|
|
1764
|
-
}, q = 120, J = 40, Y = 20, X = 32, Z = 5,
|
|
1765
|
+
}, q = 120, J = 40, Y = 20, X = 32, Z = 5, Ze = 200, Q = class extends r {
|
|
1765
1766
|
constructor(...e) {
|
|
1766
|
-
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this.rowKey = "_id", this._rowHeightFromCss = X, this._targetFloor = 0, this.showRowNumbers = !1, this.theme = void 0, this.maxRows = 0, this.editable = !0, this.showFilters = !1, this.showContextMenu = !1, this.frozenRows = 0, this.emptyMessage = "", this.noMatchingMessage = "", this.error = null, this.loading = !1, this.importEnabled = !1, this.selectable = !1, this.dataMode = "client", this.footerData = null, this.stylesheets = [], this._scrollTop = 0, this._scrollLeft = 0, this._viewportHeight = 0, this._viewportWidth = 0, this._colLeftOffsets = [], this._totalRowWidth = 0, this._baseStyleSheets = [], this._activeCell = null, this._headerCol = null, this._focusedCellEl = null, this._editingCell = null, this._sortCriteria = [], this._selection = new
|
|
1767
|
+
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this.rowKey = "_id", this._rowHeightFromCss = X, this._targetFloor = 0, this.showRowNumbers = !1, this.theme = void 0, this.maxRows = 0, this.editable = !0, this.showFilters = !1, this.showContextMenu = !1, this.frozenRows = 0, this.emptyMessage = "", this.noMatchingMessage = "", this.error = null, this.loading = !1, this.importEnabled = !1, this.selectable = !1, this.dataMode = "client", this.footerData = null, this.stylesheets = [], this._scrollTop = 0, this._scrollLeft = 0, this._viewportHeight = 0, this._viewportWidth = 0, this._colLeftOffsets = [], this._totalRowWidth = 0, this._baseStyleSheets = [], this._activeCell = null, this._headerCol = null, this._focusedCellEl = null, this._editingCell = null, this._sortCriteria = [], this._selection = new ce(), this._editing = new le(), this._rowSelection = new O(), this._undo = new k(), this._filters = [], this._filteredIndices = [], this._sortedIndices = [], this._openFilterKey = null, this._rowSelectionVersion = 0, this._lastCheckboxRowId = null, this._unkeyedIds = /* @__PURE__ */ new WeakMap(), this._unkeyedSeq = 0, this._visibleIdsCache = null, this._checkboxShiftPending = !1, this._autocompleteState = null, this._headerMenu = null, this._bodyContextMenu = null, this._commentPopup = null, this._viewDirty = !0, this._isDragging = !1, this._wasDrag = !1, this._resizing = null, this._resizeCleanup = null, this._wasHeaderDrag = !1, this._wasRowDrag = !1, this._colDrag = null, this._colDragIndicatorLeft = null, this._fillDrag = null, this._rowDrag = null, this._rowDragIndicatorY = null, this._findState = null, this._columnWidths = /* @__PURE__ */ new Map(), this._hostResizeObserver = null, this._comments = /* @__PURE__ */ new Map(), this._isDragOver = !1, this._editorMoving = !1, this._onEditorBlur = (e) => {
|
|
1767
1768
|
!this._editorMoving && e.currentTarget?.isConnected && this._commitEdit();
|
|
1768
1769
|
}, this._warnedUnconstrained = !1, this._onHostFocus = (e) => {
|
|
1769
1770
|
e.composedPath()[0] !== this || this._activeCell || this._headerCol !== null || this.visibleColumns.length !== 0 && this.matches(":focus-visible") && (this._visibleRowCount > 0 ? (this._selection.setActive(0, 0), this._syncActiveCell()) : this._headerCol = 0);
|
|
@@ -1786,7 +1787,7 @@ var K = {
|
|
|
1786
1787
|
}, this._invalidCells = /* @__PURE__ */ new Map(), this._textFilterState = /* @__PURE__ */ new Map(), this._numberFilterState = /* @__PURE__ */ new Map(), this._dateFilterState = /* @__PURE__ */ new Map(), this._emptyFilterState = /* @__PURE__ */ new Map();
|
|
1787
1788
|
}
|
|
1788
1789
|
static {
|
|
1789
|
-
this.styles =
|
|
1790
|
+
this.styles = C;
|
|
1790
1791
|
}
|
|
1791
1792
|
get data() {
|
|
1792
1793
|
return this._data;
|
|
@@ -2164,19 +2165,23 @@ var K = {
|
|
|
2164
2165
|
}
|
|
2165
2166
|
exportToString(e, t) {
|
|
2166
2167
|
let n = this._exportSlice(t);
|
|
2167
|
-
return n ?
|
|
2168
|
+
return n ? R(n.rows, n.cols, e) : "";
|
|
2168
2169
|
}
|
|
2169
2170
|
async exportToBlob(e, t) {
|
|
2170
2171
|
let n = this._exportSlice(t) ?? {
|
|
2171
2172
|
rows: [],
|
|
2172
2173
|
cols: []
|
|
2173
2174
|
};
|
|
2174
|
-
return
|
|
2175
|
+
return z(n.rows, n.cols, e);
|
|
2175
2176
|
}
|
|
2176
|
-
async exportToFile(e, t) {
|
|
2177
|
-
|
|
2177
|
+
async exportToFile(e, t, n) {
|
|
2178
|
+
H(await this.exportToBlob(e, n), t ?? `export${Fe(e)}`);
|
|
2178
2179
|
}
|
|
2179
2180
|
_exportSlice(e) {
|
|
2181
|
+
if (e && "rows" in e && e.rows) return {
|
|
2182
|
+
rows: e.rows,
|
|
2183
|
+
cols: this.visibleColumns
|
|
2184
|
+
};
|
|
2180
2185
|
if (e?.selectionOnly) {
|
|
2181
2186
|
let e = this._selection.getEffectiveRange();
|
|
2182
2187
|
if (!e) return null;
|
|
@@ -2251,7 +2256,7 @@ var K = {
|
|
|
2251
2256
|
async importFromFile(e) {
|
|
2252
2257
|
let t = e.name.toLowerCase();
|
|
2253
2258
|
if (t.endsWith(".xlsx")) {
|
|
2254
|
-
let t = await
|
|
2259
|
+
let t = await Xe(await e.arrayBuffer());
|
|
2255
2260
|
this._applyImportedSheet(t);
|
|
2256
2261
|
} else if (t.endsWith(".csv") || t.endsWith(".tsv")) {
|
|
2257
2262
|
let t = await e.text(), n = g(t);
|
|
@@ -2265,7 +2270,7 @@ var K = {
|
|
|
2265
2270
|
let a = t.get(e);
|
|
2266
2271
|
if (!a) return;
|
|
2267
2272
|
let o = this.columns.find((e) => e.key === a);
|
|
2268
|
-
r[a] = o ?
|
|
2273
|
+
r[a] = o ? A(n[i] ?? "", o) : n[i] ?? null;
|
|
2269
2274
|
}), r;
|
|
2270
2275
|
}), r = [...this.data];
|
|
2271
2276
|
this.data = n, this._undo.push({
|
|
@@ -2286,7 +2291,7 @@ var K = {
|
|
|
2286
2291
|
let a = n.get(t);
|
|
2287
2292
|
if (!a) return;
|
|
2288
2293
|
let o = this.columns.find((e) => e.key === a);
|
|
2289
|
-
r[a] = o ?
|
|
2294
|
+
r[a] = o ? A(e[i] ?? "", o) : e[i] ?? null;
|
|
2290
2295
|
}), r;
|
|
2291
2296
|
}), i = [...this.data];
|
|
2292
2297
|
this.data = r, this._undo.push({
|
|
@@ -2435,7 +2440,7 @@ var K = {
|
|
|
2435
2440
|
this._filteredIndices = Array.from({ length: this.data.length }, (e, t) => t), this._sortedIndices = this._filteredIndices;
|
|
2436
2441
|
return;
|
|
2437
2442
|
}
|
|
2438
|
-
if (this._filteredIndices =
|
|
2443
|
+
if (this._filteredIndices = ue(this.data, this._filters, (e, t, n) => {
|
|
2439
2444
|
this._emit("filter-error", {
|
|
2440
2445
|
error: e,
|
|
2441
2446
|
row: t,
|
|
@@ -2490,7 +2495,7 @@ var K = {
|
|
|
2490
2495
|
e !== this._viewportHeight && (this._viewportHeight = e), t !== this._viewportWidth && (this._viewportWidth = t), this._warnIfUnconstrained();
|
|
2491
2496
|
}
|
|
2492
2497
|
_warnIfUnconstrained() {
|
|
2493
|
-
this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount <
|
|
2498
|
+
this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount < Ze || this.scrollHeight > this.clientHeight + 1 || (this._warnedUnconstrained = !0, console.warn(`[@iyulab/flex-table] ${this._visibleRowCount} rows but the host has no height constraint — it grew to fit every row, so virtual scrolling is off and all rows are rendered. Give the host a height (e.g. height: 400px, or flex: 1 1 auto with min-height: 0 inside a sized parent) so it becomes the scroll container.`));
|
|
2494
2499
|
}
|
|
2495
2500
|
_onScroll() {
|
|
2496
2501
|
this._scrollTop = this.scrollTop, this._scrollLeft = this.scrollLeft;
|
|
@@ -2538,7 +2543,9 @@ var K = {
|
|
|
2538
2543
|
this._wasDrag = !1;
|
|
2539
2544
|
return;
|
|
2540
2545
|
}
|
|
2541
|
-
this._isDragging = !1, this._editing.current && this._commitEdit()
|
|
2546
|
+
this._isDragging = !1, this._editing.current && this._commitEdit();
|
|
2547
|
+
let r = e.shiftKey || e.ctrlKey || e.metaKey;
|
|
2548
|
+
e.shiftKey ? this._selection.setActiveWithRange(t, n) : e.ctrlKey || e.metaKey ? this._selection.toggleCell(t, n) : this._selection.setActive(t, n), this._activeCell = this._selection.activeCell ? { ...this._selection.activeCell } : null, this._dispatchSelectionEvent(), this.requestUpdate(), !r && !S(e, e.currentTarget) && this._fireRowActivate(this.visibleColumns[n], "click");
|
|
2542
2549
|
}
|
|
2543
2550
|
_onCellMouseDown(e, t, n) {
|
|
2544
2551
|
if (e.button !== 0 || e.shiftKey) return;
|
|
@@ -2573,13 +2580,14 @@ var K = {
|
|
|
2573
2580
|
_isCellEditable(e) {
|
|
2574
2581
|
return !(!this.editable || e.editable === !1);
|
|
2575
2582
|
}
|
|
2576
|
-
_fireRowActivate(e) {
|
|
2583
|
+
_fireRowActivate(e, t) {
|
|
2577
2584
|
if (!this._activeCell) return;
|
|
2578
|
-
let
|
|
2579
|
-
|
|
2580
|
-
row:
|
|
2581
|
-
id: this.getRowId(
|
|
2582
|
-
|
|
2585
|
+
let n = this._toDataIndex(this._activeCell.row), r = this.data[n];
|
|
2586
|
+
r && this._emit("row-activate", {
|
|
2587
|
+
row: r,
|
|
2588
|
+
id: this.getRowId(r),
|
|
2589
|
+
via: t,
|
|
2590
|
+
index: n,
|
|
2583
2591
|
col: this._activeCell.col,
|
|
2584
2592
|
key: e?.key
|
|
2585
2593
|
});
|
|
@@ -2629,7 +2637,7 @@ var K = {
|
|
|
2629
2637
|
}
|
|
2630
2638
|
let t = this.shadowRoot?.querySelector(".ft-editor");
|
|
2631
2639
|
if (t) {
|
|
2632
|
-
let n =
|
|
2640
|
+
let n = A(t.value, e);
|
|
2633
2641
|
this._applyEdit(n);
|
|
2634
2642
|
} else this._cancelEdit();
|
|
2635
2643
|
}
|
|
@@ -2794,7 +2802,7 @@ var K = {
|
|
|
2794
2802
|
if ((e.key === "Enter" || e.key === "F2") && this._activeCell && !v(e)) {
|
|
2795
2803
|
e.preventDefault();
|
|
2796
2804
|
let n = t[this._activeCell.col];
|
|
2797
|
-
n && this._isCellEditable(n) ? this._startEdit() : e.key === "Enter" && this._fireRowActivate(n);
|
|
2805
|
+
n && this._isCellEditable(n) ? this._startEdit() : e.key === "Enter" && this._fireRowActivate(n, "keyboard");
|
|
2798
2806
|
return;
|
|
2799
2807
|
}
|
|
2800
2808
|
if (!this._selection.activeCell) {
|
|
@@ -2953,7 +2961,7 @@ var K = {
|
|
|
2953
2961
|
let e = this._selection.getEffectiveRange();
|
|
2954
2962
|
return e ? {
|
|
2955
2963
|
range: e,
|
|
2956
|
-
text:
|
|
2964
|
+
text: fe(this._sortedIndices.map((e) => this.data[e]), this.visibleColumns, e)
|
|
2957
2965
|
} : null;
|
|
2958
2966
|
}
|
|
2959
2967
|
async _copyFromMenu() {
|
|
@@ -3036,7 +3044,7 @@ var K = {
|
|
|
3036
3044
|
for (let a = 0; a < t[i].length; a++) {
|
|
3037
3045
|
let s = e.col + a;
|
|
3038
3046
|
if (s >= n.length) break;
|
|
3039
|
-
let c = n[s], l = this.data[o][c.key], u =
|
|
3047
|
+
let c = n[s], l = this.data[o][c.key], u = A(t[i][a], c);
|
|
3040
3048
|
this.data[o][c.key] = u, r.push({
|
|
3041
3049
|
row: o,
|
|
3042
3050
|
col: s,
|
|
@@ -3101,7 +3109,7 @@ var K = {
|
|
|
3101
3109
|
for (let r = e.startCol + 1; r <= e.endCol; r++) {
|
|
3102
3110
|
let e = t[r];
|
|
3103
3111
|
if (!e || !this._isCellEditable(e)) continue;
|
|
3104
|
-
let a =
|
|
3112
|
+
let a = A(o == null ? "" : String(o), e);
|
|
3105
3113
|
n.push({
|
|
3106
3114
|
row: i,
|
|
3107
3115
|
key: e.key,
|
|
@@ -3182,7 +3190,11 @@ var K = {
|
|
|
3182
3190
|
n < this.scrollLeft ? this.scrollLeft = n : r > this.scrollLeft + this.clientWidth && (this.scrollLeft = r - this.clientWidth);
|
|
3183
3191
|
}
|
|
3184
3192
|
_dispatchSelectionEvent() {
|
|
3185
|
-
|
|
3193
|
+
let e = this._activeCell, t = e ? this.data[this._toDataIndex(e.row)] : void 0;
|
|
3194
|
+
this._emit("cell-select", e ? {
|
|
3195
|
+
...e,
|
|
3196
|
+
id: t ? this.getRowId(t) : ""
|
|
3197
|
+
} : null);
|
|
3186
3198
|
}
|
|
3187
3199
|
_onHeaderClick(e, t) {
|
|
3188
3200
|
if (this._wasHeaderDrag) {
|
|
@@ -3719,7 +3731,7 @@ var K = {
|
|
|
3719
3731
|
</select>
|
|
3720
3732
|
<input class="ft-filter-input ft-num-cond-input" type="text" inputmode="decimal" placeholder=${e("valuePlaceholder")}
|
|
3721
3733
|
aria-label=${e("conditionValue", { n: n === "cond1" ? 1 : 2 })}
|
|
3722
|
-
.value=${r.text ?? (r.value == null ? "" :
|
|
3734
|
+
.value=${r.text ?? (r.value == null ? "" : j(r.value))}
|
|
3723
3735
|
aria-invalid=${r.text && r.value == null ? "true" : "false"}
|
|
3724
3736
|
@input=${(e) => {
|
|
3725
3737
|
let r = e.target.value, i = this._numberFilterState.get(t) ?? this._defaultNumState();
|
|
@@ -4470,7 +4482,7 @@ var K = {
|
|
|
4470
4482
|
let n = e[t.key], r = n == null ? "" : String(n);
|
|
4471
4483
|
if (t.type === "number") return a`
|
|
4472
4484
|
<input class="ft-editor ft-editor-number" type="text" inputmode="decimal" aria-label=${t.label}
|
|
4473
|
-
.value=${typeof n == "number" ?
|
|
4485
|
+
.value=${typeof n == "number" ? j(n) : r}
|
|
4474
4486
|
@keydown=${this._onEditorKeyDown}
|
|
4475
4487
|
@blur=${this._onEditorBlur}>
|
|
4476
4488
|
`;
|
|
@@ -4479,7 +4491,7 @@ var K = {
|
|
|
4479
4491
|
return a`
|
|
4480
4492
|
<u-date-picker class="ft-editor ft-editor-${t.type}" size="sm" aria-label=${t.label}
|
|
4481
4493
|
mode=${e ? "datetime" : "date"} ?confirm=${e}
|
|
4482
|
-
.value=${
|
|
4494
|
+
.value=${Qe(n, e)}
|
|
4483
4495
|
@keydown=${this._onEditorKeyDown}
|
|
4484
4496
|
@change=${() => this._commitEdit()}
|
|
4485
4497
|
@blur=${this._onEditorBlur}></u-date-picker>
|
|
@@ -4586,12 +4598,12 @@ G([c({ type: Array })], Q.prototype, "columns", void 0), G([c({
|
|
|
4586
4598
|
type: Number,
|
|
4587
4599
|
attribute: "max-undo-size"
|
|
4588
4600
|
})], Q.prototype, "maxUndoSize", null), G([l()], Q.prototype, "_scrollTop", void 0), G([l()], Q.prototype, "_scrollLeft", void 0), G([l()], Q.prototype, "_viewportHeight", void 0), G([l()], Q.prototype, "_viewportWidth", void 0), G([l()], Q.prototype, "_activeCell", void 0), G([l()], Q.prototype, "_headerCol", void 0), G([l()], Q.prototype, "_editingCell", void 0), G([l()], Q.prototype, "_sortCriteria", void 0), G([l()], Q.prototype, "_openFilterKey", void 0), G([l()], Q.prototype, "_rowSelectionVersion", void 0), G([l()], Q.prototype, "_autocompleteState", void 0), G([l()], Q.prototype, "_headerMenu", void 0), G([l()], Q.prototype, "_bodyContextMenu", void 0), G([l()], Q.prototype, "_commentPopup", void 0), G([l()], Q.prototype, "_isDragOver", void 0), Q = G([s("flex-table")], Q);
|
|
4589
|
-
function
|
|
4601
|
+
function Qe(e, t) {
|
|
4590
4602
|
if (t) {
|
|
4591
|
-
let t =
|
|
4603
|
+
let t = me(e);
|
|
4592
4604
|
return /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(t) ? t.replace(" ", "T") : void 0;
|
|
4593
4605
|
}
|
|
4594
|
-
let n =
|
|
4606
|
+
let n = pe(e);
|
|
4595
4607
|
return /^\d{4}-\d{2}-\d{2}$/.test(n) ? n : void 0;
|
|
4596
4608
|
}
|
|
4597
4609
|
function $(e) {
|
|
@@ -4602,4 +4614,4 @@ function $(e) {
|
|
|
4602
4614
|
}
|
|
4603
4615
|
}
|
|
4604
4616
|
//#endregion
|
|
4605
|
-
export {
|
|
4617
|
+
export { z as a, D as c, R as i, W as n, k as o, H as r, O as s, Q as t };
|