@iyulab/flex-table 0.40.3 → 0.41.1
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 +58 -2
- package/README.md +25 -2
- package/dist/clipboard/clipboard.d.ts +11 -0
- package/dist/{flex-table-DvETrA1w.js → flex-table-C6PFutM_.js} +295 -226
- package/dist/flex-table.d.ts +10 -1
- package/dist/flex-table.js +1 -1
- package/dist/locale.d.ts +1 -1
- package/dist/models/types.d.ts +11 -0
- package/dist/react.js +1 -1
- package/package.json +3 -3
- package/skills/iyulab-flex-table/SKILL.md +2 -0
- package/skills/iyulab-flex-table/references/api.md +1 -0
|
@@ -2,11 +2,11 @@ import { n as e, t } from "./sorting-CjfjRxwL.js";
|
|
|
2
2
|
import { LitElement as n, css as r, html as i, nothing as a } from "lit";
|
|
3
3
|
import { customElement as o, property as s, state as c } from "lit/decorators.js";
|
|
4
4
|
import { Locale as l } from "@iyulab/components/dist/utilities/Locale.js";
|
|
5
|
-
import {
|
|
6
|
-
import { decodeTsv as
|
|
7
|
-
import { isImeComposing as
|
|
5
|
+
import { dateTextPattern as u, formatDate as d, formatNumber as f, parseDate as p, parseNumber as m } from "@iyulab/components/dist/utilities/format.js";
|
|
6
|
+
import { decodeTsv as h, encodeTsv as g } from "@iyulab/components/dist/utilities/tsv.js";
|
|
7
|
+
import { isImeComposing as _ } from "@iyulab/components/dist/utilities/keyboard.js";
|
|
8
8
|
//#region src/styles/flex-table.styles.ts
|
|
9
|
-
var
|
|
9
|
+
var v = r`
|
|
10
10
|
/* --- Theme Variables (Light defaults) --- */
|
|
11
11
|
:host {
|
|
12
12
|
--ft-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
@@ -262,6 +262,15 @@ var h = r`
|
|
|
262
262
|
.ft-row-even:hover .ft-cell { background: var(--ft-row-hover-bg); }
|
|
263
263
|
.ft-row-odd:hover .ft-cell { background: var(--ft-row-odd-hover-bg); }
|
|
264
264
|
|
|
265
|
+
/* mergeRepeated — one surface per run: the row it starts on sets the background, the lines
|
|
266
|
+
inside the run go, and the repeated values stay in the DOM (copy, find and screen readers
|
|
267
|
+
read them) but are not painted. A selected or active cell paints its value again. */
|
|
268
|
+
.ft-row-even .ft-cell.ft-merge-even:not(.ft-invalid), .ft-row-odd .ft-cell.ft-merge-even:not(.ft-invalid) { background: var(--ft-row-even-bg); }
|
|
269
|
+
.ft-row-even .ft-cell.ft-merge-odd:not(.ft-invalid), .ft-row-odd .ft-cell.ft-merge-odd:not(.ft-invalid) { background: var(--ft-row-odd-bg); }
|
|
270
|
+
.ft-cell.ft-merge-open { border-bottom-color: transparent; }
|
|
271
|
+
.ft-cell.ft-merge-continued:not(.ft-active):not(.ft-selected) { color: transparent; }
|
|
272
|
+
.ft-cell.ft-merge-continued:not(.ft-active):not(.ft-selected) > :not(.ft-comment-indicator) { opacity: 0; }
|
|
273
|
+
|
|
265
274
|
.ft-cell.ft-active {
|
|
266
275
|
outline: 2px solid var(--ft-active-color);
|
|
267
276
|
outline-offset: -2px;
|
|
@@ -912,13 +921,13 @@ var h = r`
|
|
|
912
921
|
`;
|
|
913
922
|
//#endregion
|
|
914
923
|
//#region src/renderers/format.ts
|
|
915
|
-
function
|
|
916
|
-
return e == null ? "" : typeof t == "function" ? t(e) :
|
|
924
|
+
function y(e, t) {
|
|
925
|
+
return e == null ? "" : typeof t == "function" ? t(e) : b(t) ? S(e, t) : x(e, t);
|
|
917
926
|
}
|
|
918
|
-
function
|
|
927
|
+
function b(e) {
|
|
919
928
|
return /[yMdHhms]/.test(e);
|
|
920
929
|
}
|
|
921
|
-
function
|
|
930
|
+
function x(e, t) {
|
|
922
931
|
let n = typeof e == "number" ? e : Number(e);
|
|
923
932
|
if (isNaN(n)) return String(e);
|
|
924
933
|
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, u = {
|
|
@@ -931,7 +940,7 @@ function v(e, t) {
|
|
|
931
940
|
style: "percent"
|
|
932
941
|
}).format(n) : (d = new Intl.NumberFormat(l.get(), u).format(n), a && (d = a + d)), d + "";
|
|
933
942
|
}
|
|
934
|
-
function
|
|
943
|
+
function S(e, t) {
|
|
935
944
|
let n;
|
|
936
945
|
if (e instanceof Date) n = e;
|
|
937
946
|
else if (typeof e == "string" || typeof e == "number") n = new Date(e);
|
|
@@ -942,26 +951,26 @@ function y(e, t) {
|
|
|
942
951
|
}
|
|
943
952
|
//#endregion
|
|
944
953
|
//#region src/renderers/cell-renderer.ts
|
|
945
|
-
function
|
|
946
|
-
return n.render ? n.render(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) :
|
|
954
|
+
function C(e, t, n) {
|
|
955
|
+
return n.render ? n.render(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) : y(e, n.format) : w(e, n);
|
|
947
956
|
}
|
|
948
|
-
function
|
|
957
|
+
function w(e, t) {
|
|
949
958
|
if (e == null) return "";
|
|
950
959
|
switch (t.type) {
|
|
951
|
-
case "number": return
|
|
960
|
+
case "number": return D(e);
|
|
952
961
|
case "boolean": return i`<span class="ft-bool">${e ? "✔" : ""}</span>`;
|
|
953
|
-
case "date": return
|
|
954
|
-
case "datetime": return
|
|
955
|
-
case "select": return
|
|
962
|
+
case "date": return O(e);
|
|
963
|
+
case "datetime": return ee(e);
|
|
964
|
+
case "select": return T(e, t);
|
|
956
965
|
default: return String(e);
|
|
957
966
|
}
|
|
958
967
|
}
|
|
959
|
-
function
|
|
968
|
+
function T(e, t) {
|
|
960
969
|
if (!t.options || t.options.length === 0 || typeof t.options[0] == "string") return e == null ? "" : String(e);
|
|
961
970
|
let n = t.options.find((t) => t.value === e);
|
|
962
971
|
return n ? n.label : e == null ? "" : String(e);
|
|
963
972
|
}
|
|
964
|
-
var
|
|
973
|
+
var E = {
|
|
965
974
|
year: "numeric",
|
|
966
975
|
month: "numeric",
|
|
967
976
|
day: "numeric",
|
|
@@ -969,19 +978,19 @@ var C = {
|
|
|
969
978
|
minute: "numeric",
|
|
970
979
|
second: "numeric"
|
|
971
980
|
};
|
|
972
|
-
function
|
|
973
|
-
return typeof e == "number" ? Number.isInteger(e) ?
|
|
981
|
+
function D(e) {
|
|
982
|
+
return typeof e == "number" ? Number.isInteger(e) ? f(e) : f(e, { minimumFractionDigits: 1 }) : String(e);
|
|
974
983
|
}
|
|
975
|
-
function
|
|
976
|
-
return e instanceof Date || typeof e == "string" ?
|
|
984
|
+
function O(e) {
|
|
985
|
+
return e instanceof Date || typeof e == "string" ? d(e) : String(e);
|
|
977
986
|
}
|
|
978
|
-
function
|
|
979
|
-
return e instanceof Date || typeof e == "string" ?
|
|
987
|
+
function ee(e) {
|
|
988
|
+
return e instanceof Date || typeof e == "string" ? d(e, E) : String(e);
|
|
980
989
|
}
|
|
981
990
|
//#endregion
|
|
982
991
|
//#region src/locale.ts
|
|
983
|
-
var
|
|
984
|
-
|
|
992
|
+
var k = l.namespace("flex-table");
|
|
993
|
+
k.register("en", {
|
|
985
994
|
showHiddenColumns: "Show hidden column(s)",
|
|
986
995
|
columnMenu: "Column menu",
|
|
987
996
|
cellActions: "Cell actions",
|
|
@@ -1033,8 +1042,11 @@ D.register("en", {
|
|
|
1033
1042
|
deleteComment: "Delete Comment",
|
|
1034
1043
|
booleanTrue: "True",
|
|
1035
1044
|
booleanFalse: "False",
|
|
1036
|
-
dropFileToImport: "Drop file to import (.xlsx / .csv)"
|
|
1037
|
-
|
|
1045
|
+
dropFileToImport: "Drop file to import (.xlsx / .csv)",
|
|
1046
|
+
notANumber: "Enter a number",
|
|
1047
|
+
notADate: "Enter a date as YYYY-MM-DD",
|
|
1048
|
+
notInList: "Value must be from the existing list"
|
|
1049
|
+
}), k.register("ko", {
|
|
1038
1050
|
showHiddenColumns: "숨긴 열 보기",
|
|
1039
1051
|
columnMenu: "열 메뉴",
|
|
1040
1052
|
cellActions: "셀 작업",
|
|
@@ -1086,12 +1098,15 @@ D.register("en", {
|
|
|
1086
1098
|
deleteComment: "메모 삭제",
|
|
1087
1099
|
booleanTrue: "참",
|
|
1088
1100
|
booleanFalse: "거짓",
|
|
1089
|
-
dropFileToImport: "가져올 파일을 놓으세요 (.xlsx / .csv)"
|
|
1101
|
+
dropFileToImport: "가져올 파일을 놓으세요 (.xlsx / .csv)",
|
|
1102
|
+
notANumber: "숫자를 입력하세요",
|
|
1103
|
+
notADate: "날짜를 YYYY-MM-DD 로 입력하세요",
|
|
1104
|
+
notInList: "목록에 있는 값이어야 합니다"
|
|
1090
1105
|
});
|
|
1091
|
-
var
|
|
1106
|
+
var A = (e, t) => k.text(e, t);
|
|
1092
1107
|
//#endregion
|
|
1093
1108
|
//#region src/core/selection.ts
|
|
1094
|
-
function
|
|
1109
|
+
function te(e) {
|
|
1095
1110
|
return {
|
|
1096
1111
|
startRow: Math.min(e.startRow, e.endRow),
|
|
1097
1112
|
startCol: Math.min(e.startCol, e.endCol),
|
|
@@ -1099,7 +1114,7 @@ function ee(e) {
|
|
|
1099
1114
|
endCol: Math.max(e.startCol, e.endCol)
|
|
1100
1115
|
};
|
|
1101
1116
|
}
|
|
1102
|
-
var
|
|
1117
|
+
var ne = class {
|
|
1103
1118
|
constructor() {
|
|
1104
1119
|
this.activeCell = null, this.rangeAnchor = null, this.range = null, this.extraRanges = [], this._rowCount = 0, this._colCount = 0;
|
|
1105
1120
|
}
|
|
@@ -1126,7 +1141,7 @@ var te = class {
|
|
|
1126
1141
|
return e < 0 || e >= this._rowCount || t < 0 || t >= this._colCount ? this.activeCell : (!this.rangeAnchor && this.activeCell && (this.rangeAnchor = { ...this.activeCell }), this.activeCell = {
|
|
1127
1142
|
row: e,
|
|
1128
1143
|
col: t
|
|
1129
|
-
}, this.rangeAnchor && (this.range =
|
|
1144
|
+
}, this.rangeAnchor && (this.range = te({
|
|
1130
1145
|
startRow: this.rangeAnchor.row,
|
|
1131
1146
|
startCol: this.rangeAnchor.col,
|
|
1132
1147
|
endRow: e,
|
|
@@ -1197,7 +1212,7 @@ var te = class {
|
|
|
1197
1212
|
shiftMoveRight() {
|
|
1198
1213
|
return this.activeCell ? this.setActiveWithRange(this.activeCell.row, this.activeCell.col + 1) : null;
|
|
1199
1214
|
}
|
|
1200
|
-
},
|
|
1215
|
+
}, re = class {
|
|
1201
1216
|
constructor() {
|
|
1202
1217
|
this.current = null;
|
|
1203
1218
|
}
|
|
@@ -1218,7 +1233,7 @@ var te = class {
|
|
|
1218
1233
|
let e = this.current;
|
|
1219
1234
|
return this.current = null, e;
|
|
1220
1235
|
}
|
|
1221
|
-
},
|
|
1236
|
+
}, j = class {
|
|
1222
1237
|
constructor() {
|
|
1223
1238
|
this._selected = /* @__PURE__ */ new Set(), this._mode = "multi", this._rowCount = 0;
|
|
1224
1239
|
}
|
|
@@ -1279,7 +1294,7 @@ var te = class {
|
|
|
1279
1294
|
};
|
|
1280
1295
|
//#endregion
|
|
1281
1296
|
//#region src/core/filtering.ts
|
|
1282
|
-
function
|
|
1297
|
+
function ie(e, t, n) {
|
|
1283
1298
|
if (t.length === 0) return Array.from({ length: e.length }, (e, t) => t);
|
|
1284
1299
|
let r = [];
|
|
1285
1300
|
for (let i = 0; i < e.length; i++) {
|
|
@@ -1298,9 +1313,9 @@ function re(e, t, n) {
|
|
|
1298
1313
|
}
|
|
1299
1314
|
//#endregion
|
|
1300
1315
|
//#region src/core/undo.ts
|
|
1301
|
-
var
|
|
1316
|
+
var ae = 100, M = class {
|
|
1302
1317
|
constructor() {
|
|
1303
|
-
this._undoStack = [], this._redoStack = [], this._maxSize =
|
|
1318
|
+
this._undoStack = [], this._redoStack = [], this._maxSize = ae;
|
|
1304
1319
|
}
|
|
1305
1320
|
get maxSize() {
|
|
1306
1321
|
return this._maxSize;
|
|
@@ -1337,7 +1352,7 @@ var ie = 100, A = class {
|
|
|
1337
1352
|
};
|
|
1338
1353
|
//#endregion
|
|
1339
1354
|
//#region src/clipboard/clipboard.ts
|
|
1340
|
-
function
|
|
1355
|
+
function oe(e, t, n) {
|
|
1341
1356
|
let r = [];
|
|
1342
1357
|
for (let i = n.startRow; i <= n.endRow; i++) {
|
|
1343
1358
|
let a = e[i], o = [];
|
|
@@ -1347,22 +1362,37 @@ function ae(e, t, n) {
|
|
|
1347
1362
|
}
|
|
1348
1363
|
r.push(o);
|
|
1349
1364
|
}
|
|
1350
|
-
return
|
|
1365
|
+
return g(r);
|
|
1351
1366
|
}
|
|
1352
|
-
function
|
|
1367
|
+
function N(e, t) {
|
|
1353
1368
|
if (e === "") return null;
|
|
1354
1369
|
switch (t.type) {
|
|
1355
1370
|
case "number": {
|
|
1356
|
-
let t =
|
|
1357
|
-
|
|
1371
|
+
let t = m(e);
|
|
1372
|
+
if (t !== null) return t;
|
|
1373
|
+
let n = Number(e.trim());
|
|
1374
|
+
return e.trim() !== "" && Number.isFinite(n) ? n : e;
|
|
1358
1375
|
}
|
|
1359
1376
|
case "boolean": return e.toLowerCase() === "true" || e === "1";
|
|
1377
|
+
case "date": return p(e) ?? e;
|
|
1360
1378
|
default: return e;
|
|
1361
1379
|
}
|
|
1362
1380
|
}
|
|
1381
|
+
function P(e) {
|
|
1382
|
+
let t = String(e);
|
|
1383
|
+
if (!Number.isFinite(e) || t.includes("e")) return t;
|
|
1384
|
+
let n = new Intl.NumberFormat(l.get()).formatToParts(1.5).find((e) => e.type === "decimal")?.value;
|
|
1385
|
+
return n && n !== "." ? t.replace(".", n) : t;
|
|
1386
|
+
}
|
|
1387
|
+
function se(e) {
|
|
1388
|
+
if (e == null || e === "") return "";
|
|
1389
|
+
if (e instanceof Date) return Number.isNaN(e.getTime()) ? "" : `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
1390
|
+
let t = String(e), n = /^(\d{4}-\d{2}-\d{2})(?:$|T)/.exec(t);
|
|
1391
|
+
return n ? n[1] : t;
|
|
1392
|
+
}
|
|
1363
1393
|
//#endregion
|
|
1364
1394
|
//#region src/export/xlsx-writer.ts
|
|
1365
|
-
var
|
|
1395
|
+
var ce = (() => {
|
|
1366
1396
|
let e = /* @__PURE__ */ new Uint32Array(256);
|
|
1367
1397
|
for (let t = 0; t < 256; t++) {
|
|
1368
1398
|
let n = t;
|
|
@@ -1371,56 +1401,56 @@ var M = (() => {
|
|
|
1371
1401
|
}
|
|
1372
1402
|
return e;
|
|
1373
1403
|
})();
|
|
1374
|
-
function
|
|
1404
|
+
function le(e) {
|
|
1375
1405
|
let t = 4294967295;
|
|
1376
|
-
for (let n = 0; n < e.length; n++) t =
|
|
1406
|
+
for (let n = 0; n < e.length; n++) t = ce[(t ^ e[n]) & 255] ^ t >>> 8;
|
|
1377
1407
|
return (t ^ 4294967295) >>> 0;
|
|
1378
1408
|
}
|
|
1379
|
-
var
|
|
1380
|
-
function
|
|
1409
|
+
var F = new TextEncoder();
|
|
1410
|
+
function ue(e) {
|
|
1381
1411
|
let t = [], n = [], r = 0;
|
|
1382
1412
|
for (let i of e) {
|
|
1383
|
-
let e =
|
|
1413
|
+
let e = F.encode(i.name), a = le(i.data), o = i.data.length, s = new ArrayBuffer(30 + e.length), c = new DataView(s);
|
|
1384
1414
|
c.setUint32(0, 67324752, !0), c.setUint16(4, 20, !0), c.setUint16(6, 0, !0), c.setUint16(8, 0, !0), c.setUint16(10, 0, !0), c.setUint16(12, 33, !0), c.setUint32(14, a, !0), c.setUint32(18, o, !0), c.setUint32(22, o, !0), c.setUint16(26, e.length, !0), c.setUint16(28, 0, !0), new Uint8Array(s, 30).set(e), t.push(new Uint8Array(s)), t.push(i.data);
|
|
1385
1415
|
let l = new ArrayBuffer(46 + e.length), u = new DataView(l);
|
|
1386
1416
|
u.setUint32(0, 33639248, !0), u.setUint16(4, 20, !0), u.setUint16(6, 20, !0), u.setUint16(8, 0, !0), u.setUint16(10, 0, !0), u.setUint16(12, 0, !0), u.setUint16(14, 33, !0), u.setUint32(16, a, !0), u.setUint32(20, o, !0), u.setUint32(24, o, !0), u.setUint16(28, e.length, !0), u.setUint16(30, 0, !0), u.setUint16(32, 0, !0), u.setUint16(34, 0, !0), u.setUint16(36, 0, !0), u.setUint32(38, 0, !0), u.setUint32(42, r, !0), new Uint8Array(l, 46).set(e), n.push(new Uint8Array(l)), r += 30 + e.length + o;
|
|
1387
1417
|
}
|
|
1388
|
-
let i =
|
|
1389
|
-
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),
|
|
1418
|
+
let i = I(n), a = /* @__PURE__ */ new ArrayBuffer(22), o = new DataView(a);
|
|
1419
|
+
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), I([
|
|
1390
1420
|
...t,
|
|
1391
1421
|
i,
|
|
1392
1422
|
new Uint8Array(a)
|
|
1393
1423
|
]);
|
|
1394
1424
|
}
|
|
1395
|
-
function
|
|
1425
|
+
function I(e) {
|
|
1396
1426
|
let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
|
|
1397
1427
|
for (let t of e) n.set(t, r), r += t.length;
|
|
1398
1428
|
return n;
|
|
1399
1429
|
}
|
|
1400
|
-
function
|
|
1430
|
+
function L(e) {
|
|
1401
1431
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1402
1432
|
}
|
|
1403
|
-
function
|
|
1433
|
+
function de(e) {
|
|
1404
1434
|
let t = "";
|
|
1405
1435
|
for (e++; e > 0;) t = String.fromCharCode(64 + (e % 26 || 26)) + t, e = Math.floor((e - 1) / 26);
|
|
1406
1436
|
return t;
|
|
1407
1437
|
}
|
|
1408
|
-
function
|
|
1409
|
-
return
|
|
1438
|
+
function R(e, t) {
|
|
1439
|
+
return de(t) + (e + 1);
|
|
1410
1440
|
}
|
|
1411
|
-
function
|
|
1441
|
+
function fe(e) {
|
|
1412
1442
|
let t = Date.UTC(1899, 11, 30);
|
|
1413
1443
|
return (e.getTime() - t) / 864e5;
|
|
1414
1444
|
}
|
|
1415
|
-
var
|
|
1416
|
-
function
|
|
1417
|
-
let n = [], r = t.map((e, t) => `<c r="${
|
|
1445
|
+
var pe = "<?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>", me = "<?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>", z = "<?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>", he = "<?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>", ge = "<?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>";
|
|
1446
|
+
function _e(e, t) {
|
|
1447
|
+
let n = [], r = t.map((e, t) => `<c r="${R(0, t)}" t="str" s="2"><v>${L(e.label)}</v></c>`);
|
|
1418
1448
|
return n.push(`<row r="1">${r.join("")}</row>`), e.forEach((e, r) => {
|
|
1419
1449
|
let i = t.map((t, n) => {
|
|
1420
|
-
let i =
|
|
1450
|
+
let i = R(r + 1, n), a = e[t.key];
|
|
1421
1451
|
if (a == null) return `<c r="${i}" t="str"><v></v></c>`;
|
|
1422
1452
|
let o = t.type ?? "text";
|
|
1423
|
-
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>${
|
|
1453
|
+
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>${fe(a).toFixed(6)}</v></c>` : o === "boolean" ? `<c r="${i}" t="b"><v>${+!!a}</v></c>` : `<c r="${i}" t="str"><v>${L(String(a))}</v></c>`;
|
|
1424
1454
|
});
|
|
1425
1455
|
n.push(`<row r="${r + 2}">${i.join("")}</row>`);
|
|
1426
1456
|
}), `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
@@ -1428,32 +1458,32 @@ function R(e, t) {
|
|
|
1428
1458
|
<sheetData>${n.join("")}</sheetData>
|
|
1429
1459
|
</worksheet>`;
|
|
1430
1460
|
}
|
|
1431
|
-
function
|
|
1432
|
-
let n =
|
|
1433
|
-
return
|
|
1461
|
+
function ve(e, t) {
|
|
1462
|
+
let n = _e(e, t);
|
|
1463
|
+
return ue([
|
|
1434
1464
|
{
|
|
1435
1465
|
name: "[Content_Types].xml",
|
|
1436
|
-
data:
|
|
1466
|
+
data: F.encode(pe)
|
|
1437
1467
|
},
|
|
1438
1468
|
{
|
|
1439
1469
|
name: "_rels/.rels",
|
|
1440
|
-
data:
|
|
1470
|
+
data: F.encode(me)
|
|
1441
1471
|
},
|
|
1442
1472
|
{
|
|
1443
1473
|
name: "xl/workbook.xml",
|
|
1444
|
-
data:
|
|
1474
|
+
data: F.encode(z)
|
|
1445
1475
|
},
|
|
1446
1476
|
{
|
|
1447
1477
|
name: "xl/_rels/workbook.xml.rels",
|
|
1448
|
-
data:
|
|
1478
|
+
data: F.encode(he)
|
|
1449
1479
|
},
|
|
1450
1480
|
{
|
|
1451
1481
|
name: "xl/worksheets/sheet1.xml",
|
|
1452
|
-
data:
|
|
1482
|
+
data: F.encode(n)
|
|
1453
1483
|
},
|
|
1454
1484
|
{
|
|
1455
1485
|
name: "xl/styles.xml",
|
|
1456
|
-
data:
|
|
1486
|
+
data: F.encode(ge)
|
|
1457
1487
|
}
|
|
1458
1488
|
]);
|
|
1459
1489
|
}
|
|
@@ -1463,20 +1493,20 @@ function B(e, t, n) {
|
|
|
1463
1493
|
switch (n) {
|
|
1464
1494
|
case "csv": return V(e, t, ",");
|
|
1465
1495
|
case "tsv": return V(e, t, " ");
|
|
1466
|
-
case "json": return
|
|
1467
|
-
case "xlsx": return
|
|
1496
|
+
case "json": return be(e, t);
|
|
1497
|
+
case "xlsx": return ve(e, t);
|
|
1468
1498
|
}
|
|
1469
1499
|
}
|
|
1470
|
-
function
|
|
1500
|
+
function ye(e, t) {
|
|
1471
1501
|
return e == null ? "" : (t.type === "date" || t.type === "datetime") && e instanceof Date ? e.toISOString() : String(e);
|
|
1472
1502
|
}
|
|
1473
1503
|
function V(e, t, n) {
|
|
1474
|
-
return [t.map((e) => H(e.label, n)).join(n), ...e.map((e) => t.map((t) => H(
|
|
1504
|
+
return [t.map((e) => H(e.label, n)).join(n), ...e.map((e) => t.map((t) => H(ye(e[t.key], t), n)).join(n))].join("\n");
|
|
1475
1505
|
}
|
|
1476
1506
|
function H(e, t) {
|
|
1477
1507
|
return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? "\"" + e.replace(/"/g, "\"\"") + "\"" : e;
|
|
1478
1508
|
}
|
|
1479
|
-
function
|
|
1509
|
+
function be(e, t) {
|
|
1480
1510
|
let n = e.map((e) => {
|
|
1481
1511
|
let n = {};
|
|
1482
1512
|
for (let r of t) {
|
|
@@ -1487,35 +1517,35 @@ function he(e, t) {
|
|
|
1487
1517
|
});
|
|
1488
1518
|
return JSON.stringify(n, null, 2);
|
|
1489
1519
|
}
|
|
1490
|
-
function
|
|
1520
|
+
function xe(e, t, n) {
|
|
1491
1521
|
let r = new Blob([e], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
1492
1522
|
a.href = i, a.download = t, a.style.display = "none", document.body.appendChild(a), a.click(), document.body.removeChild(a), setTimeout(() => URL.revokeObjectURL(i), 100);
|
|
1493
1523
|
}
|
|
1494
|
-
var
|
|
1524
|
+
var Se = {
|
|
1495
1525
|
csv: "text/csv;charset=utf-8",
|
|
1496
1526
|
tsv: "text/tab-separated-values;charset=utf-8",
|
|
1497
1527
|
json: "application/json;charset=utf-8",
|
|
1498
1528
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
1499
|
-
},
|
|
1529
|
+
}, Ce = {
|
|
1500
1530
|
csv: ".csv",
|
|
1501
1531
|
tsv: ".tsv",
|
|
1502
1532
|
json: ".json",
|
|
1503
1533
|
xlsx: ".xlsx"
|
|
1504
1534
|
};
|
|
1505
|
-
function
|
|
1506
|
-
return
|
|
1535
|
+
function we(e) {
|
|
1536
|
+
return Se[e];
|
|
1507
1537
|
}
|
|
1508
|
-
function
|
|
1509
|
-
return
|
|
1538
|
+
function Te(e) {
|
|
1539
|
+
return Ce[e];
|
|
1510
1540
|
}
|
|
1511
1541
|
//#endregion
|
|
1512
1542
|
//#region src/export/xlsx-reader.ts
|
|
1513
|
-
function
|
|
1543
|
+
function Ee(e) {
|
|
1514
1544
|
for (let t = e.byteLength - 22; t >= 0; t--) if (e.getUint32(t, !0) === 101010256) return t;
|
|
1515
1545
|
throw Error("XLSX: End of central directory not found — not a valid ZIP file");
|
|
1516
1546
|
}
|
|
1517
|
-
function
|
|
1518
|
-
let t =
|
|
1547
|
+
function De(e) {
|
|
1548
|
+
let t = Ee(e), n = e.getUint32(t + 16, !0), r = e.getUint32(t + 12, !0), i = new TextDecoder("utf-8"), a = [], o = n, s = n + r;
|
|
1519
1549
|
for (; o < s && e.getUint32(o, !0) === 33639248;) {
|
|
1520
1550
|
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));
|
|
1521
1551
|
a.push({
|
|
@@ -1528,7 +1558,7 @@ function Se(e) {
|
|
|
1528
1558
|
}
|
|
1529
1559
|
return a;
|
|
1530
1560
|
}
|
|
1531
|
-
async function
|
|
1561
|
+
async function Oe(e) {
|
|
1532
1562
|
let t = new DecompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
|
|
1533
1563
|
n.write(e), n.close();
|
|
1534
1564
|
let i = [];
|
|
@@ -1541,28 +1571,28 @@ async function Ce(e) {
|
|
|
1541
1571
|
for (let e of i) o.set(e, s), s += e.length;
|
|
1542
1572
|
return o;
|
|
1543
1573
|
}
|
|
1544
|
-
async function
|
|
1574
|
+
async function ke(e, t) {
|
|
1545
1575
|
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);
|
|
1546
1576
|
if (t.compressionMethod === 0) return o.slice();
|
|
1547
|
-
if (t.compressionMethod === 8) return
|
|
1577
|
+
if (t.compressionMethod === 8) return Oe(o);
|
|
1548
1578
|
throw Error(`XLSX: Unsupported compression method ${t.compressionMethod}`);
|
|
1549
1579
|
}
|
|
1550
|
-
async function
|
|
1551
|
-
let t = new DataView(e), n =
|
|
1552
|
-
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await
|
|
1580
|
+
async function Ae(e) {
|
|
1581
|
+
let t = new DataView(e), n = De(t), r = /* @__PURE__ */ new Map();
|
|
1582
|
+
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await ke(t, e));
|
|
1553
1583
|
return r;
|
|
1554
1584
|
}
|
|
1555
|
-
var
|
|
1585
|
+
var je = new TextDecoder("utf-8");
|
|
1556
1586
|
function U(e) {
|
|
1557
|
-
let t =
|
|
1587
|
+
let t = je.decode(e);
|
|
1558
1588
|
return new DOMParser().parseFromString(t, "application/xml");
|
|
1559
1589
|
}
|
|
1560
|
-
function
|
|
1590
|
+
function Me(e) {
|
|
1561
1591
|
if (!e) return [];
|
|
1562
1592
|
let t = U(e);
|
|
1563
1593
|
return Array.from(t.querySelectorAll("si")).map((e) => Array.from(e.querySelectorAll("t")).map((e) => e.textContent ?? "").join(""));
|
|
1564
1594
|
}
|
|
1565
|
-
var
|
|
1595
|
+
var Ne = /* @__PURE__ */ new Set([
|
|
1566
1596
|
14,
|
|
1567
1597
|
15,
|
|
1568
1598
|
16,
|
|
@@ -1582,29 +1612,29 @@ var Oe = /* @__PURE__ */ new Set([
|
|
|
1582
1612
|
57,
|
|
1583
1613
|
58
|
|
1584
1614
|
]);
|
|
1585
|
-
function
|
|
1615
|
+
function Pe(e) {
|
|
1586
1616
|
let t = e.replace(/"[^"]*"/g, "").replace(/\\./g, "").replace(/\[[^\]]*\]/g, "").split(";")[0];
|
|
1587
1617
|
return /[dy]/i.test(t);
|
|
1588
1618
|
}
|
|
1589
|
-
function
|
|
1619
|
+
function Fe(e) {
|
|
1590
1620
|
let t = /* @__PURE__ */ new Set();
|
|
1591
1621
|
if (!e) return t;
|
|
1592
1622
|
let n = U(e), r = /* @__PURE__ */ new Map();
|
|
1593
1623
|
for (let e of Array.from(n.querySelectorAll("numFmts > numFmt"))) r.set(parseInt(e.getAttribute("numFmtId") ?? "", 10), e.getAttribute("formatCode") ?? "");
|
|
1594
1624
|
return Array.from(n.querySelectorAll("cellXfs > xf")).forEach((e, n) => {
|
|
1595
1625
|
let i = parseInt(e.getAttribute("numFmtId") ?? "0", 10), a = r.get(i);
|
|
1596
|
-
(a === void 0 ?
|
|
1626
|
+
(a === void 0 ? Ne.has(i) : Pe(a)) && t.add(n);
|
|
1597
1627
|
}), t;
|
|
1598
1628
|
}
|
|
1599
|
-
function
|
|
1629
|
+
function Ie(e) {
|
|
1600
1630
|
if (!e) return !1;
|
|
1601
1631
|
let t = U(e).querySelector("workbookPr")?.getAttribute("date1904");
|
|
1602
1632
|
return t === "1" || t === "true";
|
|
1603
1633
|
}
|
|
1604
|
-
function
|
|
1634
|
+
function W(e, t) {
|
|
1605
1635
|
return new Date((t ? Date.UTC(1904, 0, 1) : Date.UTC(1899, 11, 30)) + Math.floor(e) * 864e5).toISOString().slice(0, 10);
|
|
1606
1636
|
}
|
|
1607
|
-
function
|
|
1637
|
+
function Le(e, t, n, r) {
|
|
1608
1638
|
let i = U(e).querySelectorAll("row");
|
|
1609
1639
|
if (i.length === 0) return [];
|
|
1610
1640
|
let a = 0, o = /* @__PURE__ */ new Map();
|
|
@@ -1612,7 +1642,7 @@ function Ne(e, t, n, r) {
|
|
|
1612
1642
|
let i = parseInt(e.getAttribute("r") ?? "1", 10) - 1, s = /* @__PURE__ */ new Map();
|
|
1613
1643
|
o.set(i, s);
|
|
1614
1644
|
for (let i of e.querySelectorAll("c")) {
|
|
1615
|
-
let e =
|
|
1645
|
+
let e = Re(i.getAttribute("r") ?? "");
|
|
1616
1646
|
e > a && (a = e);
|
|
1617
1647
|
let o = i.getAttribute("t") ?? "", c = i.getAttribute("s") ?? "", l = i.querySelector("v")?.textContent ?? "", u = i.querySelector("is > t")?.textContent ?? null, d;
|
|
1618
1648
|
if (o === "s") d = t[parseInt(l, 10)] ?? "";
|
|
@@ -1621,7 +1651,7 @@ function Ne(e, t, n, r) {
|
|
|
1621
1651
|
else if (l === "") d = "";
|
|
1622
1652
|
else {
|
|
1623
1653
|
let e = parseFloat(l);
|
|
1624
|
-
d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ?
|
|
1654
|
+
d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ? W(e, r) : l;
|
|
1625
1655
|
}
|
|
1626
1656
|
s.set(e, d);
|
|
1627
1657
|
}
|
|
@@ -1635,13 +1665,13 @@ function Ne(e, t, n, r) {
|
|
|
1635
1665
|
}
|
|
1636
1666
|
return c;
|
|
1637
1667
|
}
|
|
1638
|
-
function
|
|
1668
|
+
function Re(e) {
|
|
1639
1669
|
let t = 0, n = 0;
|
|
1640
1670
|
for (; n < e.length && e[n] >= "A" && e[n] <= "Z";) t = t * 26 + (e.charCodeAt(n) - 64), n++;
|
|
1641
1671
|
return t - 1;
|
|
1642
1672
|
}
|
|
1643
|
-
async function
|
|
1644
|
-
let t = await
|
|
1673
|
+
async function ze(e) {
|
|
1674
|
+
let t = await Ae(e), n = Me(t.get("xl/sharedStrings.xml")), r = t.get("xl/worksheets/sheet1.xml");
|
|
1645
1675
|
if (!r) {
|
|
1646
1676
|
for (let [e, n] of t) if (e.toLowerCase().includes("worksheets/sheet")) {
|
|
1647
1677
|
r = n;
|
|
@@ -1649,7 +1679,7 @@ async function Pe(e) {
|
|
|
1649
1679
|
}
|
|
1650
1680
|
}
|
|
1651
1681
|
if (!r) throw Error("XLSX: No worksheet found");
|
|
1652
|
-
let i =
|
|
1682
|
+
let i = Fe(t.get("xl/styles.xml")), a = Ie(t.get("xl/workbook.xml")), o = Le(r, n, i, a);
|
|
1653
1683
|
return o.length === 0 ? {
|
|
1654
1684
|
headers: [],
|
|
1655
1685
|
rows: []
|
|
@@ -1664,7 +1694,7 @@ function G(e) {
|
|
|
1664
1694
|
return e.align ? e.align : e.type === "number" ? "end" : e.type === "boolean" ? "center" : "start";
|
|
1665
1695
|
}
|
|
1666
1696
|
//#endregion
|
|
1667
|
-
//#region \0@oxc-project+runtime@0.
|
|
1697
|
+
//#region \0@oxc-project+runtime@0.152.0/helpers/esm/decorate.js
|
|
1668
1698
|
function K(e, t, n, r) {
|
|
1669
1699
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
1670
1700
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
@@ -1680,14 +1710,14 @@ var q = {
|
|
|
1680
1710
|
lt: "<",
|
|
1681
1711
|
gte: "≥",
|
|
1682
1712
|
lte: "≤"
|
|
1683
|
-
}, J = 120, Y = 40, X = 20, Z = 32, Q = 5,
|
|
1713
|
+
}, J = 120, Y = 40, X = 20, Z = 32, Q = 5, Be = 200, $ = class extends n {
|
|
1684
1714
|
constructor(...e) {
|
|
1685
|
-
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this._rowHeightFromCss = Z, this.showRowNumbers = !1, this.theme = void 0, this.maxRows = 0, this.editable = !0, this.showFilters = !1, this.showContextMenu = !1, this.frozenRows = 0, this.emptyMessage = "No data", this.noMatchingMessage = "No matching data", 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._editingCell = null, this._sortCriteria = [], this._selection = new
|
|
1715
|
+
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this._rowHeightFromCss = Z, this.showRowNumbers = !1, this.theme = void 0, this.maxRows = 0, this.editable = !0, this.showFilters = !1, this.showContextMenu = !1, this.frozenRows = 0, this.emptyMessage = "No data", this.noMatchingMessage = "No matching data", 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._editingCell = null, this._sortCriteria = [], this._selection = new ne(), this._editing = new re(), this._rowSelection = new j(), this._undo = new M(), this._filters = [], this._filteredIndices = [], this._sortedIndices = [], this._openFilterKey = null, this._rowSelectionVersion = 0, this._lastCheckboxRowIndex = 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._warnedUnconstrained = !1, this._onCommentPopupOutsideClick = () => {
|
|
1686
1716
|
this._commitCommentPopup();
|
|
1687
1717
|
}, 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();
|
|
1688
1718
|
}
|
|
1689
1719
|
static {
|
|
1690
|
-
this.styles =
|
|
1720
|
+
this.styles = v;
|
|
1691
1721
|
}
|
|
1692
1722
|
get data() {
|
|
1693
1723
|
return this._data;
|
|
@@ -2052,7 +2082,7 @@ var q = {
|
|
|
2052
2082
|
return B(this._sortedIndices.map((e) => this.data[e]), this.visibleColumns, e);
|
|
2053
2083
|
}
|
|
2054
2084
|
exportToFile(e, t) {
|
|
2055
|
-
|
|
2085
|
+
xe(this.exportToString(e), t ?? `export${Te(e)}`, we(e));
|
|
2056
2086
|
}
|
|
2057
2087
|
setComment(e, t, n) {
|
|
2058
2088
|
let r = this.getComment(e, t);
|
|
@@ -2109,10 +2139,10 @@ var q = {
|
|
|
2109
2139
|
async importFromFile(e) {
|
|
2110
2140
|
let t = e.name.toLowerCase();
|
|
2111
2141
|
if (t.endsWith(".xlsx")) {
|
|
2112
|
-
let t = await
|
|
2142
|
+
let t = await ze(await e.arrayBuffer());
|
|
2113
2143
|
this._applyImportedSheet(t);
|
|
2114
2144
|
} else if (t.endsWith(".csv") || t.endsWith(".tsv")) {
|
|
2115
|
-
let t = await e.text(), n =
|
|
2145
|
+
let t = await e.text(), n = h(t);
|
|
2116
2146
|
this._applyImportedRows(n);
|
|
2117
2147
|
} else console.warn(`flex-table importFromFile: unsupported file type "${e.name}"`);
|
|
2118
2148
|
}
|
|
@@ -2123,7 +2153,7 @@ var q = {
|
|
|
2123
2153
|
let a = t.get(e);
|
|
2124
2154
|
if (!a) return;
|
|
2125
2155
|
let o = this.columns.find((e) => e.key === a);
|
|
2126
|
-
r[a] = o ?
|
|
2156
|
+
r[a] = o ? N(n[i] ?? "", o) : n[i] ?? null;
|
|
2127
2157
|
}), r;
|
|
2128
2158
|
}), r = [...this.data];
|
|
2129
2159
|
this.data = n, this._undo.push({
|
|
@@ -2148,7 +2178,7 @@ var q = {
|
|
|
2148
2178
|
let a = n.get(t);
|
|
2149
2179
|
if (!a) return;
|
|
2150
2180
|
let o = this.columns.find((e) => e.key === a);
|
|
2151
|
-
r[a] = o ?
|
|
2181
|
+
r[a] = o ? N(e[i] ?? "", o) : e[i] ?? null;
|
|
2152
2182
|
}), r;
|
|
2153
2183
|
}), i = [...this.data];
|
|
2154
2184
|
this.data = r, this._undo.push({
|
|
@@ -2302,7 +2332,7 @@ var q = {
|
|
|
2302
2332
|
this._filteredIndices = Array.from({ length: this.data.length }, (e, t) => t), this._sortedIndices = this._filteredIndices;
|
|
2303
2333
|
return;
|
|
2304
2334
|
}
|
|
2305
|
-
if (this._filteredIndices =
|
|
2335
|
+
if (this._filteredIndices = ie(this.data, this._filters, (e, t, n) => {
|
|
2306
2336
|
this.dispatchEvent(new CustomEvent("filter-error", {
|
|
2307
2337
|
detail: {
|
|
2308
2338
|
error: e,
|
|
@@ -2325,14 +2355,14 @@ var q = {
|
|
|
2325
2355
|
_focusEditor() {
|
|
2326
2356
|
if (!this._editingCell) return;
|
|
2327
2357
|
let e = this.shadowRoot?.querySelector(".ft-editor");
|
|
2328
|
-
e && document.activeElement !== e && (e.focus(),
|
|
2358
|
+
e && document.activeElement !== e && (e.focus(), e.type === "text" && e.select());
|
|
2329
2359
|
}
|
|
2330
2360
|
_measureViewport() {
|
|
2331
2361
|
let e = this.clientHeight, t = this.clientWidth;
|
|
2332
2362
|
e !== this._viewportHeight && (this._viewportHeight = e), t !== this._viewportWidth && (this._viewportWidth = t), this._warnIfUnconstrained();
|
|
2333
2363
|
}
|
|
2334
2364
|
_warnIfUnconstrained() {
|
|
2335
|
-
this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount <
|
|
2365
|
+
this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount < Be || 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.`));
|
|
2336
2366
|
}
|
|
2337
2367
|
_onScroll() {
|
|
2338
2368
|
this._scrollTop = this.scrollTop, this._scrollLeft = this.scrollLeft;
|
|
@@ -2462,7 +2492,7 @@ var q = {
|
|
|
2462
2492
|
}
|
|
2463
2493
|
let t = this.shadowRoot?.querySelector(".ft-editor");
|
|
2464
2494
|
if (t) {
|
|
2465
|
-
let n =
|
|
2495
|
+
let n = N(t.value, e);
|
|
2466
2496
|
this._applyEdit(n);
|
|
2467
2497
|
} else this._cancelEdit();
|
|
2468
2498
|
}
|
|
@@ -2472,7 +2502,22 @@ var q = {
|
|
|
2472
2502
|
if (this._editingCell = null, !t) return;
|
|
2473
2503
|
let { row: n, col: r } = t.position, i = this._toDataIndex(n), a = this.visibleColumns[r], o = t.originalValue;
|
|
2474
2504
|
if (a.autocomplete === "strict" && e != null && e !== "" && !this._getAutocompleteCandidates(a, "").includes(String(e))) {
|
|
2475
|
-
let t = "
|
|
2505
|
+
let t = A("notInList");
|
|
2506
|
+
this._markCellInvalid(n, r, t), this.dispatchEvent(new CustomEvent("validation-error", {
|
|
2507
|
+
detail: {
|
|
2508
|
+
row: i,
|
|
2509
|
+
col: r,
|
|
2510
|
+
key: a.key,
|
|
2511
|
+
value: e,
|
|
2512
|
+
error: t
|
|
2513
|
+
},
|
|
2514
|
+
bubbles: !0,
|
|
2515
|
+
composed: !0
|
|
2516
|
+
}));
|
|
2517
|
+
return;
|
|
2518
|
+
}
|
|
2519
|
+
if (a.type === "number" && typeof e == "string" || a.type === "date" && typeof e == "string" && p(e) === null) {
|
|
2520
|
+
let t = A(a.type === "number" ? "notANumber" : "notADate");
|
|
2476
2521
|
this._markCellInvalid(n, r, t), this.dispatchEvent(new CustomEvent("validation-error", {
|
|
2477
2522
|
detail: {
|
|
2478
2523
|
row: i,
|
|
@@ -2536,7 +2581,7 @@ var q = {
|
|
|
2536
2581
|
}));
|
|
2537
2582
|
}
|
|
2538
2583
|
_onEditorKeyDown(e) {
|
|
2539
|
-
if (!
|
|
2584
|
+
if (!_(e)) {
|
|
2540
2585
|
if (this._autocompleteState && this._autocompleteState.candidates.length > 0) {
|
|
2541
2586
|
if (e.key === "ArrowDown") {
|
|
2542
2587
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -2604,7 +2649,7 @@ var q = {
|
|
|
2604
2649
|
].includes(t) && this._handleCtrlKey(e)) return;
|
|
2605
2650
|
}
|
|
2606
2651
|
if (t.length !== 0 && this._visibleRowCount !== 0) {
|
|
2607
|
-
if ((e.key === "Enter" || e.key === "F2") && this._activeCell && !
|
|
2652
|
+
if ((e.key === "Enter" || e.key === "F2") && this._activeCell && !_(e)) {
|
|
2608
2653
|
e.preventDefault();
|
|
2609
2654
|
let n = t[this._activeCell.col];
|
|
2610
2655
|
n && this._isCellEditable(n) ? this._startEdit() : e.key === "Enter" && this._fireRowActivate(n);
|
|
@@ -2692,7 +2737,7 @@ var q = {
|
|
|
2692
2737
|
async _handleCopy(e) {
|
|
2693
2738
|
let t = this._selection.getEffectiveRange();
|
|
2694
2739
|
if (!t) return;
|
|
2695
|
-
let n = this.visibleColumns, r =
|
|
2740
|
+
let n = this.visibleColumns, r = oe(this._sortedIndices.map((e) => this.data[e]), n, t);
|
|
2696
2741
|
try {
|
|
2697
2742
|
await navigator.clipboard.writeText(r);
|
|
2698
2743
|
} catch (e) {
|
|
@@ -2718,7 +2763,7 @@ var q = {
|
|
|
2718
2763
|
if (!this._activeCell) return;
|
|
2719
2764
|
let e = await this._readClipboardText();
|
|
2720
2765
|
if (e == null) return;
|
|
2721
|
-
let t =
|
|
2766
|
+
let t = h(e);
|
|
2722
2767
|
if (t.length === 0) return;
|
|
2723
2768
|
let n = this._expandRowsForPaste(this._activeCell.row, t.length), r = this._applyPasteData(this._activeCell, t);
|
|
2724
2769
|
if (r.length > 0 || n.length > 0) {
|
|
@@ -2776,7 +2821,7 @@ var q = {
|
|
|
2776
2821
|
for (let a = 0; a < t[i].length; a++) {
|
|
2777
2822
|
let s = e.col + a;
|
|
2778
2823
|
if (s >= n.length) break;
|
|
2779
|
-
let c = n[s], l = this.data[o][c.key], u =
|
|
2824
|
+
let c = n[s], l = this.data[o][c.key], u = N(t[i][a], c);
|
|
2780
2825
|
this.data[o][c.key] = u, r.push({
|
|
2781
2826
|
row: o,
|
|
2782
2827
|
col: s,
|
|
@@ -2841,7 +2886,7 @@ var q = {
|
|
|
2841
2886
|
for (let r = e.startCol + 1; r <= e.endCol; r++) {
|
|
2842
2887
|
let e = t[r];
|
|
2843
2888
|
if (!e || !this._isCellEditable(e)) continue;
|
|
2844
|
-
let a =
|
|
2889
|
+
let a = N(o == null ? "" : String(o), e);
|
|
2845
2890
|
n.push({
|
|
2846
2891
|
row: i,
|
|
2847
2892
|
key: e.key,
|
|
@@ -3001,7 +3046,7 @@ var q = {
|
|
|
3001
3046
|
@click=${n ? (t) => this._onHeaderClick(t, e) : void 0}>
|
|
3002
3047
|
${C ? i`
|
|
3003
3048
|
<button class="ft-hidden-col-indicator"
|
|
3004
|
-
title=${
|
|
3049
|
+
title=${A("showHiddenColumns")}
|
|
3005
3050
|
@click=${(t) => {
|
|
3006
3051
|
t.stopPropagation(), this._showHiddenBefore(e);
|
|
3007
3052
|
}}>❯</button>
|
|
@@ -3011,8 +3056,8 @@ var q = {
|
|
|
3011
3056
|
${o >= 0 ? i`<span class="ft-sort-order">${o + 1}</span>` : ""}
|
|
3012
3057
|
<button class="ft-column-menu-btn ${s ? "ft-filter-active" : ""}"
|
|
3013
3058
|
type="button"
|
|
3014
|
-
title=${
|
|
3015
|
-
aria-label=${
|
|
3059
|
+
title=${A("columnMenu")}
|
|
3060
|
+
aria-label=${A("columnMenuFor", { header: e.label })}
|
|
3016
3061
|
aria-haspopup="menu"
|
|
3017
3062
|
aria-expanded=${this._headerMenu?.key === e.key ? "true" : "false"}
|
|
3018
3063
|
@mousedown=${(e) => e.stopPropagation()}
|
|
@@ -3131,26 +3176,26 @@ var q = {
|
|
|
3131
3176
|
}}>${t}</button>
|
|
3132
3177
|
`;
|
|
3133
3178
|
return i`
|
|
3134
|
-
<div class="ft-header-menu" role="menu" aria-label=${
|
|
3179
|
+
<div class="ft-header-menu" role="menu" aria-label=${A("columnMenuRegion", { header: o.label })}
|
|
3135
3180
|
style="position: fixed; left: ${t}px; top: ${n}px; z-index: var(--u-layer-floating, 1000);"
|
|
3136
3181
|
@mousedown=${(e) => e.stopPropagation()}
|
|
3137
3182
|
@keydown=${(e) => this._onHeaderMenuKeydown(e)}>
|
|
3138
3183
|
${o.sortable === !1 ? a : i`
|
|
3139
|
-
${c("sort-asc",
|
|
3140
|
-
${c("sort-desc",
|
|
3184
|
+
${c("sort-asc", A("sortAscending"), () => this._applySortFromMenu(e, "asc"))}
|
|
3185
|
+
${c("sort-desc", A("sortDescending"), () => this._applySortFromMenu(e, "desc"))}
|
|
3141
3186
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3142
3187
|
`}
|
|
3143
3188
|
${this.showFilters ? i`
|
|
3144
|
-
${c("filter",
|
|
3145
|
-
${s ? c("clear-filter",
|
|
3189
|
+
${c("filter", A("filter"), () => this._openFilterFromMenu(e))}
|
|
3190
|
+
${s ? c("clear-filter", A("clearFilter"), () => this._clearColumnFilter(e)) : a}
|
|
3146
3191
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3147
3192
|
` : a}
|
|
3148
|
-
${c("hide",
|
|
3149
|
-
${r.map((e) => c("show",
|
|
3193
|
+
${c("hide", A("hideColumn"), () => this._setColumnHidden(e, !0))}
|
|
3194
|
+
${r.map((e) => c("show", A("showColumn", { header: e.label }), () => this._setColumnHidden(e.key, !1)))}
|
|
3150
3195
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3151
|
-
${c("autofit",
|
|
3152
|
-
${c("wider",
|
|
3153
|
-
${c("narrower",
|
|
3196
|
+
${c("autofit", A("autoFitWidth"), () => this._autoFitColumn(e))}
|
|
3197
|
+
${c("wider", A("wider"), () => this._resizeColumnBy(e, X), !0)}
|
|
3198
|
+
${c("narrower", A("narrower"), () => this._resizeColumnBy(e, -20), !0)}
|
|
3154
3199
|
</div>
|
|
3155
3200
|
`;
|
|
3156
3201
|
}
|
|
@@ -3168,26 +3213,26 @@ var q = {
|
|
|
3168
3213
|
}}>${e}</button>
|
|
3169
3214
|
`, f = i`<div class="ft-context-menu-separator" role="separator"></div>`;
|
|
3170
3215
|
return i`
|
|
3171
|
-
<div class="ft-body-context-menu" role="menu" aria-label=${
|
|
3216
|
+
<div class="ft-body-context-menu" role="menu" aria-label=${A("cellActions")}
|
|
3172
3217
|
style="position: fixed; left: ${n}px; top: ${r}px; z-index: var(--u-layer-floating, 1000);"
|
|
3173
3218
|
@mousedown=${(e) => e.stopPropagation()}
|
|
3174
3219
|
@keydown=${(e) => this._onMenuKeydown(e, ".ft-body-context-menu", l)}>
|
|
3175
|
-
${d(
|
|
3220
|
+
${d(A("copy"), () => this._handleCopy(!1))}
|
|
3176
3221
|
${f}
|
|
3177
|
-
${d(
|
|
3178
|
-
${d(
|
|
3179
|
-
${d(
|
|
3222
|
+
${d(A("insertRowAbove"), () => this.addRow(void 0, t))}
|
|
3223
|
+
${d(A("insertRowBelow"), () => this.addRow(void 0, t + 1))}
|
|
3224
|
+
${d(A("deleteRow"), () => this.deleteRows([t]), !0)}
|
|
3180
3225
|
${f}
|
|
3181
|
-
${d(
|
|
3226
|
+
${d(A("hideColumn"), () => this._setColumnHidden(o.key, !0))}
|
|
3182
3227
|
${f}
|
|
3183
|
-
${d(`${
|
|
3184
|
-
${d(`${
|
|
3228
|
+
${d(`${A("sortAscending")} ↑`, () => this._applySortFromMenu(o.key, "asc"))}
|
|
3229
|
+
${d(`${A("sortDescending")} ↓`, () => this._applySortFromMenu(o.key, "desc"))}
|
|
3185
3230
|
${f}
|
|
3186
|
-
${d(
|
|
3187
|
-
${c ? d(
|
|
3231
|
+
${d(A("filterByThisValue"), () => this.setFilter(o.key, (e) => e === s))}
|
|
3232
|
+
${c ? d(A("clearFilter"), () => this.removeFilter(o.key)) : a}
|
|
3188
3233
|
${f}
|
|
3189
|
-
${d(
|
|
3190
|
-
${u ? d(
|
|
3234
|
+
${d(A(u ? "editComment" : "addComment"), () => this._openCommentPopup(t, o.key, n, r))}
|
|
3235
|
+
${u ? d(A("deleteComment"), () => this.setComment(t, o.key, null), !0) : a}
|
|
3191
3236
|
</div>
|
|
3192
3237
|
`;
|
|
3193
3238
|
}
|
|
@@ -3219,13 +3264,13 @@ var q = {
|
|
|
3219
3264
|
@mousedown=${(e) => e.stopPropagation()}>
|
|
3220
3265
|
<textarea class="ft-comment-popup-textarea"
|
|
3221
3266
|
rows="4"
|
|
3222
|
-
placeholder=${
|
|
3267
|
+
placeholder=${A("addCommentPlaceholder")}
|
|
3223
3268
|
@keydown=${(e) => {
|
|
3224
3269
|
e.key === "Escape" && (e.preventDefault(), this._cancelCommentPopup()), e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), this._commitCommentPopup());
|
|
3225
3270
|
}}></textarea>
|
|
3226
3271
|
<div class="ft-comment-popup-buttons">
|
|
3227
|
-
<button class="ft-comment-popup-cancel" @click=${() => this._cancelCommentPopup()}>${
|
|
3228
|
-
<button class="ft-comment-popup-save" @click=${() => this._commitCommentPopup()}>${
|
|
3272
|
+
<button class="ft-comment-popup-cancel" @click=${() => this._cancelCommentPopup()}>${A("cancel")}</button>
|
|
3273
|
+
<button class="ft-comment-popup-save" @click=${() => this._commitCommentPopup()}>${A("save")}</button>
|
|
3229
3274
|
</div>
|
|
3230
3275
|
</div>
|
|
3231
3276
|
`;
|
|
@@ -3261,7 +3306,7 @@ var q = {
|
|
|
3261
3306
|
<div class="ft-filter-dropdown" @click=${(e) => e.stopPropagation()}>
|
|
3262
3307
|
${t === "boolean" ? this._renderBooleanFilter(e) : t === "number" ? this._renderNumberFilter(e) : t === "date" || t === "datetime" ? this._renderDateFilter(e) : this._renderTextFilter(e)}
|
|
3263
3308
|
<div class="ft-filter-actions">
|
|
3264
|
-
<button class="ft-filter-clear" @click=${() => this._clearColumnFilter(e.key)}>${
|
|
3309
|
+
<button class="ft-filter-clear" @click=${() => this._clearColumnFilter(e.key)}>${A("clear")}</button>
|
|
3265
3310
|
</div>
|
|
3266
3311
|
</div>
|
|
3267
3312
|
`;
|
|
@@ -3294,7 +3339,7 @@ var q = {
|
|
|
3294
3339
|
let n = this._emptyFilterState.get(e) ?? "";
|
|
3295
3340
|
return i`
|
|
3296
3341
|
<div class="ft-filter-empty-row">
|
|
3297
|
-
<label>${
|
|
3342
|
+
<label>${A("blankCells")}</label>
|
|
3298
3343
|
<select class="ft-filter-mode-select"
|
|
3299
3344
|
.value=${n}
|
|
3300
3345
|
@change=${(n) => {
|
|
@@ -3304,9 +3349,9 @@ var q = {
|
|
|
3304
3349
|
@keydown=${(e) => {
|
|
3305
3350
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
3306
3351
|
}}>
|
|
3307
|
-
<option value="">${
|
|
3308
|
-
<option value="empty">${
|
|
3309
|
-
<option value="non-empty">${
|
|
3352
|
+
<option value="">${A("blankAll")}</option>
|
|
3353
|
+
<option value="empty">${A("emptyOnly")}</option>
|
|
3354
|
+
<option value="non-empty">${A("nonEmptyOnly")}</option>
|
|
3310
3355
|
</select>
|
|
3311
3356
|
</div>
|
|
3312
3357
|
`;
|
|
@@ -3382,13 +3427,13 @@ var q = {
|
|
|
3382
3427
|
@keydown=${(e) => {
|
|
3383
3428
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
3384
3429
|
}}>
|
|
3385
|
-
<option value="contains">${
|
|
3386
|
-
<option value="starts">${
|
|
3387
|
-
<option value="ends">${
|
|
3388
|
-
<option value="wildcard">${
|
|
3430
|
+
<option value="contains">${A("contains")}</option>
|
|
3431
|
+
<option value="starts">${A("startsWith")}</option>
|
|
3432
|
+
<option value="ends">${A("endsWith")}</option>
|
|
3433
|
+
<option value="wildcard">${A("wildcard")}</option>
|
|
3389
3434
|
</select>
|
|
3390
3435
|
</div>
|
|
3391
|
-
<input class="ft-filter-input" type="text" placeholder=${
|
|
3436
|
+
<input class="ft-filter-input" type="text" placeholder=${A("searchPlaceholder")}
|
|
3392
3437
|
.value=${t.value}
|
|
3393
3438
|
@input=${(t) => {
|
|
3394
3439
|
let n = t.target.value, r = this._textFilterState.get(e.key) ?? {
|
|
@@ -3439,13 +3484,15 @@ var q = {
|
|
|
3439
3484
|
}}>
|
|
3440
3485
|
${Object.keys(q).map((e) => i`<option value=${e}>${q[e]}</option>`)}
|
|
3441
3486
|
</select>
|
|
3442
|
-
<input class="ft-filter-input ft-num-cond-input" type="
|
|
3443
|
-
.value=${n.value == null ? "" :
|
|
3487
|
+
<input class="ft-filter-input ft-num-cond-input" type="text" inputmode="decimal" placeholder=${A("valuePlaceholder")}
|
|
3488
|
+
.value=${n.text ?? (n.value == null ? "" : P(n.value))}
|
|
3489
|
+
aria-invalid=${n.text && n.value == null ? "true" : "false"}
|
|
3444
3490
|
@input=${(n) => {
|
|
3445
3491
|
let r = n.target.value, i = this._numberFilterState.get(e) ?? this._defaultNumState();
|
|
3446
3492
|
i[t] = {
|
|
3447
3493
|
...i[t],
|
|
3448
|
-
|
|
3494
|
+
text: r,
|
|
3495
|
+
value: r.trim() === "" ? null : m(r)
|
|
3449
3496
|
}, this._numberFilterState.set(e, i), this._emptyFilterState.delete(e), this._applyFilterForKey(e);
|
|
3450
3497
|
}}
|
|
3451
3498
|
@keydown=${(e) => {
|
|
@@ -3500,13 +3547,13 @@ var q = {
|
|
|
3500
3547
|
let t = e.type === "datetime" ? "datetime-local" : "date", n = this._dateFilterState.get(e.key) ?? {};
|
|
3501
3548
|
return i`
|
|
3502
3549
|
<div class="ft-filter-range">
|
|
3503
|
-
<input class="ft-filter-input" type=${t} placeholder=${
|
|
3550
|
+
<input class="ft-filter-input" type=${t} placeholder=${A("fromPlaceholder")}
|
|
3504
3551
|
.value=${n.from ?? ""}
|
|
3505
3552
|
@input=${(t) => this._applyDateFilter(e.key, t, "from")}
|
|
3506
3553
|
@keydown=${(e) => {
|
|
3507
3554
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
3508
3555
|
}}>
|
|
3509
|
-
<input class="ft-filter-input" type=${t} placeholder=${
|
|
3556
|
+
<input class="ft-filter-input" type=${t} placeholder=${A("toPlaceholder")}
|
|
3510
3557
|
.value=${n.to ?? ""}
|
|
3511
3558
|
@input=${(t) => this._applyDateFilter(e.key, t, "to")}
|
|
3512
3559
|
@keydown=${(e) => {
|
|
@@ -3532,9 +3579,9 @@ var q = {
|
|
|
3532
3579
|
@keydown=${(e) => {
|
|
3533
3580
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
3534
3581
|
}}>
|
|
3535
|
-
<option value="all">${
|
|
3536
|
-
<option value="true">\u2714 ${
|
|
3537
|
-
<option value="false">\u2718 ${
|
|
3582
|
+
<option value="all">${A("all")}</option>
|
|
3583
|
+
<option value="true">\u2714 ${A("booleanTrue")}</option>
|
|
3584
|
+
<option value="false">\u2718 ${A("booleanFalse")}</option>
|
|
3538
3585
|
</select>
|
|
3539
3586
|
${this._renderEmptyFilterRow(e.key)}
|
|
3540
3587
|
`;
|
|
@@ -3951,42 +3998,42 @@ var q = {
|
|
|
3951
3998
|
this._closeFindPanel();
|
|
3952
3999
|
return;
|
|
3953
4000
|
}
|
|
3954
|
-
e.key === "Enter" && !
|
|
4001
|
+
e.key === "Enter" && !_(e) && e.target instanceof HTMLInputElement && e.target.classList.contains("ft-find-input") && (e.shiftKey ? this._findPrev() : this._findNext());
|
|
3955
4002
|
}}>
|
|
3956
4003
|
<div class="ft-find-row">
|
|
3957
|
-
<input class="ft-find-input" type="text" placeholder=${
|
|
4004
|
+
<input class="ft-find-input" type="text" placeholder=${A("findPlaceholder")}
|
|
3958
4005
|
.value=${t}
|
|
3959
4006
|
@input=${(e) => {
|
|
3960
4007
|
this._findState.query = e.target.value, this._findSearch();
|
|
3961
4008
|
}}>
|
|
3962
4009
|
<span class="ft-find-count">${c > 0 ? `${l}/${c}` : t ? "0 results" : ""}</span>
|
|
3963
|
-
<button @click=${() => this._findPrev()} title=${
|
|
3964
|
-
<button @click=${() => this._findNext()} title=${
|
|
3965
|
-
<label title=${
|
|
4010
|
+
<button @click=${() => this._findPrev()} title=${A("findPrevious")}>◀</button>
|
|
4011
|
+
<button @click=${() => this._findNext()} title=${A("findNext")}>▶</button>
|
|
4012
|
+
<label title=${A("matchCase")}><input type="checkbox" ?checked=${r} @change=${(e) => {
|
|
3966
4013
|
this._findState.matchCase = e.target.checked, this._findSearch();
|
|
3967
4014
|
}}> Aa</label>
|
|
3968
|
-
<label title=${
|
|
4015
|
+
<label title=${A("wholeCell")}><input type="checkbox" ?checked=${a} @change=${(e) => {
|
|
3969
4016
|
this._findState.wholeCell = e.target.checked, this._findSearch();
|
|
3970
4017
|
}}> [ ]</label>
|
|
3971
|
-
<button @click=${() => this._closeFindPanel()} title=${
|
|
4018
|
+
<button @click=${() => this._closeFindPanel()} title=${A("closeFind")}>✕</button>
|
|
3972
4019
|
</div>
|
|
3973
4020
|
${e === "replace" ? i`
|
|
3974
4021
|
<div class="ft-find-row">
|
|
3975
|
-
<input class="ft-find-replace-input" type="text" placeholder=${
|
|
4022
|
+
<input class="ft-find-replace-input" type="text" placeholder=${A("replaceWithPlaceholder")}
|
|
3976
4023
|
.value=${n}
|
|
3977
4024
|
@input=${(e) => {
|
|
3978
4025
|
this._findState.replaceWith = e.target.value;
|
|
3979
4026
|
}}>
|
|
3980
|
-
<button @click=${() => this._replaceOne()} ?disabled=${c === 0}>${
|
|
3981
|
-
<button @click=${() => this._replaceAll()} ?disabled=${c === 0}>${
|
|
4027
|
+
<button @click=${() => this._replaceOne()} ?disabled=${c === 0}>${A("replace")}</button>
|
|
4028
|
+
<button @click=${() => this._replaceAll()} ?disabled=${c === 0}>${A("replaceAll")}</button>
|
|
3982
4029
|
</div>
|
|
3983
4030
|
` : ""}
|
|
3984
4031
|
</div>
|
|
3985
4032
|
`;
|
|
3986
4033
|
}
|
|
3987
4034
|
render() {
|
|
3988
|
-
let e = this.visibleColumns, t = this.importEnabled && this._isDragOver ? i`<div class="ft-import-overlay">${
|
|
3989
|
-
if (e.length === 0) return i`${t}${n}<div class="ft-empty">${
|
|
4035
|
+
let e = this.visibleColumns, t = this.importEnabled && this._isDragOver ? i`<div class="ft-import-overlay">${A("dropFileToImport")}</div>` : a, n = this.loading ? i`<div class="ft-loading-overlay"></div>` : a;
|
|
4036
|
+
if (e.length === 0) return i`${t}${n}<div class="ft-empty">${A("noColumnsDefined")}</div>`;
|
|
3990
4037
|
let r = this.headerHeight, o = this._totalRowWidth, { start: s, end: c } = this.visibleColRange, l = [];
|
|
3991
4038
|
for (let t = 0; t < e.length; t++) (e[t].pinned === "left" || e[t].pinned === "right") && (t < s || t >= c) && l.push(t);
|
|
3992
4039
|
let u = 0, d = this._scrollLeft, f = this.selectable ? i`<div class="ft-checkbox-header"
|
|
@@ -4105,8 +4152,8 @@ var q = {
|
|
|
4105
4152
|
@mousedown=${(t) => this._onRowNumMouseDown(t, e)}
|
|
4106
4153
|
@click=${() => this._onRowNumberClick(e)}>${s + 1}</div>
|
|
4107
4154
|
` : "", y = [];
|
|
4108
|
-
for (let t of r) y.push(this._renderCell(c, o[t], e, t));
|
|
4109
|
-
for (let r = t; r < n; r++) y.push(this._renderCell(c, o[r], e, r));
|
|
4155
|
+
for (let t of r) y.push(this._renderCell(c, o[t], e, t, this._mergeState(o[t], e)));
|
|
4156
|
+
for (let r = t; r < n; r++) y.push(this._renderCell(c, o[r], e, r, this._mergeState(o[r], e)));
|
|
4110
4157
|
return i`
|
|
4111
4158
|
<div class="ft-row ${f} ${p ? "ft-row-selected" : ""}" role="row" aria-rowindex=${e + 2}
|
|
4112
4159
|
style="top: ${l}px; height: ${u}px; width: ${d}px;">
|
|
@@ -4115,52 +4162,82 @@ var q = {
|
|
|
4115
4162
|
</div>
|
|
4116
4163
|
`;
|
|
4117
4164
|
}
|
|
4118
|
-
|
|
4119
|
-
let
|
|
4120
|
-
|
|
4121
|
-
let
|
|
4165
|
+
_continuesRun(e, t) {
|
|
4166
|
+
let n = e.mergeRepeated;
|
|
4167
|
+
if (!n || t <= 0 || t >= this._visibleRowCount) return !1;
|
|
4168
|
+
let r = this.data[this._toDataIndex(t)], i = this.data[this._toDataIndex(t - 1)];
|
|
4169
|
+
if (!r || !i) return !1;
|
|
4170
|
+
if (typeof n == "function") return n(r, i, e);
|
|
4171
|
+
let a = r[e.key];
|
|
4172
|
+
if (a == null || a === "") return !1;
|
|
4173
|
+
let o = i[e.key];
|
|
4174
|
+
return a instanceof Date && o instanceof Date ? a.getTime() === o.getTime() : Object.is(a, o);
|
|
4175
|
+
}
|
|
4176
|
+
_isForcedRunHead(e) {
|
|
4177
|
+
let t = this._frozenRowCount;
|
|
4178
|
+
return e === t ? !0 : e < t ? !1 : e === t + Math.floor((this._scrollTop + this.rowHeight / 2) / this.rowHeight);
|
|
4179
|
+
}
|
|
4180
|
+
_mergeState(e, t) {
|
|
4181
|
+
if (!e.mergeRepeated) return null;
|
|
4182
|
+
let n = !this._isForcedRunHead(t) && this._continuesRun(e, t), r = !this._isForcedRunHead(t + 1) && this._continuesRun(e, t + 1);
|
|
4183
|
+
if (!n && !r) return null;
|
|
4184
|
+
let i = t;
|
|
4185
|
+
for (; i > 0 && !this._isForcedRunHead(i) && this._continuesRun(e, i);) i--;
|
|
4186
|
+
return {
|
|
4187
|
+
continues: n,
|
|
4188
|
+
opensDown: r,
|
|
4189
|
+
headParity: i % 2 == 0 ? "even" : "odd"
|
|
4190
|
+
};
|
|
4191
|
+
}
|
|
4192
|
+
_renderCell(e, t, n, r, o = null) {
|
|
4193
|
+
let s = this._activeCell?.row === n && this._activeCell?.col === r, c = this._editingCell?.row === n && this._editingCell?.col === r, l = this._selection.isInRange(n, r), u = t.pinned === "left", d = t.pinned === "right", f = u || d, p = this._getColWidth(t), m = this.rowHeight, h = this._colLeftOffsets[r] ?? 0, g;
|
|
4194
|
+
g = u ? `position: absolute; top: 0; left: ${this._scrollLeft + this._getPinnedLeft(r)}px; width: ${p}px; height: ${m}px; z-index: 2;` : d ? `position: absolute; top: 0; left: ${this._getPinnedRightLeft(r)}px; width: ${p}px; height: ${m}px; z-index: 2;` : `left: ${h}px; width: ${p}px; height: ${m}px;`;
|
|
4195
|
+
let _ = !this._isCellEditable(t);
|
|
4122
4196
|
if (t.conditionalRules && t.conditionalRules.length > 0) {
|
|
4123
4197
|
let n = e[t.key], r = {};
|
|
4124
4198
|
for (let i of t.conditionalRules) i.when(n, e, t) && (i.style.background && (r.background = i.style.background), i.style.color && (r.color = i.style.color), i.style.fontWeight && (r["font-weight"] = i.style.fontWeight), i.style.fontStyle && (r["font-style"] = i.style.fontStyle));
|
|
4125
4199
|
let i = Object.entries(r).map(([e, t]) => `${e}: ${t}`).join("; ");
|
|
4126
|
-
i && (
|
|
4200
|
+
i && (g += " " + i + ";");
|
|
4127
4201
|
}
|
|
4128
|
-
if (
|
|
4129
|
-
<div class="ft-cell ft-editing ft-active ${
|
|
4202
|
+
if (c) return i`
|
|
4203
|
+
<div class="ft-cell ft-editing ft-active ${f ? "ft-pinned" : ""}" role="gridcell"
|
|
4130
4204
|
aria-colindex=${r + 1}
|
|
4131
4205
|
data-col-index=${r}
|
|
4132
4206
|
aria-selected="true"
|
|
4133
|
-
aria-readonly=${
|
|
4134
|
-
style=${
|
|
4207
|
+
aria-readonly=${_ ? "true" : a}
|
|
4208
|
+
style=${g}>
|
|
4135
4209
|
${this._renderEditor(e, t)}
|
|
4136
4210
|
</div>
|
|
4137
4211
|
`;
|
|
4138
|
-
let
|
|
4212
|
+
let v = s || l, y = this._isCellInvalid(n, r), b = (this._findState?.results ?? []).findIndex((e) => e.row === n && e.col === r), x = b >= 0, S = x && b === this._findState.currentIndex, w = [
|
|
4139
4213
|
"ft-cell",
|
|
4140
4214
|
`ft-type-${t.type ?? "text"}`,
|
|
4141
4215
|
`ft-align-${G(t)}`,
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
S ? "ft-find-current" : x ? "ft-find-match" : ""
|
|
4147
|
-
|
|
4216
|
+
s ? "ft-active" : "",
|
|
4217
|
+
l ? "ft-selected" : "",
|
|
4218
|
+
f ? "ft-pinned" : "",
|
|
4219
|
+
y ? "ft-invalid" : "",
|
|
4220
|
+
S ? "ft-find-current" : x ? "ft-find-match" : "",
|
|
4221
|
+
o ? `ft-merge-${o.headParity}` : "",
|
|
4222
|
+
o?.continues ? "ft-merge-continued" : "",
|
|
4223
|
+
o?.opensDown ? "ft-merge-open" : ""
|
|
4224
|
+
].filter(Boolean).join(" "), T = this._toDataIndex(n), E = this._comments.get(T)?.get(t.key) ?? null, D = E !== null, O = D ? i`<div class="ft-comment-indicator" title=${E}></div>` : a;
|
|
4148
4225
|
return i`
|
|
4149
|
-
<div class=${
|
|
4226
|
+
<div class=${D ? w + " ft-has-comment" : w}
|
|
4150
4227
|
role="gridcell"
|
|
4151
4228
|
aria-colindex=${r + 1}
|
|
4152
4229
|
data-col-index=${r}
|
|
4153
|
-
aria-selected=${
|
|
4154
|
-
aria-readonly=${
|
|
4155
|
-
aria-invalid=${
|
|
4156
|
-
title=${
|
|
4157
|
-
style=${
|
|
4230
|
+
aria-selected=${v ? "true" : "false"}
|
|
4231
|
+
aria-readonly=${_ ? "true" : a}
|
|
4232
|
+
aria-invalid=${y ? "true" : a}
|
|
4233
|
+
title=${y ?? a}
|
|
4234
|
+
style=${g}
|
|
4158
4235
|
@mousedown=${(e) => this._onCellMouseDown(e, n, r)}
|
|
4159
4236
|
@mouseenter=${() => this._onCellMouseEnter(n, r)}
|
|
4160
4237
|
@click=${(e) => this._onCellClickEvent(e, n, r)}
|
|
4161
4238
|
@dblclick=${() => this._onCellDblClick(n, r)}>
|
|
4162
|
-
${
|
|
4163
|
-
${
|
|
4239
|
+
${O}
|
|
4240
|
+
${C(e[t.key], e, t)}
|
|
4164
4241
|
</div>
|
|
4165
4242
|
`;
|
|
4166
4243
|
}
|
|
@@ -4168,20 +4245,17 @@ var q = {
|
|
|
4168
4245
|
if (t.editor) return t.editor(e[t.key], e, t);
|
|
4169
4246
|
let n = e[t.key], r = n == null ? "" : String(n);
|
|
4170
4247
|
if (t.type === "number") return i`
|
|
4171
|
-
<input class="ft-editor ft-editor-number" type="
|
|
4172
|
-
.value=${r}
|
|
4248
|
+
<input class="ft-editor ft-editor-number" type="text" inputmode="decimal"
|
|
4249
|
+
.value=${typeof n == "number" ? P(n) : r}
|
|
4173
4250
|
@keydown=${this._onEditorKeyDown}
|
|
4174
4251
|
@blur=${() => this._commitEdit()}>
|
|
4175
4252
|
`;
|
|
4176
|
-
if (t.type === "date")
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
<input class="ft-editor" type="date"
|
|
4180
|
-
.value=${e}
|
|
4253
|
+
if (t.type === "date") return i`
|
|
4254
|
+
<input class="ft-editor ft-editor-date" type="text" inputmode="numeric" placeholder=${u()}
|
|
4255
|
+
.value=${se(n)}
|
|
4181
4256
|
@keydown=${this._onEditorKeyDown}
|
|
4182
4257
|
@blur=${() => this._commitEdit()}>
|
|
4183
4258
|
`;
|
|
4184
|
-
}
|
|
4185
4259
|
if (t.type === "datetime") {
|
|
4186
4260
|
let e = this._toDateTimeInputValue(n);
|
|
4187
4261
|
return i`
|
|
@@ -4231,11 +4305,6 @@ var q = {
|
|
|
4231
4305
|
@blur=${() => this._commitEdit()}>
|
|
4232
4306
|
`;
|
|
4233
4307
|
}
|
|
4234
|
-
_toDateInputValue(e) {
|
|
4235
|
-
if (!e) return "";
|
|
4236
|
-
let t = e instanceof Date ? e : new Date(String(e));
|
|
4237
|
-
return isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`;
|
|
4238
|
-
}
|
|
4239
4308
|
_toDateTimeInputValue(e) {
|
|
4240
4309
|
if (!e) return "";
|
|
4241
4310
|
let t = e instanceof Date ? e : new Date(String(e));
|
|
@@ -4298,4 +4367,4 @@ K([s({ type: Array })], $.prototype, "columns", void 0), K([s({
|
|
|
4298
4367
|
attribute: "max-undo-size"
|
|
4299
4368
|
})], $.prototype, "maxUndoSize", null), K([c()], $.prototype, "_scrollTop", void 0), K([c()], $.prototype, "_scrollLeft", void 0), K([c()], $.prototype, "_viewportHeight", void 0), K([c()], $.prototype, "_viewportWidth", void 0), K([c()], $.prototype, "_activeCell", void 0), K([c()], $.prototype, "_editingCell", void 0), K([c()], $.prototype, "_sortCriteria", void 0), K([c()], $.prototype, "_openFilterKey", void 0), K([c()], $.prototype, "_rowSelectionVersion", void 0), K([c()], $.prototype, "_autocompleteState", void 0), K([c()], $.prototype, "_headerMenu", void 0), K([c()], $.prototype, "_bodyContextMenu", void 0), K([c()], $.prototype, "_commentPopup", void 0), K([c()], $.prototype, "_isDragOver", void 0), $ = K([o("flex-table")], $);
|
|
4300
4369
|
//#endregion
|
|
4301
|
-
export {
|
|
4370
|
+
export { j as a, M as i, G as n, k as o, B as r, C as s, $ as t };
|