@iyulab/flex-table 0.48.0 → 0.48.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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.48.1] - 2026-10-06
4
+
5
+ ### Fixed
6
+
7
+ - **Cmd+C and Cmd+X work in Safari again.** 0.48.0 moved the keys to the browser's copy/cut events
8
+ alone, and Safari fires no copy event without a text selection — a grid's selection is not one. The
9
+ keys now take the browser's event where it fires and write through the Clipboard API where it does
10
+ not (`copyFromKey`/`pasteFromKey` from `@iyulab/components` 2.1.0). A cut still clears only once
11
+ its text is on the clipboard.
12
+
13
+ ### Changed
14
+
15
+ - `clipboard-error` again covers the keys: `'copy'` when neither path put the text on the clipboard
16
+ (a cut then clears nothing), `'paste'` when neither could read it.
17
+ - Requires `@iyulab/components` 2.1.0 or later.
18
+
3
19
  ## [0.48.0] - 2026-10-06
4
20
 
5
21
  ### Fixed
package/README.md CHANGED
@@ -50,7 +50,7 @@ npm install @iyulab/flex-table
50
50
  - **Range Selection** — Shift+Arrow, Shift+Click for multi-cell selection
51
51
  - **Column Selection** — Ctrl+Click header or `selectColumn()` API
52
52
  - **Row Selection** — Checkbox-based row selection (`selectable`, single/multi mode)
53
- - **Clipboard** — Ctrl+C/X/V with TSV format (Excel/Google Sheets compatible, RFC 4180), through the browser's own copy/cut/paste — no clipboard permission needed
53
+ - **Clipboard** — Ctrl+C/X/V with TSV format (Excel/Google Sheets compatible, RFC 4180), through the browser's own copy/cut/paste where it fires and the Clipboard API where it does not (Safari)
54
54
  - **Sorting** — Click header to sort (asc/desc/none), Shift+click for multi-sort
55
55
  - **Column Menu** — A 24×24 button in every header opens the column's menu: sort, filter, hide/show, auto-fit, wider/narrower (also opens on header right-click)
56
56
  - **Column Resize** — Drag header border, double-click to auto-fit, Alt+Arrow keyboard resize, or the column menu
@@ -334,7 +334,7 @@ All events use `CustomEvent` with `bubbles: true, composed: true`.
334
334
  | `clipboard-copy` | `{ range, text }` | Range copied as TSV |
335
335
  | `clipboard-cut` | `{ range, text }` | Range cut as TSV |
336
336
  | `clipboard-paste` | `{ changes, addedRows }` | Data pasted from clipboard |
337
- | `clipboard-error` | `{ action, error }` | The context menu's Copy could not write to the clipboard (`action`: `'copy'`); no `clipboard-copy` follows |
337
+ | `clipboard-error` | `{ action, error }` | Copy (`action: 'copy'`) could not put the text on the clipboard — no `clipboard-copy`/`clipboard-cut` follows and a cut clears nothing — or paste (`'paste'`) could not read it |
338
338
 
339
339
  ### State Events
340
340
 
@@ -6,8 +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, pasteFromKey as y } from "@iyulab/components/dist/utilities/clipboard.js";
9
10
  //#region src/styles/flex-table.styles.ts
10
- var v = r`
11
+ var b = r`
11
12
  /* --- Theme Variables (Light defaults) --- */
12
13
  :host {
13
14
  --ft-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
@@ -1017,13 +1018,13 @@ var v = r`
1017
1018
  `;
1018
1019
  //#endregion
1019
1020
  //#region src/renderers/format.ts
1020
- function y(e, t) {
1021
- return e == null ? "" : typeof t == "function" ? t(e) : b(t) ? S(e, t) : x(e, t);
1021
+ function x(e, t) {
1022
+ return e == null ? "" : typeof t == "function" ? t(e) : S(t) ? w(e, t) : C(e, t);
1022
1023
  }
1023
- function b(e) {
1024
+ function S(e) {
1024
1025
  return /[yMdHhms]/.test(e);
1025
1026
  }
1026
- function x(e, t) {
1027
+ function C(e, t) {
1027
1028
  let n = typeof e == "number" ? e : Number(e);
1028
1029
  if (isNaN(n)) return String(e);
1029
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 = {
@@ -1036,7 +1037,7 @@ function x(e, t) {
1036
1037
  style: "percent"
1037
1038
  }).format(n) : (d = new Intl.NumberFormat(l.get(), u).format(n), a && (d = a + d)), d + "";
1038
1039
  }
1039
- function S(e, t) {
1040
+ function w(e, t) {
1040
1041
  let n;
1041
1042
  if (e instanceof Date) n = e;
1042
1043
  else if (typeof e == "string" || typeof e == "number") n = new Date(e);
@@ -1047,26 +1048,26 @@ function S(e, t) {
1047
1048
  }
1048
1049
  //#endregion
1049
1050
  //#region src/renderers/cell-renderer.ts
1050
- function C(e, t, n) {
1051
- 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);
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) : x(e, n.format) : E(e, n);
1052
1053
  }
1053
- function w(e, t) {
1054
+ function E(e, t) {
1054
1055
  if (e == null) return "";
1055
1056
  switch (t.type) {
1056
- case "number": return D(e);
1057
+ case "number": return ee(e);
1057
1058
  case "boolean": return i`<span class="ft-bool">${e ? "✔" : ""}</span>`;
1058
- case "date": return O(e);
1059
- case "datetime": return ee(e);
1060
- case "select": return T(e, t);
1059
+ case "date": return te(e);
1060
+ case "datetime": return ne(e);
1061
+ case "select": return D(e, t);
1061
1062
  default: return String(e);
1062
1063
  }
1063
1064
  }
1064
- function T(e, t) {
1065
+ function D(e, t) {
1065
1066
  if (!t.options || t.options.length === 0 || typeof t.options[0] == "string") return e == null ? "" : String(e);
1066
1067
  let n = t.options.find((t) => t.value === e);
1067
1068
  return n ? n.label : e == null ? "" : String(e);
1068
1069
  }
1069
- var E = {
1070
+ var O = {
1070
1071
  year: "numeric",
1071
1072
  month: "numeric",
1072
1073
  day: "numeric",
@@ -1074,14 +1075,14 @@ var E = {
1074
1075
  minute: "numeric",
1075
1076
  second: "numeric"
1076
1077
  };
1077
- function D(e) {
1078
+ function ee(e) {
1078
1079
  return typeof e == "number" ? Number.isInteger(e) ? d(e) : d(e, { minimumFractionDigits: 1 }) : String(e);
1079
1080
  }
1080
- function O(e) {
1081
+ function te(e) {
1081
1082
  return e instanceof Date || typeof e == "string" ? u(e) : String(e);
1082
1083
  }
1083
- function ee(e) {
1084
- return e instanceof Date || typeof e == "string" ? u(e, E) : String(e);
1084
+ function ne(e) {
1085
+ return e instanceof Date || typeof e == "string" ? u(e, O) : String(e);
1085
1086
  }
1086
1087
  //#endregion
1087
1088
  //#region src/locale.ts
@@ -1204,7 +1205,7 @@ k.register("en", {
1204
1205
  var A = (e, t) => k.text(e, t);
1205
1206
  //#endregion
1206
1207
  //#region src/core/selection.ts
1207
- function te(e) {
1208
+ function re(e) {
1208
1209
  return {
1209
1210
  startRow: Math.min(e.startRow, e.endRow),
1210
1211
  startCol: Math.min(e.startCol, e.endCol),
@@ -1212,7 +1213,7 @@ function te(e) {
1212
1213
  endCol: Math.max(e.startCol, e.endCol)
1213
1214
  };
1214
1215
  }
1215
- var ne = class {
1216
+ var ie = class {
1216
1217
  constructor() {
1217
1218
  this.activeCell = null, this.rangeAnchor = null, this.range = null, this.extraRanges = [], this._rowCount = 0, this._colCount = 0;
1218
1219
  }
@@ -1239,7 +1240,7 @@ var ne = class {
1239
1240
  return e < 0 || e >= this._rowCount || t < 0 || t >= this._colCount ? this.activeCell : (!this.rangeAnchor && this.activeCell && (this.rangeAnchor = { ...this.activeCell }), this.activeCell = {
1240
1241
  row: e,
1241
1242
  col: t
1242
- }, this.rangeAnchor && (this.range = te({
1243
+ }, this.rangeAnchor && (this.range = re({
1243
1244
  startRow: this.rangeAnchor.row,
1244
1245
  startCol: this.rangeAnchor.col,
1245
1246
  endRow: e,
@@ -1310,7 +1311,7 @@ var ne = class {
1310
1311
  shiftMoveRight() {
1311
1312
  return this.activeCell ? this.setActiveWithRange(this.activeCell.row, this.activeCell.col + 1) : null;
1312
1313
  }
1313
- }, re = class {
1314
+ }, ae = class {
1314
1315
  constructor() {
1315
1316
  this.current = null;
1316
1317
  }
@@ -1392,7 +1393,7 @@ var ne = class {
1392
1393
  };
1393
1394
  //#endregion
1394
1395
  //#region src/core/filtering.ts
1395
- function ie(e, t, n) {
1396
+ function oe(e, t, n) {
1396
1397
  if (t.length === 0) return Array.from({ length: e.length }, (e, t) => t);
1397
1398
  let r = [];
1398
1399
  for (let i = 0; i < e.length; i++) {
@@ -1411,9 +1412,9 @@ function ie(e, t, n) {
1411
1412
  }
1412
1413
  //#endregion
1413
1414
  //#region src/core/undo.ts
1414
- var ae = 100, M = class {
1415
+ var se = 100, ce = class {
1415
1416
  constructor() {
1416
- this._undoStack = [], this._redoStack = [], this._maxSize = ae;
1417
+ this._undoStack = [], this._redoStack = [], this._maxSize = se;
1417
1418
  }
1418
1419
  get maxSize() {
1419
1420
  return this._maxSize;
@@ -1450,7 +1451,7 @@ var ae = 100, M = class {
1450
1451
  };
1451
1452
  //#endregion
1452
1453
  //#region src/clipboard/clipboard.ts
1453
- function oe(e, t, n) {
1454
+ function le(e, t, n) {
1454
1455
  let r = [];
1455
1456
  for (let i = n.startRow; i <= n.endRow; i++) {
1456
1457
  let a = e[i], o = [];
@@ -1462,7 +1463,7 @@ function oe(e, t, n) {
1462
1463
  }
1463
1464
  return g(r);
1464
1465
  }
1465
- function N(e, t) {
1466
+ function M(e, t) {
1466
1467
  if (e === "") return null;
1467
1468
  switch (t.type) {
1468
1469
  case "number": {
@@ -1477,19 +1478,19 @@ function N(e, t) {
1477
1478
  default: return e;
1478
1479
  }
1479
1480
  }
1480
- function P(e) {
1481
+ function N(e) {
1481
1482
  let t = String(e);
1482
1483
  if (!Number.isFinite(e) || t.includes("e")) return t;
1483
1484
  let n = new Intl.NumberFormat(l.get()).formatToParts(1.5).find((e) => e.type === "decimal")?.value;
1484
1485
  return n && n !== "." ? t.replace(".", n) : t;
1485
1486
  }
1486
- function se(e) {
1487
+ function ue(e) {
1487
1488
  if (e == null || e === "") return "";
1488
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")}`;
1489
1490
  let t = String(e), n = /^(\d{4}-\d{2}-\d{2})(?:$|T)/.exec(t);
1490
1491
  return n ? n[1] : t;
1491
1492
  }
1492
- function ce(e) {
1493
+ function de(e) {
1493
1494
  if (e == null || e === "") return "";
1494
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);
1495
1496
  if (n) return `${n[1]} ${n[2]}`;
@@ -1500,7 +1501,7 @@ function ce(e) {
1500
1501
  }
1501
1502
  //#endregion
1502
1503
  //#region src/export/xlsx-writer.ts
1503
- var le = (() => {
1504
+ var fe = (() => {
1504
1505
  let e = /* @__PURE__ */ new Uint32Array(256);
1505
1506
  for (let t = 0; t < 256; t++) {
1506
1507
  let n = t;
@@ -1509,23 +1510,23 @@ var le = (() => {
1509
1510
  }
1510
1511
  return e;
1511
1512
  })();
1512
- function ue(e) {
1513
+ function pe(e) {
1513
1514
  let t = 4294967295;
1514
- for (let n = 0; n < e.length; n++) t = le[(t ^ e[n]) & 255] ^ t >>> 8;
1515
+ for (let n = 0; n < e.length; n++) t = fe[(t ^ e[n]) & 255] ^ t >>> 8;
1515
1516
  return (t ^ 4294967295) >>> 0;
1516
1517
  }
1517
- var F = new TextEncoder();
1518
- function de(e) {
1519
- return I(e.map((e) => ({
1518
+ var P = new TextEncoder();
1519
+ function me(e) {
1520
+ return F(e.map((e) => ({
1520
1521
  ...e,
1521
1522
  body: e.data,
1522
1523
  method: 0
1523
1524
  })));
1524
1525
  }
1525
- async function fe(e) {
1526
+ async function he(e) {
1526
1527
  let t = [];
1527
1528
  for (let n of e) {
1528
- let e = await pe(n.data);
1529
+ let e = await ge(n.data);
1529
1530
  t.push(e.length < n.data.length ? {
1530
1531
  ...n,
1531
1532
  body: e,
@@ -1536,9 +1537,9 @@ async function fe(e) {
1536
1537
  method: 0
1537
1538
  });
1538
1539
  }
1539
- return I(t);
1540
+ return F(t);
1540
1541
  }
1541
- async function pe(e) {
1542
+ async function ge(e) {
1542
1543
  let t = new CompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
1543
1544
  n.write(e), n.close();
1544
1545
  let i = [];
@@ -1547,52 +1548,52 @@ async function pe(e) {
1547
1548
  if (e) break;
1548
1549
  i.push(t);
1549
1550
  }
1550
- return L(i);
1551
+ return I(i);
1551
1552
  }
1552
- function I(e) {
1553
+ function F(e) {
1553
1554
  let t = [], n = [], r = 0;
1554
1555
  for (let i of e) {
1555
- let e = F.encode(i.name), a = ue(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);
1556
+ let e = P.encode(i.name), a = pe(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);
1556
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);
1557
1558
  let d = new ArrayBuffer(46 + e.length), f = new DataView(d);
1558
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;
1559
1560
  }
1560
- let i = L(n), a = /* @__PURE__ */ new ArrayBuffer(22), o = new DataView(a);
1561
- 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), L([
1561
+ let i = I(n), a = /* @__PURE__ */ new ArrayBuffer(22), o = new DataView(a);
1562
+ 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([
1562
1563
  ...t,
1563
1564
  i,
1564
1565
  new Uint8Array(a)
1565
1566
  ]);
1566
1567
  }
1567
- function L(e) {
1568
+ function I(e) {
1568
1569
  let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
1569
1570
  for (let t of e) n.set(t, r), r += t.length;
1570
1571
  return n;
1571
1572
  }
1572
- function R(e) {
1573
+ function L(e) {
1573
1574
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1574
1575
  }
1575
- function me(e) {
1576
+ function _e(e) {
1576
1577
  let t = "";
1577
1578
  for (e++; e > 0;) t = String.fromCharCode(64 + (e % 26 || 26)) + t, e = Math.floor((e - 1) / 26);
1578
1579
  return t;
1579
1580
  }
1580
- function z(e, t) {
1581
- return me(t) + (e + 1);
1581
+ function R(e, t) {
1582
+ return _e(t) + (e + 1);
1582
1583
  }
1583
- function he(e) {
1584
+ function ve(e) {
1584
1585
  let t = Date.UTC(1899, 11, 30);
1585
1586
  return (e.getTime() - t) / 864e5;
1586
1587
  }
1587
- var ge = "<?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>", _e = "<?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>", ve = "<?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>", ye = "<?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>", be = "<?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>";
1588
- function xe(e, t) {
1589
- let n = [], r = t.map((e, t) => `<c r="${z(0, t)}" t="str" s="2"><v>${R(e.label)}</v></c>`);
1588
+ var ye = "<?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>", be = "<?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>", xe = "<?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>", Se = "<?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>", Ce = "<?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 we(e, t) {
1590
+ let n = [], r = t.map((e, t) => `<c r="${R(0, t)}" t="str" s="2"><v>${L(e.label)}</v></c>`);
1590
1591
  return n.push(`<row r="1">${r.join("")}</row>`), e.forEach((e, r) => {
1591
1592
  let i = t.map((t, n) => {
1592
- let i = z(r + 1, n), a = e[t.key];
1593
+ let i = R(r + 1, n), a = e[t.key];
1593
1594
  if (a == null) return `<c r="${i}" t="str"><v></v></c>`;
1594
1595
  let o = t.type ?? "text";
1595
- 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>${he(a).toFixed(6)}</v></c>` : o === "boolean" ? `<c r="${i}" t="b"><v>${+!!a}</v></c>` : `<c r="${i}" t="str"><v>${R(String(a))}</v></c>`;
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>${ve(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>`;
1596
1597
  });
1597
1598
  n.push(`<row r="${r + 2}">${i.join("")}</row>`);
1598
1599
  }), `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
@@ -1600,65 +1601,65 @@ function xe(e, t) {
1600
1601
  <sheetData>${n.join("")}</sheetData>
1601
1602
  </worksheet>`;
1602
1603
  }
1603
- function Se(e, t) {
1604
- return de(B(e, t));
1604
+ function Te(e, t) {
1605
+ return me(z(e, t));
1605
1606
  }
1606
- function Ce(e, t) {
1607
- return fe(B(e, t));
1607
+ function Ee(e, t) {
1608
+ return he(z(e, t));
1608
1609
  }
1609
- function B(e, t) {
1610
- let n = xe(e, t);
1610
+ function z(e, t) {
1611
+ let n = we(e, t);
1611
1612
  return [
1612
1613
  {
1613
1614
  name: "[Content_Types].xml",
1614
- data: F.encode(ge)
1615
+ data: P.encode(ye)
1615
1616
  },
1616
1617
  {
1617
1618
  name: "_rels/.rels",
1618
- data: F.encode(_e)
1619
+ data: P.encode(be)
1619
1620
  },
1620
1621
  {
1621
1622
  name: "xl/workbook.xml",
1622
- data: F.encode(ve)
1623
+ data: P.encode(xe)
1623
1624
  },
1624
1625
  {
1625
1626
  name: "xl/_rels/workbook.xml.rels",
1626
- data: F.encode(ye)
1627
+ data: P.encode(Se)
1627
1628
  },
1628
1629
  {
1629
1630
  name: "xl/worksheets/sheet1.xml",
1630
- data: F.encode(n)
1631
+ data: P.encode(n)
1631
1632
  },
1632
1633
  {
1633
1634
  name: "xl/styles.xml",
1634
- data: F.encode(be)
1635
+ data: P.encode(Ce)
1635
1636
  }
1636
1637
  ];
1637
1638
  }
1638
1639
  //#endregion
1639
1640
  //#region src/export/export.ts
1640
- function V(e, t, n) {
1641
+ function B(e, t, n) {
1641
1642
  switch (n) {
1642
- case "csv": return H(e, t, ",");
1643
- case "tsv": return H(e, t, " ");
1644
- case "json": return Ee(e, t);
1645
- case "xlsx": return Se(e, t);
1643
+ case "csv": return V(e, t, ",");
1644
+ case "tsv": return V(e, t, " ");
1645
+ case "json": return ke(e, t);
1646
+ case "xlsx": return Te(e, t);
1646
1647
  }
1647
1648
  }
1648
- async function we(e, t, n) {
1649
- let r = n === "xlsx" ? await Ce(e, t) : V(e, t, n);
1650
- return new Blob([r], { type: Ae(n) });
1649
+ async function De(e, t, n) {
1650
+ let r = n === "xlsx" ? await Ee(e, t) : B(e, t, n);
1651
+ return new Blob([r], { type: Ne(n) });
1651
1652
  }
1652
- function Te(e, t) {
1653
+ function Oe(e, t) {
1653
1654
  return e == null ? "" : (t.type === "date" || t.type === "datetime") && e instanceof Date ? e.toISOString() : String(e);
1654
1655
  }
1655
- function H(e, t, n) {
1656
- return [t.map((e) => U(e.label, n)).join(n), ...e.map((e) => t.map((t) => U(Te(e[t.key], t), n)).join(n))].join("\n");
1656
+ function V(e, t, n) {
1657
+ return [t.map((e) => H(e.label, n)).join(n), ...e.map((e) => t.map((t) => H(Oe(e[t.key], t), n)).join(n))].join("\n");
1657
1658
  }
1658
- function U(e, t) {
1659
+ function H(e, t) {
1659
1660
  return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? "\"" + e.replace(/"/g, "\"\"") + "\"" : e;
1660
1661
  }
1661
- function Ee(e, t) {
1662
+ function ke(e, t) {
1662
1663
  let n = e.map((e) => {
1663
1664
  let n = {};
1664
1665
  for (let r of t) {
@@ -1669,35 +1670,35 @@ function Ee(e, t) {
1669
1670
  });
1670
1671
  return JSON.stringify(n, null, 2);
1671
1672
  }
1672
- function De(e, t) {
1673
+ function Ae(e, t) {
1673
1674
  let n = URL.createObjectURL(e), r = document.createElement("a");
1674
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);
1675
1676
  }
1676
- var Oe = {
1677
+ var je = {
1677
1678
  csv: "text/csv;charset=utf-8",
1678
1679
  tsv: "text/tab-separated-values;charset=utf-8",
1679
1680
  json: "application/json;charset=utf-8",
1680
1681
  xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
1681
- }, ke = {
1682
+ }, Me = {
1682
1683
  csv: ".csv",
1683
1684
  tsv: ".tsv",
1684
1685
  json: ".json",
1685
1686
  xlsx: ".xlsx"
1686
1687
  };
1687
- function Ae(e) {
1688
- return Oe[e];
1688
+ function Ne(e) {
1689
+ return je[e];
1689
1690
  }
1690
- function je(e) {
1691
- return ke[e];
1691
+ function Pe(e) {
1692
+ return Me[e];
1692
1693
  }
1693
1694
  //#endregion
1694
1695
  //#region src/export/xlsx-reader.ts
1695
- function Me(e) {
1696
+ function Fe(e) {
1696
1697
  for (let t = e.byteLength - 22; t >= 0; t--) if (e.getUint32(t, !0) === 101010256) return t;
1697
1698
  throw Error("XLSX: End of central directory not found — not a valid ZIP file");
1698
1699
  }
1699
- function Ne(e) {
1700
- let t = Me(e), n = e.getUint32(t + 16, !0), r = e.getUint32(t + 12, !0), i = new TextDecoder("utf-8"), a = [], o = n, s = n + r;
1700
+ function Ie(e) {
1701
+ let t = Fe(e), n = e.getUint32(t + 16, !0), r = e.getUint32(t + 12, !0), i = new TextDecoder("utf-8"), a = [], o = n, s = n + r;
1701
1702
  for (; o < s && e.getUint32(o, !0) === 33639248;) {
1702
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));
1703
1704
  a.push({
@@ -1710,7 +1711,7 @@ function Ne(e) {
1710
1711
  }
1711
1712
  return a;
1712
1713
  }
1713
- async function Pe(e) {
1714
+ async function Le(e) {
1714
1715
  let t = new DecompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
1715
1716
  n.write(e), n.close();
1716
1717
  let i = [];
@@ -1723,28 +1724,28 @@ async function Pe(e) {
1723
1724
  for (let e of i) o.set(e, s), s += e.length;
1724
1725
  return o;
1725
1726
  }
1726
- async function Fe(e, t) {
1727
+ async function Re(e, t) {
1727
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);
1728
1729
  if (t.compressionMethod === 0) return o.slice();
1729
- if (t.compressionMethod === 8) return Pe(o);
1730
+ if (t.compressionMethod === 8) return Le(o);
1730
1731
  throw Error(`XLSX: Unsupported compression method ${t.compressionMethod}`);
1731
1732
  }
1732
- async function Ie(e) {
1733
- let t = new DataView(e), n = Ne(t), r = /* @__PURE__ */ new Map();
1734
- for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await Fe(t, e));
1733
+ async function ze(e) {
1734
+ let t = new DataView(e), n = Ie(t), r = /* @__PURE__ */ new Map();
1735
+ for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await Re(t, e));
1735
1736
  return r;
1736
1737
  }
1737
- var Le = new TextDecoder("utf-8");
1738
- function W(e) {
1739
- let t = Le.decode(e);
1738
+ var Be = new TextDecoder("utf-8");
1739
+ function U(e) {
1740
+ let t = Be.decode(e);
1740
1741
  return new DOMParser().parseFromString(t, "application/xml");
1741
1742
  }
1742
- function Re(e) {
1743
+ function Ve(e) {
1743
1744
  if (!e) return [];
1744
- let t = W(e);
1745
+ let t = U(e);
1745
1746
  return Array.from(t.querySelectorAll("si")).map((e) => Array.from(e.querySelectorAll("t")).map((e) => e.textContent ?? "").join(""));
1746
1747
  }
1747
- var ze = /* @__PURE__ */ new Set([
1748
+ var He = /* @__PURE__ */ new Set([
1748
1749
  14,
1749
1750
  15,
1750
1751
  16,
@@ -1764,37 +1765,37 @@ var ze = /* @__PURE__ */ new Set([
1764
1765
  57,
1765
1766
  58
1766
1767
  ]);
1767
- function Be(e) {
1768
+ function Ue(e) {
1768
1769
  let t = e.replace(/"[^"]*"/g, "").replace(/\\./g, "").replace(/\[[^\]]*\]/g, "").split(";")[0];
1769
1770
  return /[dy]/i.test(t);
1770
1771
  }
1771
- function Ve(e) {
1772
+ function We(e) {
1772
1773
  let t = /* @__PURE__ */ new Set();
1773
1774
  if (!e) return t;
1774
- let n = W(e), r = /* @__PURE__ */ new Map();
1775
+ let n = U(e), r = /* @__PURE__ */ new Map();
1775
1776
  for (let e of Array.from(n.querySelectorAll("numFmts > numFmt"))) r.set(parseInt(e.getAttribute("numFmtId") ?? "", 10), e.getAttribute("formatCode") ?? "");
1776
1777
  return Array.from(n.querySelectorAll("cellXfs > xf")).forEach((e, n) => {
1777
1778
  let i = parseInt(e.getAttribute("numFmtId") ?? "0", 10), a = r.get(i);
1778
- (a === void 0 ? ze.has(i) : Be(a)) && t.add(n);
1779
+ (a === void 0 ? He.has(i) : Ue(a)) && t.add(n);
1779
1780
  }), t;
1780
1781
  }
1781
- function He(e) {
1782
+ function Ge(e) {
1782
1783
  if (!e) return !1;
1783
- let t = W(e).querySelector("workbookPr")?.getAttribute("date1904");
1784
+ let t = U(e).querySelector("workbookPr")?.getAttribute("date1904");
1784
1785
  return t === "1" || t === "true";
1785
1786
  }
1786
- function Ue(e, t) {
1787
+ function Ke(e, t) {
1787
1788
  return new Date((t ? Date.UTC(1904, 0, 1) : Date.UTC(1899, 11, 30)) + Math.floor(e) * 864e5).toISOString().slice(0, 10);
1788
1789
  }
1789
- function We(e, t, n, r) {
1790
- let i = W(e).querySelectorAll("row");
1790
+ function qe(e, t, n, r) {
1791
+ let i = U(e).querySelectorAll("row");
1791
1792
  if (i.length === 0) return [];
1792
1793
  let a = 0, o = /* @__PURE__ */ new Map();
1793
1794
  for (let e of i) {
1794
1795
  let i = parseInt(e.getAttribute("r") ?? "1", 10) - 1, s = /* @__PURE__ */ new Map();
1795
1796
  o.set(i, s);
1796
1797
  for (let i of e.querySelectorAll("c")) {
1797
- let e = Ge(i.getAttribute("r") ?? "");
1798
+ let e = Je(i.getAttribute("r") ?? "");
1798
1799
  e > a && (a = e);
1799
1800
  let o = i.getAttribute("t") ?? "", c = i.getAttribute("s") ?? "", l = i.querySelector("v")?.textContent ?? "", u = i.querySelector("is > t")?.textContent ?? null, d;
1800
1801
  if (o === "s") d = t[parseInt(l, 10)] ?? "";
@@ -1803,7 +1804,7 @@ function We(e, t, n, r) {
1803
1804
  else if (l === "") d = "";
1804
1805
  else {
1805
1806
  let e = parseFloat(l);
1806
- d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ? Ue(e, r) : l;
1807
+ d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ? Ke(e, r) : l;
1807
1808
  }
1808
1809
  s.set(e, d);
1809
1810
  }
@@ -1817,13 +1818,13 @@ function We(e, t, n, r) {
1817
1818
  }
1818
1819
  return c;
1819
1820
  }
1820
- function Ge(e) {
1821
+ function Je(e) {
1821
1822
  let t = 0, n = 0;
1822
1823
  for (; n < e.length && e[n] >= "A" && e[n] <= "Z";) t = t * 26 + (e.charCodeAt(n) - 64), n++;
1823
1824
  return t - 1;
1824
1825
  }
1825
- async function Ke(e) {
1826
- let t = await Ie(e), n = Re(t.get("xl/sharedStrings.xml")), r = t.get("xl/worksheets/sheet1.xml");
1826
+ async function Ye(e) {
1827
+ let t = await ze(e), n = Ve(t.get("xl/sharedStrings.xml")), r = t.get("xl/worksheets/sheet1.xml");
1827
1828
  if (!r) {
1828
1829
  for (let [e, n] of t) if (e.toLowerCase().includes("worksheets/sheet")) {
1829
1830
  r = n;
@@ -1831,7 +1832,7 @@ async function Ke(e) {
1831
1832
  }
1832
1833
  }
1833
1834
  if (!r) throw Error("XLSX: No worksheet found");
1834
- let i = Ve(t.get("xl/styles.xml")), a = He(t.get("xl/workbook.xml")), o = We(r, n, i, a);
1835
+ let i = We(t.get("xl/styles.xml")), a = Ge(t.get("xl/workbook.xml")), o = qe(r, n, i, a);
1835
1836
  return o.length === 0 ? {
1836
1837
  headers: [],
1837
1838
  rows: []
@@ -1842,12 +1843,12 @@ async function Ke(e) {
1842
1843
  }
1843
1844
  //#endregion
1844
1845
  //#region src/models/types.ts
1845
- function G(e) {
1846
+ function W(e) {
1846
1847
  return e.align ? e.align : e.type === "number" ? "end" : e.type === "boolean" ? "center" : "start";
1847
1848
  }
1848
1849
  //#endregion
1849
1850
  //#region \0@oxc-project+runtime@0.152.0/helpers/esm/decorate.js
1850
- function K(e, t, n, r) {
1851
+ function G(e, t, n, r) {
1851
1852
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
1852
1853
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
1853
1854
  else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
@@ -1855,25 +1856,21 @@ function K(e, t, n, r) {
1855
1856
  }
1856
1857
  //#endregion
1857
1858
  //#region src/flex-table.ts
1858
- var q = [
1859
- "copy",
1860
- "cut",
1861
- "paste"
1862
- ], J = {
1859
+ var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable, q = {
1863
1860
  eq: "=",
1864
1861
  neq: "≠",
1865
1862
  gt: ">",
1866
1863
  lt: "<",
1867
1864
  gte: "≥",
1868
1865
  lte: "≤"
1869
- }, Y = 120, X = 40, qe = 20, Je = 32, Z = 5, Ye = 200, Q = class extends n {
1866
+ }, J = 120, Y = 40, X = 20, Xe = 32, Z = 5, Ze = 200, Q = class extends n {
1870
1867
  constructor(...e) {
1871
- super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this._rowHeightFromCss = Je, 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 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 = () => {
1868
+ super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this._rowHeightFromCss = Xe, 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 ie(), this._editing = new ae(), this._rowSelection = new j(), this._undo = new ce(), 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 = () => {
1872
1869
  this._commitCommentPopup();
1873
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();
1874
1871
  }
1875
1872
  static {
1876
- this.styles = v;
1873
+ this.styles = b;
1877
1874
  }
1878
1875
  get data() {
1879
1876
  return this._data;
@@ -1883,7 +1880,7 @@ var q = [
1883
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);
1884
1881
  }
1885
1882
  get rowHeight() {
1886
- let e = this._rowHeightExplicit ?? this._rowHeightFromCss ?? Je;
1883
+ let e = this._rowHeightExplicit ?? this._rowHeightFromCss ?? Xe;
1887
1884
  return Math.max(e, this._targetFloor);
1888
1885
  }
1889
1886
  set rowHeight(e) {
@@ -2233,17 +2230,17 @@ var q = [
2233
2230
  }
2234
2231
  exportToString(e, t) {
2235
2232
  let n = this._exportSlice(t);
2236
- return n ? V(n.rows, n.cols, e) : "";
2233
+ return n ? B(n.rows, n.cols, e) : "";
2237
2234
  }
2238
2235
  async exportToBlob(e, t) {
2239
2236
  let n = this._exportSlice(t) ?? {
2240
2237
  rows: [],
2241
2238
  cols: []
2242
2239
  };
2243
- return we(n.rows, n.cols, e);
2240
+ return De(n.rows, n.cols, e);
2244
2241
  }
2245
2242
  async exportToFile(e, t) {
2246
- De(await this.exportToBlob(e), t ?? `export${je(e)}`);
2243
+ Ae(await this.exportToBlob(e), t ?? `export${Pe(e)}`);
2247
2244
  }
2248
2245
  _exportSlice(e) {
2249
2246
  if (e?.selectionOnly) {
@@ -2316,7 +2313,7 @@ var q = [
2316
2313
  async importFromFile(e) {
2317
2314
  let t = e.name.toLowerCase();
2318
2315
  if (t.endsWith(".xlsx")) {
2319
- let t = await Ke(await e.arrayBuffer());
2316
+ let t = await Ye(await e.arrayBuffer());
2320
2317
  this._applyImportedSheet(t);
2321
2318
  } else if (t.endsWith(".csv") || t.endsWith(".tsv")) {
2322
2319
  let t = await e.text(), n = h(t);
@@ -2330,7 +2327,7 @@ var q = [
2330
2327
  let a = t.get(e);
2331
2328
  if (!a) return;
2332
2329
  let o = this.columns.find((e) => e.key === a);
2333
- r[a] = o ? N(n[i] ?? "", o) : n[i] ?? null;
2330
+ r[a] = o ? M(n[i] ?? "", o) : n[i] ?? null;
2334
2331
  }), r;
2335
2332
  }), r = [...this.data];
2336
2333
  this.data = n, this._undo.push({
@@ -2355,7 +2352,7 @@ var q = [
2355
2352
  let a = n.get(t);
2356
2353
  if (!a) return;
2357
2354
  let o = this.columns.find((e) => e.key === a);
2358
- r[a] = o ? N(e[i] ?? "", o) : e[i] ?? null;
2355
+ r[a] = o ? M(e[i] ?? "", o) : e[i] ?? null;
2359
2356
  }), r;
2360
2357
  }), i = [...this.data];
2361
2358
  this.data = r, this._undo.push({
@@ -2408,8 +2405,8 @@ var q = [
2408
2405
  return this._columnWidths.get(e);
2409
2406
  }
2410
2407
  _getColWidth(e) {
2411
- let t = this._columnWidths.get(e.key) ?? e.width ?? Y;
2412
- return Math.max(t, e.minWidth ?? X);
2408
+ let t = this._columnWidths.get(e.key) ?? e.width ?? J;
2409
+ return Math.max(t, e.minWidth ?? Y);
2413
2410
  }
2414
2411
  get headerHeight() {
2415
2412
  return this.rowHeight + 8;
@@ -2442,14 +2439,10 @@ var q = [
2442
2439
  };
2443
2440
  }
2444
2441
  connectedCallback() {
2445
- super.connectedCallback(), this._onScroll = this._onScroll.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onDocumentClick = this._onDocumentClick.bind(this), this._onContextMenu = this._onContextMenu.bind(this), this._onDragover = this._onDragover.bind(this), this._onDragleave = this._onDragleave.bind(this), this._onDrop = this._onDrop.bind(this), this._onClipboard = this._onClipboard.bind(this), this.addEventListener("scroll", this._onScroll, { passive: !0 }), this.addEventListener("keydown", this._onKeyDown);
2446
- for (let e of q) this.addEventListener(e, this._onClipboard);
2447
- this.addEventListener("contextmenu", this._onContextMenu), this.addEventListener("dragover", this._onDragover), this.addEventListener("dragleave", this._onDragleave), this.addEventListener("drop", this._onDrop), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.setAttribute("role", "grid"), typeof ResizeObserver < "u" && (this._hostResizeObserver = new ResizeObserver(() => this._measureViewport()), this._hostResizeObserver.observe(this));
2442
+ super.connectedCallback(), this._onScroll = this._onScroll.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onDocumentClick = this._onDocumentClick.bind(this), this._onContextMenu = this._onContextMenu.bind(this), this._onDragover = this._onDragover.bind(this), this._onDragleave = this._onDragleave.bind(this), this._onDrop = this._onDrop.bind(this), this.addEventListener("scroll", this._onScroll, { passive: !0 }), this.addEventListener("keydown", this._onKeyDown), this.addEventListener("contextmenu", this._onContextMenu), this.addEventListener("dragover", this._onDragover), this.addEventListener("dragleave", this._onDragleave), this.addEventListener("drop", this._onDrop), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.setAttribute("role", "grid"), typeof ResizeObserver < "u" && (this._hostResizeObserver = new ResizeObserver(() => this._measureViewport()), this._hostResizeObserver.observe(this));
2448
2443
  }
2449
2444
  disconnectedCallback() {
2450
- super.disconnectedCallback(), this.removeEventListener("scroll", this._onScroll), this.removeEventListener("keydown", this._onKeyDown);
2451
- for (let e of q) this.removeEventListener(e, this._onClipboard);
2452
- this.removeEventListener("contextmenu", this._onContextMenu), this.removeEventListener("dragover", this._onDragover), this.removeEventListener("dragleave", this._onDragleave), this.removeEventListener("drop", this._onDrop), document.removeEventListener("click", this._onDocumentClick), document.removeEventListener("mousedown", this._onCommentPopupOutsideClick), this._isDragging = !1, this._wasDrag = !1, this._resizeCleanup &&= (this._resizeCleanup(), null), this._hostResizeObserver &&= (this._hostResizeObserver.disconnect(), null);
2445
+ super.disconnectedCallback(), this.removeEventListener("scroll", this._onScroll), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("contextmenu", this._onContextMenu), this.removeEventListener("dragover", this._onDragover), this.removeEventListener("dragleave", this._onDragleave), this.removeEventListener("drop", this._onDrop), document.removeEventListener("click", this._onDocumentClick), document.removeEventListener("mousedown", this._onCommentPopupOutsideClick), this._isDragging = !1, this._wasDrag = !1, this._resizeCleanup &&= (this._resizeCleanup(), null), this._hostResizeObserver &&= (this._hostResizeObserver.disconnect(), null);
2453
2446
  }
2454
2447
  firstUpdated() {
2455
2448
  this._readDensityTokens(), this._measureViewport(), this.shadowRoot && Array.isArray(this.shadowRoot.adoptedStyleSheets) && (this._baseStyleSheets = [...this.shadowRoot.adoptedStyleSheets]), this._syncStylesheets();
@@ -2512,7 +2505,7 @@ var q = [
2512
2505
  this._filteredIndices = Array.from({ length: this.data.length }, (e, t) => t), this._sortedIndices = this._filteredIndices;
2513
2506
  return;
2514
2507
  }
2515
- if (this._filteredIndices = ie(this.data, this._filters, (e, t, n) => {
2508
+ if (this._filteredIndices = oe(this.data, this._filters, (e, t, n) => {
2516
2509
  this.dispatchEvent(new CustomEvent("filter-error", {
2517
2510
  detail: {
2518
2511
  error: e,
@@ -2551,7 +2544,7 @@ var q = [
2551
2544
  e !== this._viewportHeight && (this._viewportHeight = e), t !== this._viewportWidth && (this._viewportWidth = t), this._warnIfUnconstrained();
2552
2545
  }
2553
2546
  _warnIfUnconstrained() {
2554
- this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount < Ye || 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.`));
2547
+ this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount < Ze || this.scrollHeight > this.clientHeight + 1 || (this._warnedUnconstrained = !0, console.warn(`[@iyulab/flex-table] ${this._visibleRowCount} rows but the host has no height constraint — it grew to fit every row, so virtual scrolling is off and all rows are rendered. Give the host a height (e.g. height: 400px, or flex: 1 1 auto with min-height: 0 inside a sized parent) so it becomes the scroll container.`));
2555
2548
  }
2556
2549
  _onScroll() {
2557
2550
  this._scrollTop = this.scrollTop, this._scrollLeft = this.scrollLeft;
@@ -2696,7 +2689,7 @@ var q = [
2696
2689
  }
2697
2690
  let t = this.shadowRoot?.querySelector(".ft-editor");
2698
2691
  if (t) {
2699
- let n = N(t.value, e);
2692
+ let n = M(t.value, e);
2700
2693
  this._applyEdit(n);
2701
2694
  } else this._cancelEdit();
2702
2695
  }
@@ -2896,8 +2889,16 @@ var q = [
2896
2889
  case "z": return e.preventDefault(), e.shiftKey ? this.redo() : this.undo(), !0;
2897
2890
  case "y": return e.preventDefault(), this.redo(), !0;
2898
2891
  case "c":
2899
- case "x":
2900
- case "v": return !0;
2892
+ case "x": {
2893
+ if (K(e.composedPath()[0])) return !0;
2894
+ let t = this._selectionTsv();
2895
+ if (!t) return !0;
2896
+ let n = e.key.toLowerCase() === "x" && this.editable;
2897
+ return v(t.text).then((e) => {
2898
+ e ? this._afterCopy(t.range, t.text, n) : this._clipboardError("copy", /* @__PURE__ */ Error("The clipboard did not take the copied text"));
2899
+ }), !0;
2900
+ }
2901
+ case "v": return K(e.composedPath()[0]) || !this.editable || !this._activeCell || y().then((e) => this._pasteText(e), (e) => this._clipboardError("paste", e)), !0;
2901
2902
  case "d": return e.preventDefault(), this.editable && this._handleFillDown(), !0;
2902
2903
  case "r": return e.preventDefault(), this.editable && this._handleFillRight(), !0;
2903
2904
  case "f": return e.preventDefault(), this._toggleFindPanel("find"), !0;
@@ -2909,12 +2910,12 @@ var q = [
2909
2910
  if (!e.altKey || !this._activeCell || e.key !== "ArrowLeft" && e.key !== "ArrowRight") return !1;
2910
2911
  e.preventDefault();
2911
2912
  let n = t[this._activeCell.col];
2912
- return n && this._resizeColumnBy(n.key, e.key === "ArrowRight" ? qe : -20), !0;
2913
+ return n && this._resizeColumnBy(n.key, e.key === "ArrowRight" ? X : -20), !0;
2913
2914
  }
2914
2915
  _resizeColumnBy(e, t) {
2915
2916
  let n = this.visibleColumns.findIndex((t) => t.key === e), r = this.visibleColumns[n];
2916
2917
  if (!r) return;
2917
- let i = this._columnWidths.get(r.key) ?? r.width ?? Y, a = r.minWidth ?? X, o = Math.max(a, i + t);
2918
+ let i = this._columnWidths.get(r.key) ?? r.width ?? J, a = r.minWidth ?? Y, o = Math.max(a, i + t);
2918
2919
  this._columnWidths.set(r.key, o), this.requestUpdate(), this.dispatchEvent(new CustomEvent("column-resize", {
2919
2920
  detail: {
2920
2921
  key: r.key,
@@ -2944,39 +2945,31 @@ var q = [
2944
2945
  let e = this._selection.getEffectiveRange();
2945
2946
  return e ? {
2946
2947
  range: e,
2947
- text: oe(this._sortedIndices.map((e) => this.data[e]), this.visibleColumns, e)
2948
+ text: le(this._sortedIndices.map((e) => this.data[e]), this.visibleColumns, e)
2948
2949
  } : null;
2949
2950
  }
2950
- _onClipboard(e) {
2951
- let t = e.composedPath()[0];
2952
- if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLElement && t.isContentEditable || !e.clipboardData) return;
2953
- if (e.type === "paste") {
2954
- if (!this.editable || !this._activeCell) return;
2955
- e.preventDefault(), this._pasteText(e.clipboardData.getData("text/plain"));
2956
- return;
2957
- }
2958
- let n = this._selectionTsv();
2959
- n && (e.preventDefault(), e.clipboardData.setData("text/plain", n.text), this._afterCopy(n.range, n.text, e.type === "cut" && this.editable));
2960
- }
2961
2951
  async _copyFromMenu() {
2962
2952
  let e = this._selectionTsv();
2963
2953
  if (e) {
2964
2954
  try {
2965
2955
  await navigator.clipboard.writeText(e.text);
2966
2956
  } catch (e) {
2967
- this.dispatchEvent(new CustomEvent("clipboard-error", {
2968
- detail: {
2969
- action: "copy",
2970
- error: e
2971
- },
2972
- bubbles: !0,
2973
- composed: !0
2974
- }));
2957
+ this._clipboardError("copy", e);
2975
2958
  return;
2976
2959
  }
2977
2960
  this._afterCopy(e.range, e.text, !1);
2978
2961
  }
2979
2962
  }
2963
+ _clipboardError(e, t) {
2964
+ this.dispatchEvent(new CustomEvent("clipboard-error", {
2965
+ detail: {
2966
+ action: e,
2967
+ error: t
2968
+ },
2969
+ bubbles: !0,
2970
+ composed: !0
2971
+ }));
2972
+ }
2980
2973
  _afterCopy(e, t, n) {
2981
2974
  n && this._clearRange(e), this.dispatchEvent(new CustomEvent(n ? "clipboard-cut" : "clipboard-copy", {
2982
2975
  detail: {
@@ -3040,7 +3033,7 @@ var q = [
3040
3033
  for (let a = 0; a < t[i].length; a++) {
3041
3034
  let s = e.col + a;
3042
3035
  if (s >= n.length) break;
3043
- let c = n[s], l = this.data[o][c.key], u = N(t[i][a], c);
3036
+ let c = n[s], l = this.data[o][c.key], u = M(t[i][a], c);
3044
3037
  this.data[o][c.key] = u, r.push({
3045
3038
  row: o,
3046
3039
  col: s,
@@ -3105,7 +3098,7 @@ var q = [
3105
3098
  for (let r = e.startCol + 1; r <= e.endCol; r++) {
3106
3099
  let e = t[r];
3107
3100
  if (!e || !this._isCellEditable(e)) continue;
3108
- let a = N(o == null ? "" : String(o), e);
3101
+ let a = M(o == null ? "" : String(o), e);
3109
3102
  n.push({
3110
3103
  row: i,
3111
3104
  key: e.key,
@@ -3242,7 +3235,7 @@ var q = [
3242
3235
  return Math.min(n, i);
3243
3236
  }
3244
3237
  _renderHeaderCell(e, t) {
3245
- let n = e.sortable !== !1, r = this._sortCriteria.find((t) => t.key === e.key), o = this._sortCriteria.length > 1 ? this._sortCriteria.findIndex((t) => t.key === e.key) : -1, s = this._filters.some((t) => t.key === e.key), c = e.pinned === "left", l = e.pinned === "right", u = c || l, d = e.headerAlign ?? G(e), f = [
3238
+ let n = e.sortable !== !1, r = this._sortCriteria.find((t) => t.key === e.key), o = this._sortCriteria.length > 1 ? this._sortCriteria.findIndex((t) => t.key === e.key) : -1, s = this._filters.some((t) => t.key === e.key), c = e.pinned === "left", l = e.pinned === "right", u = c || l, d = e.headerAlign ?? W(e), f = [
3246
3239
  "ft-header-cell",
3247
3240
  n ? "ft-sortable" : "",
3248
3241
  u ? "ft-pinned" : "",
@@ -3414,7 +3407,7 @@ var q = [
3414
3407
  ${r.map((e) => c("show", A("showColumn", { header: e.label }), () => this._setColumnHidden(e.key, !1)))}
3415
3408
  <div class="ft-header-menu-separator" role="separator"></div>
3416
3409
  ${c("autofit", A("autoFitWidth"), () => this._autoFitColumn(e))}
3417
- ${c("wider", A("wider"), () => this._resizeColumnBy(e, qe), !0)}
3410
+ ${c("wider", A("wider"), () => this._resizeColumnBy(e, X), !0)}
3418
3411
  ${c("narrower", A("narrower"), () => this._resizeColumnBy(e, -20), !0)}
3419
3412
  </div>
3420
3413
  `;
@@ -3703,10 +3696,10 @@ var q = [
3703
3696
  @keydown=${(e) => {
3704
3697
  e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
3705
3698
  }}>
3706
- ${Object.keys(J).map((e) => i`<option value=${e}>${J[e]}</option>`)}
3699
+ ${Object.keys(q).map((e) => i`<option value=${e}>${q[e]}</option>`)}
3707
3700
  </select>
3708
3701
  <input class="ft-filter-input ft-num-cond-input" type="text" inputmode="decimal" placeholder=${A("valuePlaceholder")}
3709
- .value=${n.text ?? (n.value == null ? "" : P(n.value))}
3702
+ .value=${n.text ?? (n.value == null ? "" : N(n.value))}
3710
3703
  aria-invalid=${n.text && n.value == null ? "true" : "false"}
3711
3704
  @input=${(n) => {
3712
3705
  let r = n.target.value, i = this._numberFilterState.get(e) ?? this._defaultNumState();
@@ -3815,7 +3808,7 @@ var q = [
3815
3808
  if (!n) return;
3816
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}"]`);
3817
3810
  if (a && (i = Math.max(i, a.scrollWidth)), r) for (let e of r) i = Math.max(i, e.scrollWidth);
3818
- let o = n.minWidth ?? X, s = Math.max(o, i + 8);
3811
+ let o = n.minWidth ?? Y, s = Math.max(o, i + 8);
3819
3812
  this._columnWidths.set(n.key, s), this.requestUpdate(), this.dispatchEvent(new CustomEvent("column-resize", {
3820
3813
  detail: {
3821
3814
  key: n.key,
@@ -3828,7 +3821,7 @@ var q = [
3828
3821
  }
3829
3822
  _onResizeStart(e, t) {
3830
3823
  e.preventDefault(), e.stopPropagation();
3831
- let n = this.visibleColumns[t], r = this._columnWidths.get(n.key) ?? n.width ?? Y;
3824
+ let n = this.visibleColumns[t], r = this._columnWidths.get(n.key) ?? n.width ?? J;
3832
3825
  this._resizing = {
3833
3826
  colIndex: t,
3834
3827
  startX: e.clientX,
@@ -3836,13 +3829,13 @@ var q = [
3836
3829
  };
3837
3830
  let i = (e) => {
3838
3831
  if (!this._resizing) return;
3839
- let t = e.clientX - this._resizing.startX, r = n.minWidth ?? X, i = Math.max(r, this._resizing.startWidth + t);
3832
+ let t = e.clientX - this._resizing.startX, r = n.minWidth ?? Y, i = Math.max(r, this._resizing.startWidth + t);
3840
3833
  this._columnWidths.set(n.key, i), this.requestUpdate();
3841
3834
  }, a = () => {
3842
3835
  document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this._resizeCleanup = null;
3843
3836
  }, o = () => {
3844
3837
  if (a(), this._resizing) {
3845
- let e = this._columnWidths.get(n.key) ?? Y;
3838
+ let e = this._columnWidths.get(n.key) ?? J;
3846
3839
  this.dispatchEvent(new CustomEvent("column-resize", {
3847
3840
  detail: {
3848
3841
  key: n.key,
@@ -4431,10 +4424,10 @@ var q = [
4431
4424
  ${this._renderEditor(e, t)}
4432
4425
  </div>
4433
4426
  `;
4434
- 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 = [
4427
+ 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, C = [
4435
4428
  "ft-cell",
4436
4429
  `ft-type-${t.type ?? "text"}`,
4437
- `ft-align-${G(t)}`,
4430
+ `ft-align-${W(t)}`,
4438
4431
  s ? "ft-active" : "",
4439
4432
  l ? "ft-selected" : "",
4440
4433
  f ? "ft-pinned" : "",
@@ -4444,9 +4437,9 @@ var q = [
4444
4437
  o?.continues ? "ft-merge-continued" : "",
4445
4438
  o?.opensDown ? "ft-merge-open" : "",
4446
4439
  t.reveal === "hover" ? "ft-reveal-hover" : ""
4447
- ].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;
4440
+ ].filter(Boolean).join(" "), w = this._toDataIndex(n), E = this._comments.get(w)?.get(t.key) ?? null, D = E !== null, O = D ? i`<div class="ft-comment-indicator" title=${E}></div>` : a;
4448
4441
  return i`
4449
- <div class=${D ? w + " ft-has-comment" : w}
4442
+ <div class=${D ? C + " ft-has-comment" : C}
4450
4443
  role="gridcell"
4451
4444
  aria-colindex=${r + 1}
4452
4445
  data-col-index=${r}
@@ -4460,7 +4453,7 @@ var q = [
4460
4453
  @click=${(e) => this._onCellClickEvent(e, n, r)}
4461
4454
  @dblclick=${() => this._onCellDblClick(n, r)}>
4462
4455
  ${O}
4463
- ${C(e[t.key], e, t)}
4456
+ ${T(e[t.key], e, t)}
4464
4457
  </div>
4465
4458
  `;
4466
4459
  }
@@ -4469,7 +4462,7 @@ var q = [
4469
4462
  let n = e[t.key], r = n == null ? "" : String(n);
4470
4463
  if (t.type === "number") return i`
4471
4464
  <input class="ft-editor ft-editor-number" type="text" inputmode="decimal"
4472
- .value=${typeof n == "number" ? P(n) : r}
4465
+ .value=${typeof n == "number" ? N(n) : r}
4473
4466
  @keydown=${this._onEditorKeyDown}
4474
4467
  @blur=${() => this._commitEdit()}>
4475
4468
  `;
@@ -4478,7 +4471,7 @@ var q = [
4478
4471
  return i`
4479
4472
  <u-date-picker class="ft-editor ft-editor-${t.type}" size="sm"
4480
4473
  mode=${e ? "datetime" : "date"} ?confirm=${e}
4481
- .value=${Xe(n, e)}
4474
+ .value=${Qe(n, e)}
4482
4475
  @keydown=${this._onEditorKeyDown}
4483
4476
  @change=${() => this._commitEdit()}
4484
4477
  @blur=${() => this._commitEdit()}></u-date-picker>
@@ -4525,67 +4518,67 @@ var q = [
4525
4518
  `;
4526
4519
  }
4527
4520
  };
4528
- K([s({ type: Array })], Q.prototype, "columns", void 0), K([s({
4521
+ G([s({ type: Array })], Q.prototype, "columns", void 0), G([s({
4529
4522
  type: Array,
4530
4523
  hasChanged: () => !0
4531
- })], Q.prototype, "data", null), K([s({
4524
+ })], Q.prototype, "data", null), G([s({
4532
4525
  type: Boolean,
4533
4526
  attribute: "clear-undo-on-data-change"
4534
- })], Q.prototype, "clearUndoOnDataChange", void 0), K([s({
4527
+ })], Q.prototype, "clearUndoOnDataChange", void 0), G([s({
4535
4528
  type: Boolean,
4536
4529
  attribute: "clear-selection-on-data-change"
4537
- })], Q.prototype, "clearSelectionOnDataChange", void 0), K([s({
4530
+ })], Q.prototype, "clearSelectionOnDataChange", void 0), G([s({
4538
4531
  type: Number,
4539
4532
  attribute: "row-height"
4540
- })], Q.prototype, "rowHeight", null), K([s({
4533
+ })], Q.prototype, "rowHeight", null), G([s({
4541
4534
  type: Boolean,
4542
4535
  attribute: "show-row-numbers"
4543
- })], Q.prototype, "showRowNumbers", void 0), K([s({
4536
+ })], Q.prototype, "showRowNumbers", void 0), G([s({
4544
4537
  type: String,
4545
4538
  reflect: !0
4546
- })], Q.prototype, "theme", void 0), K([s({
4539
+ })], Q.prototype, "theme", void 0), G([s({
4547
4540
  type: Number,
4548
4541
  attribute: "max-rows"
4549
- })], Q.prototype, "maxRows", void 0), K([s({ type: Boolean })], Q.prototype, "editable", void 0), K([s({
4542
+ })], Q.prototype, "maxRows", void 0), G([s({ type: Boolean })], Q.prototype, "editable", void 0), G([s({
4550
4543
  type: Boolean,
4551
4544
  attribute: "show-filters"
4552
- })], Q.prototype, "showFilters", void 0), K([s({
4545
+ })], Q.prototype, "showFilters", void 0), G([s({
4553
4546
  type: Boolean,
4554
4547
  attribute: "show-context-menu"
4555
- })], Q.prototype, "showContextMenu", void 0), K([s({
4548
+ })], Q.prototype, "showContextMenu", void 0), G([s({
4556
4549
  type: Number,
4557
4550
  attribute: "frozen-rows"
4558
- })], Q.prototype, "frozenRows", void 0), K([s({
4551
+ })], Q.prototype, "frozenRows", void 0), G([s({
4559
4552
  type: String,
4560
4553
  attribute: "empty-message"
4561
- })], Q.prototype, "emptyMessage", void 0), K([s({
4554
+ })], Q.prototype, "emptyMessage", void 0), G([s({
4562
4555
  type: String,
4563
4556
  attribute: "no-matching-message"
4564
- })], Q.prototype, "noMatchingMessage", void 0), K([s({
4557
+ })], Q.prototype, "noMatchingMessage", void 0), G([s({
4565
4558
  type: Boolean,
4566
4559
  reflect: !0
4567
- })], Q.prototype, "loading", void 0), K([s({
4560
+ })], Q.prototype, "loading", void 0), G([s({
4568
4561
  type: Boolean,
4569
4562
  attribute: "import-enabled"
4570
- })], Q.prototype, "importEnabled", void 0), K([s({ type: Boolean })], Q.prototype, "selectable", void 0), K([s({
4563
+ })], Q.prototype, "importEnabled", void 0), G([s({ type: Boolean })], Q.prototype, "selectable", void 0), G([s({
4571
4564
  type: String,
4572
4565
  attribute: "selection-mode"
4573
- })], Q.prototype, "selectionMode", null), K([s({
4566
+ })], Q.prototype, "selectionMode", null), G([s({
4574
4567
  type: String,
4575
4568
  attribute: "data-mode"
4576
- })], Q.prototype, "dataMode", void 0), K([s({
4569
+ })], Q.prototype, "dataMode", void 0), G([s({
4577
4570
  type: Object,
4578
4571
  attribute: "footer-data"
4579
- })], Q.prototype, "footerData", void 0), K([s({ attribute: !1 })], Q.prototype, "stylesheets", void 0), K([s({
4572
+ })], Q.prototype, "footerData", void 0), G([s({ attribute: !1 })], Q.prototype, "stylesheets", void 0), G([s({
4580
4573
  type: Number,
4581
4574
  attribute: "max-undo-size"
4582
- })], Q.prototype, "maxUndoSize", null), K([c()], Q.prototype, "_scrollTop", void 0), K([c()], Q.prototype, "_scrollLeft", void 0), K([c()], Q.prototype, "_viewportHeight", void 0), K([c()], Q.prototype, "_viewportWidth", void 0), K([c()], Q.prototype, "_activeCell", void 0), K([c()], Q.prototype, "_editingCell", void 0), K([c()], Q.prototype, "_sortCriteria", void 0), K([c()], Q.prototype, "_openFilterKey", void 0), K([c()], Q.prototype, "_rowSelectionVersion", void 0), K([c()], Q.prototype, "_autocompleteState", void 0), K([c()], Q.prototype, "_headerMenu", void 0), K([c()], Q.prototype, "_bodyContextMenu", void 0), K([c()], Q.prototype, "_commentPopup", void 0), K([c()], Q.prototype, "_isDragOver", void 0), Q = K([o("flex-table")], Q);
4583
- function Xe(e, t) {
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
+ function Qe(e, t) {
4584
4577
  if (t) {
4585
- let t = ce(e);
4578
+ let t = de(e);
4586
4579
  return /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(t) ? t.replace(" ", "T") : void 0;
4587
4580
  }
4588
- let n = se(e);
4581
+ let n = ue(e);
4589
4582
  return /^\d{4}-\d{2}-\d{2}$/.test(n) ? n : void 0;
4590
4583
  }
4591
4584
  function $(e) {
@@ -4596,4 +4589,4 @@ function $(e) {
4596
4589
  }
4597
4590
  }
4598
4591
  //#endregion
4599
- export { j as a, M as i, G as n, k as o, V as r, C as s, Q as t };
4592
+ export { j as a, ce as i, W as n, k as o, B as r, T as s, Q as t };
@@ -397,13 +397,9 @@ export declare class FlexTable extends LitElement {
397
397
  * The selection as TSV in display (sorted) order, or `null` without a selection.
398
398
  */
399
399
  private _selectionTsv;
400
- /**
401
- * The browser's copy / cut / paste on the grid. Events from a text field inside the grid (the cell
402
- * editor, the find panel, a filter input) are that field's own and pass through untouched.
403
- */
404
- private _onClipboard;
405
- /** The context menu's Copy — no clipboard event to fill, so it goes through the async Clipboard API. */
400
+ /** The context menu's Copy — a click, not a key, so it goes through the async Clipboard API. */
406
401
  private _copyFromMenu;
402
+ private _clipboardError;
407
403
  /** Runs once the text is on the clipboard — only then is a cut range cleared. */
408
404
  private _afterCopy;
409
405
  private _pasteText;
@@ -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-B8ehfxqn.js";
1
+ import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./flex-table-CQNVaL0x.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-B8ehfxqn.js";
1
+ import { t as e } from "./flex-table-CQNVaL0x.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.0",
3
+ "version": "0.48.1",
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.0.1",
76
+ "@iyulab/components": ">=2.1.0",
77
77
  "@lit/react": "^1.0.8",
78
78
  "react": "^18.0.0 || ^19.0.0"
79
79
  },
@@ -159,7 +159,7 @@ All are `CustomEvent`s with `bubbles: true, composed: true`. `row`/`index` are d
159
159
  | `selection-change` | `{ selectedIndices, selectedRows }` |
160
160
  | `clipboard-copy` / `clipboard-cut` | `{ range, text }` (TSV) |
161
161
  | `clipboard-paste` | `{ changes, addedRows }` |
162
- | `clipboard-error` | `{ action: 'copy', error }` — the context menu's Copy could not write; no `clipboard-copy` follows |
162
+ | `clipboard-error` | `{ action: 'copy' \| 'paste', error }` — copy could not put the text on the clipboard (no `clipboard-copy`/`clipboard-cut` follows; a cut clears nothing), or paste could not read it |
163
163
  | `fill-handle-apply` | `{ sourceRange, targetRange, cells }` |
164
164
  | `find-replace` | `{ type: 'replace' \| 'replace-all', cells }` |
165
165
  | `comment-change` | `{ dataIndex, colKey, text }` |