@iyulab/flex-table 0.52.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,15 @@
1
- import { n as e, t } from "./sorting-CjfjRxwL.js";
2
- import { LitElement as n, css as r, html as i, nothing as a } from "lit";
3
- import { customElement as o, property as s, state as c } from "lit/decorators.js";
4
- import { Locale as l } from "@iyulab/components/dist/utilities/Locale.js";
5
- import { formatDate as u, formatNumber as d, parseDate as f, parseDateTime as p, parseNumber as m } from "@iyulab/components/dist/utilities/format.js";
6
- import { decodeTsv as h, encodeTsv as g } from "@iyulab/components/dist/utilities/tsv.js";
1
+ import { n as e } from "./locale-B1SiVDS1.js";
2
+ import { n as t, t as n } from "./sorting-CjfjRxwL.js";
3
+ import { LitElement as r, css as i, html as a, nothing as o } from "lit";
4
+ import { customElement as s, property as c, state as l } from "lit/decorators.js";
5
+ import { Locale as u } from "@iyulab/components/dist/utilities/Locale.js";
6
+ import { formatDate as d, formatNumber as f, parseDate as p, parseDateTime as m, parseNumber as h } from "@iyulab/components/dist/utilities/format.js";
7
+ import { decodeTsv as g, encodeTsv as _ } from "@iyulab/components/dist/utilities/tsv.js";
7
8
  import "@iyulab/components/dist/components/date-picker/UDatePicker.js";
8
- import { isImeComposing as _ } from "@iyulab/components/dist/utilities/keyboard.js";
9
- import { copyFromKey as v, isTextEntry as y, pasteFromKey as b } from "@iyulab/components/dist/utilities/clipboard.js";
9
+ import { isImeComposing as v } from "@iyulab/components/dist/utilities/keyboard.js";
10
+ import { copyFromKey as y, isTextEntry as b, pasteFromKey as x } from "@iyulab/components/dist/utilities/clipboard.js";
10
11
  //#region src/styles/flex-table.styles.ts
11
- var x = r`
12
+ var S = i`
12
13
  /* --- Theme Variables (Light defaults) --- */
13
14
  :host {
14
15
  --ft-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
@@ -391,6 +392,10 @@ var x = r`
391
392
  color: var(--ft-empty-color);
392
393
  }
393
394
 
395
+ .ft-error {
396
+ color: var(--ft-invalid-color);
397
+ }
398
+
394
399
  .ft-has-comment {
395
400
  position: relative;
396
401
  }
@@ -1023,26 +1028,26 @@ var x = r`
1023
1028
  `;
1024
1029
  //#endregion
1025
1030
  //#region src/renderers/format.ts
1026
- function S(e, t) {
1027
- return e == null ? "" : typeof t == "function" ? t(e) : C(t) ? w(e, t) : ee(e, t);
1031
+ function C(e, t) {
1032
+ return e == null ? "" : typeof t == "function" ? t(e) : w(t) ? E(e, t) : T(e, t);
1028
1033
  }
1029
- function C(e) {
1034
+ function w(e) {
1030
1035
  return /[yMdHhms]/.test(e);
1031
1036
  }
1032
- function ee(e, t) {
1037
+ function T(e, t) {
1033
1038
  let n = typeof e == "number" ? e : Number(e);
1034
1039
  if (isNaN(n)) return String(e);
1035
- 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 = {
1040
+ let r = t.endsWith("%"), i = t.match(/^([^#0.,%]+)/), a = i ? i[1] : "", o = t.replace(/^[^#0.,%]+/, "").replace(/%$/, ""), s = o.match(/\.([0#]+)$/), c = s ? s[1].length : 0, l = {
1036
1041
  minimumFractionDigits: c,
1037
1042
  maximumFractionDigits: c,
1038
1043
  useGrouping: o.includes(",")
1039
1044
  }, d;
1040
- return r ? d = new Intl.NumberFormat(l.get(), {
1041
- ...u,
1045
+ return r ? d = new Intl.NumberFormat(u.get(), {
1046
+ ...l,
1042
1047
  style: "percent"
1043
- }).format(n) : (d = new Intl.NumberFormat(l.get(), u).format(n), a && (d = a + d)), d + "";
1048
+ }).format(n) : (d = new Intl.NumberFormat(u.get(), l).format(n), a && (d = a + d)), d + "";
1044
1049
  }
1045
- function w(e, t) {
1050
+ function E(e, t) {
1046
1051
  let n;
1047
1052
  if (e instanceof Date) n = e;
1048
1053
  else if (typeof e == "string" || typeof e == "number") n = new Date(e);
@@ -1053,21 +1058,21 @@ function w(e, t) {
1053
1058
  }
1054
1059
  //#endregion
1055
1060
  //#region src/renderers/cell-renderer.ts
1056
- function T(e, t, n) {
1057
- 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);
1061
+ function D(e, t, n) {
1062
+ return n.render ? n.render(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) : C(e, n.format) : O(e, n);
1058
1063
  }
1059
- function E(e, t) {
1064
+ function O(e, t) {
1060
1065
  if (e == null) return "";
1061
1066
  switch (t.type) {
1062
1067
  case "number": return ne(e);
1063
- case "boolean": return i`<span class="ft-bool">${e ? "✔" : ""}</span>`;
1068
+ case "boolean": return a`<span class="ft-bool">${e ? "✔" : ""}</span>`;
1064
1069
  case "date": return re(e);
1065
1070
  case "datetime": return ie(e);
1066
- case "select": return D(e, t);
1071
+ case "select": return ee(e, t);
1067
1072
  default: return String(e);
1068
1073
  }
1069
1074
  }
1070
- function D(e, t) {
1075
+ function ee(e, t) {
1071
1076
  if (!t.options || t.options.length === 0 || typeof t.options[0] == "string") return e == null ? "" : String(e);
1072
1077
  let n = t.options.find((t) => t.value === e);
1073
1078
  return n ? n.label : e == null ? "" : String(e);
@@ -1081,160 +1086,15 @@ var te = {
1081
1086
  second: "numeric"
1082
1087
  };
1083
1088
  function ne(e) {
1084
- return typeof e == "number" ? Number.isInteger(e) ? d(e) : d(e, { minimumFractionDigits: 1 }) : String(e);
1089
+ return typeof e == "number" ? Number.isInteger(e) ? f(e) : f(e, { minimumFractionDigits: 1 }) : String(e);
1085
1090
  }
1086
1091
  function re(e) {
1087
- return e instanceof Date || typeof e == "string" ? u(e) : String(e);
1092
+ return e instanceof Date || typeof e == "string" ? d(e) : String(e);
1088
1093
  }
1089
1094
  function ie(e) {
1090
- return e instanceof Date || typeof e == "string" ? u(e, te) : String(e);
1095
+ return e instanceof Date || typeof e == "string" ? d(e, te) : String(e);
1091
1096
  }
1092
1097
  //#endregion
1093
- //#region src/locale.ts
1094
- var O = l.namespace("flex-table");
1095
- O.register("en", {
1096
- showHiddenColumns: "Show hidden column(s)",
1097
- columnMenu: "Column menu",
1098
- cellActions: "Cell actions",
1099
- noColumnsDefined: "No columns defined",
1100
- addCommentPlaceholder: "Add a comment… (Ctrl+Enter to save)",
1101
- cancel: "Cancel",
1102
- save: "Save",
1103
- clear: "Clear",
1104
- blankCells: "Blank cells",
1105
- emptyOnly: "Empty only",
1106
- nonEmptyOnly: "Non-empty only",
1107
- blankAll: "— All —",
1108
- all: "All",
1109
- contains: "Contains",
1110
- startsWith: "Starts with",
1111
- endsWith: "Ends with",
1112
- wildcard: "Wildcard",
1113
- searchPlaceholder: "Search...",
1114
- valuePlaceholder: "Value",
1115
- fromPlaceholder: "From",
1116
- toPlaceholder: "To",
1117
- findPlaceholder: "Find...",
1118
- findPrevious: "Previous match",
1119
- findNext: "Next match",
1120
- matchCase: "Match case",
1121
- wholeCell: "Whole cell",
1122
- closeFind: "Close find",
1123
- findNoResults: "No results",
1124
- replaceWithPlaceholder: "Replace with...",
1125
- replace: "Replace",
1126
- replaceAll: "Replace all",
1127
- findInput: "Find",
1128
- replaceInput: "Replace with",
1129
- filterFor: "Filter {header}",
1130
- filterMatchMode: "Match",
1131
- filterText: "Filter text",
1132
- conditionOperator: "Condition {n}",
1133
- conditionValue: "Condition {n} value",
1134
- conditionJoin: "Combine conditions",
1135
- sortAscending: "Sort ascending",
1136
- sortDescending: "Sort descending",
1137
- filter: "Filter…",
1138
- clearFilter: "Clear filter",
1139
- hideColumn: "Hide column",
1140
- showColumn: "Show: {header}",
1141
- autoFitWidth: "Auto-fit width",
1142
- wider: "Wider",
1143
- narrower: "Narrower",
1144
- columnMenuFor: "Column menu: {header}",
1145
- columnMenuRegion: "{header} column",
1146
- copy: "Copy",
1147
- insertRowAbove: "Insert row above",
1148
- insertRowBelow: "Insert row below",
1149
- deleteRow: "Delete row",
1150
- selectRow: "Select row",
1151
- selectAllRows: "Select all rows",
1152
- filterByThisValue: "Filter by this value",
1153
- addComment: "Add Comment",
1154
- editComment: "Edit Comment",
1155
- deleteComment: "Delete Comment",
1156
- booleanTrue: "True",
1157
- booleanFalse: "False",
1158
- dropFileToImport: "Drop file to import (.xlsx / .csv)",
1159
- notANumber: "Enter a number",
1160
- notADate: "Enter a date as YYYY-MM-DD",
1161
- notADateTime: "Enter a date and time as YYYY-MM-DD HH:mm",
1162
- notInList: "Value must be from the existing list",
1163
- requestFailed: "Request failed ({status})",
1164
- networkFailed: "Could not reach the server."
1165
- }), O.register("ko", {
1166
- showHiddenColumns: "숨긴 열 보기",
1167
- columnMenu: "열 메뉴",
1168
- cellActions: "셀 작업",
1169
- noColumnsDefined: "정의된 열이 없습니다",
1170
- addCommentPlaceholder: "메모 입력… (Ctrl+Enter 로 저장)",
1171
- cancel: "취소",
1172
- save: "저장",
1173
- clear: "지우기",
1174
- blankCells: "빈 셀",
1175
- emptyOnly: "빈 값만",
1176
- nonEmptyOnly: "빈 값 제외",
1177
- blankAll: "— 전체 —",
1178
- all: "전체",
1179
- contains: "포함",
1180
- startsWith: "시작 문자",
1181
- endsWith: "끝 문자",
1182
- wildcard: "와일드카드",
1183
- searchPlaceholder: "검색...",
1184
- valuePlaceholder: "값",
1185
- fromPlaceholder: "시작",
1186
- toPlaceholder: "끝",
1187
- findPlaceholder: "찾기...",
1188
- findPrevious: "이전 일치",
1189
- findNext: "다음 일치",
1190
- matchCase: "대/소문자 구분",
1191
- wholeCell: "셀 전체 일치",
1192
- closeFind: "찾기 닫기",
1193
- findNoResults: "결과 없음",
1194
- replaceWithPlaceholder: "바꿀 내용...",
1195
- replace: "바꾸기",
1196
- replaceAll: "모두 바꾸기",
1197
- findInput: "찾을 내용",
1198
- replaceInput: "바꿀 내용",
1199
- filterFor: "{header} 필터",
1200
- filterMatchMode: "일치 방식",
1201
- filterText: "필터 텍스트",
1202
- conditionOperator: "조건 {n}",
1203
- conditionValue: "조건 {n} 값",
1204
- conditionJoin: "조건 결합",
1205
- sortAscending: "오름차순 정렬",
1206
- sortDescending: "내림차순 정렬",
1207
- filter: "필터…",
1208
- clearFilter: "필터 지우기",
1209
- hideColumn: "열 숨기기",
1210
- showColumn: "{header} 보기",
1211
- autoFitWidth: "너비 자동 맞춤",
1212
- wider: "넓게",
1213
- narrower: "좁게",
1214
- columnMenuFor: "{header} 열 메뉴",
1215
- columnMenuRegion: "{header} 열",
1216
- copy: "복사",
1217
- insertRowAbove: "위에 행 삽입",
1218
- insertRowBelow: "아래에 행 삽입",
1219
- deleteRow: "행 삭제",
1220
- selectRow: "행 선택",
1221
- selectAllRows: "모든 행 선택",
1222
- filterByThisValue: "이 값으로 필터",
1223
- addComment: "메모 추가",
1224
- editComment: "메모 편집",
1225
- deleteComment: "메모 삭제",
1226
- booleanTrue: "참",
1227
- booleanFalse: "거짓",
1228
- dropFileToImport: "가져올 파일을 놓으세요 (.xlsx / .csv)",
1229
- notANumber: "숫자를 입력하세요",
1230
- notADate: "날짜를 YYYY-MM-DD 로 입력하세요",
1231
- notADateTime: "날짜와 시간을 YYYY-MM-DD HH:mm 으로 입력하세요",
1232
- notInList: "목록에 있는 값이어야 합니다",
1233
- requestFailed: "요청이 실패했습니다 ({status})",
1234
- networkFailed: "서버에 연결하지 못했습니다."
1235
- });
1236
- var k = (e, t) => O.text(e, t);
1237
- //#endregion
1238
1098
  //#region src/core/selection.ts
1239
1099
  function ae(e) {
1240
1100
  return {
@@ -1363,7 +1223,7 @@ var oe = class {
1363
1223
  let e = this.current;
1364
1224
  return this.current = null, e;
1365
1225
  }
1366
- }, A = class {
1226
+ }, k = class {
1367
1227
  constructor() {
1368
1228
  this._selected = /* @__PURE__ */ new Set(), this._mode = "multi", this._rowCount = 0;
1369
1229
  }
@@ -1443,7 +1303,7 @@ function ce(e, t, n) {
1443
1303
  }
1444
1304
  //#endregion
1445
1305
  //#region src/core/undo.ts
1446
- var le = 100, j = class {
1306
+ var le = 100, A = class {
1447
1307
  constructor() {
1448
1308
  this._undoStack = [], this._redoStack = [], this._maxSize = le;
1449
1309
  }
@@ -1492,27 +1352,27 @@ function ue(e, t, n) {
1492
1352
  }
1493
1353
  r.push(o);
1494
1354
  }
1495
- return g(r);
1355
+ return _(r);
1496
1356
  }
1497
- function M(e, t) {
1357
+ function j(e, t) {
1498
1358
  if (e === "") return null;
1499
1359
  switch (t.type) {
1500
1360
  case "number": {
1501
- let t = m(e);
1361
+ let t = h(e);
1502
1362
  if (t !== null) return t;
1503
1363
  let n = Number(e.trim());
1504
1364
  return e.trim() !== "" && Number.isFinite(n) ? n : e;
1505
1365
  }
1506
1366
  case "boolean": return e.toLowerCase() === "true" || e === "1";
1507
- case "date": return f(e) ?? e;
1508
- case "datetime": return p(e) ?? e;
1367
+ case "date": return p(e) ?? e;
1368
+ case "datetime": return m(e) ?? e;
1509
1369
  default: return e;
1510
1370
  }
1511
1371
  }
1512
- function N(e) {
1372
+ function M(e) {
1513
1373
  let t = String(e);
1514
1374
  if (!Number.isFinite(e) || t.includes("e")) return t;
1515
- let n = new Intl.NumberFormat(l.get()).formatToParts(1.5).find((e) => e.type === "decimal")?.value;
1375
+ let n = new Intl.NumberFormat(u.get()).formatToParts(1.5).find((e) => e.type === "decimal")?.value;
1516
1376
  return n && n !== "." ? t.replace(".", n) : t;
1517
1377
  }
1518
1378
  function de(e) {
@@ -1546,9 +1406,9 @@ function me(e) {
1546
1406
  for (let n = 0; n < e.length; n++) t = pe[(t ^ e[n]) & 255] ^ t >>> 8;
1547
1407
  return (t ^ 4294967295) >>> 0;
1548
1408
  }
1549
- var P = new TextEncoder();
1409
+ var N = new TextEncoder();
1550
1410
  function he(e) {
1551
- return F(e.map((e) => ({
1411
+ return P(e.map((e) => ({
1552
1412
  ...e,
1553
1413
  body: e.data,
1554
1414
  method: 0
@@ -1568,7 +1428,7 @@ async function ge(e) {
1568
1428
  method: 0
1569
1429
  });
1570
1430
  }
1571
- return F(t);
1431
+ return P(t);
1572
1432
  }
1573
1433
  async function _e(e) {
1574
1434
  let t = new CompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
@@ -1579,29 +1439,29 @@ async function _e(e) {
1579
1439
  if (e) break;
1580
1440
  i.push(t);
1581
1441
  }
1582
- return I(i);
1442
+ return F(i);
1583
1443
  }
1584
- function F(e) {
1444
+ function P(e) {
1585
1445
  let t = [], n = [], r = 0;
1586
1446
  for (let i of e) {
1587
- 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);
1447
+ let e = N.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);
1588
1448
  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);
1589
1449
  let d = new ArrayBuffer(46 + e.length), f = new DataView(d);
1590
1450
  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;
1591
1451
  }
1592
- let i = I(n), a = /* @__PURE__ */ new ArrayBuffer(22), o = new DataView(a);
1593
- 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([
1452
+ let i = F(n), a = /* @__PURE__ */ new ArrayBuffer(22), o = new DataView(a);
1453
+ 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), F([
1594
1454
  ...t,
1595
1455
  i,
1596
1456
  new Uint8Array(a)
1597
1457
  ]);
1598
1458
  }
1599
- function I(e) {
1459
+ function F(e) {
1600
1460
  let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
1601
1461
  for (let t of e) n.set(t, r), r += t.length;
1602
1462
  return n;
1603
1463
  }
1604
- function L(e) {
1464
+ function I(e) {
1605
1465
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1606
1466
  }
1607
1467
  function ve(e) {
@@ -1609,7 +1469,7 @@ function ve(e) {
1609
1469
  for (e++; e > 0;) t = String.fromCharCode(64 + (e % 26 || 26)) + t, e = Math.floor((e - 1) / 26);
1610
1470
  return t;
1611
1471
  }
1612
- function R(e, t) {
1472
+ function L(e, t) {
1613
1473
  return ve(t) + (e + 1);
1614
1474
  }
1615
1475
  function ye(e) {
@@ -1618,13 +1478,13 @@ function ye(e) {
1618
1478
  }
1619
1479
  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>";
1620
1480
  function Te(e, t) {
1621
- let n = [], r = t.map((e, t) => `<c r="${R(0, t)}" t="str" s="2"><v>${L(e.label)}</v></c>`);
1481
+ let n = [], r = t.map((e, t) => `<c r="${L(0, t)}" t="str" s="2"><v>${I(e.label)}</v></c>`);
1622
1482
  return n.push(`<row r="1">${r.join("")}</row>`), e.forEach((e, r) => {
1623
1483
  let i = t.map((t, n) => {
1624
- let i = R(r + 1, n), a = e[t.key];
1484
+ let i = L(r + 1, n), a = e[t.key];
1625
1485
  if (a == null) return `<c r="${i}" t="str"><v></v></c>`;
1626
1486
  let o = t.type ?? "text";
1627
- 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>`;
1487
+ 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>${I(String(a))}</v></c>`;
1628
1488
  });
1629
1489
  n.push(`<row r="${r + 2}">${i.join("")}</row>`);
1630
1490
  }), `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
@@ -1633,64 +1493,64 @@ function Te(e, t) {
1633
1493
  </worksheet>`;
1634
1494
  }
1635
1495
  function Ee(e, t) {
1636
- return he(z(e, t));
1496
+ return he(R(e, t));
1637
1497
  }
1638
1498
  function De(e, t) {
1639
- return ge(z(e, t));
1499
+ return ge(R(e, t));
1640
1500
  }
1641
- function z(e, t) {
1501
+ function R(e, t) {
1642
1502
  let n = Te(e, t);
1643
1503
  return [
1644
1504
  {
1645
1505
  name: "[Content_Types].xml",
1646
- data: P.encode(be)
1506
+ data: N.encode(be)
1647
1507
  },
1648
1508
  {
1649
1509
  name: "_rels/.rels",
1650
- data: P.encode(xe)
1510
+ data: N.encode(xe)
1651
1511
  },
1652
1512
  {
1653
1513
  name: "xl/workbook.xml",
1654
- data: P.encode(Se)
1514
+ data: N.encode(Se)
1655
1515
  },
1656
1516
  {
1657
1517
  name: "xl/_rels/workbook.xml.rels",
1658
- data: P.encode(Ce)
1518
+ data: N.encode(Ce)
1659
1519
  },
1660
1520
  {
1661
1521
  name: "xl/worksheets/sheet1.xml",
1662
- data: P.encode(n)
1522
+ data: N.encode(n)
1663
1523
  },
1664
1524
  {
1665
1525
  name: "xl/styles.xml",
1666
- data: P.encode(we)
1526
+ data: N.encode(we)
1667
1527
  }
1668
1528
  ];
1669
1529
  }
1670
1530
  //#endregion
1671
1531
  //#region src/export/export.ts
1672
- function B(e, t, n) {
1532
+ function z(e, t, n) {
1673
1533
  switch (n) {
1674
1534
  case "csv": return V(e, t, ",");
1675
1535
  case "tsv": return V(e, t, " ");
1676
- case "json": return Ae(e, t);
1536
+ case "json": return ke(e, t);
1677
1537
  case "xlsx": return Ee(e, t);
1678
1538
  }
1679
1539
  }
1680
1540
  async function Oe(e, t, n) {
1681
- let r = n === "xlsx" ? await De(e, t) : B(e, t, n);
1682
- return new Blob([r], { type: Pe(n) });
1541
+ let r = n === "xlsx" ? await De(e, t) : z(e, t, n);
1542
+ return new Blob([r], { type: Ne(n) });
1683
1543
  }
1684
- function ke(e, t) {
1544
+ function B(e, t) {
1685
1545
  return e == null ? "" : (t.type === "date" || t.type === "datetime") && e instanceof Date ? e.toISOString() : String(e);
1686
1546
  }
1687
1547
  function V(e, t, n) {
1688
- 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");
1548
+ return [t.map((e) => H(e.label, n)).join(n), ...e.map((e) => t.map((t) => H(B(e[t.key], t), n)).join(n))].join("\n");
1689
1549
  }
1690
1550
  function H(e, t) {
1691
1551
  return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? "\"" + e.replace(/"/g, "\"\"") + "\"" : e;
1692
1552
  }
1693
- function Ae(e, t) {
1553
+ function ke(e, t) {
1694
1554
  let n = e.map((e) => {
1695
1555
  let n = {};
1696
1556
  for (let r of t) {
@@ -1701,35 +1561,35 @@ function Ae(e, t) {
1701
1561
  });
1702
1562
  return JSON.stringify(n, null, 2);
1703
1563
  }
1704
- function je(e, t) {
1564
+ function Ae(e, t) {
1705
1565
  let n = URL.createObjectURL(e), r = document.createElement("a");
1706
1566
  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);
1707
1567
  }
1708
- var Me = {
1568
+ var je = {
1709
1569
  csv: "text/csv;charset=utf-8",
1710
1570
  tsv: "text/tab-separated-values;charset=utf-8",
1711
1571
  json: "application/json;charset=utf-8",
1712
1572
  xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
1713
- }, Ne = {
1573
+ }, Me = {
1714
1574
  csv: ".csv",
1715
1575
  tsv: ".tsv",
1716
1576
  json: ".json",
1717
1577
  xlsx: ".xlsx"
1718
1578
  };
1579
+ function Ne(e) {
1580
+ return je[e];
1581
+ }
1719
1582
  function Pe(e) {
1720
1583
  return Me[e];
1721
1584
  }
1722
- function Fe(e) {
1723
- return Ne[e];
1724
- }
1725
1585
  //#endregion
1726
1586
  //#region src/export/xlsx-reader.ts
1727
- function Ie(e) {
1587
+ function Fe(e) {
1728
1588
  for (let t = e.byteLength - 22; t >= 0; t--) if (e.getUint32(t, !0) === 101010256) return t;
1729
1589
  throw Error("XLSX: End of central directory not found — not a valid ZIP file");
1730
1590
  }
1731
- function Le(e) {
1732
- 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;
1591
+ function Ie(e) {
1592
+ 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;
1733
1593
  for (; o < s && e.getUint32(o, !0) === 33639248;) {
1734
1594
  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));
1735
1595
  a.push({
@@ -1742,7 +1602,7 @@ function Le(e) {
1742
1602
  }
1743
1603
  return a;
1744
1604
  }
1745
- async function Re(e) {
1605
+ async function Le(e) {
1746
1606
  let t = new DecompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
1747
1607
  n.write(e), n.close();
1748
1608
  let i = [];
@@ -1755,28 +1615,28 @@ async function Re(e) {
1755
1615
  for (let e of i) o.set(e, s), s += e.length;
1756
1616
  return o;
1757
1617
  }
1758
- async function ze(e, t) {
1618
+ async function Re(e, t) {
1759
1619
  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);
1760
1620
  if (t.compressionMethod === 0) return o.slice();
1761
- if (t.compressionMethod === 8) return Re(o);
1621
+ if (t.compressionMethod === 8) return Le(o);
1762
1622
  throw Error(`XLSX: Unsupported compression method ${t.compressionMethod}`);
1763
1623
  }
1764
- async function Be(e) {
1765
- let t = new DataView(e), n = Le(t), r = /* @__PURE__ */ new Map();
1766
- for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await ze(t, e));
1624
+ async function ze(e) {
1625
+ let t = new DataView(e), n = Ie(t), r = /* @__PURE__ */ new Map();
1626
+ for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await Re(t, e));
1767
1627
  return r;
1768
1628
  }
1769
- var Ve = new TextDecoder("utf-8");
1629
+ var Be = new TextDecoder("utf-8");
1770
1630
  function U(e) {
1771
- let t = Ve.decode(e);
1631
+ let t = Be.decode(e);
1772
1632
  return new DOMParser().parseFromString(t, "application/xml");
1773
1633
  }
1774
- function He(e) {
1634
+ function Ve(e) {
1775
1635
  if (!e) return [];
1776
1636
  let t = U(e);
1777
1637
  return Array.from(t.querySelectorAll("si")).map((e) => Array.from(e.querySelectorAll("t")).map((e) => e.textContent ?? "").join(""));
1778
1638
  }
1779
- var Ue = /* @__PURE__ */ new Set([
1639
+ var He = /* @__PURE__ */ new Set([
1780
1640
  14,
1781
1641
  15,
1782
1642
  16,
@@ -1796,29 +1656,29 @@ var Ue = /* @__PURE__ */ new Set([
1796
1656
  57,
1797
1657
  58
1798
1658
  ]);
1799
- function We(e) {
1659
+ function Ue(e) {
1800
1660
  let t = e.replace(/"[^"]*"/g, "").replace(/\\./g, "").replace(/\[[^\]]*\]/g, "").split(";")[0];
1801
1661
  return /[dy]/i.test(t);
1802
1662
  }
1803
- function Ge(e) {
1663
+ function We(e) {
1804
1664
  let t = /* @__PURE__ */ new Set();
1805
1665
  if (!e) return t;
1806
1666
  let n = U(e), r = /* @__PURE__ */ new Map();
1807
1667
  for (let e of Array.from(n.querySelectorAll("numFmts > numFmt"))) r.set(parseInt(e.getAttribute("numFmtId") ?? "", 10), e.getAttribute("formatCode") ?? "");
1808
1668
  return Array.from(n.querySelectorAll("cellXfs > xf")).forEach((e, n) => {
1809
1669
  let i = parseInt(e.getAttribute("numFmtId") ?? "0", 10), a = r.get(i);
1810
- (a === void 0 ? Ue.has(i) : We(a)) && t.add(n);
1670
+ (a === void 0 ? He.has(i) : Ue(a)) && t.add(n);
1811
1671
  }), t;
1812
1672
  }
1813
- function Ke(e) {
1673
+ function Ge(e) {
1814
1674
  if (!e) return !1;
1815
1675
  let t = U(e).querySelector("workbookPr")?.getAttribute("date1904");
1816
1676
  return t === "1" || t === "true";
1817
1677
  }
1818
- function qe(e, t) {
1678
+ function Ke(e, t) {
1819
1679
  return new Date((t ? Date.UTC(1904, 0, 1) : Date.UTC(1899, 11, 30)) + Math.floor(e) * 864e5).toISOString().slice(0, 10);
1820
1680
  }
1821
- function Je(e, t, n, r) {
1681
+ function qe(e, t, n, r) {
1822
1682
  let i = U(e).querySelectorAll("row");
1823
1683
  if (i.length === 0) return [];
1824
1684
  let a = 0, o = /* @__PURE__ */ new Map();
@@ -1826,7 +1686,7 @@ function Je(e, t, n, r) {
1826
1686
  let i = parseInt(e.getAttribute("r") ?? "1", 10) - 1, s = /* @__PURE__ */ new Map();
1827
1687
  o.set(i, s);
1828
1688
  for (let i of e.querySelectorAll("c")) {
1829
- let e = Ye(i.getAttribute("r") ?? "");
1689
+ let e = Je(i.getAttribute("r") ?? "");
1830
1690
  e > a && (a = e);
1831
1691
  let o = i.getAttribute("t") ?? "", c = i.getAttribute("s") ?? "", l = i.querySelector("v")?.textContent ?? "", u = i.querySelector("is > t")?.textContent ?? null, d;
1832
1692
  if (o === "s") d = t[parseInt(l, 10)] ?? "";
@@ -1835,7 +1695,7 @@ function Je(e, t, n, r) {
1835
1695
  else if (l === "") d = "";
1836
1696
  else {
1837
1697
  let e = parseFloat(l);
1838
- d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ? qe(e, r) : l;
1698
+ d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ? Ke(e, r) : l;
1839
1699
  }
1840
1700
  s.set(e, d);
1841
1701
  }
@@ -1849,13 +1709,13 @@ function Je(e, t, n, r) {
1849
1709
  }
1850
1710
  return c;
1851
1711
  }
1852
- function Ye(e) {
1712
+ function Je(e) {
1853
1713
  let t = 0, n = 0;
1854
1714
  for (; n < e.length && e[n] >= "A" && e[n] <= "Z";) t = t * 26 + (e.charCodeAt(n) - 64), n++;
1855
1715
  return t - 1;
1856
1716
  }
1857
- async function Xe(e) {
1858
- let t = await Be(e), n = He(t.get("xl/sharedStrings.xml")), r = t.get("xl/worksheets/sheet1.xml");
1717
+ async function Ye(e) {
1718
+ let t = await ze(e), n = Ve(t.get("xl/sharedStrings.xml")), r = t.get("xl/worksheets/sheet1.xml");
1859
1719
  if (!r) {
1860
1720
  for (let [e, n] of t) if (e.toLowerCase().includes("worksheets/sheet")) {
1861
1721
  r = n;
@@ -1863,7 +1723,7 @@ async function Xe(e) {
1863
1723
  }
1864
1724
  }
1865
1725
  if (!r) throw Error("XLSX: No worksheet found");
1866
- let i = Ge(t.get("xl/styles.xml")), a = Ke(t.get("xl/workbook.xml")), o = Je(r, n, i, a);
1726
+ let i = We(t.get("xl/styles.xml")), a = Ge(t.get("xl/workbook.xml")), o = qe(r, n, i, a);
1867
1727
  return o.length === 0 ? {
1868
1728
  headers: [],
1869
1729
  rows: []
@@ -1894,9 +1754,9 @@ var K = {
1894
1754
  lt: "<",
1895
1755
  gte: "≥",
1896
1756
  lte: "≤"
1897
- }, q = 120, J = 40, Y = 20, X = 32, Z = 5, Ze = 200, Q = class extends n {
1757
+ }, q = 120, J = 40, Y = 20, X = 32, Z = 5, Xe = 200, Q = class extends r {
1898
1758
  constructor(...e) {
1899
- 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._headerCol = null, this._focusedCellEl = 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._onHostFocus = (e) => {
1759
+ 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.error = null, this.loading = !1, this.importEnabled = !1, this.selectable = !1, this.dataMode = "client", this.footerData = null, this.stylesheets = [], this._scrollTop = 0, this._scrollLeft = 0, this._viewportHeight = 0, this._viewportWidth = 0, this._colLeftOffsets = [], this._totalRowWidth = 0, this._baseStyleSheets = [], this._activeCell = null, this._headerCol = null, this._focusedCellEl = null, this._editingCell = null, this._sortCriteria = [], this._selection = new oe(), this._editing = new se(), this._rowSelection = new k(), this._undo = new A(), 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._onHostFocus = (e) => {
1900
1760
  e.composedPath()[0] !== this || this._activeCell || this._headerCol !== null || this.visibleColumns.length !== 0 && this.matches(":focus-visible") && (this._visibleRowCount > 0 ? (this._selection.setActive(0, 0), this._syncActiveCell()) : this._headerCol = 0);
1901
1761
  }, this._onFocusIn = (e) => {
1902
1762
  let t = e.composedPath()[0];
@@ -1917,7 +1777,7 @@ var K = {
1917
1777
  }, 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();
1918
1778
  }
1919
1779
  static {
1920
- this.styles = x;
1780
+ this.styles = S;
1921
1781
  }
1922
1782
  get data() {
1923
1783
  return this._data;
@@ -2246,7 +2106,7 @@ var K = {
2246
2106
  }
2247
2107
  exportToString(e, t) {
2248
2108
  let n = this._exportSlice(t);
2249
- return n ? B(n.rows, n.cols, e) : "";
2109
+ return n ? z(n.rows, n.cols, e) : "";
2250
2110
  }
2251
2111
  async exportToBlob(e, t) {
2252
2112
  let n = this._exportSlice(t) ?? {
@@ -2256,7 +2116,7 @@ var K = {
2256
2116
  return Oe(n.rows, n.cols, e);
2257
2117
  }
2258
2118
  async exportToFile(e, t) {
2259
- je(await this.exportToBlob(e), t ?? `export${Fe(e)}`);
2119
+ Ae(await this.exportToBlob(e), t ?? `export${Pe(e)}`);
2260
2120
  }
2261
2121
  _exportSlice(e) {
2262
2122
  if (e?.selectionOnly) {
@@ -2325,10 +2185,10 @@ var K = {
2325
2185
  async importFromFile(e) {
2326
2186
  let t = e.name.toLowerCase();
2327
2187
  if (t.endsWith(".xlsx")) {
2328
- let t = await Xe(await e.arrayBuffer());
2188
+ let t = await Ye(await e.arrayBuffer());
2329
2189
  this._applyImportedSheet(t);
2330
2190
  } else if (t.endsWith(".csv") || t.endsWith(".tsv")) {
2331
- let t = await e.text(), n = h(t);
2191
+ let t = await e.text(), n = g(t);
2332
2192
  this._applyImportedRows(n);
2333
2193
  } else console.warn(`flex-table importFromFile: unsupported file type "${e.name}"`);
2334
2194
  }
@@ -2339,7 +2199,7 @@ var K = {
2339
2199
  let a = t.get(e);
2340
2200
  if (!a) return;
2341
2201
  let o = this.columns.find((e) => e.key === a);
2342
- r[a] = o ? M(n[i] ?? "", o) : n[i] ?? null;
2202
+ r[a] = o ? j(n[i] ?? "", o) : n[i] ?? null;
2343
2203
  }), r;
2344
2204
  }), r = [...this.data];
2345
2205
  this.data = n, this._undo.push({
@@ -2360,7 +2220,7 @@ var K = {
2360
2220
  let a = n.get(t);
2361
2221
  if (!a) return;
2362
2222
  let o = this.columns.find((e) => e.key === a);
2363
- r[a] = o ? M(e[i] ?? "", o) : e[i] ?? null;
2223
+ r[a] = o ? j(e[i] ?? "", o) : e[i] ?? null;
2364
2224
  }), r;
2365
2225
  }), i = [...this.data];
2366
2226
  this.data = r, this._undo.push({
@@ -2443,10 +2303,10 @@ var K = {
2443
2303
  };
2444
2304
  }
2445
2305
  connectedCallback() {
2446
- super.connectedCallback(), this._unsubscribeLocale = l.subscribe(() => this.requestUpdate()), this._detachedLocaleRevision !== void 0 && this._detachedLocaleRevision !== l.revision && this.requestUpdate(), this._detachedLocaleRevision = void 0, 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("focus", this._onHostFocus), this.renderRoot.addEventListener("focusin", this._onFocusIn), this.renderRoot.addEventListener("focusout", this._onFocusOut), 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));
2306
+ super.connectedCallback(), this._unsubscribeLocale = u.subscribe(() => this.requestUpdate()), this._detachedLocaleRevision !== void 0 && this._detachedLocaleRevision !== u.revision && this.requestUpdate(), this._detachedLocaleRevision = void 0, 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("focus", this._onHostFocus), this.renderRoot.addEventListener("focusin", this._onFocusIn), this.renderRoot.addEventListener("focusout", this._onFocusOut), 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));
2447
2307
  }
2448
2308
  disconnectedCallback() {
2449
- super.disconnectedCallback(), this._unsubscribeLocale?.(), this._unsubscribeLocale = void 0, this._detachedLocaleRevision = l.revision, this.removeEventListener("scroll", this._onScroll), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("focus", this._onHostFocus), this.renderRoot.removeEventListener("focusin", this._onFocusIn), this.renderRoot.removeEventListener("focusout", this._onFocusOut), 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);
2309
+ super.disconnectedCallback(), this._unsubscribeLocale?.(), this._unsubscribeLocale = void 0, this._detachedLocaleRevision = u.revision, this.removeEventListener("scroll", this._onScroll), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("focus", this._onHostFocus), this.renderRoot.removeEventListener("focusin", this._onFocusIn), this.renderRoot.removeEventListener("focusout", this._onFocusOut), 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);
2450
2310
  }
2451
2311
  firstUpdated() {
2452
2312
  this._readDensityTokens(), this._measureViewport(), this.shadowRoot && Array.isArray(this.shadowRoot.adoptedStyleSheets) && (this._baseStyleSheets = [...this.shadowRoot.adoptedStyleSheets]), this._syncStylesheets();
@@ -2518,8 +2378,8 @@ var K = {
2518
2378
  }), this._filters.length === 0 && this._sortCriteria.length === 0) this._sortedIndices = Array.from({ length: this.data.length }, (e, t) => t);
2519
2379
  else if (this._sortCriteria.length === 0) this._sortedIndices = [...this._filteredIndices];
2520
2380
  else {
2521
- let e = this._filteredIndices.map((e) => this.data[e]), n = t(e, this._sortCriteria, this.visibleColumns);
2522
- this._sortedIndices = n.map((e) => this._filteredIndices[e]);
2381
+ let e = this._filteredIndices.map((e) => this.data[e]), t = n(e, this._sortCriteria, this.visibleColumns);
2382
+ this._sortedIndices = t.map((e) => this._filteredIndices[e]);
2523
2383
  }
2524
2384
  }
2525
2385
  _toDataIndex(e) {
@@ -2544,7 +2404,7 @@ var K = {
2544
2404
  e !== this._viewportHeight && (this._viewportHeight = e), t !== this._viewportWidth && (this._viewportWidth = t), this._warnIfUnconstrained();
2545
2405
  }
2546
2406
  _warnIfUnconstrained() {
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.`));
2407
+ this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount < Xe || 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.`));
2548
2408
  }
2549
2409
  _onScroll() {
2550
2410
  this._scrollTop = this.scrollTop, this._scrollLeft = this.scrollLeft;
@@ -2682,64 +2542,64 @@ var K = {
2682
2542
  }
2683
2543
  let t = this.shadowRoot?.querySelector(".ft-editor");
2684
2544
  if (t) {
2685
- let n = M(t.value, e);
2545
+ let n = j(t.value, e);
2686
2546
  this._applyEdit(n);
2687
2547
  } else this._cancelEdit();
2688
2548
  }
2689
- _applyEdit(e) {
2549
+ _applyEdit(t) {
2690
2550
  this._autocompleteState = null;
2691
- let t = this._editing.commit();
2692
- if (this._editingCell = null, !t) return;
2693
- let { row: n, col: r } = t.position, i = this._toDataIndex(n), a = this.visibleColumns[r], o = t.originalValue;
2694
- if (a.autocomplete === "strict" && e != null && e !== "" && !this._getAutocompleteCandidates(a, "").includes(String(e))) {
2695
- let t = k("notInList");
2696
- this._markCellInvalid(n, r, () => k("notInList")), this._emit("validation-error", {
2697
- row: i,
2698
- col: r,
2699
- key: a.key,
2700
- value: e,
2701
- error: t
2551
+ let n = this._editing.commit();
2552
+ if (this._editingCell = null, !n) return;
2553
+ let { row: r, col: i } = n.position, a = this._toDataIndex(r), o = this.visibleColumns[i], s = n.originalValue;
2554
+ if (o.autocomplete === "strict" && t != null && t !== "" && !this._getAutocompleteCandidates(o, "").includes(String(t))) {
2555
+ let n = e("notInList");
2556
+ this._markCellInvalid(r, i, () => e("notInList")), this._emit("validation-error", {
2557
+ row: a,
2558
+ col: i,
2559
+ key: o.key,
2560
+ value: t,
2561
+ error: n
2702
2562
  });
2703
2563
  return;
2704
2564
  }
2705
- 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) {
2706
- let t = a.type === "number" ? "notANumber" : a.type === "date" ? "notADate" : "notADateTime", o = k(t);
2707
- this._markCellInvalid(n, r, () => k(t)), this._emit("validation-error", {
2708
- row: i,
2709
- col: r,
2710
- key: a.key,
2711
- value: e,
2712
- error: o
2565
+ if (o.type === "number" && typeof t == "string" || o.type === "date" && typeof t == "string" && p(t) === null || o.type === "datetime" && typeof t == "string" && m(t) === null) {
2566
+ let n = o.type === "number" ? "notANumber" : o.type === "date" ? "notADate" : "notADateTime", s = e(n);
2567
+ this._markCellInvalid(r, i, () => e(n)), this._emit("validation-error", {
2568
+ row: a,
2569
+ col: i,
2570
+ key: o.key,
2571
+ value: t,
2572
+ error: s
2713
2573
  });
2714
2574
  return;
2715
2575
  }
2716
- if (a.validator) {
2717
- let t = a.validator(e, this.data[i], a);
2718
- if (t) {
2719
- this._markCellInvalid(n, r, t), this._emit("validation-error", {
2720
- row: i,
2721
- col: r,
2722
- key: a.key,
2723
- value: e,
2724
- error: t
2576
+ if (o.validator) {
2577
+ let e = o.validator(t, this.data[a], o);
2578
+ if (e) {
2579
+ this._markCellInvalid(r, i, e), this._emit("validation-error", {
2580
+ row: a,
2581
+ col: i,
2582
+ key: o.key,
2583
+ value: t,
2584
+ error: e
2725
2585
  });
2726
2586
  return;
2727
2587
  }
2728
2588
  }
2729
- this.data[i][a.key] = e, this._undo.push({
2589
+ this.data[a][o.key] = t, this._undo.push({
2730
2590
  label: "cell-edit",
2731
2591
  undo: () => {
2732
- this.data[i][a.key] = o, this.requestUpdate();
2592
+ this.data[a][o.key] = s, this.requestUpdate();
2733
2593
  },
2734
2594
  redo: () => {
2735
- this.data[i][a.key] = e, this.requestUpdate();
2595
+ this.data[a][o.key] = t, this.requestUpdate();
2736
2596
  }
2737
2597
  }), this.requestUpdate(), this._emit("cell-edit-commit", {
2738
- row: i,
2739
- col: r,
2740
- key: a.key,
2741
- oldValue: o,
2742
- newValue: e
2598
+ row: a,
2599
+ col: i,
2600
+ key: o.key,
2601
+ oldValue: s,
2602
+ newValue: t
2743
2603
  }), this._dispatchUndoStateEvent();
2744
2604
  }
2745
2605
  _cancelEdit() {
@@ -2751,7 +2611,7 @@ var K = {
2751
2611
  });
2752
2612
  }
2753
2613
  _onEditorKeyDown(e) {
2754
- if (_(e)) return;
2614
+ if (v(e)) return;
2755
2615
  let t = e.currentTarget;
2756
2616
  if (!(t?.localName === "u-date-picker" && (e.composedPath().some((e) => e instanceof Element && e.part?.contains("popover")) || e.key === "Escape" && $(t)))) {
2757
2617
  if (this._autocompleteState && this._autocompleteState.candidates.length > 0) {
@@ -2836,7 +2696,7 @@ var K = {
2836
2696
  ].includes(e.key) && (e.preventDefault(), this._headerCol = 0);
2837
2697
  return;
2838
2698
  }
2839
- if ((e.key === "Enter" || e.key === "F2") && this._activeCell && !_(e)) {
2699
+ if ((e.key === "Enter" || e.key === "F2") && this._activeCell && !v(e)) {
2840
2700
  e.preventDefault();
2841
2701
  let n = t[this._activeCell.col];
2842
2702
  n && this._isCellEditable(n) ? this._startEdit() : e.key === "Enter" && this._fireRowActivate(n);
@@ -2901,7 +2761,7 @@ var K = {
2901
2761
  return;
2902
2762
  case "Enter":
2903
2763
  case " ":
2904
- if (_(e)) return;
2764
+ if (v(e)) return;
2905
2765
  e.preventDefault(), r.sortable !== !1 && this._toggleSort(r, e.shiftKey);
2906
2766
  return;
2907
2767
  default: return;
@@ -2940,15 +2800,15 @@ var K = {
2940
2800
  case "y": return e.preventDefault(), this.redo(), !0;
2941
2801
  case "c":
2942
2802
  case "x": {
2943
- if (y(e.composedPath()[0])) return !0;
2803
+ if (b(e.composedPath()[0])) return !0;
2944
2804
  let t = this._selectionTsv();
2945
2805
  if (!t) return !0;
2946
2806
  let n = e.key.toLowerCase() === "x" && this.editable;
2947
- return v(t.text).then((e) => {
2807
+ return y(t.text).then((e) => {
2948
2808
  e ? this._afterCopy(t.range, t.text, n) : this._clipboardError("copy", /* @__PURE__ */ Error("The clipboard did not take the copied text"));
2949
2809
  }), !0;
2950
2810
  }
2951
- case "v": return y(e.composedPath()[0]) || !this.editable || !this._activeCell || b().then((e) => this._pasteText(e), (e) => this._clipboardError("paste", e)), !0;
2811
+ case "v": return b(e.composedPath()[0]) || !this.editable || !this._activeCell || x().then((e) => this._pasteText(e), (e) => this._clipboardError("paste", e)), !0;
2952
2812
  case "d": return e.preventDefault(), this.editable && this._handleFillDown(), !0;
2953
2813
  case "r": return e.preventDefault(), this.editable && this._handleFillRight(), !0;
2954
2814
  case "f": return e.preventDefault(), this._toggleFindPanel("find"), !0;
@@ -3023,7 +2883,7 @@ var K = {
3023
2883
  }
3024
2884
  _pasteText(e) {
3025
2885
  if (!this._activeCell) return;
3026
- let t = h(e);
2886
+ let t = g(e);
3027
2887
  if (t.length === 0) return;
3028
2888
  let n = this._expandRowsForPaste(this._activeCell.row, t.length), r = this._applyPasteData(this._activeCell, t);
3029
2889
  if (this._selectPastedRange(this._activeCell, t), r.length > 0 || n.length > 0) {
@@ -3070,7 +2930,7 @@ var K = {
3070
2930
  for (let a = 0; a < t[i].length; a++) {
3071
2931
  let s = e.col + a;
3072
2932
  if (s >= n.length) break;
3073
- let c = n[s], l = this.data[o][c.key], u = M(t[i][a], c);
2933
+ let c = n[s], l = this.data[o][c.key], u = j(t[i][a], c);
3074
2934
  this.data[o][c.key] = u, r.push({
3075
2935
  row: o,
3076
2936
  col: s,
@@ -3135,7 +2995,7 @@ var K = {
3135
2995
  for (let r = e.startCol + 1; r <= e.endCol; r++) {
3136
2996
  let e = t[r];
3137
2997
  if (!e || !this._isCellEditable(e)) continue;
3138
- let a = M(o == null ? "" : String(o), e);
2998
+ let a = j(o == null ? "" : String(o), e);
3139
2999
  n.push({
3140
3000
  row: i,
3141
3001
  key: e.key,
@@ -3230,8 +3090,8 @@ var K = {
3230
3090
  }
3231
3091
  t.sortable !== !1 && this._toggleSort(t, e.shiftKey);
3232
3092
  }
3233
- _toggleSort(t, n) {
3234
- this._sortCriteria = e(this._sortCriteria, t.key, n), this.dataMode !== "server" && this._recomputeView(), this.requestUpdate(), this._emit("sort-change", { criteria: [...this._sortCriteria] });
3093
+ _toggleSort(e, n) {
3094
+ this._sortCriteria = t(this._sortCriteria, e.key, n), this.dataMode !== "server" && this._recomputeView(), this.requestUpdate(), this._emit("sort-change", { criteria: [...this._sortCriteria] });
3235
3095
  }
3236
3096
  _selectColumn(e) {
3237
3097
  let t = this._visibleRowCount;
@@ -3264,61 +3124,61 @@ var K = {
3264
3124
  let r = this._getColWidth(t[e]), i = this._scrollLeft + this._viewportWidth - this._getPinnedRight(e) - r;
3265
3125
  return Math.min(n, i);
3266
3126
  }
3267
- _renderHeaderCell(e, t) {
3268
- 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 = [
3127
+ _renderHeaderCell(t, n) {
3128
+ let r = t.sortable !== !1, i = this._sortCriteria.find((e) => e.key === t.key), s = this._sortCriteria.length > 1 ? this._sortCriteria.findIndex((e) => e.key === t.key) : -1, c = this._filters.some((e) => e.key === t.key), l = t.pinned === "left", u = t.pinned === "right", d = l || u, f = t.headerAlign ?? W(t), p = [
3269
3129
  "ft-header-cell",
3270
- n ? "ft-sortable" : "",
3271
- u ? "ft-pinned" : "",
3272
- d === "center" ? "ft-header-align-center" : "",
3273
- d === "end" ? "ft-header-align-end" : "",
3274
- this._headerCol === t ? "ft-header-active" : ""
3275
- ].filter(Boolean).join(" "), p = n ? r ? r.direction === "asc" ? "ascending" : "descending" : "none" : void 0, m = this._getColWidth(e), h = this.headerHeight, g = this._colLeftOffsets[t] ?? 0, _;
3276
- _ = c ? `position: absolute; top: 0; left: ${this._scrollLeft + this._getPinnedLeft(t)}px; width: ${m}px; height: ${h}px; z-index: 4;` : l ? `position: absolute; top: 0; left: ${this._getPinnedRightLeft(t)}px; width: ${m}px; height: ${h}px; z-index: 4;` : `left: ${g}px; width: ${m}px; height: ${h}px;`;
3277
- let v = this._colDrag?.active && this._colDrag.colIndex === t, y = [...f.split(" "), v ? "ft-col-dragging" : ""].filter(Boolean).join(" "), b = this.columns, x = b.findIndex((t) => t.key === e.key), S = [];
3278
- if (x > 0) for (let e = x - 1; e >= 0 && b[e].hidden; e--) S.push(b[e]);
3279
- let C = S.length > 0;
3280
- return i`
3281
- <div class=${y}
3130
+ r ? "ft-sortable" : "",
3131
+ d ? "ft-pinned" : "",
3132
+ f === "center" ? "ft-header-align-center" : "",
3133
+ f === "end" ? "ft-header-align-end" : "",
3134
+ this._headerCol === n ? "ft-header-active" : ""
3135
+ ].filter(Boolean).join(" "), m = r ? i ? i.direction === "asc" ? "ascending" : "descending" : "none" : void 0, h = this._getColWidth(t), g = this.headerHeight, _ = this._colLeftOffsets[n] ?? 0, v;
3136
+ v = l ? `position: absolute; top: 0; left: ${this._scrollLeft + this._getPinnedLeft(n)}px; width: ${h}px; height: ${g}px; z-index: 4;` : u ? `position: absolute; top: 0; left: ${this._getPinnedRightLeft(n)}px; width: ${h}px; height: ${g}px; z-index: 4;` : `left: ${_}px; width: ${h}px; height: ${g}px;`;
3137
+ let y = this._colDrag?.active && this._colDrag.colIndex === n, b = [...p.split(" "), y ? "ft-col-dragging" : ""].filter(Boolean).join(" "), x = this.columns, S = x.findIndex((e) => e.key === t.key), C = [];
3138
+ if (S > 0) for (let e = S - 1; e >= 0 && x[e].hidden; e--) C.push(x[e]);
3139
+ let w = C.length > 0;
3140
+ return a`
3141
+ <div class=${b}
3282
3142
  role="columnheader"
3283
3143
  tabindex="-1"
3284
- aria-colindex=${t + 1}
3285
- data-col-index=${t}
3286
- style=${_}
3287
- aria-sort=${p ?? a}
3288
- @contextmenu=${(t) => this._onHeaderContextMenu(t, e)}
3289
- @mousedown=${(n) => this._onHeaderMouseDown(n, e, t)}
3290
- @click=${n ? (t) => this._onHeaderClick(t, e) : void 0}>
3291
- ${C ? i`
3144
+ aria-colindex=${n + 1}
3145
+ data-col-index=${n}
3146
+ style=${v}
3147
+ aria-sort=${m ?? o}
3148
+ @contextmenu=${(e) => this._onHeaderContextMenu(e, t)}
3149
+ @mousedown=${(e) => this._onHeaderMouseDown(e, t, n)}
3150
+ @click=${r ? (e) => this._onHeaderClick(e, t) : void 0}>
3151
+ ${w ? a`
3292
3152
  <button class="ft-hidden-col-indicator" tabindex="-1"
3293
- title=${k("showHiddenColumns")}
3294
- @click=${(t) => {
3295
- t.stopPropagation(), this._showHiddenBefore(e);
3153
+ title=${e("showHiddenColumns")}
3154
+ @click=${(e) => {
3155
+ e.stopPropagation(), this._showHiddenBefore(t);
3296
3156
  }}>&#x276F;</button>
3297
3157
  ` : ""}
3298
- <span>${e.label}</span>
3299
- ${r ? i`<span class="ft-sort-indicator">${r.direction === "asc" ? "▲" : "▼"}</span>` : ""}
3300
- ${o >= 0 ? i`<span class="ft-sort-order">${o + 1}</span>` : ""}
3301
- <button class="ft-column-menu-btn ${s ? "ft-filter-active" : ""}"
3158
+ <span>${t.label}</span>
3159
+ ${i ? a`<span class="ft-sort-indicator">${i.direction === "asc" ? "▲" : "▼"}</span>` : ""}
3160
+ ${s >= 0 ? a`<span class="ft-sort-order">${s + 1}</span>` : ""}
3161
+ <button class="ft-column-menu-btn ${c ? "ft-filter-active" : ""}"
3302
3162
  type="button"
3303
3163
  tabindex="-1"
3304
- data-key=${e.key}
3305
- title=${k("columnMenu")}
3306
- aria-label=${k("columnMenuFor", { header: e.label })}
3164
+ data-key=${t.key}
3165
+ title=${e("columnMenu")}
3166
+ aria-label=${e("columnMenuFor", { header: t.label })}
3307
3167
  aria-haspopup="menu"
3308
- aria-expanded=${this._headerMenu?.key === e.key ? "true" : "false"}
3168
+ aria-expanded=${this._headerMenu?.key === t.key ? "true" : "false"}
3309
3169
  @mousedown=${(e) => e.stopPropagation()}
3310
- @click=${(t) => this._onColumnMenuBtnClick(t, e)}>
3170
+ @click=${(e) => this._onColumnMenuBtnClick(e, t)}>
3311
3171
  \u22EE
3312
3172
  </button>
3313
3173
  <div class="ft-resize-handle"
3314
3174
  @mousedown=${(e) => {
3315
- e.stopPropagation(), this._wasHeaderDrag = !0, this._onResizeStart(e, t);
3175
+ e.stopPropagation(), this._wasHeaderDrag = !0, this._onResizeStart(e, n);
3316
3176
  }}
3317
- @dblclick=${(t) => {
3318
- t.preventDefault(), t.stopPropagation(), this._autoFitColumn(e.key);
3177
+ @dblclick=${(e) => {
3178
+ e.preventDefault(), e.stopPropagation(), this._autoFitColumn(t.key);
3319
3179
  }}></div>
3320
3180
  </div>
3321
- ${this._openFilterKey === e.key ? this._renderFilterDropdown(e) : ""}
3181
+ ${this._openFilterKey === t.key ? this._renderFilterDropdown(t) : ""}
3322
3182
  `;
3323
3183
  }
3324
3184
  _hiddenNeighbors(e) {
@@ -3412,73 +3272,73 @@ var K = {
3412
3272
  for (let e = n - 1; e >= 0 && t[e].hidden; e--) this._setColumnHidden(t[e].key, !1);
3413
3273
  }
3414
3274
  _renderHeaderContextMenu() {
3415
- if (!this._headerMenu) return a;
3416
- let { key: e, x: t, y: n, hiddenNeighbors: r } = this._headerMenu, o = this.columns.find((t) => t.key === e);
3417
- if (!o) return a;
3418
- let s = this._filters.some((t) => t.key === e), c = (e, t, n, r = !1) => i`
3275
+ if (!this._headerMenu) return o;
3276
+ let { key: t, x: n, y: r, hiddenNeighbors: i } = this._headerMenu, s = this.columns.find((e) => e.key === t);
3277
+ if (!s) return o;
3278
+ let c = this._filters.some((e) => e.key === t), l = (e, t, n, r = !1) => a`
3419
3279
  <button type="button" role="menuitem" class="ft-header-menu-item" data-action=${e}
3420
3280
  @click=${(e) => {
3421
3281
  e.stopPropagation(), r || (this._headerMenu = null), n();
3422
3282
  }}>${t}</button>
3423
3283
  `;
3424
- return i`
3425
- <div class="ft-header-menu" role="menu" aria-label=${k("columnMenuRegion", { header: o.label })}
3426
- style="position: fixed; left: ${t}px; top: ${n}px; z-index: var(--u-layer-floating, 1000);"
3284
+ return a`
3285
+ <div class="ft-header-menu" role="menu" aria-label=${e("columnMenuRegion", { header: s.label })}
3286
+ style="position: fixed; left: ${n}px; top: ${r}px; z-index: var(--u-layer-floating, 1000);"
3427
3287
  @mousedown=${(e) => e.stopPropagation()}
3428
3288
  @keydown=${(e) => this._onHeaderMenuKeydown(e)}>
3429
- ${o.sortable === !1 ? a : i`
3430
- ${c("sort-asc", k("sortAscending"), () => this._applySortFromMenu(e, "asc"))}
3431
- ${c("sort-desc", k("sortDescending"), () => this._applySortFromMenu(e, "desc"))}
3289
+ ${s.sortable === !1 ? o : a`
3290
+ ${l("sort-asc", e("sortAscending"), () => this._applySortFromMenu(t, "asc"))}
3291
+ ${l("sort-desc", e("sortDescending"), () => this._applySortFromMenu(t, "desc"))}
3432
3292
  <div class="ft-header-menu-separator" role="separator"></div>
3433
3293
  `}
3434
- ${this.showFilters ? i`
3435
- ${c("filter", k("filter"), () => this._openFilterFromMenu(e))}
3436
- ${s ? c("clear-filter", k("clearFilter"), () => this._clearColumnFilter(e)) : a}
3294
+ ${this.showFilters ? a`
3295
+ ${l("filter", e("filter"), () => this._openFilterFromMenu(t))}
3296
+ ${c ? l("clear-filter", e("clearFilter"), () => this._clearColumnFilter(t)) : o}
3437
3297
  <div class="ft-header-menu-separator" role="separator"></div>
3438
- ` : a}
3439
- ${c("hide", k("hideColumn"), () => this._setColumnHidden(e, !0))}
3440
- ${r.map((e) => c("show", k("showColumn", { header: e.label }), () => this._setColumnHidden(e.key, !1)))}
3298
+ ` : o}
3299
+ ${l("hide", e("hideColumn"), () => this._setColumnHidden(t, !0))}
3300
+ ${i.map((t) => l("show", e("showColumn", { header: t.label }), () => this._setColumnHidden(t.key, !1)))}
3441
3301
  <div class="ft-header-menu-separator" role="separator"></div>
3442
- ${c("autofit", k("autoFitWidth"), () => this._autoFitColumn(e))}
3443
- ${c("wider", k("wider"), () => this._resizeColumnBy(e, Y), !0)}
3444
- ${c("narrower", k("narrower"), () => this._resizeColumnBy(e, -20), !0)}
3302
+ ${l("autofit", e("autoFitWidth"), () => this._autoFitColumn(t))}
3303
+ ${l("wider", e("wider"), () => this._resizeColumnBy(t, Y), !0)}
3304
+ ${l("narrower", e("narrower"), () => this._resizeColumnBy(t, -20), !0)}
3445
3305
  </div>
3446
3306
  `;
3447
3307
  }
3448
3308
  _renderBodyContextMenu() {
3449
- if (!this._bodyContextMenu) return a;
3450
- let { colIndex: e, dataIndex: t, x: n, y: r } = this._bodyContextMenu, o = this.visibleColumns[e];
3451
- if (!o) return a;
3452
- let s = this.data[t]?.[o.key], c = this._filters.some((e) => e.key === o.key), l = (e = !1) => {
3309
+ if (!this._bodyContextMenu) return o;
3310
+ let { colIndex: t, dataIndex: n, x: r, y: i } = this._bodyContextMenu, s = this.visibleColumns[t];
3311
+ if (!s) return o;
3312
+ let c = this.data[n]?.[s.key], l = this._filters.some((e) => e.key === s.key), u = (e = !1) => {
3453
3313
  this._bodyContextMenu = null, e && this.focus();
3454
- }, u = !!this.getComment(t, o.key), d = (e, t, n = !1) => i`
3314
+ }, d = !!this.getComment(n, s.key), f = (e, t, n = !1) => a`
3455
3315
  <button type="button" role="menuitem"
3456
3316
  class="ft-context-menu-item ${n ? "ft-context-menu-danger" : ""}"
3457
3317
  @click=${() => {
3458
- t(), l();
3318
+ t(), u();
3459
3319
  }}>${e}</button>
3460
- `, f = i`<div class="ft-context-menu-separator" role="separator"></div>`;
3461
- return i`
3462
- <div class="ft-body-context-menu" role="menu" aria-label=${k("cellActions")}
3463
- style="position: fixed; left: ${n}px; top: ${r}px; z-index: var(--u-layer-floating, 1000);"
3320
+ `, p = a`<div class="ft-context-menu-separator" role="separator"></div>`;
3321
+ return a`
3322
+ <div class="ft-body-context-menu" role="menu" aria-label=${e("cellActions")}
3323
+ style="position: fixed; left: ${r}px; top: ${i}px; z-index: var(--u-layer-floating, 1000);"
3464
3324
  @mousedown=${(e) => e.stopPropagation()}
3465
- @keydown=${(e) => this._onMenuKeydown(e, ".ft-body-context-menu", l)}>
3466
- ${d(k("copy"), () => this._copyFromMenu())}
3467
- ${f}
3468
- ${d(k("insertRowAbove"), () => this.addRow(void 0, t))}
3469
- ${d(k("insertRowBelow"), () => this.addRow(void 0, t + 1))}
3470
- ${d(k("deleteRow"), () => this.deleteRows([t]), !0)}
3471
- ${f}
3472
- ${d(k("hideColumn"), () => this._setColumnHidden(o.key, !0))}
3473
- ${f}
3474
- ${d(`${k("sortAscending")} ↑`, () => this._applySortFromMenu(o.key, "asc"))}
3475
- ${d(`${k("sortDescending")} ↓`, () => this._applySortFromMenu(o.key, "desc"))}
3476
- ${f}
3477
- ${d(k("filterByThisValue"), () => this.setFilter(o.key, (e) => e === s))}
3478
- ${c ? d(k("clearFilter"), () => this.removeFilter(o.key)) : a}
3479
- ${f}
3480
- ${d(k(u ? "editComment" : "addComment"), () => this._openCommentPopup(t, o.key, n, r))}
3481
- ${u ? d(k("deleteComment"), () => this.setComment(t, o.key, null), !0) : a}
3325
+ @keydown=${(e) => this._onMenuKeydown(e, ".ft-body-context-menu", u)}>
3326
+ ${f(e("copy"), () => this._copyFromMenu())}
3327
+ ${p}
3328
+ ${f(e("insertRowAbove"), () => this.addRow(void 0, n))}
3329
+ ${f(e("insertRowBelow"), () => this.addRow(void 0, n + 1))}
3330
+ ${f(e("deleteRow"), () => this.deleteRows([n]), !0)}
3331
+ ${p}
3332
+ ${f(e("hideColumn"), () => this._setColumnHidden(s.key, !0))}
3333
+ ${p}
3334
+ ${f(`${e("sortAscending")} ↑`, () => this._applySortFromMenu(s.key, "asc"))}
3335
+ ${f(`${e("sortDescending")} ↓`, () => this._applySortFromMenu(s.key, "desc"))}
3336
+ ${p}
3337
+ ${f(e("filterByThisValue"), () => this.setFilter(s.key, (e) => e === c))}
3338
+ ${l ? f(e("clearFilter"), () => this.removeFilter(s.key)) : o}
3339
+ ${p}
3340
+ ${f(e(d ? "editComment" : "addComment"), () => this._openCommentPopup(n, s.key, r, i))}
3341
+ ${d ? f(e("deleteComment"), () => this.setComment(n, s.key, null), !0) : o}
3482
3342
  </div>
3483
3343
  `;
3484
3344
  }
@@ -3502,21 +3362,21 @@ var K = {
3502
3362
  this._commentPopup &&= (document.removeEventListener("mousedown", this._onCommentPopupOutsideClick), null);
3503
3363
  }
3504
3364
  _renderCommentPopup() {
3505
- if (!this._commentPopup) return a;
3506
- let { x: e, y: t } = this._commentPopup, n = e + 240 > window.innerWidth ? e - 240 : e, r = t + 150 > window.innerHeight ? t - 150 : t;
3507
- return i`
3365
+ if (!this._commentPopup) return o;
3366
+ let { x: t, y: n } = this._commentPopup, r = t + 240 > window.innerWidth ? t - 240 : t, i = n + 150 > window.innerHeight ? n - 150 : n;
3367
+ return a`
3508
3368
  <div class="ft-comment-popup"
3509
- style="position: fixed; left: ${n}px; top: ${r}px; z-index: calc(var(--u-layer-floating, 1000) + 1);"
3369
+ style="position: fixed; left: ${r}px; top: ${i}px; z-index: calc(var(--u-layer-floating, 1000) + 1);"
3510
3370
  @mousedown=${(e) => e.stopPropagation()}>
3511
- <textarea class="ft-comment-popup-textarea" aria-label=${k("addComment")}
3371
+ <textarea class="ft-comment-popup-textarea" aria-label=${e("addComment")}
3512
3372
  rows="4"
3513
- placeholder=${k("addCommentPlaceholder")}
3373
+ placeholder=${e("addCommentPlaceholder")}
3514
3374
  @keydown=${(e) => {
3515
3375
  e.key === "Escape" && (e.preventDefault(), this._cancelCommentPopup()), e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), this._commitCommentPopup());
3516
3376
  }}></textarea>
3517
3377
  <div class="ft-comment-popup-buttons">
3518
- <button class="ft-comment-popup-cancel" @click=${() => this._cancelCommentPopup()}>${k("cancel")}</button>
3519
- <button class="ft-comment-popup-save" @click=${() => this._commitCommentPopup()}>${k("save")}</button>
3378
+ <button class="ft-comment-popup-cancel" @click=${() => this._cancelCommentPopup()}>${e("cancel")}</button>
3379
+ <button class="ft-comment-popup-save" @click=${() => this._commitCommentPopup()}>${e("save")}</button>
3520
3380
  </div>
3521
3381
  </div>
3522
3382
  `;
@@ -3562,18 +3422,18 @@ var K = {
3562
3422
  let n = e.composedPath(), r = t.findIndex((e) => n.includes(e)), i = t.length - 1;
3563
3423
  e.shiftKey && r <= 0 ? (e.preventDefault(), t[i].focus()) : !e.shiftKey && (r === i || r === -1) && (e.preventDefault(), t[0].focus());
3564
3424
  }
3565
- _renderFilterDropdown(e) {
3566
- let t = e.type ?? "text";
3567
- return i`
3568
- <div class="ft-filter-dropdown" role="dialog" aria-label=${k("filterFor", { header: e.label })}
3425
+ _renderFilterDropdown(t) {
3426
+ let n = t.type ?? "text";
3427
+ return a`
3428
+ <div class="ft-filter-dropdown" role="dialog" aria-label=${e("filterFor", { header: t.label })}
3569
3429
  @click=${(e) => e.stopPropagation()}
3570
3430
  @keydown=${{
3571
3431
  handleEvent: (e) => this._onFilterDialogKeydown(e),
3572
3432
  capture: !0
3573
3433
  }}>
3574
- ${t === "boolean" ? this._renderBooleanFilter(e) : t === "number" ? this._renderNumberFilter(e) : t === "date" || t === "datetime" ? this._renderDateFilter(e) : this._renderTextFilter(e)}
3434
+ ${n === "boolean" ? this._renderBooleanFilter(t) : n === "number" ? this._renderNumberFilter(t) : n === "date" || n === "datetime" ? this._renderDateFilter(t) : this._renderTextFilter(t)}
3575
3435
  <div class="ft-filter-actions">
3576
- <button class="ft-filter-clear" @click=${() => this._clearColumnFilter(e.key)}>${k("clear")}</button>
3436
+ <button class="ft-filter-clear" @click=${() => this._clearColumnFilter(t.key)}>${e("clear")}</button>
3577
3437
  </div>
3578
3438
  </div>
3579
3439
  `;
@@ -3602,23 +3462,23 @@ var K = {
3602
3462
  _buildEmptyPredicate(e) {
3603
3463
  return e === "empty" ? (e) => e == null || e === "" : (e) => e != null && e !== "";
3604
3464
  }
3605
- _renderEmptyFilterRow(e, t) {
3606
- let n = this._emptyFilterState.get(e) ?? "";
3607
- return i`
3465
+ _renderEmptyFilterRow(t, n) {
3466
+ let r = this._emptyFilterState.get(t) ?? "";
3467
+ return a`
3608
3468
  <div class="ft-filter-empty-row">
3609
- <label>${k("blankCells")}</label>
3610
- <select class="ft-filter-mode-select" aria-label=${k("blankCells")}
3611
- .value=${n}
3612
- @change=${(n) => {
3613
- let r = n.target.value;
3614
- (r === "" || r === "empty" || r === "non-empty") && (r ? this._emptyFilterState.set(e, r) : this._emptyFilterState.delete(e), t?.(), this._applyFilterForKey(e));
3469
+ <label>${e("blankCells")}</label>
3470
+ <select class="ft-filter-mode-select" aria-label=${e("blankCells")}
3471
+ .value=${r}
3472
+ @change=${(e) => {
3473
+ let r = e.target.value;
3474
+ (r === "" || r === "empty" || r === "non-empty") && (r ? this._emptyFilterState.set(t, r) : this._emptyFilterState.delete(t), n?.(), this._applyFilterForKey(t));
3615
3475
  }}
3616
3476
  @keydown=${(e) => {
3617
3477
  e.key === "Escape" && this._closeFilterDropdown(), e.stopPropagation();
3618
3478
  }}>
3619
- <option value="">${k("blankAll")}</option>
3620
- <option value="empty">${k("emptyOnly")}</option>
3621
- <option value="non-empty">${k("nonEmptyOnly")}</option>
3479
+ <option value="">${e("blankAll")}</option>
3480
+ <option value="empty">${e("emptyOnly")}</option>
3481
+ <option value="non-empty">${e("nonEmptyOnly")}</option>
3622
3482
  </select>
3623
3483
  </div>
3624
3484
  `;
@@ -3672,51 +3532,51 @@ var K = {
3672
3532
  t ? this.setFilter(e, t) : this.removeFilter(e);
3673
3533
  } else this.removeFilter(e);
3674
3534
  }
3675
- _renderTextFilter(e) {
3676
- let t = this._textFilterState.get(e.key) ?? {
3535
+ _renderTextFilter(t) {
3536
+ let n = this._textFilterState.get(t.key) ?? {
3677
3537
  value: "",
3678
3538
  mode: "contains"
3679
3539
  };
3680
- return i`
3540
+ return a`
3681
3541
  <div class="ft-filter-mode-row">
3682
- <select class="ft-filter-mode-select" aria-label=${k("filterMatchMode")}
3683
- .value=${t.mode}
3684
- @change=${(t) => {
3685
- let n = t.target.value, r = this._textFilterState.get(e.key) ?? {
3542
+ <select class="ft-filter-mode-select" aria-label=${e("filterMatchMode")}
3543
+ .value=${n.mode}
3544
+ @change=${(e) => {
3545
+ let n = e.target.value, r = this._textFilterState.get(t.key) ?? {
3686
3546
  value: "",
3687
3547
  mode: "contains"
3688
3548
  };
3689
- this._textFilterState.set(e.key, {
3549
+ this._textFilterState.set(t.key, {
3690
3550
  ...r,
3691
3551
  mode: n
3692
- }), this._applyTextFilter(e.key);
3552
+ }), this._applyTextFilter(t.key);
3693
3553
  }}
3694
3554
  @keydown=${(e) => {
3695
3555
  e.key === "Escape" && this._closeFilterDropdown(), e.stopPropagation();
3696
3556
  }}>
3697
- <option value="contains">${k("contains")}</option>
3698
- <option value="starts">${k("startsWith")}</option>
3699
- <option value="ends">${k("endsWith")}</option>
3700
- <option value="wildcard">${k("wildcard")}</option>
3557
+ <option value="contains">${e("contains")}</option>
3558
+ <option value="starts">${e("startsWith")}</option>
3559
+ <option value="ends">${e("endsWith")}</option>
3560
+ <option value="wildcard">${e("wildcard")}</option>
3701
3561
  </select>
3702
3562
  </div>
3703
- <input class="ft-filter-input" type="text" placeholder=${k("searchPlaceholder")} aria-label=${k("filterText")}
3704
- .value=${t.value}
3705
- @input=${(t) => {
3706
- let n = t.target.value, r = this._textFilterState.get(e.key) ?? {
3563
+ <input class="ft-filter-input" type="text" placeholder=${e("searchPlaceholder")} aria-label=${e("filterText")}
3564
+ .value=${n.value}
3565
+ @input=${(e) => {
3566
+ let n = e.target.value, r = this._textFilterState.get(t.key) ?? {
3707
3567
  value: "",
3708
3568
  mode: "contains"
3709
3569
  };
3710
- this._textFilterState.set(e.key, {
3570
+ this._textFilterState.set(t.key, {
3711
3571
  ...r,
3712
3572
  value: n
3713
- }), this._emptyFilterState.delete(e.key), this._applyTextFilter(e.key);
3573
+ }), this._emptyFilterState.delete(t.key), this._applyTextFilter(t.key);
3714
3574
  }}
3715
3575
  @keydown=${(e) => {
3716
3576
  e.key === "Escape" && this._closeFilterDropdown(), e.stopPropagation();
3717
3577
  }}>
3718
- ${this._renderEmptyFilterRow(e.key, () => {
3719
- this._textFilterState.delete(e.key);
3578
+ ${this._renderEmptyFilterRow(t.key, () => {
3579
+ this._textFilterState.delete(t.key);
3720
3580
  })}
3721
3581
  `;
3722
3582
  }
@@ -3733,35 +3593,35 @@ var K = {
3733
3593
  }
3734
3594
  };
3735
3595
  }
3736
- _renderNumCondRow(e, t) {
3737
- let n = (this._numberFilterState.get(e) ?? this._defaultNumState())[t];
3738
- return i`
3596
+ _renderNumCondRow(t, n) {
3597
+ let r = (this._numberFilterState.get(t) ?? this._defaultNumState())[n];
3598
+ return a`
3739
3599
  <div class="ft-num-cond-row">
3740
- <select class="ft-filter-mode-select ft-num-op-select" aria-label=${k("conditionOperator", { n: t === "cond1" ? 1 : 2 })}
3741
- .value=${n.op}
3742
- @change=${(n) => {
3743
- let r = n.target.value, i = this._numberFilterState.get(e) ?? this._defaultNumState();
3744
- i[t] = {
3745
- ...i[t],
3600
+ <select class="ft-filter-mode-select ft-num-op-select" aria-label=${e("conditionOperator", { n: n === "cond1" ? 1 : 2 })}
3601
+ .value=${r.op}
3602
+ @change=${(e) => {
3603
+ let r = e.target.value, i = this._numberFilterState.get(t) ?? this._defaultNumState();
3604
+ i[n] = {
3605
+ ...i[n],
3746
3606
  op: r
3747
- }, this._numberFilterState.set(e, i), this._emptyFilterState.delete(e), this._applyFilterForKey(e);
3607
+ }, this._numberFilterState.set(t, i), this._emptyFilterState.delete(t), this._applyFilterForKey(t);
3748
3608
  }}
3749
3609
  @keydown=${(e) => {
3750
3610
  e.key === "Escape" && this._closeFilterDropdown(), e.stopPropagation();
3751
3611
  }}>
3752
- ${Object.keys(K).map((e) => i`<option value=${e}>${K[e]}</option>`)}
3612
+ ${Object.keys(K).map((e) => a`<option value=${e}>${K[e]}</option>`)}
3753
3613
  </select>
3754
- <input class="ft-filter-input ft-num-cond-input" type="text" inputmode="decimal" placeholder=${k("valuePlaceholder")}
3755
- aria-label=${k("conditionValue", { n: t === "cond1" ? 1 : 2 })}
3756
- .value=${n.text ?? (n.value == null ? "" : N(n.value))}
3757
- aria-invalid=${n.text && n.value == null ? "true" : "false"}
3758
- @input=${(n) => {
3759
- let r = n.target.value, i = this._numberFilterState.get(e) ?? this._defaultNumState();
3760
- i[t] = {
3761
- ...i[t],
3614
+ <input class="ft-filter-input ft-num-cond-input" type="text" inputmode="decimal" placeholder=${e("valuePlaceholder")}
3615
+ aria-label=${e("conditionValue", { n: n === "cond1" ? 1 : 2 })}
3616
+ .value=${r.text ?? (r.value == null ? "" : M(r.value))}
3617
+ aria-invalid=${r.text && r.value == null ? "true" : "false"}
3618
+ @input=${(e) => {
3619
+ let r = e.target.value, i = this._numberFilterState.get(t) ?? this._defaultNumState();
3620
+ i[n] = {
3621
+ ...i[n],
3762
3622
  text: r,
3763
- value: r.trim() === "" ? null : m(r)
3764
- }, this._numberFilterState.set(e, i), this._emptyFilterState.delete(e), this._applyFilterForKey(e);
3623
+ value: r.trim() === "" ? null : h(r)
3624
+ }, this._numberFilterState.set(t, i), this._emptyFilterState.delete(t), this._applyFilterForKey(t);
3765
3625
  }}
3766
3626
  @keydown=${(e) => {
3767
3627
  e.key === "Escape" && this._closeFilterDropdown(), e.stopPropagation();
@@ -3769,16 +3629,16 @@ var K = {
3769
3629
  </div>
3770
3630
  `;
3771
3631
  }
3772
- _renderNumberFilter(e) {
3773
- let t = this._numberFilterState.get(e.key) ?? this._defaultNumState();
3774
- return i`
3775
- ${this._renderNumCondRow(e.key, "cond1")}
3632
+ _renderNumberFilter(t) {
3633
+ let n = this._numberFilterState.get(t.key) ?? this._defaultNumState();
3634
+ return a`
3635
+ ${this._renderNumCondRow(t.key, "cond1")}
3776
3636
  <div class="ft-filter-mode-row">
3777
- <select class="ft-filter-mode-select" aria-label=${k("conditionJoin")}
3778
- .value=${t.join}
3779
- @change=${(t) => {
3780
- let n = t.target.value, r = this._numberFilterState.get(e.key) ?? this._defaultNumState();
3781
- r.join = n, this._numberFilterState.set(e.key, r), this._emptyFilterState.delete(e.key), this._applyFilterForKey(e.key);
3637
+ <select class="ft-filter-mode-select" aria-label=${e("conditionJoin")}
3638
+ .value=${n.join}
3639
+ @change=${(e) => {
3640
+ let n = e.target.value, r = this._numberFilterState.get(t.key) ?? this._defaultNumState();
3641
+ r.join = n, this._numberFilterState.set(t.key, r), this._emptyFilterState.delete(t.key), this._applyFilterForKey(t.key);
3782
3642
  }}
3783
3643
  @keydown=${(e) => {
3784
3644
  e.key === "Escape" && this._closeFilterDropdown(), e.stopPropagation();
@@ -3787,9 +3647,9 @@ var K = {
3787
3647
  <option value="or">OR</option>
3788
3648
  </select>
3789
3649
  </div>
3790
- ${this._renderNumCondRow(e.key, "cond2")}
3791
- ${this._renderEmptyFilterRow(e.key, () => {
3792
- this._numberFilterState.delete(e.key);
3650
+ ${this._renderNumCondRow(t.key, "cond2")}
3651
+ ${this._renderEmptyFilterRow(t.key, () => {
3652
+ this._numberFilterState.delete(t.key);
3793
3653
  })}
3794
3654
  `;
3795
3655
  }
@@ -3811,25 +3671,25 @@ var K = {
3811
3671
  let n = this._invalidCells.get(this._cellKey(e, t));
3812
3672
  return n ? typeof n.error == "function" ? n.error() : n.error : null;
3813
3673
  }
3814
- _renderDateFilter(e) {
3815
- let t = e.type === "datetime", n = this._dateFilterState.get(e.key) ?? {}, r = (e) => e?.slice(0, 10), o = (e) => {
3674
+ _renderDateFilter(t) {
3675
+ let n = t.type === "datetime", r = this._dateFilterState.get(t.key) ?? {}, i = (e) => e?.slice(0, 10), s = (e) => {
3816
3676
  e.key === "Escape" && $(e.currentTarget) || (e.stopPropagation(), e.key === "Escape" && this._closeFilterDropdown());
3817
3677
  };
3818
- return i`
3678
+ return a`
3819
3679
  <div class="ft-filter-range ft-filter-range-dates">
3820
3680
  <u-date-picker class="ft-filter-date" size="sm" clearable
3821
- mode=${t ? "datetime" : "date"} label=${k("fromPlaceholder")}
3822
- .value=${n.from ?? ""} max=${r(n.to) ?? a}
3823
- @change=${(t) => this._applyDateFilter(e.key, t, "from")}
3824
- @keydown=${o}></u-date-picker>
3681
+ mode=${n ? "datetime" : "date"} label=${e("fromPlaceholder")}
3682
+ .value=${r.from ?? ""} max=${i(r.to) ?? o}
3683
+ @change=${(e) => this._applyDateFilter(t.key, e, "from")}
3684
+ @keydown=${s}></u-date-picker>
3825
3685
  <u-date-picker class="ft-filter-date" size="sm" clearable
3826
- mode=${t ? "datetime" : "date"} label=${k("toPlaceholder")}
3827
- .value=${n.to ?? ""} min=${r(n.from) ?? a}
3828
- @change=${(t) => this._applyDateFilter(e.key, t, "to")}
3829
- @keydown=${o}></u-date-picker>
3686
+ mode=${n ? "datetime" : "date"} label=${e("toPlaceholder")}
3687
+ .value=${r.to ?? ""} min=${i(r.from) ?? o}
3688
+ @change=${(e) => this._applyDateFilter(t.key, e, "to")}
3689
+ @keydown=${s}></u-date-picker>
3830
3690
  </div>
3831
- ${this._renderEmptyFilterRow(e.key, () => {
3832
- this._dateFilterState.delete(e.key);
3691
+ ${this._renderEmptyFilterRow(t.key, () => {
3692
+ this._dateFilterState.delete(t.key);
3833
3693
  })}
3834
3694
  `;
3835
3695
  }
@@ -3837,21 +3697,21 @@ var K = {
3837
3697
  let r = t.target.value ?? "", i = this._dateFilterState.get(e) ?? {};
3838
3698
  r === "" ? delete i[n] : i[n] = r, this._dateFilterState.set(e, i), this._emptyFilterState.delete(e), this._applyFilterForKey(e);
3839
3699
  }
3840
- _renderBooleanFilter(e) {
3841
- return i`
3842
- <select class="ft-filter-input" aria-label=${k("filterFor", { header: e.label })}
3843
- @change=${(t) => {
3844
- let n = t.target.value;
3845
- n === "all" ? this.removeFilter(e.key) : this.setFilter(e.key, (e) => !!e == (n === "true"));
3700
+ _renderBooleanFilter(t) {
3701
+ return a`
3702
+ <select class="ft-filter-input" aria-label=${e("filterFor", { header: t.label })}
3703
+ @change=${(e) => {
3704
+ let n = e.target.value;
3705
+ n === "all" ? this.removeFilter(t.key) : this.setFilter(t.key, (e) => !!e == (n === "true"));
3846
3706
  }}
3847
3707
  @keydown=${(e) => {
3848
3708
  e.key === "Escape" && this._closeFilterDropdown(), e.stopPropagation();
3849
3709
  }}>
3850
- <option value="all">${k("all")}</option>
3851
- <option value="true">\u2714 ${k("booleanTrue")}</option>
3852
- <option value="false">\u2718 ${k("booleanFalse")}</option>
3710
+ <option value="all">${e("all")}</option>
3711
+ <option value="true">\u2714 ${e("booleanTrue")}</option>
3712
+ <option value="false">\u2718 ${e("booleanFalse")}</option>
3853
3713
  </select>
3854
- ${this._renderEmptyFilterRow(e.key)}
3714
+ ${this._renderEmptyFilterRow(t.key)}
3855
3715
  `;
3856
3716
  }
3857
3717
  _clearColumnFilter(e) {
@@ -4044,9 +3904,9 @@ var K = {
4044
3904
  if (e.endCol >= t.length || e.endRow >= this._visibleRowCount) return "";
4045
3905
  let n = (this._colLeftOffsets[e.endCol] ?? 0) + this._getColWidth(t[e.endCol]) - this._scrollLeft - 4, r = this.headerHeight + (e.endRow + 1) * this.rowHeight - this._scrollTop - 4;
4046
3906
  if (n < 0 || r < this.headerHeight) return "";
4047
- let a = this._fillDrag?.active && this._fillDrag.targetRange ? this._renderFillPreview(this._fillDrag.targetRange) : "";
4048
- return i`
4049
- ${a}
3907
+ let i = this._fillDrag?.active && this._fillDrag.targetRange ? this._renderFillPreview(this._fillDrag.targetRange) : "";
3908
+ return a`
3909
+ ${i}
4050
3910
  <div class="ft-fill-handle"
4051
3911
  style="left:${n}px;top:${r}px;"
4052
3912
  @mousedown=${(e) => this._onFillHandleMouseDown(e)}>
@@ -4056,8 +3916,8 @@ var K = {
4056
3916
  _renderFillPreview(e) {
4057
3917
  let t = this.visibleColumns;
4058
3918
  if (e.endCol >= t.length || e.endRow >= this._visibleRowCount) return "";
4059
- let n = (this._colLeftOffsets[e.startCol] ?? 0) - this._scrollLeft, r = this.headerHeight + e.startRow * this.rowHeight - this._scrollTop, a = (this._colLeftOffsets[e.endCol] ?? 0) + this._getColWidth(t[e.endCol]) - (this._colLeftOffsets[e.startCol] ?? 0), o = (e.endRow - e.startRow + 1) * this.rowHeight;
4060
- return i`<div class="ft-fill-preview" style="left:${n}px;top:${r}px;width:${a}px;height:${o}px;"></div>`;
3919
+ let n = (this._colLeftOffsets[e.startCol] ?? 0) - this._scrollLeft, r = this.headerHeight + e.startRow * this.rowHeight - this._scrollTop, i = (this._colLeftOffsets[e.endCol] ?? 0) + this._getColWidth(t[e.endCol]) - (this._colLeftOffsets[e.startCol] ?? 0), o = (e.endRow - e.startRow + 1) * this.rowHeight;
3920
+ return a`<div class="ft-fill-preview" style="left:${n}px;top:${r}px;width:${i}px;height:${o}px;"></div>`;
4061
3921
  }
4062
3922
  _onRowNumMouseDown(e, t) {
4063
3923
  if (e.button !== 0) return;
@@ -4234,100 +4094,100 @@ var K = {
4234
4094
  }
4235
4095
  _renderFindPanel() {
4236
4096
  if (!this._findState) return "";
4237
- let { mode: e, query: t, replaceWith: n, matchCase: r, wholeCell: a, results: o, currentIndex: s } = this._findState, c = o.length, l = c > 0 ? s + 1 : 0;
4238
- return i`
4097
+ let { mode: t, query: n, replaceWith: r, matchCase: i, wholeCell: o, results: s, currentIndex: c } = this._findState, l = s.length, u = l > 0 ? c + 1 : 0;
4098
+ return a`
4239
4099
  <div class="ft-find-panel"
4240
4100
  @keydown=${(e) => {
4241
4101
  if (e.stopPropagation(), e.key === "Escape") {
4242
4102
  this._closeFindPanel();
4243
4103
  return;
4244
4104
  }
4245
- e.key === "Enter" && !_(e) && e.target instanceof HTMLInputElement && e.target.classList.contains("ft-find-input") && (e.shiftKey ? this._findPrev() : this._findNext());
4105
+ e.key === "Enter" && !v(e) && e.target instanceof HTMLInputElement && e.target.classList.contains("ft-find-input") && (e.shiftKey ? this._findPrev() : this._findNext());
4246
4106
  }}>
4247
4107
  <div class="ft-find-row">
4248
- <input class="ft-find-input" type="text" placeholder=${k("findPlaceholder")} aria-label=${k("findInput")}
4249
- .value=${t}
4108
+ <input class="ft-find-input" type="text" placeholder=${e("findPlaceholder")} aria-label=${e("findInput")}
4109
+ .value=${n}
4250
4110
  @input=${(e) => {
4251
4111
  this._findState.query = e.target.value, this._findSearch();
4252
4112
  }}>
4253
- <span class="ft-find-count">${c > 0 ? `${l}/${c}` : t ? k("findNoResults") : ""}</span>
4113
+ <span class="ft-find-count">${l > 0 ? `${u}/${l}` : n ? e("findNoResults") : ""}</span>
4254
4114
  <!-- 글리프는 이름이 아니다(«◀» 는 «black left-pointing triangle» 로 읽힌다) — 이름은 aria-label, 키는 aria-keyshortcuts -->
4255
- <button @click=${() => this._findPrev()} aria-label=${k("findPrevious")} aria-keyshortcuts="Shift+Enter" title=${`${k("findPrevious")} (Shift+Enter)`}>◀</button>
4256
- <button @click=${() => this._findNext()} aria-label=${k("findNext")} aria-keyshortcuts="Enter" title=${`${k("findNext")} (Enter)`}>▶</button>
4257
- <label title=${k("matchCase")}><input type="checkbox" aria-label=${k("matchCase")} ?checked=${r} @change=${(e) => {
4115
+ <button @click=${() => this._findPrev()} aria-label=${e("findPrevious")} aria-keyshortcuts="Shift+Enter" title=${`${e("findPrevious")} (Shift+Enter)`}>◀</button>
4116
+ <button @click=${() => this._findNext()} aria-label=${e("findNext")} aria-keyshortcuts="Enter" title=${`${e("findNext")} (Enter)`}>▶</button>
4117
+ <label title=${e("matchCase")}><input type="checkbox" aria-label=${e("matchCase")} ?checked=${i} @change=${(e) => {
4258
4118
  this._findState.matchCase = e.target.checked, this._findSearch();
4259
4119
  }}> Aa</label>
4260
- <label title=${k("wholeCell")}><input type="checkbox" aria-label=${k("wholeCell")} ?checked=${a} @change=${(e) => {
4120
+ <label title=${e("wholeCell")}><input type="checkbox" aria-label=${e("wholeCell")} ?checked=${o} @change=${(e) => {
4261
4121
  this._findState.wholeCell = e.target.checked, this._findSearch();
4262
4122
  }}> [ ]</label>
4263
- <button @click=${() => this._closeFindPanel()} aria-label=${k("closeFind")} aria-keyshortcuts="Escape" title=${`${k("closeFind")} (Escape)`}>✕</button>
4123
+ <button @click=${() => this._closeFindPanel()} aria-label=${e("closeFind")} aria-keyshortcuts="Escape" title=${`${e("closeFind")} (Escape)`}>✕</button>
4264
4124
  </div>
4265
- ${e === "replace" ? i`
4125
+ ${t === "replace" ? a`
4266
4126
  <div class="ft-find-row">
4267
- <input class="ft-find-replace-input" type="text" placeholder=${k("replaceWithPlaceholder")} aria-label=${k("replaceInput")}
4268
- .value=${n}
4127
+ <input class="ft-find-replace-input" type="text" placeholder=${e("replaceWithPlaceholder")} aria-label=${e("replaceInput")}
4128
+ .value=${r}
4269
4129
  @input=${(e) => {
4270
4130
  this._findState.replaceWith = e.target.value;
4271
4131
  }}>
4272
- <button @click=${() => this._replaceOne()} ?disabled=${c === 0}>${k("replace")}</button>
4273
- <button @click=${() => this._replaceAll()} ?disabled=${c === 0}>${k("replaceAll")}</button>
4132
+ <button @click=${() => this._replaceOne()} ?disabled=${l === 0}>${e("replace")}</button>
4133
+ <button @click=${() => this._replaceAll()} ?disabled=${l === 0}>${e("replaceAll")}</button>
4274
4134
  </div>
4275
4135
  ` : ""}
4276
4136
  </div>
4277
4137
  `;
4278
4138
  }
4279
4139
  render() {
4280
- 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;
4281
- if (e.length === 0) return i`${t}${n}<div class="ft-empty">${k("noColumnsDefined")}</div>`;
4282
- let r = this.headerHeight, o = this._totalRowWidth, { start: s, end: c } = this.visibleColRange, l = [];
4283
- for (let t = 0; t < e.length; t++) (e[t].pinned === "left" || e[t].pinned === "right") && (t < s || t >= c) && l.push(t);
4284
- let u = 0, d = this._scrollLeft, f = this.selectable ? i`<div class="ft-checkbox-header"
4285
- style="position: absolute; top: 0; left: ${d + u}px; width: ${this._checkboxColWidth}px; height: ${r}px; z-index: 4;">
4286
- ${this._rowSelection.mode === "multi" ? i`
4140
+ let t = this.visibleColumns, n = this.importEnabled && this._isDragOver ? a`<div class="ft-import-overlay">${e("dropFileToImport")}</div>` : o, r = this.loading ? a`<div class="ft-loading-overlay"></div>` : o;
4141
+ if (t.length === 0) return a`${n}${r}<div class="ft-empty">${e("noColumnsDefined")}</div>`;
4142
+ let i = this.headerHeight, s = this._totalRowWidth, { start: c, end: l } = this.visibleColRange, u = [];
4143
+ for (let e = 0; e < t.length; e++) (t[e].pinned === "left" || t[e].pinned === "right") && (e < c || e >= l) && u.push(e);
4144
+ let d = 0, f = this._scrollLeft, p = this.selectable ? a`<div class="ft-checkbox-header"
4145
+ style="position: absolute; top: 0; left: ${f + d}px; width: ${this._checkboxColWidth}px; height: ${i}px; z-index: 4;">
4146
+ ${this._rowSelection.mode === "multi" ? a`
4287
4147
  <!-- 칸 전체가 누르는 자리다(라벨) — 체크 상자는 16px 그대로. -->
4288
- <label class="ft-checkbox-hit"><input type="checkbox" tabindex="-1" aria-label=${k("selectAllRows")}
4148
+ <label class="ft-checkbox-hit"><input type="checkbox" tabindex="-1" aria-label=${e("selectAllRows")}
4289
4149
  .checked=${this._rowSelection.isAllSelected}
4290
4150
  .indeterminate=${this._rowSelection.isSomeSelected}
4291
4151
  @change=${this._onSelectAllChange}></label>
4292
4152
  ` : ""}
4293
4153
  </div>` : "";
4294
- this.selectable && (u += this._checkboxColWidth);
4295
- let p = this.showRowNumbers ? i`<div class="ft-row-num-header"
4296
- style="position: absolute; top: 0; left: ${d + u}px; width: 48px; height: ${r}px; z-index: 4;">#</div>` : "", m = [];
4297
- for (let t of l) m.push(this._renderHeaderCell(e[t], t));
4298
- for (let t = s; t < c; t++) m.push(this._renderHeaderCell(e[t], t));
4299
- let h = this._colDragIndicatorLeft == null ? "" : i`<div class="ft-drop-indicator" style="left:${this._colDragIndicatorLeft}px"></div>`;
4300
- if (this.data.length === 0 || this._visibleRowCount === 0) {
4301
- let e = this.data.length === 0 ? this.emptyMessage : this.noMatchingMessage;
4302
- return i`
4303
- ${n}
4304
- <div class="ft-header" role="row" aria-rowindex="1" style="width: ${o}px; height: ${r}px;">
4305
- ${f}${p}
4306
- ${m}
4154
+ this.selectable && (d += this._checkboxColWidth);
4155
+ let m = this.showRowNumbers ? a`<div class="ft-row-num-header"
4156
+ style="position: absolute; top: 0; left: ${f + d}px; width: 48px; height: ${i}px; z-index: 4;">#</div>` : "", h = [];
4157
+ for (let e of u) h.push(this._renderHeaderCell(t[e], e));
4158
+ for (let e = c; e < l; e++) h.push(this._renderHeaderCell(t[e], e));
4159
+ let g = this._colDragIndicatorLeft == null ? "" : a`<div class="ft-drop-indicator" style="left:${this._colDragIndicatorLeft}px"></div>`;
4160
+ if (this.error || this.data.length === 0 || this._visibleRowCount === 0) {
4161
+ let e = this.error ? a`<div class="ft-empty ft-error" role="alert">${this.error.message}</div>` : a`<div class="ft-empty">${this.data.length === 0 ? this.emptyMessage : this.noMatchingMessage}</div>`;
4162
+ return a`
4163
+ ${r}
4164
+ <div class="ft-header" role="row" aria-rowindex="1" style="width: ${s}px; height: ${i}px;">
4165
+ ${p}${m}
4307
4166
  ${h}
4167
+ ${g}
4308
4168
  </div>
4309
- <div class="ft-empty">${e}</div>
4169
+ ${e}
4310
4170
  `;
4311
4171
  }
4312
- let { start: g, end: _ } = this.visibleRange, v = this._frozenRowCount, y = [];
4313
- for (let e = g; e < _; e++) y.push(this._renderRow(e, s, c, l, (e - v) * this.rowHeight));
4314
- let b = this._renderFillHandle(), x = this._rowDragIndicatorY == null ? "" : i`<div class="ft-row-drop-indicator" style="top:${this._rowDragIndicatorY}px;width:${o}px;"></div>`;
4315
- return i`
4316
- ${t}
4172
+ let { start: _, end: v } = this.visibleRange, y = this._frozenRowCount, b = [];
4173
+ for (let e = _; e < v; e++) b.push(this._renderRow(e, c, l, u, (e - y) * this.rowHeight));
4174
+ let x = this._renderFillHandle(), S = this._rowDragIndicatorY == null ? "" : a`<div class="ft-row-drop-indicator" style="top:${this._rowDragIndicatorY}px;width:${s}px;"></div>`;
4175
+ return a`
4317
4176
  ${n}
4177
+ ${r}
4318
4178
  ${this._renderFindPanel()}
4319
- <div class="ft-header" role="row" aria-rowindex="1" style="width: ${o}px; height: ${r}px;">
4320
- ${f}${p}
4321
- ${m}
4179
+ <div class="ft-header" role="row" aria-rowindex="1" style="width: ${s}px; height: ${i}px;">
4180
+ ${p}${m}
4322
4181
  ${h}
4182
+ ${g}
4323
4183
  </div>
4324
- ${this._renderFrozenRows(s, c, l)}
4325
- <div class="ft-body" style="height: ${this.totalBodyHeight}px; width: ${o}px;">
4326
- ${y}
4184
+ ${this._renderFrozenRows(c, l, u)}
4185
+ <div class="ft-body" style="height: ${this.totalBodyHeight}px; width: ${s}px;">
4186
+ ${b}
4327
4187
  </div>
4328
- ${this.footerData ? this._renderFooter(s, c, l) : ""}
4188
+ ${this.footerData ? this._renderFooter(c, l, u) : ""}
4189
+ ${S}
4329
4190
  ${x}
4330
- ${b}
4331
4191
  ${this._renderHeaderContextMenu()}
4332
4192
  ${this._renderBodyContextMenu()}
4333
4193
  ${this._renderCommentPopup()}
@@ -4344,69 +4204,69 @@ var K = {
4344
4204
  }
4345
4205
  _renderFrozenRows(e, t, n) {
4346
4206
  let r = this._frozenRowCount;
4347
- if (r === 0) return a;
4348
- let o = this._totalRowWidth, s = [];
4207
+ if (r === 0) return o;
4208
+ let i = this._totalRowWidth, s = [];
4349
4209
  for (let i = 0; i < r; i++) s.push(this._renderRow(i, e, t, n, i * this.rowHeight));
4350
- return i`
4351
- <div class="ft-frozen-rows" style="top: ${this.headerHeight}px; height: ${this.frozenRowsHeight}px; width: ${o}px;">
4210
+ return a`
4211
+ <div class="ft-frozen-rows" style="top: ${this.headerHeight}px; height: ${this.frozenRowsHeight}px; width: ${i}px;">
4352
4212
  ${s}
4353
4213
  </div>
4354
4214
  `;
4355
4215
  }
4356
4216
  _renderFooter(e, t, n) {
4357
4217
  if (!this.footerData) return "";
4358
- let r = this.visibleColumns, a = this.rowHeight, o = this._totalRowWidth, s = this._scrollLeft, c = 0, l = this.selectable ? i`<div class="ft-footer-cell ft-checkbox-cell"
4359
- style="position: absolute; top: 0; left: ${s + c}px; width: ${this._checkboxColWidth}px; height: ${a}px; z-index: 2;"></div>` : "";
4218
+ let r = this.visibleColumns, i = this.rowHeight, o = this._totalRowWidth, s = this._scrollLeft, c = 0, l = this.selectable ? a`<div class="ft-footer-cell ft-checkbox-cell"
4219
+ style="position: absolute; top: 0; left: ${s + c}px; width: ${this._checkboxColWidth}px; height: ${i}px; z-index: 2;"></div>` : "";
4360
4220
  this.selectable && (c += this._checkboxColWidth);
4361
- let u = this.showRowNumbers ? i`<div class="ft-footer-cell ft-row-num"
4362
- style="position: absolute; top: 0; left: ${s + c}px; width: 48px; height: ${a}px; z-index: 2;"></div>` : "", d = [];
4221
+ let u = this.showRowNumbers ? a`<div class="ft-footer-cell ft-row-num"
4222
+ style="position: absolute; top: 0; left: ${s + c}px; width: 48px; height: ${i}px; z-index: 2;"></div>` : "", d = [];
4363
4223
  for (let e of n) {
4364
- let t = r[e], n = this._getColWidth(t), o = t.pinned === "right" ? `position: absolute; top: 0; left: ${this._getPinnedRightLeft(e)}px; width: ${n}px; height: ${a}px; z-index: 2;` : `position: absolute; top: 0; left: ${s + this._getPinnedLeft(e)}px; width: ${n}px; height: ${a}px; z-index: 2;`;
4365
- d.push(i`
4224
+ let t = r[e], n = this._getColWidth(t), o = t.pinned === "right" ? `position: absolute; top: 0; left: ${this._getPinnedRightLeft(e)}px; width: ${n}px; height: ${i}px; z-index: 2;` : `position: absolute; top: 0; left: ${s + this._getPinnedLeft(e)}px; width: ${n}px; height: ${i}px; z-index: 2;`;
4225
+ d.push(a`
4366
4226
  <div class="ft-footer-cell ft-pinned" role="gridcell" aria-colindex=${e + 1} style=${o}>
4367
4227
  ${this.footerData[t.key] ?? ""}</div>
4368
4228
  `);
4369
4229
  }
4370
4230
  for (let n = e; n < t; n++) {
4371
4231
  let e = r[n], t = this._getColWidth(e), o = this._colLeftOffsets[n] ?? 0, c = e.pinned === "left", l = e.pinned === "right", u = c || l, f;
4372
- f = c ? `position: absolute; top: 0; left: ${s + this._getPinnedLeft(n)}px; width: ${t}px; height: ${a}px; z-index: 2;` : l ? `position: absolute; top: 0; right: ${-s + this._getPinnedRight(n)}px; width: ${t}px; height: ${a}px; z-index: 2;` : `left: ${o}px; width: ${t}px; height: ${a}px;`, d.push(i`
4232
+ f = c ? `position: absolute; top: 0; left: ${s + this._getPinnedLeft(n)}px; width: ${t}px; height: ${i}px; z-index: 2;` : l ? `position: absolute; top: 0; right: ${-s + this._getPinnedRight(n)}px; width: ${t}px; height: ${i}px; z-index: 2;` : `left: ${o}px; width: ${t}px; height: ${i}px;`, d.push(a`
4373
4233
  <div class="ft-footer-cell ${u ? "ft-pinned" : ""}" role="gridcell" aria-colindex=${n + 1} style=${f}>
4374
4234
  ${this.footerData[e.key] ?? ""}</div>
4375
4235
  `);
4376
4236
  }
4377
- return i`
4378
- <div class="ft-footer" role="row" aria-rowindex=${this._visibleRowCount + 2} style="width: ${o}px; height: ${a}px;">
4237
+ return a`
4238
+ <div class="ft-footer" role="row" aria-rowindex=${this._visibleRowCount + 2} style="width: ${o}px; height: ${i}px;">
4379
4239
  ${l}${u}
4380
4240
  ${d}
4381
4241
  </div>
4382
4242
  `;
4383
4243
  }
4384
- _renderRow(e, t, n, r, a) {
4385
- let o = this.visibleColumns, s = this._toDataIndex(e), c = this.data[s], l = a ?? e * this.rowHeight, u = this.rowHeight, d = this._totalRowWidth, f = e % 2 == 0 ? "ft-row-even" : "ft-row-odd", p = this.selectable && this._rowSelection.isSelected(e), m = this._scrollLeft, h = 0, g = this.selectable ? i`
4244
+ _renderRow(t, n, r, i, o) {
4245
+ let s = this.visibleColumns, c = this._toDataIndex(t), l = this.data[c], u = o ?? t * this.rowHeight, d = this.rowHeight, f = this._totalRowWidth, p = t % 2 == 0 ? "ft-row-even" : "ft-row-odd", m = this.selectable && this._rowSelection.isSelected(t), h = this._scrollLeft, g = 0, _ = this.selectable ? a`
4386
4246
  <div class="ft-checkbox-cell"
4387
- style="position: absolute; top: 0; left: ${m + h}px; width: ${this._checkboxColWidth}px; height: ${u}px; z-index: 2;">
4247
+ style="position: absolute; top: 0; left: ${h + g}px; width: ${this._checkboxColWidth}px; height: ${d}px; z-index: 2;">
4388
4248
  <!-- 행 체크박스는 Tab 정지점이 아니다 — 그리드(호스트)가 하나의 정지점이고 행 선택은 Shift+Space 다.
4389
4249
  렌더된 행마다 정지점이면 표 하나를 지나는 데 Tab 이 행 수만큼 든다. -->
4390
- <label class="ft-checkbox-hit"><input type="checkbox" tabindex="-1" aria-label=${k("selectRow")}
4391
- .checked=${p}
4250
+ <label class="ft-checkbox-hit"><input type="checkbox" tabindex="-1" aria-label=${e("selectRow")}
4251
+ .checked=${m}
4392
4252
  @click=${(e) => this._onRowCheckboxClick(e)}
4393
- @change=${(t) => this._onRowCheckboxChange(t, e)}></label>
4253
+ @change=${(e) => this._onRowCheckboxChange(e, t)}></label>
4394
4254
  </div>
4395
4255
  ` : "";
4396
- this.selectable && (h += this._checkboxColWidth);
4397
- let _ = this._rowDrag?.active && this._rowDrag.rowIndex === e, v = this.showRowNumbers ? i`
4398
- <div class="ft-row-num ${_ ? "ft-col-dragging" : ""}"
4399
- style="position: absolute; top: 0; left: ${m + h}px; width: 48px; height: ${u}px; z-index: 2; cursor: grab;"
4400
- @mousedown=${(t) => this._onRowNumMouseDown(t, e)}
4401
- @click=${() => this._onRowNumberClick(e)}>${s + 1}</div>
4402
- ` : "", y = [];
4403
- for (let t of r) y.push(this._renderCell(c, o[t], e, t, this._mergeState(o[t], e)));
4404
- for (let r = t; r < n; r++) y.push(this._renderCell(c, o[r], e, r, this._mergeState(o[r], e)));
4405
- return i`
4406
- <div class="ft-row ${f} ${p ? "ft-row-selected" : ""}" role="row" aria-rowindex=${e + 2}
4407
- style="top: ${l}px; height: ${u}px; width: ${d}px;">
4408
- ${g}${v}
4409
- ${y}
4256
+ this.selectable && (g += this._checkboxColWidth);
4257
+ let v = this._rowDrag?.active && this._rowDrag.rowIndex === t, y = this.showRowNumbers ? a`
4258
+ <div class="ft-row-num ${v ? "ft-col-dragging" : ""}"
4259
+ style="position: absolute; top: 0; left: ${h + g}px; width: 48px; height: ${d}px; z-index: 2; cursor: grab;"
4260
+ @mousedown=${(e) => this._onRowNumMouseDown(e, t)}
4261
+ @click=${() => this._onRowNumberClick(t)}>${c + 1}</div>
4262
+ ` : "", b = [];
4263
+ for (let e of i) b.push(this._renderCell(l, s[e], t, e, this._mergeState(s[e], t)));
4264
+ for (let e = n; e < r; e++) b.push(this._renderCell(l, s[e], t, e, this._mergeState(s[e], t)));
4265
+ return a`
4266
+ <div class="ft-row ${p} ${m ? "ft-row-selected" : ""}" role="row" aria-rowindex=${t + 2}
4267
+ style="top: ${u}px; height: ${d}px; width: ${f}px;">
4268
+ ${_}${y}
4269
+ ${b}
4410
4270
  </div>
4411
4271
  `;
4412
4272
  }
@@ -4437,7 +4297,7 @@ var K = {
4437
4297
  headParity: i % 2 == 0 ? "even" : "odd"
4438
4298
  };
4439
4299
  }
4440
- _renderCell(e, t, n, r, o = null) {
4300
+ _renderCell(e, t, n, r, i = null) {
4441
4301
  let s = this._activeCell?.row === n && this._activeCell?.col === r, c = this._editingCell?.row === n && this._editingCell?.col === r, l = this._selection.isInRange(n, r), u = t.pinned === "left", d = t.pinned === "right", f = u || d, p = this._getColWidth(t), m = this.rowHeight, h = this._colLeftOffsets[r] ?? 0, g;
4442
4302
  g = u ? `position: absolute; top: 0; left: ${this._scrollLeft + this._getPinnedLeft(r)}px; width: ${p}px; height: ${m}px; z-index: 2;` : d ? `position: absolute; top: 0; left: ${this._getPinnedRightLeft(r)}px; width: ${p}px; height: ${m}px; z-index: 2;` : `left: ${h}px; width: ${p}px; height: ${m}px;`;
4443
4303
  let _ = !this._isCellEditable(t);
@@ -4447,12 +4307,12 @@ var K = {
4447
4307
  let i = Object.entries(r).map(([e, t]) => `${e}: ${t}`).join("; ");
4448
4308
  i && (g += " " + i + ";");
4449
4309
  }
4450
- if (c) return i`
4310
+ if (c) return a`
4451
4311
  <div class="ft-cell ft-editing ft-active ${f ? "ft-pinned" : ""}" role="gridcell"
4452
4312
  aria-colindex=${r + 1}
4453
4313
  data-col-index=${r}
4454
4314
  aria-selected="true"
4455
- aria-readonly=${_ ? "true" : a}
4315
+ aria-readonly=${_ ? "true" : o}
4456
4316
  style=${g}>
4457
4317
  ${this._renderEditor(e, t)}
4458
4318
  </div>
@@ -4466,46 +4326,46 @@ var K = {
4466
4326
  f ? "ft-pinned" : "",
4467
4327
  y ? "ft-invalid" : "",
4468
4328
  S ? "ft-find-current" : x ? "ft-find-match" : "",
4469
- o ? `ft-merge-${o.headParity}` : "",
4470
- o?.continues ? "ft-merge-continued" : "",
4471
- o?.opensDown ? "ft-merge-open" : "",
4329
+ i ? `ft-merge-${i.headParity}` : "",
4330
+ i?.continues ? "ft-merge-continued" : "",
4331
+ i?.opensDown ? "ft-merge-open" : "",
4472
4332
  t.reveal === "hover" ? "ft-reveal-hover" : ""
4473
- ].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;
4474
- return i`
4333
+ ].filter(Boolean).join(" "), w = this._toDataIndex(n), T = this._comments.get(w)?.get(t.key) ?? null, E = T !== null, O = E ? a`<div class="ft-comment-indicator" title=${T}></div>` : o;
4334
+ return a`
4475
4335
  <div class=${E ? C + " ft-has-comment" : C}
4476
4336
  role="gridcell"
4477
4337
  tabindex="-1"
4478
4338
  aria-colindex=${r + 1}
4479
4339
  data-col-index=${r}
4480
4340
  aria-selected=${v ? "true" : "false"}
4481
- aria-readonly=${_ ? "true" : a}
4482
- aria-invalid=${y ? "true" : a}
4483
- title=${y ?? a}
4341
+ aria-readonly=${_ ? "true" : o}
4342
+ aria-invalid=${y ? "true" : o}
4343
+ title=${y ?? o}
4484
4344
  style=${g}
4485
4345
  @mousedown=${(e) => this._onCellMouseDown(e, n, r)}
4486
4346
  @mouseenter=${() => this._onCellMouseEnter(n, r)}
4487
4347
  @click=${(e) => this._onCellClickEvent(e, n, r)}
4488
4348
  @dblclick=${() => this._onCellDblClick(n, r)}>
4489
- ${D}
4490
- ${T(e[t.key], e, t)}
4349
+ ${O}
4350
+ ${D(e[t.key], e, t)}
4491
4351
  </div>
4492
4352
  `;
4493
4353
  }
4494
4354
  _renderEditor(e, t) {
4495
4355
  if (t.editor) return t.editor(e[t.key], e, t);
4496
4356
  let n = e[t.key], r = n == null ? "" : String(n);
4497
- if (t.type === "number") return i`
4357
+ if (t.type === "number") return a`
4498
4358
  <input class="ft-editor ft-editor-number" type="text" inputmode="decimal" aria-label=${t.label}
4499
- .value=${typeof n == "number" ? N(n) : r}
4359
+ .value=${typeof n == "number" ? M(n) : r}
4500
4360
  @keydown=${this._onEditorKeyDown}
4501
4361
  @blur=${() => this._commitEdit()}>
4502
4362
  `;
4503
4363
  if (t.type === "date" || t.type === "datetime") {
4504
4364
  let e = t.type === "datetime";
4505
- return i`
4365
+ return a`
4506
4366
  <u-date-picker class="ft-editor ft-editor-${t.type}" size="sm" aria-label=${t.label}
4507
4367
  mode=${e ? "datetime" : "date"} ?confirm=${e}
4508
- .value=${Qe(n, e)}
4368
+ .value=${Ze(n, e)}
4509
4369
  @keydown=${this._onEditorKeyDown}
4510
4370
  @change=${() => this._commitEdit()}
4511
4371
  @blur=${() => this._commitEdit()}></u-date-picker>
@@ -4513,30 +4373,30 @@ var K = {
4513
4373
  }
4514
4374
  if (t.type === "select" && t.options && t.options.length > 0) {
4515
4375
  let e = t.options, r = typeof e[0] == "string";
4516
- return i`
4376
+ return a`
4517
4377
  <select class="ft-editor" aria-label=${t.label}
4518
4378
  @keydown=${this._onEditorKeyDown}
4519
4379
  @blur=${() => this._commitEdit()}
4520
4380
  @change=${() => this._commitEdit()}>
4521
- ${r ? e.map((e) => i`<option value=${e} ?selected=${e === n}>${e}</option>`) : e.map((e) => i`<option value=${String(e.value)} ?selected=${e.value === n}>${e.label}</option>`)}
4381
+ ${r ? e.map((e) => a`<option value=${e} ?selected=${e === n}>${e}</option>`) : e.map((e) => a`<option value=${String(e.value)} ?selected=${e.value === n}>${e.label}</option>`)}
4522
4382
  </select>
4523
4383
  `;
4524
4384
  }
4525
4385
  if (t.autocomplete) {
4526
4386
  let e = this._autocompleteState?.candidates ?? [], n = this._autocompleteState?.activeIndex ?? -1;
4527
- return i`
4387
+ return a`
4528
4388
  <input class="ft-editor" type="text" aria-label=${t.label}
4529
4389
  role="combobox" aria-autocomplete="list"
4530
4390
  aria-expanded=${e.length > 0 ? "true" : "false"}
4531
4391
  aria-controls="ft-autocomplete-list"
4532
- aria-activedescendant=${n >= 0 && e.length > 0 ? `ft-autocomplete-${n}` : a}
4392
+ aria-activedescendant=${n >= 0 && e.length > 0 ? `ft-autocomplete-${n}` : o}
4533
4393
  .value=${r}
4534
4394
  @input=${(e) => this._onAutocompleteInput(e, t)}
4535
4395
  @keydown=${this._onEditorKeyDown}
4536
4396
  @blur=${() => this._commitEdit()}>
4537
- ${e.length > 0 ? i`
4397
+ ${e.length > 0 ? a`
4538
4398
  <div class="ft-autocomplete-dropdown" id="ft-autocomplete-list" role="listbox" aria-label=${t.label}>
4539
- ${e.map((e, t) => i`
4399
+ ${e.map((e, t) => a`
4540
4400
  <div class="ft-autocomplete-item ${t === n ? "ft-autocomplete-active" : ""}"
4541
4401
  id=${`ft-autocomplete-${t}`} role="option" aria-selected=${t === n ? "true" : "false"}
4542
4402
  @mousedown=${(t) => {
@@ -4546,10 +4406,10 @@ var K = {
4546
4406
  </div>
4547
4407
  `)}
4548
4408
  </div>
4549
- ` : a}
4409
+ ` : o}
4550
4410
  `;
4551
4411
  }
4552
- return i`
4412
+ return a`
4553
4413
  <input class="ft-editor" type="text" aria-label=${t.label}
4554
4414
  .value=${r}
4555
4415
  @keydown=${this._onEditorKeyDown}
@@ -4557,62 +4417,62 @@ var K = {
4557
4417
  `;
4558
4418
  }
4559
4419
  };
4560
- G([s({ type: Array })], Q.prototype, "columns", void 0), G([s({
4420
+ G([c({ type: Array })], Q.prototype, "columns", void 0), G([c({
4561
4421
  type: Array,
4562
4422
  hasChanged: () => !0
4563
- })], Q.prototype, "data", null), G([s({
4423
+ })], Q.prototype, "data", null), G([c({
4564
4424
  type: Boolean,
4565
4425
  attribute: "clear-undo-on-data-change"
4566
- })], Q.prototype, "clearUndoOnDataChange", void 0), G([s({
4426
+ })], Q.prototype, "clearUndoOnDataChange", void 0), G([c({
4567
4427
  type: Boolean,
4568
4428
  attribute: "clear-selection-on-data-change"
4569
- })], Q.prototype, "clearSelectionOnDataChange", void 0), G([s({
4429
+ })], Q.prototype, "clearSelectionOnDataChange", void 0), G([c({
4570
4430
  type: Number,
4571
4431
  attribute: "row-height"
4572
- })], Q.prototype, "rowHeight", null), G([s({
4432
+ })], Q.prototype, "rowHeight", null), G([c({
4573
4433
  type: Boolean,
4574
4434
  attribute: "show-row-numbers"
4575
- })], Q.prototype, "showRowNumbers", void 0), G([s({
4435
+ })], Q.prototype, "showRowNumbers", void 0), G([c({
4576
4436
  type: String,
4577
4437
  reflect: !0
4578
- })], Q.prototype, "theme", void 0), G([s({
4438
+ })], Q.prototype, "theme", void 0), G([c({
4579
4439
  type: Number,
4580
4440
  attribute: "max-rows"
4581
- })], Q.prototype, "maxRows", void 0), G([s({ type: Boolean })], Q.prototype, "editable", void 0), G([s({
4441
+ })], Q.prototype, "maxRows", void 0), G([c({ type: Boolean })], Q.prototype, "editable", void 0), G([c({
4582
4442
  type: Boolean,
4583
4443
  attribute: "show-filters"
4584
- })], Q.prototype, "showFilters", void 0), G([s({
4444
+ })], Q.prototype, "showFilters", void 0), G([c({
4585
4445
  type: Boolean,
4586
4446
  attribute: "show-context-menu"
4587
- })], Q.prototype, "showContextMenu", void 0), G([s({
4447
+ })], Q.prototype, "showContextMenu", void 0), G([c({
4588
4448
  type: Number,
4589
4449
  attribute: "frozen-rows"
4590
- })], Q.prototype, "frozenRows", void 0), G([s({
4450
+ })], Q.prototype, "frozenRows", void 0), G([c({
4591
4451
  type: String,
4592
4452
  attribute: "empty-message"
4593
- })], Q.prototype, "emptyMessage", void 0), G([s({
4453
+ })], Q.prototype, "emptyMessage", void 0), G([c({
4594
4454
  type: String,
4595
4455
  attribute: "no-matching-message"
4596
- })], Q.prototype, "noMatchingMessage", void 0), G([s({
4456
+ })], Q.prototype, "noMatchingMessage", void 0), G([c({ attribute: !1 })], Q.prototype, "error", void 0), G([c({
4597
4457
  type: Boolean,
4598
4458
  reflect: !0
4599
- })], Q.prototype, "loading", void 0), G([s({
4459
+ })], Q.prototype, "loading", void 0), G([c({
4600
4460
  type: Boolean,
4601
4461
  attribute: "import-enabled"
4602
- })], Q.prototype, "importEnabled", void 0), G([s({ type: Boolean })], Q.prototype, "selectable", void 0), G([s({
4462
+ })], Q.prototype, "importEnabled", void 0), G([c({ type: Boolean })], Q.prototype, "selectable", void 0), G([c({
4603
4463
  type: String,
4604
4464
  attribute: "selection-mode"
4605
- })], Q.prototype, "selectionMode", null), G([s({
4465
+ })], Q.prototype, "selectionMode", null), G([c({
4606
4466
  type: String,
4607
4467
  attribute: "data-mode"
4608
- })], Q.prototype, "dataMode", void 0), G([s({
4468
+ })], Q.prototype, "dataMode", void 0), G([c({
4609
4469
  type: Object,
4610
4470
  attribute: "footer-data"
4611
- })], Q.prototype, "footerData", void 0), G([s({ attribute: !1 })], Q.prototype, "stylesheets", void 0), G([s({
4471
+ })], Q.prototype, "footerData", void 0), G([c({ attribute: !1 })], Q.prototype, "stylesheets", void 0), G([c({
4612
4472
  type: Number,
4613
4473
  attribute: "max-undo-size"
4614
- })], 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, "_headerCol", 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);
4615
- function Qe(e, t) {
4474
+ })], Q.prototype, "maxUndoSize", null), G([l()], Q.prototype, "_scrollTop", void 0), G([l()], Q.prototype, "_scrollLeft", void 0), G([l()], Q.prototype, "_viewportHeight", void 0), G([l()], Q.prototype, "_viewportWidth", void 0), G([l()], Q.prototype, "_activeCell", void 0), G([l()], Q.prototype, "_headerCol", void 0), G([l()], Q.prototype, "_editingCell", void 0), G([l()], Q.prototype, "_sortCriteria", void 0), G([l()], Q.prototype, "_openFilterKey", void 0), G([l()], Q.prototype, "_rowSelectionVersion", void 0), G([l()], Q.prototype, "_autocompleteState", void 0), G([l()], Q.prototype, "_headerMenu", void 0), G([l()], Q.prototype, "_bodyContextMenu", void 0), G([l()], Q.prototype, "_commentPopup", void 0), G([l()], Q.prototype, "_isDragOver", void 0), Q = G([s("flex-table")], Q);
4475
+ function Ze(e, t) {
4616
4476
  if (t) {
4617
4477
  let t = fe(e);
4618
4478
  return /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(t) ? t.replace(" ", "T") : void 0;
@@ -4628,4 +4488,4 @@ function $(e) {
4628
4488
  }
4629
4489
  }
4630
4490
  //#endregion
4631
- export { A as a, T as c, j as i, W as n, O as o, B as r, k as s, Q as t };
4491
+ export { k as a, A as i, W as n, D as o, z as r, Q as t };