@iyulab/flex-table 0.48.1 → 0.48.3
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 +22 -0
- package/dist/{flex-table-CQNVaL0x.js → flex-table-CLw2o8sr.js} +177 -177
- package/dist/flex-table.js +1 -1
- package/dist/react.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.48.3] - 2026-10-06
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **Enter and Space on a column menu button open the menu while a cell is active.** The grid read
|
|
8
|
+
the key as its own and started editing the active cell instead. Keys pressed on a control inside
|
|
9
|
+
the grid — a column menu button, a row checkbox, a button a cell renders — are now that control's;
|
|
10
|
+
the grid's cell keys apply while the grid itself has focus. Ctrl/Cmd shortcuts still apply.
|
|
11
|
+
|
|
12
|
+
## [0.48.2] - 2026-10-06
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- **Ctrl+C / Ctrl+X / Ctrl+V apply again while a row checkbox has focus.** 0.48.0 treated every
|
|
17
|
+
`<input>` as a text field with its own clipboard, so with focus on a row checkbox the keys did
|
|
18
|
+
nothing. Only text fields (the cell editor, the find panel's search box, a filter input) keep
|
|
19
|
+
their own clipboard now (`isTextEntry` from `@iyulab/components` 2.2.0).
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Requires `@iyulab/components` 2.2.0 or later.
|
|
24
|
+
|
|
3
25
|
## [0.48.1] - 2026-10-06
|
|
4
26
|
|
|
5
27
|
### Fixed
|
|
@@ -6,9 +6,9 @@ import { formatDate as u, formatNumber as d, parseDate as f, parseDateTime as p,
|
|
|
6
6
|
import { decodeTsv as h, encodeTsv as g } from "@iyulab/components/dist/utilities/tsv.js";
|
|
7
7
|
import "@iyulab/components/dist/components/date-picker/UDatePicker.js";
|
|
8
8
|
import { isImeComposing as _ } from "@iyulab/components/dist/utilities/keyboard.js";
|
|
9
|
-
import { copyFromKey as v,
|
|
9
|
+
import { copyFromKey as v, isTextEntry as y, pasteFromKey as b } from "@iyulab/components/dist/utilities/clipboard.js";
|
|
10
10
|
//#region src/styles/flex-table.styles.ts
|
|
11
|
-
var
|
|
11
|
+
var x = r`
|
|
12
12
|
/* --- Theme Variables (Light defaults) --- */
|
|
13
13
|
:host {
|
|
14
14
|
--ft-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
@@ -1018,13 +1018,13 @@ var b = r`
|
|
|
1018
1018
|
`;
|
|
1019
1019
|
//#endregion
|
|
1020
1020
|
//#region src/renderers/format.ts
|
|
1021
|
-
function
|
|
1022
|
-
return e == null ? "" : typeof t == "function" ? t(e) :
|
|
1021
|
+
function S(e, t) {
|
|
1022
|
+
return e == null ? "" : typeof t == "function" ? t(e) : C(t) ? w(e, t) : ee(e, t);
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function C(e) {
|
|
1025
1025
|
return /[yMdHhms]/.test(e);
|
|
1026
1026
|
}
|
|
1027
|
-
function
|
|
1027
|
+
function ee(e, t) {
|
|
1028
1028
|
let n = typeof e == "number" ? e : Number(e);
|
|
1029
1029
|
if (isNaN(n)) return String(e);
|
|
1030
1030
|
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 = {
|
|
@@ -1049,15 +1049,15 @@ function w(e, t) {
|
|
|
1049
1049
|
//#endregion
|
|
1050
1050
|
//#region src/renderers/cell-renderer.ts
|
|
1051
1051
|
function T(e, t, n) {
|
|
1052
|
-
return n.render ? n.render(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) :
|
|
1052
|
+
return n.render ? n.render(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) : S(e, n.format) : E(e, n);
|
|
1053
1053
|
}
|
|
1054
1054
|
function E(e, t) {
|
|
1055
1055
|
if (e == null) return "";
|
|
1056
1056
|
switch (t.type) {
|
|
1057
|
-
case "number": return
|
|
1057
|
+
case "number": return ne(e);
|
|
1058
1058
|
case "boolean": return i`<span class="ft-bool">${e ? "✔" : ""}</span>`;
|
|
1059
|
-
case "date": return
|
|
1060
|
-
case "datetime": return
|
|
1059
|
+
case "date": return re(e);
|
|
1060
|
+
case "datetime": return ie(e);
|
|
1061
1061
|
case "select": return D(e, t);
|
|
1062
1062
|
default: return String(e);
|
|
1063
1063
|
}
|
|
@@ -1067,7 +1067,7 @@ function D(e, t) {
|
|
|
1067
1067
|
let n = t.options.find((t) => t.value === e);
|
|
1068
1068
|
return n ? n.label : e == null ? "" : String(e);
|
|
1069
1069
|
}
|
|
1070
|
-
var
|
|
1070
|
+
var te = {
|
|
1071
1071
|
year: "numeric",
|
|
1072
1072
|
month: "numeric",
|
|
1073
1073
|
day: "numeric",
|
|
@@ -1075,19 +1075,19 @@ var O = {
|
|
|
1075
1075
|
minute: "numeric",
|
|
1076
1076
|
second: "numeric"
|
|
1077
1077
|
};
|
|
1078
|
-
function
|
|
1078
|
+
function ne(e) {
|
|
1079
1079
|
return typeof e == "number" ? Number.isInteger(e) ? d(e) : d(e, { minimumFractionDigits: 1 }) : String(e);
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function re(e) {
|
|
1082
1082
|
return e instanceof Date || typeof e == "string" ? u(e) : String(e);
|
|
1083
1083
|
}
|
|
1084
|
-
function
|
|
1085
|
-
return e instanceof Date || typeof e == "string" ? u(e,
|
|
1084
|
+
function ie(e) {
|
|
1085
|
+
return e instanceof Date || typeof e == "string" ? u(e, te) : String(e);
|
|
1086
1086
|
}
|
|
1087
1087
|
//#endregion
|
|
1088
1088
|
//#region src/locale.ts
|
|
1089
|
-
var
|
|
1090
|
-
|
|
1089
|
+
var O = l.namespace("flex-table");
|
|
1090
|
+
O.register("en", {
|
|
1091
1091
|
showHiddenColumns: "Show hidden column(s)",
|
|
1092
1092
|
columnMenu: "Column menu",
|
|
1093
1093
|
cellActions: "Cell actions",
|
|
@@ -1144,7 +1144,7 @@ k.register("en", {
|
|
|
1144
1144
|
notADate: "Enter a date as YYYY-MM-DD",
|
|
1145
1145
|
notADateTime: "Enter a date and time as YYYY-MM-DD HH:mm",
|
|
1146
1146
|
notInList: "Value must be from the existing list"
|
|
1147
|
-
}),
|
|
1147
|
+
}), O.register("ko", {
|
|
1148
1148
|
showHiddenColumns: "숨긴 열 보기",
|
|
1149
1149
|
columnMenu: "열 메뉴",
|
|
1150
1150
|
cellActions: "셀 작업",
|
|
@@ -1202,10 +1202,10 @@ k.register("en", {
|
|
|
1202
1202
|
notADateTime: "날짜와 시간을 YYYY-MM-DD HH:mm 으로 입력하세요",
|
|
1203
1203
|
notInList: "목록에 있는 값이어야 합니다"
|
|
1204
1204
|
});
|
|
1205
|
-
var
|
|
1205
|
+
var k = (e, t) => O.text(e, t);
|
|
1206
1206
|
//#endregion
|
|
1207
1207
|
//#region src/core/selection.ts
|
|
1208
|
-
function
|
|
1208
|
+
function ae(e) {
|
|
1209
1209
|
return {
|
|
1210
1210
|
startRow: Math.min(e.startRow, e.endRow),
|
|
1211
1211
|
startCol: Math.min(e.startCol, e.endCol),
|
|
@@ -1213,7 +1213,7 @@ function re(e) {
|
|
|
1213
1213
|
endCol: Math.max(e.startCol, e.endCol)
|
|
1214
1214
|
};
|
|
1215
1215
|
}
|
|
1216
|
-
var
|
|
1216
|
+
var oe = class {
|
|
1217
1217
|
constructor() {
|
|
1218
1218
|
this.activeCell = null, this.rangeAnchor = null, this.range = null, this.extraRanges = [], this._rowCount = 0, this._colCount = 0;
|
|
1219
1219
|
}
|
|
@@ -1240,7 +1240,7 @@ var ie = class {
|
|
|
1240
1240
|
return e < 0 || e >= this._rowCount || t < 0 || t >= this._colCount ? this.activeCell : (!this.rangeAnchor && this.activeCell && (this.rangeAnchor = { ...this.activeCell }), this.activeCell = {
|
|
1241
1241
|
row: e,
|
|
1242
1242
|
col: t
|
|
1243
|
-
}, this.rangeAnchor && (this.range =
|
|
1243
|
+
}, this.rangeAnchor && (this.range = ae({
|
|
1244
1244
|
startRow: this.rangeAnchor.row,
|
|
1245
1245
|
startCol: this.rangeAnchor.col,
|
|
1246
1246
|
endRow: e,
|
|
@@ -1311,7 +1311,7 @@ var ie = class {
|
|
|
1311
1311
|
shiftMoveRight() {
|
|
1312
1312
|
return this.activeCell ? this.setActiveWithRange(this.activeCell.row, this.activeCell.col + 1) : null;
|
|
1313
1313
|
}
|
|
1314
|
-
},
|
|
1314
|
+
}, se = class {
|
|
1315
1315
|
constructor() {
|
|
1316
1316
|
this.current = null;
|
|
1317
1317
|
}
|
|
@@ -1332,7 +1332,7 @@ var ie = class {
|
|
|
1332
1332
|
let e = this.current;
|
|
1333
1333
|
return this.current = null, e;
|
|
1334
1334
|
}
|
|
1335
|
-
},
|
|
1335
|
+
}, A = class {
|
|
1336
1336
|
constructor() {
|
|
1337
1337
|
this._selected = /* @__PURE__ */ new Set(), this._mode = "multi", this._rowCount = 0;
|
|
1338
1338
|
}
|
|
@@ -1393,7 +1393,7 @@ var ie = class {
|
|
|
1393
1393
|
};
|
|
1394
1394
|
//#endregion
|
|
1395
1395
|
//#region src/core/filtering.ts
|
|
1396
|
-
function
|
|
1396
|
+
function ce(e, t, n) {
|
|
1397
1397
|
if (t.length === 0) return Array.from({ length: e.length }, (e, t) => t);
|
|
1398
1398
|
let r = [];
|
|
1399
1399
|
for (let i = 0; i < e.length; i++) {
|
|
@@ -1412,9 +1412,9 @@ function oe(e, t, n) {
|
|
|
1412
1412
|
}
|
|
1413
1413
|
//#endregion
|
|
1414
1414
|
//#region src/core/undo.ts
|
|
1415
|
-
var
|
|
1415
|
+
var le = 100, j = class {
|
|
1416
1416
|
constructor() {
|
|
1417
|
-
this._undoStack = [], this._redoStack = [], this._maxSize =
|
|
1417
|
+
this._undoStack = [], this._redoStack = [], this._maxSize = le;
|
|
1418
1418
|
}
|
|
1419
1419
|
get maxSize() {
|
|
1420
1420
|
return this._maxSize;
|
|
@@ -1451,7 +1451,7 @@ var se = 100, ce = class {
|
|
|
1451
1451
|
};
|
|
1452
1452
|
//#endregion
|
|
1453
1453
|
//#region src/clipboard/clipboard.ts
|
|
1454
|
-
function
|
|
1454
|
+
function ue(e, t, n) {
|
|
1455
1455
|
let r = [];
|
|
1456
1456
|
for (let i = n.startRow; i <= n.endRow; i++) {
|
|
1457
1457
|
let a = e[i], o = [];
|
|
@@ -1484,13 +1484,13 @@ function N(e) {
|
|
|
1484
1484
|
let n = new Intl.NumberFormat(l.get()).formatToParts(1.5).find((e) => e.type === "decimal")?.value;
|
|
1485
1485
|
return n && n !== "." ? t.replace(".", n) : t;
|
|
1486
1486
|
}
|
|
1487
|
-
function
|
|
1487
|
+
function de(e) {
|
|
1488
1488
|
if (e == null || e === "") return "";
|
|
1489
1489
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? "" : `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
1490
1490
|
let t = String(e), n = /^(\d{4}-\d{2}-\d{2})(?:$|T)/.exec(t);
|
|
1491
1491
|
return n ? n[1] : t;
|
|
1492
1492
|
}
|
|
1493
|
-
function
|
|
1493
|
+
function fe(e) {
|
|
1494
1494
|
if (e == null || e === "") return "";
|
|
1495
1495
|
let t = e instanceof Date ? "" : String(e), n = /^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})(?::\d{2}(?:\.\d+)?)?$/.exec(t);
|
|
1496
1496
|
if (n) return `${n[1]} ${n[2]}`;
|
|
@@ -1501,7 +1501,7 @@ function de(e) {
|
|
|
1501
1501
|
}
|
|
1502
1502
|
//#endregion
|
|
1503
1503
|
//#region src/export/xlsx-writer.ts
|
|
1504
|
-
var
|
|
1504
|
+
var pe = (() => {
|
|
1505
1505
|
let e = /* @__PURE__ */ new Uint32Array(256);
|
|
1506
1506
|
for (let t = 0; t < 256; t++) {
|
|
1507
1507
|
let n = t;
|
|
@@ -1510,23 +1510,23 @@ var fe = (() => {
|
|
|
1510
1510
|
}
|
|
1511
1511
|
return e;
|
|
1512
1512
|
})();
|
|
1513
|
-
function
|
|
1513
|
+
function me(e) {
|
|
1514
1514
|
let t = 4294967295;
|
|
1515
|
-
for (let n = 0; n < e.length; n++) t =
|
|
1515
|
+
for (let n = 0; n < e.length; n++) t = pe[(t ^ e[n]) & 255] ^ t >>> 8;
|
|
1516
1516
|
return (t ^ 4294967295) >>> 0;
|
|
1517
1517
|
}
|
|
1518
1518
|
var P = new TextEncoder();
|
|
1519
|
-
function
|
|
1519
|
+
function he(e) {
|
|
1520
1520
|
return F(e.map((e) => ({
|
|
1521
1521
|
...e,
|
|
1522
1522
|
body: e.data,
|
|
1523
1523
|
method: 0
|
|
1524
1524
|
})));
|
|
1525
1525
|
}
|
|
1526
|
-
async function
|
|
1526
|
+
async function ge(e) {
|
|
1527
1527
|
let t = [];
|
|
1528
1528
|
for (let n of e) {
|
|
1529
|
-
let e = await
|
|
1529
|
+
let e = await _e(n.data);
|
|
1530
1530
|
t.push(e.length < n.data.length ? {
|
|
1531
1531
|
...n,
|
|
1532
1532
|
body: e,
|
|
@@ -1539,7 +1539,7 @@ async function he(e) {
|
|
|
1539
1539
|
}
|
|
1540
1540
|
return F(t);
|
|
1541
1541
|
}
|
|
1542
|
-
async function
|
|
1542
|
+
async function _e(e) {
|
|
1543
1543
|
let t = new CompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
|
|
1544
1544
|
n.write(e), n.close();
|
|
1545
1545
|
let i = [];
|
|
@@ -1553,7 +1553,7 @@ async function ge(e) {
|
|
|
1553
1553
|
function F(e) {
|
|
1554
1554
|
let t = [], n = [], r = 0;
|
|
1555
1555
|
for (let i of e) {
|
|
1556
|
-
let e = P.encode(i.name), a =
|
|
1556
|
+
let e = P.encode(i.name), a = me(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);
|
|
1557
1557
|
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);
|
|
1558
1558
|
let d = new ArrayBuffer(46 + e.length), f = new DataView(d);
|
|
1559
1559
|
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;
|
|
@@ -1573,27 +1573,27 @@ function I(e) {
|
|
|
1573
1573
|
function L(e) {
|
|
1574
1574
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1575
1575
|
}
|
|
1576
|
-
function
|
|
1576
|
+
function ve(e) {
|
|
1577
1577
|
let t = "";
|
|
1578
1578
|
for (e++; e > 0;) t = String.fromCharCode(64 + (e % 26 || 26)) + t, e = Math.floor((e - 1) / 26);
|
|
1579
1579
|
return t;
|
|
1580
1580
|
}
|
|
1581
1581
|
function R(e, t) {
|
|
1582
|
-
return
|
|
1582
|
+
return ve(t) + (e + 1);
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1584
|
+
function ye(e) {
|
|
1585
1585
|
let t = Date.UTC(1899, 11, 30);
|
|
1586
1586
|
return (e.getTime() - t) / 864e5;
|
|
1587
1587
|
}
|
|
1588
|
-
var
|
|
1589
|
-
function
|
|
1588
|
+
var be = "<?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>", xe = "<?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>", Se = "<?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>", 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/worksheet\" Target=\"worksheets/sheet1.xml\"/>\n <Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\"/>\n</Relationships>", we = "<?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>";
|
|
1589
|
+
function Te(e, t) {
|
|
1590
1590
|
let n = [], r = t.map((e, t) => `<c r="${R(0, t)}" t="str" s="2"><v>${L(e.label)}</v></c>`);
|
|
1591
1591
|
return n.push(`<row r="1">${r.join("")}</row>`), e.forEach((e, r) => {
|
|
1592
1592
|
let i = t.map((t, n) => {
|
|
1593
1593
|
let i = R(r + 1, n), a = e[t.key];
|
|
1594
1594
|
if (a == null) return `<c r="${i}" t="str"><v></v></c>`;
|
|
1595
1595
|
let o = t.type ?? "text";
|
|
1596
|
-
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>${
|
|
1596
|
+
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>${ye(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>`;
|
|
1597
1597
|
});
|
|
1598
1598
|
n.push(`<row r="${r + 2}">${i.join("")}</row>`);
|
|
1599
1599
|
}), `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
@@ -1601,30 +1601,30 @@ function we(e, t) {
|
|
|
1601
1601
|
<sheetData>${n.join("")}</sheetData>
|
|
1602
1602
|
</worksheet>`;
|
|
1603
1603
|
}
|
|
1604
|
-
function Te(e, t) {
|
|
1605
|
-
return me(z(e, t));
|
|
1606
|
-
}
|
|
1607
1604
|
function Ee(e, t) {
|
|
1608
1605
|
return he(z(e, t));
|
|
1609
1606
|
}
|
|
1607
|
+
function De(e, t) {
|
|
1608
|
+
return ge(z(e, t));
|
|
1609
|
+
}
|
|
1610
1610
|
function z(e, t) {
|
|
1611
|
-
let n =
|
|
1611
|
+
let n = Te(e, t);
|
|
1612
1612
|
return [
|
|
1613
1613
|
{
|
|
1614
1614
|
name: "[Content_Types].xml",
|
|
1615
|
-
data: P.encode(
|
|
1615
|
+
data: P.encode(be)
|
|
1616
1616
|
},
|
|
1617
1617
|
{
|
|
1618
1618
|
name: "_rels/.rels",
|
|
1619
|
-
data: P.encode(
|
|
1619
|
+
data: P.encode(xe)
|
|
1620
1620
|
},
|
|
1621
1621
|
{
|
|
1622
1622
|
name: "xl/workbook.xml",
|
|
1623
|
-
data: P.encode(
|
|
1623
|
+
data: P.encode(Se)
|
|
1624
1624
|
},
|
|
1625
1625
|
{
|
|
1626
1626
|
name: "xl/_rels/workbook.xml.rels",
|
|
1627
|
-
data: P.encode(
|
|
1627
|
+
data: P.encode(Ce)
|
|
1628
1628
|
},
|
|
1629
1629
|
{
|
|
1630
1630
|
name: "xl/worksheets/sheet1.xml",
|
|
@@ -1632,7 +1632,7 @@ function z(e, t) {
|
|
|
1632
1632
|
},
|
|
1633
1633
|
{
|
|
1634
1634
|
name: "xl/styles.xml",
|
|
1635
|
-
data: P.encode(
|
|
1635
|
+
data: P.encode(we)
|
|
1636
1636
|
}
|
|
1637
1637
|
];
|
|
1638
1638
|
}
|
|
@@ -1642,24 +1642,24 @@ function B(e, t, n) {
|
|
|
1642
1642
|
switch (n) {
|
|
1643
1643
|
case "csv": return V(e, t, ",");
|
|
1644
1644
|
case "tsv": return V(e, t, " ");
|
|
1645
|
-
case "json": return
|
|
1646
|
-
case "xlsx": return
|
|
1645
|
+
case "json": return Ae(e, t);
|
|
1646
|
+
case "xlsx": return Ee(e, t);
|
|
1647
1647
|
}
|
|
1648
1648
|
}
|
|
1649
|
-
async function
|
|
1650
|
-
let r = n === "xlsx" ? await
|
|
1651
|
-
return new Blob([r], { type:
|
|
1649
|
+
async function Oe(e, t, n) {
|
|
1650
|
+
let r = n === "xlsx" ? await De(e, t) : B(e, t, n);
|
|
1651
|
+
return new Blob([r], { type: Pe(n) });
|
|
1652
1652
|
}
|
|
1653
|
-
function
|
|
1653
|
+
function ke(e, t) {
|
|
1654
1654
|
return e == null ? "" : (t.type === "date" || t.type === "datetime") && e instanceof Date ? e.toISOString() : String(e);
|
|
1655
1655
|
}
|
|
1656
1656
|
function V(e, t, n) {
|
|
1657
|
-
return [t.map((e) => H(e.label, n)).join(n), ...e.map((e) => t.map((t) => H(
|
|
1657
|
+
return [t.map((e) => H(e.label, n)).join(n), ...e.map((e) => t.map((t) => H(ke(e[t.key], t), n)).join(n))].join("\n");
|
|
1658
1658
|
}
|
|
1659
1659
|
function H(e, t) {
|
|
1660
1660
|
return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? "\"" + e.replace(/"/g, "\"\"") + "\"" : e;
|
|
1661
1661
|
}
|
|
1662
|
-
function
|
|
1662
|
+
function Ae(e, t) {
|
|
1663
1663
|
let n = e.map((e) => {
|
|
1664
1664
|
let n = {};
|
|
1665
1665
|
for (let r of t) {
|
|
@@ -1670,35 +1670,35 @@ function ke(e, t) {
|
|
|
1670
1670
|
});
|
|
1671
1671
|
return JSON.stringify(n, null, 2);
|
|
1672
1672
|
}
|
|
1673
|
-
function
|
|
1673
|
+
function je(e, t) {
|
|
1674
1674
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
1675
1675
|
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);
|
|
1676
1676
|
}
|
|
1677
|
-
var
|
|
1677
|
+
var Me = {
|
|
1678
1678
|
csv: "text/csv;charset=utf-8",
|
|
1679
1679
|
tsv: "text/tab-separated-values;charset=utf-8",
|
|
1680
1680
|
json: "application/json;charset=utf-8",
|
|
1681
1681
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
1682
|
-
},
|
|
1682
|
+
}, Ne = {
|
|
1683
1683
|
csv: ".csv",
|
|
1684
1684
|
tsv: ".tsv",
|
|
1685
1685
|
json: ".json",
|
|
1686
1686
|
xlsx: ".xlsx"
|
|
1687
1687
|
};
|
|
1688
|
-
function Ne(e) {
|
|
1689
|
-
return je[e];
|
|
1690
|
-
}
|
|
1691
1688
|
function Pe(e) {
|
|
1692
1689
|
return Me[e];
|
|
1693
1690
|
}
|
|
1691
|
+
function Fe(e) {
|
|
1692
|
+
return Ne[e];
|
|
1693
|
+
}
|
|
1694
1694
|
//#endregion
|
|
1695
1695
|
//#region src/export/xlsx-reader.ts
|
|
1696
|
-
function
|
|
1696
|
+
function Ie(e) {
|
|
1697
1697
|
for (let t = e.byteLength - 22; t >= 0; t--) if (e.getUint32(t, !0) === 101010256) return t;
|
|
1698
1698
|
throw Error("XLSX: End of central directory not found — not a valid ZIP file");
|
|
1699
1699
|
}
|
|
1700
|
-
function
|
|
1701
|
-
let t =
|
|
1700
|
+
function Le(e) {
|
|
1701
|
+
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;
|
|
1702
1702
|
for (; o < s && e.getUint32(o, !0) === 33639248;) {
|
|
1703
1703
|
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));
|
|
1704
1704
|
a.push({
|
|
@@ -1711,7 +1711,7 @@ function Ie(e) {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
return a;
|
|
1713
1713
|
}
|
|
1714
|
-
async function
|
|
1714
|
+
async function Re(e) {
|
|
1715
1715
|
let t = new DecompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
|
|
1716
1716
|
n.write(e), n.close();
|
|
1717
1717
|
let i = [];
|
|
@@ -1724,28 +1724,28 @@ async function Le(e) {
|
|
|
1724
1724
|
for (let e of i) o.set(e, s), s += e.length;
|
|
1725
1725
|
return o;
|
|
1726
1726
|
}
|
|
1727
|
-
async function
|
|
1727
|
+
async function ze(e, t) {
|
|
1728
1728
|
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);
|
|
1729
1729
|
if (t.compressionMethod === 0) return o.slice();
|
|
1730
|
-
if (t.compressionMethod === 8) return
|
|
1730
|
+
if (t.compressionMethod === 8) return Re(o);
|
|
1731
1731
|
throw Error(`XLSX: Unsupported compression method ${t.compressionMethod}`);
|
|
1732
1732
|
}
|
|
1733
|
-
async function
|
|
1734
|
-
let t = new DataView(e), n =
|
|
1735
|
-
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await
|
|
1733
|
+
async function Be(e) {
|
|
1734
|
+
let t = new DataView(e), n = Le(t), r = /* @__PURE__ */ new Map();
|
|
1735
|
+
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await ze(t, e));
|
|
1736
1736
|
return r;
|
|
1737
1737
|
}
|
|
1738
|
-
var
|
|
1738
|
+
var Ve = new TextDecoder("utf-8");
|
|
1739
1739
|
function U(e) {
|
|
1740
|
-
let t =
|
|
1740
|
+
let t = Ve.decode(e);
|
|
1741
1741
|
return new DOMParser().parseFromString(t, "application/xml");
|
|
1742
1742
|
}
|
|
1743
|
-
function
|
|
1743
|
+
function He(e) {
|
|
1744
1744
|
if (!e) return [];
|
|
1745
1745
|
let t = U(e);
|
|
1746
1746
|
return Array.from(t.querySelectorAll("si")).map((e) => Array.from(e.querySelectorAll("t")).map((e) => e.textContent ?? "").join(""));
|
|
1747
1747
|
}
|
|
1748
|
-
var
|
|
1748
|
+
var Ue = /* @__PURE__ */ new Set([
|
|
1749
1749
|
14,
|
|
1750
1750
|
15,
|
|
1751
1751
|
16,
|
|
@@ -1765,29 +1765,29 @@ var He = /* @__PURE__ */ new Set([
|
|
|
1765
1765
|
57,
|
|
1766
1766
|
58
|
|
1767
1767
|
]);
|
|
1768
|
-
function
|
|
1768
|
+
function We(e) {
|
|
1769
1769
|
let t = e.replace(/"[^"]*"/g, "").replace(/\\./g, "").replace(/\[[^\]]*\]/g, "").split(";")[0];
|
|
1770
1770
|
return /[dy]/i.test(t);
|
|
1771
1771
|
}
|
|
1772
|
-
function
|
|
1772
|
+
function Ge(e) {
|
|
1773
1773
|
let t = /* @__PURE__ */ new Set();
|
|
1774
1774
|
if (!e) return t;
|
|
1775
1775
|
let n = U(e), r = /* @__PURE__ */ new Map();
|
|
1776
1776
|
for (let e of Array.from(n.querySelectorAll("numFmts > numFmt"))) r.set(parseInt(e.getAttribute("numFmtId") ?? "", 10), e.getAttribute("formatCode") ?? "");
|
|
1777
1777
|
return Array.from(n.querySelectorAll("cellXfs > xf")).forEach((e, n) => {
|
|
1778
1778
|
let i = parseInt(e.getAttribute("numFmtId") ?? "0", 10), a = r.get(i);
|
|
1779
|
-
(a === void 0 ?
|
|
1779
|
+
(a === void 0 ? Ue.has(i) : We(a)) && t.add(n);
|
|
1780
1780
|
}), t;
|
|
1781
1781
|
}
|
|
1782
|
-
function
|
|
1782
|
+
function Ke(e) {
|
|
1783
1783
|
if (!e) return !1;
|
|
1784
1784
|
let t = U(e).querySelector("workbookPr")?.getAttribute("date1904");
|
|
1785
1785
|
return t === "1" || t === "true";
|
|
1786
1786
|
}
|
|
1787
|
-
function
|
|
1787
|
+
function qe(e, t) {
|
|
1788
1788
|
return new Date((t ? Date.UTC(1904, 0, 1) : Date.UTC(1899, 11, 30)) + Math.floor(e) * 864e5).toISOString().slice(0, 10);
|
|
1789
1789
|
}
|
|
1790
|
-
function
|
|
1790
|
+
function Je(e, t, n, r) {
|
|
1791
1791
|
let i = U(e).querySelectorAll("row");
|
|
1792
1792
|
if (i.length === 0) return [];
|
|
1793
1793
|
let a = 0, o = /* @__PURE__ */ new Map();
|
|
@@ -1795,7 +1795,7 @@ function qe(e, t, n, r) {
|
|
|
1795
1795
|
let i = parseInt(e.getAttribute("r") ?? "1", 10) - 1, s = /* @__PURE__ */ new Map();
|
|
1796
1796
|
o.set(i, s);
|
|
1797
1797
|
for (let i of e.querySelectorAll("c")) {
|
|
1798
|
-
let e =
|
|
1798
|
+
let e = Ye(i.getAttribute("r") ?? "");
|
|
1799
1799
|
e > a && (a = e);
|
|
1800
1800
|
let o = i.getAttribute("t") ?? "", c = i.getAttribute("s") ?? "", l = i.querySelector("v")?.textContent ?? "", u = i.querySelector("is > t")?.textContent ?? null, d;
|
|
1801
1801
|
if (o === "s") d = t[parseInt(l, 10)] ?? "";
|
|
@@ -1804,7 +1804,7 @@ function qe(e, t, n, r) {
|
|
|
1804
1804
|
else if (l === "") d = "";
|
|
1805
1805
|
else {
|
|
1806
1806
|
let e = parseFloat(l);
|
|
1807
|
-
d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ?
|
|
1807
|
+
d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ? qe(e, r) : l;
|
|
1808
1808
|
}
|
|
1809
1809
|
s.set(e, d);
|
|
1810
1810
|
}
|
|
@@ -1818,13 +1818,13 @@ function qe(e, t, n, r) {
|
|
|
1818
1818
|
}
|
|
1819
1819
|
return c;
|
|
1820
1820
|
}
|
|
1821
|
-
function
|
|
1821
|
+
function Ye(e) {
|
|
1822
1822
|
let t = 0, n = 0;
|
|
1823
1823
|
for (; n < e.length && e[n] >= "A" && e[n] <= "Z";) t = t * 26 + (e.charCodeAt(n) - 64), n++;
|
|
1824
1824
|
return t - 1;
|
|
1825
1825
|
}
|
|
1826
|
-
async function
|
|
1827
|
-
let t = await
|
|
1826
|
+
async function Xe(e) {
|
|
1827
|
+
let t = await Be(e), n = He(t.get("xl/sharedStrings.xml")), r = t.get("xl/worksheets/sheet1.xml");
|
|
1828
1828
|
if (!r) {
|
|
1829
1829
|
for (let [e, n] of t) if (e.toLowerCase().includes("worksheets/sheet")) {
|
|
1830
1830
|
r = n;
|
|
@@ -1832,7 +1832,7 @@ async function Ye(e) {
|
|
|
1832
1832
|
}
|
|
1833
1833
|
}
|
|
1834
1834
|
if (!r) throw Error("XLSX: No worksheet found");
|
|
1835
|
-
let i =
|
|
1835
|
+
let i = Ge(t.get("xl/styles.xml")), a = Ke(t.get("xl/workbook.xml")), o = Je(r, n, i, a);
|
|
1836
1836
|
return o.length === 0 ? {
|
|
1837
1837
|
headers: [],
|
|
1838
1838
|
rows: []
|
|
@@ -1856,21 +1856,21 @@ function G(e, t, n, r) {
|
|
|
1856
1856
|
}
|
|
1857
1857
|
//#endregion
|
|
1858
1858
|
//#region src/flex-table.ts
|
|
1859
|
-
var K =
|
|
1859
|
+
var K = {
|
|
1860
1860
|
eq: "=",
|
|
1861
1861
|
neq: "≠",
|
|
1862
1862
|
gt: ">",
|
|
1863
1863
|
lt: "<",
|
|
1864
1864
|
gte: "≥",
|
|
1865
1865
|
lte: "≤"
|
|
1866
|
-
},
|
|
1866
|
+
}, q = 120, J = 40, Y = 20, X = 32, Z = 5, Ze = 200, Q = class extends n {
|
|
1867
1867
|
constructor(...e) {
|
|
1868
|
-
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this._rowHeightFromCss =
|
|
1868
|
+
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, 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 = "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 oe(), this._editing = new se(), this._rowSelection = new A(), this._undo = new j(), 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 = () => {
|
|
1869
1869
|
this._commitCommentPopup();
|
|
1870
1870
|
}, 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();
|
|
1871
1871
|
}
|
|
1872
1872
|
static {
|
|
1873
|
-
this.styles =
|
|
1873
|
+
this.styles = x;
|
|
1874
1874
|
}
|
|
1875
1875
|
get data() {
|
|
1876
1876
|
return this._data;
|
|
@@ -1880,7 +1880,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
1880
1880
|
this._data = e, n && !this._inUndoRedo && (this.clearUndoOnDataChange && this._undo.clear(), this.clearSelectionOnDataChange && this._rowSelection.selectedCount > 0 && (this._rowSelection.deselectAll(), this._rowSelectionVersion++, this._dispatchRowSelectionEvent())), this.requestUpdate("data", t);
|
|
1881
1881
|
}
|
|
1882
1882
|
get rowHeight() {
|
|
1883
|
-
let e = this._rowHeightExplicit ?? this._rowHeightFromCss ??
|
|
1883
|
+
let e = this._rowHeightExplicit ?? this._rowHeightFromCss ?? X;
|
|
1884
1884
|
return Math.max(e, this._targetFloor);
|
|
1885
1885
|
}
|
|
1886
1886
|
set rowHeight(e) {
|
|
@@ -2237,10 +2237,10 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
2237
2237
|
rows: [],
|
|
2238
2238
|
cols: []
|
|
2239
2239
|
};
|
|
2240
|
-
return
|
|
2240
|
+
return Oe(n.rows, n.cols, e);
|
|
2241
2241
|
}
|
|
2242
2242
|
async exportToFile(e, t) {
|
|
2243
|
-
|
|
2243
|
+
je(await this.exportToBlob(e), t ?? `export${Fe(e)}`);
|
|
2244
2244
|
}
|
|
2245
2245
|
_exportSlice(e) {
|
|
2246
2246
|
if (e?.selectionOnly) {
|
|
@@ -2313,7 +2313,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
2313
2313
|
async importFromFile(e) {
|
|
2314
2314
|
let t = e.name.toLowerCase();
|
|
2315
2315
|
if (t.endsWith(".xlsx")) {
|
|
2316
|
-
let t = await
|
|
2316
|
+
let t = await Xe(await e.arrayBuffer());
|
|
2317
2317
|
this._applyImportedSheet(t);
|
|
2318
2318
|
} else if (t.endsWith(".csv") || t.endsWith(".tsv")) {
|
|
2319
2319
|
let t = await e.text(), n = h(t);
|
|
@@ -2405,8 +2405,8 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
2405
2405
|
return this._columnWidths.get(e);
|
|
2406
2406
|
}
|
|
2407
2407
|
_getColWidth(e) {
|
|
2408
|
-
let t = this._columnWidths.get(e.key) ?? e.width ??
|
|
2409
|
-
return Math.max(t, e.minWidth ??
|
|
2408
|
+
let t = this._columnWidths.get(e.key) ?? e.width ?? q;
|
|
2409
|
+
return Math.max(t, e.minWidth ?? J);
|
|
2410
2410
|
}
|
|
2411
2411
|
get headerHeight() {
|
|
2412
2412
|
return this.rowHeight + 8;
|
|
@@ -2505,7 +2505,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
2505
2505
|
this._filteredIndices = Array.from({ length: this.data.length }, (e, t) => t), this._sortedIndices = this._filteredIndices;
|
|
2506
2506
|
return;
|
|
2507
2507
|
}
|
|
2508
|
-
if (this._filteredIndices =
|
|
2508
|
+
if (this._filteredIndices = ce(this.data, this._filters, (e, t, n) => {
|
|
2509
2509
|
this.dispatchEvent(new CustomEvent("filter-error", {
|
|
2510
2510
|
detail: {
|
|
2511
2511
|
error: e,
|
|
@@ -2699,7 +2699,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
2699
2699
|
if (this._editingCell = null, !t) return;
|
|
2700
2700
|
let { row: n, col: r } = t.position, i = this._toDataIndex(n), a = this.visibleColumns[r], o = t.originalValue;
|
|
2701
2701
|
if (a.autocomplete === "strict" && e != null && e !== "" && !this._getAutocompleteCandidates(a, "").includes(String(e))) {
|
|
2702
|
-
let t =
|
|
2702
|
+
let t = k("notInList");
|
|
2703
2703
|
this._markCellInvalid(n, r, t), this.dispatchEvent(new CustomEvent("validation-error", {
|
|
2704
2704
|
detail: {
|
|
2705
2705
|
row: i,
|
|
@@ -2714,7 +2714,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
2714
2714
|
return;
|
|
2715
2715
|
}
|
|
2716
2716
|
if (a.type === "number" && typeof e == "string" || a.type === "date" && typeof e == "string" && f(e) === null || a.type === "datetime" && typeof e == "string" && p(e) === null) {
|
|
2717
|
-
let t =
|
|
2717
|
+
let t = k(a.type === "number" ? "notANumber" : a.type === "date" ? "notADate" : "notADateTime");
|
|
2718
2718
|
this._markCellInvalid(n, r, t), this.dispatchEvent(new CustomEvent("validation-error", {
|
|
2719
2719
|
detail: {
|
|
2720
2720
|
row: i,
|
|
@@ -2847,7 +2847,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
2847
2847
|
"y"
|
|
2848
2848
|
].includes(t) && this._handleCtrlKey(e)) return;
|
|
2849
2849
|
}
|
|
2850
|
-
if (t.length !== 0 && this._visibleRowCount !== 0) {
|
|
2850
|
+
if (t.length !== 0 && this._visibleRowCount !== 0 && (e.composedPath()[0] === this || e.ctrlKey || e.metaKey)) {
|
|
2851
2851
|
if ((e.key === "Enter" || e.key === "F2") && this._activeCell && !_(e)) {
|
|
2852
2852
|
e.preventDefault();
|
|
2853
2853
|
let n = t[this._activeCell.col];
|
|
@@ -2890,7 +2890,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
2890
2890
|
case "y": return e.preventDefault(), this.redo(), !0;
|
|
2891
2891
|
case "c":
|
|
2892
2892
|
case "x": {
|
|
2893
|
-
if (
|
|
2893
|
+
if (y(e.composedPath()[0])) return !0;
|
|
2894
2894
|
let t = this._selectionTsv();
|
|
2895
2895
|
if (!t) return !0;
|
|
2896
2896
|
let n = e.key.toLowerCase() === "x" && this.editable;
|
|
@@ -2898,7 +2898,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
2898
2898
|
e ? this._afterCopy(t.range, t.text, n) : this._clipboardError("copy", /* @__PURE__ */ Error("The clipboard did not take the copied text"));
|
|
2899
2899
|
}), !0;
|
|
2900
2900
|
}
|
|
2901
|
-
case "v": return
|
|
2901
|
+
case "v": return y(e.composedPath()[0]) || !this.editable || !this._activeCell || b().then((e) => this._pasteText(e), (e) => this._clipboardError("paste", e)), !0;
|
|
2902
2902
|
case "d": return e.preventDefault(), this.editable && this._handleFillDown(), !0;
|
|
2903
2903
|
case "r": return e.preventDefault(), this.editable && this._handleFillRight(), !0;
|
|
2904
2904
|
case "f": return e.preventDefault(), this._toggleFindPanel("find"), !0;
|
|
@@ -2910,12 +2910,12 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
2910
2910
|
if (!e.altKey || !this._activeCell || e.key !== "ArrowLeft" && e.key !== "ArrowRight") return !1;
|
|
2911
2911
|
e.preventDefault();
|
|
2912
2912
|
let n = t[this._activeCell.col];
|
|
2913
|
-
return n && this._resizeColumnBy(n.key, e.key === "ArrowRight" ?
|
|
2913
|
+
return n && this._resizeColumnBy(n.key, e.key === "ArrowRight" ? Y : -20), !0;
|
|
2914
2914
|
}
|
|
2915
2915
|
_resizeColumnBy(e, t) {
|
|
2916
2916
|
let n = this.visibleColumns.findIndex((t) => t.key === e), r = this.visibleColumns[n];
|
|
2917
2917
|
if (!r) return;
|
|
2918
|
-
let i = this._columnWidths.get(r.key) ?? r.width ??
|
|
2918
|
+
let i = this._columnWidths.get(r.key) ?? r.width ?? q, a = r.minWidth ?? J, o = Math.max(a, i + t);
|
|
2919
2919
|
this._columnWidths.set(r.key, o), this.requestUpdate(), this.dispatchEvent(new CustomEvent("column-resize", {
|
|
2920
2920
|
detail: {
|
|
2921
2921
|
key: r.key,
|
|
@@ -2945,7 +2945,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
2945
2945
|
let e = this._selection.getEffectiveRange();
|
|
2946
2946
|
return e ? {
|
|
2947
2947
|
range: e,
|
|
2948
|
-
text:
|
|
2948
|
+
text: ue(this._sortedIndices.map((e) => this.data[e]), this.visibleColumns, e)
|
|
2949
2949
|
} : null;
|
|
2950
2950
|
}
|
|
2951
2951
|
async _copyFromMenu() {
|
|
@@ -3258,7 +3258,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3258
3258
|
@click=${n ? (t) => this._onHeaderClick(t, e) : void 0}>
|
|
3259
3259
|
${C ? i`
|
|
3260
3260
|
<button class="ft-hidden-col-indicator"
|
|
3261
|
-
title=${
|
|
3261
|
+
title=${k("showHiddenColumns")}
|
|
3262
3262
|
@click=${(t) => {
|
|
3263
3263
|
t.stopPropagation(), this._showHiddenBefore(e);
|
|
3264
3264
|
}}>❯</button>
|
|
@@ -3268,8 +3268,8 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3268
3268
|
${o >= 0 ? i`<span class="ft-sort-order">${o + 1}</span>` : ""}
|
|
3269
3269
|
<button class="ft-column-menu-btn ${s ? "ft-filter-active" : ""}"
|
|
3270
3270
|
type="button"
|
|
3271
|
-
title=${
|
|
3272
|
-
aria-label=${
|
|
3271
|
+
title=${k("columnMenu")}
|
|
3272
|
+
aria-label=${k("columnMenuFor", { header: e.label })}
|
|
3273
3273
|
aria-haspopup="menu"
|
|
3274
3274
|
aria-expanded=${this._headerMenu?.key === e.key ? "true" : "false"}
|
|
3275
3275
|
@mousedown=${(e) => e.stopPropagation()}
|
|
@@ -3389,26 +3389,26 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3389
3389
|
}}>${t}</button>
|
|
3390
3390
|
`;
|
|
3391
3391
|
return i`
|
|
3392
|
-
<div class="ft-header-menu" role="menu" aria-label=${
|
|
3392
|
+
<div class="ft-header-menu" role="menu" aria-label=${k("columnMenuRegion", { header: o.label })}
|
|
3393
3393
|
style="position: fixed; left: ${t}px; top: ${n}px; z-index: var(--u-layer-floating, 1000);"
|
|
3394
3394
|
@mousedown=${(e) => e.stopPropagation()}
|
|
3395
3395
|
@keydown=${(e) => this._onHeaderMenuKeydown(e)}>
|
|
3396
3396
|
${o.sortable === !1 ? a : i`
|
|
3397
|
-
${c("sort-asc",
|
|
3398
|
-
${c("sort-desc",
|
|
3397
|
+
${c("sort-asc", k("sortAscending"), () => this._applySortFromMenu(e, "asc"))}
|
|
3398
|
+
${c("sort-desc", k("sortDescending"), () => this._applySortFromMenu(e, "desc"))}
|
|
3399
3399
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3400
3400
|
`}
|
|
3401
3401
|
${this.showFilters ? i`
|
|
3402
|
-
${c("filter",
|
|
3403
|
-
${s ? c("clear-filter",
|
|
3402
|
+
${c("filter", k("filter"), () => this._openFilterFromMenu(e))}
|
|
3403
|
+
${s ? c("clear-filter", k("clearFilter"), () => this._clearColumnFilter(e)) : a}
|
|
3404
3404
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3405
3405
|
` : a}
|
|
3406
|
-
${c("hide",
|
|
3407
|
-
${r.map((e) => c("show",
|
|
3406
|
+
${c("hide", k("hideColumn"), () => this._setColumnHidden(e, !0))}
|
|
3407
|
+
${r.map((e) => c("show", k("showColumn", { header: e.label }), () => this._setColumnHidden(e.key, !1)))}
|
|
3408
3408
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3409
|
-
${c("autofit",
|
|
3410
|
-
${c("wider",
|
|
3411
|
-
${c("narrower",
|
|
3409
|
+
${c("autofit", k("autoFitWidth"), () => this._autoFitColumn(e))}
|
|
3410
|
+
${c("wider", k("wider"), () => this._resizeColumnBy(e, Y), !0)}
|
|
3411
|
+
${c("narrower", k("narrower"), () => this._resizeColumnBy(e, -20), !0)}
|
|
3412
3412
|
</div>
|
|
3413
3413
|
`;
|
|
3414
3414
|
}
|
|
@@ -3426,26 +3426,26 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3426
3426
|
}}>${e}</button>
|
|
3427
3427
|
`, f = i`<div class="ft-context-menu-separator" role="separator"></div>`;
|
|
3428
3428
|
return i`
|
|
3429
|
-
<div class="ft-body-context-menu" role="menu" aria-label=${
|
|
3429
|
+
<div class="ft-body-context-menu" role="menu" aria-label=${k("cellActions")}
|
|
3430
3430
|
style="position: fixed; left: ${n}px; top: ${r}px; z-index: var(--u-layer-floating, 1000);"
|
|
3431
3431
|
@mousedown=${(e) => e.stopPropagation()}
|
|
3432
3432
|
@keydown=${(e) => this._onMenuKeydown(e, ".ft-body-context-menu", l)}>
|
|
3433
|
-
${d(
|
|
3433
|
+
${d(k("copy"), () => this._copyFromMenu())}
|
|
3434
3434
|
${f}
|
|
3435
|
-
${d(
|
|
3436
|
-
${d(
|
|
3437
|
-
${d(
|
|
3435
|
+
${d(k("insertRowAbove"), () => this.addRow(void 0, t))}
|
|
3436
|
+
${d(k("insertRowBelow"), () => this.addRow(void 0, t + 1))}
|
|
3437
|
+
${d(k("deleteRow"), () => this.deleteRows([t]), !0)}
|
|
3438
3438
|
${f}
|
|
3439
|
-
${d(
|
|
3439
|
+
${d(k("hideColumn"), () => this._setColumnHidden(o.key, !0))}
|
|
3440
3440
|
${f}
|
|
3441
|
-
${d(`${
|
|
3442
|
-
${d(`${
|
|
3441
|
+
${d(`${k("sortAscending")} ↑`, () => this._applySortFromMenu(o.key, "asc"))}
|
|
3442
|
+
${d(`${k("sortDescending")} ↓`, () => this._applySortFromMenu(o.key, "desc"))}
|
|
3443
3443
|
${f}
|
|
3444
|
-
${d(
|
|
3445
|
-
${c ? d(
|
|
3444
|
+
${d(k("filterByThisValue"), () => this.setFilter(o.key, (e) => e === s))}
|
|
3445
|
+
${c ? d(k("clearFilter"), () => this.removeFilter(o.key)) : a}
|
|
3446
3446
|
${f}
|
|
3447
|
-
${d(
|
|
3448
|
-
${u ? d(
|
|
3447
|
+
${d(k(u ? "editComment" : "addComment"), () => this._openCommentPopup(t, o.key, n, r))}
|
|
3448
|
+
${u ? d(k("deleteComment"), () => this.setComment(t, o.key, null), !0) : a}
|
|
3449
3449
|
</div>
|
|
3450
3450
|
`;
|
|
3451
3451
|
}
|
|
@@ -3477,13 +3477,13 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3477
3477
|
@mousedown=${(e) => e.stopPropagation()}>
|
|
3478
3478
|
<textarea class="ft-comment-popup-textarea"
|
|
3479
3479
|
rows="4"
|
|
3480
|
-
placeholder=${
|
|
3480
|
+
placeholder=${k("addCommentPlaceholder")}
|
|
3481
3481
|
@keydown=${(e) => {
|
|
3482
3482
|
e.key === "Escape" && (e.preventDefault(), this._cancelCommentPopup()), e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), this._commitCommentPopup());
|
|
3483
3483
|
}}></textarea>
|
|
3484
3484
|
<div class="ft-comment-popup-buttons">
|
|
3485
|
-
<button class="ft-comment-popup-cancel" @click=${() => this._cancelCommentPopup()}>${
|
|
3486
|
-
<button class="ft-comment-popup-save" @click=${() => this._commitCommentPopup()}>${
|
|
3485
|
+
<button class="ft-comment-popup-cancel" @click=${() => this._cancelCommentPopup()}>${k("cancel")}</button>
|
|
3486
|
+
<button class="ft-comment-popup-save" @click=${() => this._commitCommentPopup()}>${k("save")}</button>
|
|
3487
3487
|
</div>
|
|
3488
3488
|
</div>
|
|
3489
3489
|
`;
|
|
@@ -3520,7 +3520,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3520
3520
|
<div class="ft-filter-dropdown" @click=${(e) => e.stopPropagation()}>
|
|
3521
3521
|
${t === "boolean" ? this._renderBooleanFilter(e) : t === "number" ? this._renderNumberFilter(e) : t === "date" || t === "datetime" ? this._renderDateFilter(e) : this._renderTextFilter(e)}
|
|
3522
3522
|
<div class="ft-filter-actions">
|
|
3523
|
-
<button class="ft-filter-clear" @click=${() => this._clearColumnFilter(e.key)}>${
|
|
3523
|
+
<button class="ft-filter-clear" @click=${() => this._clearColumnFilter(e.key)}>${k("clear")}</button>
|
|
3524
3524
|
</div>
|
|
3525
3525
|
</div>
|
|
3526
3526
|
`;
|
|
@@ -3553,7 +3553,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3553
3553
|
let n = this._emptyFilterState.get(e) ?? "";
|
|
3554
3554
|
return i`
|
|
3555
3555
|
<div class="ft-filter-empty-row">
|
|
3556
|
-
<label>${
|
|
3556
|
+
<label>${k("blankCells")}</label>
|
|
3557
3557
|
<select class="ft-filter-mode-select"
|
|
3558
3558
|
.value=${n}
|
|
3559
3559
|
@change=${(n) => {
|
|
@@ -3563,9 +3563,9 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3563
3563
|
@keydown=${(e) => {
|
|
3564
3564
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
3565
3565
|
}}>
|
|
3566
|
-
<option value="">${
|
|
3567
|
-
<option value="empty">${
|
|
3568
|
-
<option value="non-empty">${
|
|
3566
|
+
<option value="">${k("blankAll")}</option>
|
|
3567
|
+
<option value="empty">${k("emptyOnly")}</option>
|
|
3568
|
+
<option value="non-empty">${k("nonEmptyOnly")}</option>
|
|
3569
3569
|
</select>
|
|
3570
3570
|
</div>
|
|
3571
3571
|
`;
|
|
@@ -3641,13 +3641,13 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3641
3641
|
@keydown=${(e) => {
|
|
3642
3642
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
3643
3643
|
}}>
|
|
3644
|
-
<option value="contains">${
|
|
3645
|
-
<option value="starts">${
|
|
3646
|
-
<option value="ends">${
|
|
3647
|
-
<option value="wildcard">${
|
|
3644
|
+
<option value="contains">${k("contains")}</option>
|
|
3645
|
+
<option value="starts">${k("startsWith")}</option>
|
|
3646
|
+
<option value="ends">${k("endsWith")}</option>
|
|
3647
|
+
<option value="wildcard">${k("wildcard")}</option>
|
|
3648
3648
|
</select>
|
|
3649
3649
|
</div>
|
|
3650
|
-
<input class="ft-filter-input" type="text" placeholder=${
|
|
3650
|
+
<input class="ft-filter-input" type="text" placeholder=${k("searchPlaceholder")}
|
|
3651
3651
|
.value=${t.value}
|
|
3652
3652
|
@input=${(t) => {
|
|
3653
3653
|
let n = t.target.value, r = this._textFilterState.get(e.key) ?? {
|
|
@@ -3696,9 +3696,9 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3696
3696
|
@keydown=${(e) => {
|
|
3697
3697
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
3698
3698
|
}}>
|
|
3699
|
-
${Object.keys(
|
|
3699
|
+
${Object.keys(K).map((e) => i`<option value=${e}>${K[e]}</option>`)}
|
|
3700
3700
|
</select>
|
|
3701
|
-
<input class="ft-filter-input ft-num-cond-input" type="text" inputmode="decimal" placeholder=${
|
|
3701
|
+
<input class="ft-filter-input ft-num-cond-input" type="text" inputmode="decimal" placeholder=${k("valuePlaceholder")}
|
|
3702
3702
|
.value=${n.text ?? (n.value == null ? "" : N(n.value))}
|
|
3703
3703
|
aria-invalid=${n.text && n.value == null ? "true" : "false"}
|
|
3704
3704
|
@input=${(n) => {
|
|
@@ -3764,12 +3764,12 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3764
3764
|
return i`
|
|
3765
3765
|
<div class="ft-filter-range ft-filter-range-dates">
|
|
3766
3766
|
<u-date-picker class="ft-filter-date" size="sm" clearable
|
|
3767
|
-
mode=${t ? "datetime" : "date"} label=${
|
|
3767
|
+
mode=${t ? "datetime" : "date"} label=${k("fromPlaceholder")}
|
|
3768
3768
|
.value=${n.from ?? ""} max=${r(n.to) ?? a}
|
|
3769
3769
|
@change=${(t) => this._applyDateFilter(e.key, t, "from")}
|
|
3770
3770
|
@keydown=${o}></u-date-picker>
|
|
3771
3771
|
<u-date-picker class="ft-filter-date" size="sm" clearable
|
|
3772
|
-
mode=${t ? "datetime" : "date"} label=${
|
|
3772
|
+
mode=${t ? "datetime" : "date"} label=${k("toPlaceholder")}
|
|
3773
3773
|
.value=${n.to ?? ""} min=${r(n.from) ?? a}
|
|
3774
3774
|
@change=${(t) => this._applyDateFilter(e.key, t, "to")}
|
|
3775
3775
|
@keydown=${o}></u-date-picker>
|
|
@@ -3793,9 +3793,9 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3793
3793
|
@keydown=${(e) => {
|
|
3794
3794
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
3795
3795
|
}}>
|
|
3796
|
-
<option value="all">${
|
|
3797
|
-
<option value="true">\u2714 ${
|
|
3798
|
-
<option value="false">\u2718 ${
|
|
3796
|
+
<option value="all">${k("all")}</option>
|
|
3797
|
+
<option value="true">\u2714 ${k("booleanTrue")}</option>
|
|
3798
|
+
<option value="false">\u2718 ${k("booleanFalse")}</option>
|
|
3799
3799
|
</select>
|
|
3800
3800
|
${this._renderEmptyFilterRow(e.key)}
|
|
3801
3801
|
`;
|
|
@@ -3808,7 +3808,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3808
3808
|
if (!n) return;
|
|
3809
3809
|
let r = this.shadowRoot?.querySelectorAll(`.ft-cell[data-col-index="${t}"]`), i = 0, a = this.shadowRoot?.querySelector(`.ft-header-cell[data-col-index="${t}"]`);
|
|
3810
3810
|
if (a && (i = Math.max(i, a.scrollWidth)), r) for (let e of r) i = Math.max(i, e.scrollWidth);
|
|
3811
|
-
let o = n.minWidth ??
|
|
3811
|
+
let o = n.minWidth ?? J, s = Math.max(o, i + 8);
|
|
3812
3812
|
this._columnWidths.set(n.key, s), this.requestUpdate(), this.dispatchEvent(new CustomEvent("column-resize", {
|
|
3813
3813
|
detail: {
|
|
3814
3814
|
key: n.key,
|
|
@@ -3821,7 +3821,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3821
3821
|
}
|
|
3822
3822
|
_onResizeStart(e, t) {
|
|
3823
3823
|
e.preventDefault(), e.stopPropagation();
|
|
3824
|
-
let n = this.visibleColumns[t], r = this._columnWidths.get(n.key) ?? n.width ??
|
|
3824
|
+
let n = this.visibleColumns[t], r = this._columnWidths.get(n.key) ?? n.width ?? q;
|
|
3825
3825
|
this._resizing = {
|
|
3826
3826
|
colIndex: t,
|
|
3827
3827
|
startX: e.clientX,
|
|
@@ -3829,13 +3829,13 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
3829
3829
|
};
|
|
3830
3830
|
let i = (e) => {
|
|
3831
3831
|
if (!this._resizing) return;
|
|
3832
|
-
let t = e.clientX - this._resizing.startX, r = n.minWidth ??
|
|
3832
|
+
let t = e.clientX - this._resizing.startX, r = n.minWidth ?? J, i = Math.max(r, this._resizing.startWidth + t);
|
|
3833
3833
|
this._columnWidths.set(n.key, i), this.requestUpdate();
|
|
3834
3834
|
}, a = () => {
|
|
3835
3835
|
document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this._resizeCleanup = null;
|
|
3836
3836
|
}, o = () => {
|
|
3837
3837
|
if (a(), this._resizing) {
|
|
3838
|
-
let e = this._columnWidths.get(n.key) ??
|
|
3838
|
+
let e = this._columnWidths.get(n.key) ?? q;
|
|
3839
3839
|
this.dispatchEvent(new CustomEvent("column-resize", {
|
|
3840
3840
|
detail: {
|
|
3841
3841
|
key: n.key,
|
|
@@ -4215,39 +4215,39 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
4215
4215
|
e.key === "Enter" && !_(e) && e.target instanceof HTMLInputElement && e.target.classList.contains("ft-find-input") && (e.shiftKey ? this._findPrev() : this._findNext());
|
|
4216
4216
|
}}>
|
|
4217
4217
|
<div class="ft-find-row">
|
|
4218
|
-
<input class="ft-find-input" type="text" placeholder=${
|
|
4218
|
+
<input class="ft-find-input" type="text" placeholder=${k("findPlaceholder")}
|
|
4219
4219
|
.value=${t}
|
|
4220
4220
|
@input=${(e) => {
|
|
4221
4221
|
this._findState.query = e.target.value, this._findSearch();
|
|
4222
4222
|
}}>
|
|
4223
4223
|
<span class="ft-find-count">${c > 0 ? `${l}/${c}` : t ? "0 results" : ""}</span>
|
|
4224
|
-
<button @click=${() => this._findPrev()} title=${
|
|
4225
|
-
<button @click=${() => this._findNext()} title=${
|
|
4226
|
-
<label title=${
|
|
4224
|
+
<button @click=${() => this._findPrev()} title=${k("findPrevious")}>◀</button>
|
|
4225
|
+
<button @click=${() => this._findNext()} title=${k("findNext")}>▶</button>
|
|
4226
|
+
<label title=${k("matchCase")}><input type="checkbox" ?checked=${r} @change=${(e) => {
|
|
4227
4227
|
this._findState.matchCase = e.target.checked, this._findSearch();
|
|
4228
4228
|
}}> Aa</label>
|
|
4229
|
-
<label title=${
|
|
4229
|
+
<label title=${k("wholeCell")}><input type="checkbox" ?checked=${a} @change=${(e) => {
|
|
4230
4230
|
this._findState.wholeCell = e.target.checked, this._findSearch();
|
|
4231
4231
|
}}> [ ]</label>
|
|
4232
|
-
<button @click=${() => this._closeFindPanel()} title=${
|
|
4232
|
+
<button @click=${() => this._closeFindPanel()} title=${k("closeFind")}>✕</button>
|
|
4233
4233
|
</div>
|
|
4234
4234
|
${e === "replace" ? i`
|
|
4235
4235
|
<div class="ft-find-row">
|
|
4236
|
-
<input class="ft-find-replace-input" type="text" placeholder=${
|
|
4236
|
+
<input class="ft-find-replace-input" type="text" placeholder=${k("replaceWithPlaceholder")}
|
|
4237
4237
|
.value=${n}
|
|
4238
4238
|
@input=${(e) => {
|
|
4239
4239
|
this._findState.replaceWith = e.target.value;
|
|
4240
4240
|
}}>
|
|
4241
|
-
<button @click=${() => this._replaceOne()} ?disabled=${c === 0}>${
|
|
4242
|
-
<button @click=${() => this._replaceAll()} ?disabled=${c === 0}>${
|
|
4241
|
+
<button @click=${() => this._replaceOne()} ?disabled=${c === 0}>${k("replace")}</button>
|
|
4242
|
+
<button @click=${() => this._replaceAll()} ?disabled=${c === 0}>${k("replaceAll")}</button>
|
|
4243
4243
|
</div>
|
|
4244
4244
|
` : ""}
|
|
4245
4245
|
</div>
|
|
4246
4246
|
`;
|
|
4247
4247
|
}
|
|
4248
4248
|
render() {
|
|
4249
|
-
let e = this.visibleColumns, t = this.importEnabled && this._isDragOver ? i`<div class="ft-import-overlay">${
|
|
4250
|
-
if (e.length === 0) return i`${t}${n}<div class="ft-empty">${
|
|
4249
|
+
let e = this.visibleColumns, t = this.importEnabled && this._isDragOver ? i`<div class="ft-import-overlay">${k("dropFileToImport")}</div>` : a, n = this.loading ? i`<div class="ft-loading-overlay"></div>` : a;
|
|
4250
|
+
if (e.length === 0) return i`${t}${n}<div class="ft-empty">${k("noColumnsDefined")}</div>`;
|
|
4251
4251
|
let r = this.headerHeight, o = this._totalRowWidth, { start: s, end: c } = this.visibleColRange, l = [];
|
|
4252
4252
|
for (let t = 0; t < e.length; t++) (e[t].pinned === "left" || e[t].pinned === "right") && (t < s || t >= c) && l.push(t);
|
|
4253
4253
|
let u = 0, d = this._scrollLeft, f = this.selectable ? i`<div class="ft-checkbox-header"
|
|
@@ -4437,9 +4437,9 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
4437
4437
|
o?.continues ? "ft-merge-continued" : "",
|
|
4438
4438
|
o?.opensDown ? "ft-merge-open" : "",
|
|
4439
4439
|
t.reveal === "hover" ? "ft-reveal-hover" : ""
|
|
4440
|
-
].filter(Boolean).join(" "),
|
|
4440
|
+
].filter(Boolean).join(" "), ee = this._toDataIndex(n), w = this._comments.get(ee)?.get(t.key) ?? null, E = w !== null, D = E ? i`<div class="ft-comment-indicator" title=${w}></div>` : a;
|
|
4441
4441
|
return i`
|
|
4442
|
-
<div class=${
|
|
4442
|
+
<div class=${E ? C + " ft-has-comment" : C}
|
|
4443
4443
|
role="gridcell"
|
|
4444
4444
|
aria-colindex=${r + 1}
|
|
4445
4445
|
data-col-index=${r}
|
|
@@ -4452,7 +4452,7 @@ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement
|
|
|
4452
4452
|
@mouseenter=${() => this._onCellMouseEnter(n, r)}
|
|
4453
4453
|
@click=${(e) => this._onCellClickEvent(e, n, r)}
|
|
4454
4454
|
@dblclick=${() => this._onCellDblClick(n, r)}>
|
|
4455
|
-
${
|
|
4455
|
+
${D}
|
|
4456
4456
|
${T(e[t.key], e, t)}
|
|
4457
4457
|
</div>
|
|
4458
4458
|
`;
|
|
@@ -4575,10 +4575,10 @@ G([s({ type: Array })], Q.prototype, "columns", void 0), G([s({
|
|
|
4575
4575
|
})], Q.prototype, "maxUndoSize", null), G([c()], Q.prototype, "_scrollTop", void 0), G([c()], Q.prototype, "_scrollLeft", void 0), G([c()], Q.prototype, "_viewportHeight", void 0), G([c()], Q.prototype, "_viewportWidth", void 0), G([c()], Q.prototype, "_activeCell", void 0), G([c()], Q.prototype, "_editingCell", void 0), G([c()], Q.prototype, "_sortCriteria", void 0), G([c()], Q.prototype, "_openFilterKey", void 0), G([c()], Q.prototype, "_rowSelectionVersion", void 0), G([c()], Q.prototype, "_autocompleteState", void 0), G([c()], Q.prototype, "_headerMenu", void 0), G([c()], Q.prototype, "_bodyContextMenu", void 0), G([c()], Q.prototype, "_commentPopup", void 0), G([c()], Q.prototype, "_isDragOver", void 0), Q = G([o("flex-table")], Q);
|
|
4576
4576
|
function Qe(e, t) {
|
|
4577
4577
|
if (t) {
|
|
4578
|
-
let t =
|
|
4578
|
+
let t = fe(e);
|
|
4579
4579
|
return /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(t) ? t.replace(" ", "T") : void 0;
|
|
4580
4580
|
}
|
|
4581
|
-
let n =
|
|
4581
|
+
let n = de(e);
|
|
4582
4582
|
return /^\d{4}-\d{2}-\d{2}$/.test(n) ? n : void 0;
|
|
4583
4583
|
}
|
|
4584
4584
|
function $(e) {
|
|
@@ -4589,4 +4589,4 @@ function $(e) {
|
|
|
4589
4589
|
}
|
|
4590
4590
|
}
|
|
4591
4591
|
//#endregion
|
|
4592
|
-
export {
|
|
4592
|
+
export { A as a, j as i, W as n, O as o, B as r, T as s, Q as t };
|
package/dist/flex-table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./flex-table-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./flex-table-CLw2o8sr.js";
|
|
2
2
|
export { o as FlexTable, e as RowSelectionState, t as UndoStack, n as effectiveAlign, i as exportData, r as flexTableLocale, a as renderCell };
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./flex-table-
|
|
1
|
+
import { t as e } from "./flex-table-CLw2o8sr.js";
|
|
2
2
|
import { i as t, t as n } from "./query-Dw4iO0ir.js";
|
|
3
3
|
import { t as r } from "./view-DiLr-TdY.js";
|
|
4
4
|
import i, { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/flex-table",
|
|
3
|
-
"version": "0.48.
|
|
3
|
+
"version": "0.48.3",
|
|
4
4
|
"description": "A minimalist, input-centric data grid web component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/flex-table.js",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"odata-query": "^8.1.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@iyulab/components": ">=2.
|
|
76
|
+
"@iyulab/components": ">=2.2.0",
|
|
77
77
|
"@lit/react": "^1.0.8",
|
|
78
78
|
"react": "^18.0.0 || ^19.0.0"
|
|
79
79
|
},
|