@iyulab/flex-table 0.36.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/README.md +19 -8
- package/dist/{flex-table-D5FjaSJV.js → flex-table-DcIjmfEK.js} +345 -273
- package/dist/flex-table.js +1 -1
- package/dist/locale.d.ts +2 -2
- package/dist/react.js +1 -1
- package/package.json +2 -2
|
@@ -906,80 +906,7 @@ var l = r`
|
|
|
906
906
|
outline: 2px solid var(--ft-find-color);
|
|
907
907
|
outline-offset: -2px;
|
|
908
908
|
}
|
|
909
|
-
|
|
910
|
-
//#endregion
|
|
911
|
-
//#region src/renderers/format.ts
|
|
912
|
-
function u(e, t) {
|
|
913
|
-
return e == null ? "" : typeof t == "function" ? t(e) : d(t) ? p(e, t) : f(e, t);
|
|
914
|
-
}
|
|
915
|
-
function d(e) {
|
|
916
|
-
return /[yMdHhms]/.test(e);
|
|
917
|
-
}
|
|
918
|
-
function f(e, t) {
|
|
919
|
-
let n = typeof e == "number" ? e : Number(e);
|
|
920
|
-
if (isNaN(n)) return String(e);
|
|
921
|
-
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 = {
|
|
922
|
-
minimumFractionDigits: c,
|
|
923
|
-
maximumFractionDigits: c,
|
|
924
|
-
useGrouping: o.includes(",")
|
|
925
|
-
}, u;
|
|
926
|
-
return r ? u = new Intl.NumberFormat(void 0, {
|
|
927
|
-
...l,
|
|
928
|
-
style: "percent"
|
|
929
|
-
}).format(n) : (u = new Intl.NumberFormat(void 0, l).format(n), a && (u = a + u)), u + "";
|
|
930
|
-
}
|
|
931
|
-
function p(e, t) {
|
|
932
|
-
let n;
|
|
933
|
-
if (e instanceof Date) n = e;
|
|
934
|
-
else if (typeof e == "string" || typeof e == "number") n = new Date(e);
|
|
935
|
-
else return String(e);
|
|
936
|
-
if (isNaN(n.getTime())) return String(e);
|
|
937
|
-
let r = String(n.getFullYear()), i = r.slice(-2), a = String(n.getMonth() + 1).padStart(2, "0"), o = String(n.getDate()).padStart(2, "0"), s = String(n.getHours()).padStart(2, "0"), c = String(n.getHours() % 12 || 12).padStart(2, "0"), l = String(n.getMinutes()).padStart(2, "0"), u = String(n.getSeconds()).padStart(2, "0");
|
|
938
|
-
return t.replace("yyyy", r).replace("yy", i).replace("MM", a).replace("dd", o).replace("HH", s).replace("hh", c).replace("mm", l).replace("ss", u);
|
|
939
|
-
}
|
|
940
|
-
//#endregion
|
|
941
|
-
//#region src/renderers/cell-renderer.ts
|
|
942
|
-
function m(e, t, n) {
|
|
943
|
-
return n.renderer ? n.renderer(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) : u(e, n.format) : h(e, n);
|
|
944
|
-
}
|
|
945
|
-
function h(e, t) {
|
|
946
|
-
if (e == null) return "";
|
|
947
|
-
switch (t.type) {
|
|
948
|
-
case "number": return _(e);
|
|
949
|
-
case "boolean": return i`<span class="ft-bool">${e ? "✔" : ""}</span>`;
|
|
950
|
-
case "date": return v(e);
|
|
951
|
-
case "datetime": return y(e);
|
|
952
|
-
case "select": return g(e, t);
|
|
953
|
-
default: return String(e);
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
function g(e, t) {
|
|
957
|
-
if (!t.options || t.options.length === 0 || typeof t.options[0] == "string") return e == null ? "" : String(e);
|
|
958
|
-
let n = t.options.find((t) => t.value === e);
|
|
959
|
-
return n ? n.label : e == null ? "" : String(e);
|
|
960
|
-
}
|
|
961
|
-
function _(e) {
|
|
962
|
-
return typeof e == "number" ? Number.isInteger(e) ? e.toLocaleString() : e.toLocaleString(void 0, { minimumFractionDigits: 1 }) : String(e);
|
|
963
|
-
}
|
|
964
|
-
function v(e) {
|
|
965
|
-
if (e instanceof Date) return e.toLocaleDateString();
|
|
966
|
-
if (typeof e == "string") {
|
|
967
|
-
let t = new Date(e);
|
|
968
|
-
return isNaN(t.getTime()) ? e : t.toLocaleDateString();
|
|
969
|
-
}
|
|
970
|
-
return String(e);
|
|
971
|
-
}
|
|
972
|
-
function y(e) {
|
|
973
|
-
if (e instanceof Date) return e.toLocaleString();
|
|
974
|
-
if (typeof e == "string") {
|
|
975
|
-
let t = new Date(e);
|
|
976
|
-
return isNaN(t.getTime()) ? e : t.toLocaleString();
|
|
977
|
-
}
|
|
978
|
-
return String(e);
|
|
979
|
-
}
|
|
980
|
-
//#endregion
|
|
981
|
-
//#region node_modules/@iyulab/components/dist/utilities/Locale.js
|
|
982
|
-
var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
909
|
+
`, u = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
983
910
|
"../assets/locales/ar.json": {
|
|
984
911
|
valueMissing: "هذا الحقل مطلوب",
|
|
985
912
|
badInput: "يرجى إدخال قيمة صالحة",
|
|
@@ -1018,7 +945,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1018
945
|
alertNotice: "إشعار",
|
|
1019
946
|
alertMessage: "رسالة",
|
|
1020
947
|
remove: "إزالة",
|
|
1021
|
-
closeTab: "إغلاق علامة التبويب"
|
|
948
|
+
closeTab: "إغلاق علامة التبويب",
|
|
949
|
+
breadcrumb: "مسار التنقل"
|
|
1022
950
|
},
|
|
1023
951
|
"../assets/locales/de.json": {
|
|
1024
952
|
valueMissing: "Dieses Feld ist erforderlich",
|
|
@@ -1058,7 +986,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1058
986
|
alertNotice: "Hinweis",
|
|
1059
987
|
alertMessage: "Nachricht",
|
|
1060
988
|
remove: "Entfernen",
|
|
1061
|
-
closeTab: "Tab schließen"
|
|
989
|
+
closeTab: "Tab schließen",
|
|
990
|
+
breadcrumb: "Navigationspfad"
|
|
1062
991
|
},
|
|
1063
992
|
"../assets/locales/en.json": {
|
|
1064
993
|
valueMissing: "This field is required",
|
|
@@ -1098,7 +1027,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1098
1027
|
alertNotice: "Notice",
|
|
1099
1028
|
alertMessage: "Message",
|
|
1100
1029
|
remove: "Remove",
|
|
1101
|
-
closeTab: "Close tab"
|
|
1030
|
+
closeTab: "Close tab",
|
|
1031
|
+
breadcrumb: "Breadcrumb"
|
|
1102
1032
|
},
|
|
1103
1033
|
"../assets/locales/es.json": {
|
|
1104
1034
|
valueMissing: "Este campo es obligatorio",
|
|
@@ -1138,7 +1068,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1138
1068
|
alertNotice: "Aviso",
|
|
1139
1069
|
alertMessage: "Mensaje",
|
|
1140
1070
|
remove: "Quitar",
|
|
1141
|
-
closeTab: "Cerrar pestaña"
|
|
1071
|
+
closeTab: "Cerrar pestaña",
|
|
1072
|
+
breadcrumb: "Ruta de navegación"
|
|
1142
1073
|
},
|
|
1143
1074
|
"../assets/locales/fr.json": {
|
|
1144
1075
|
valueMissing: "Ce champ est obligatoire",
|
|
@@ -1178,7 +1109,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1178
1109
|
alertNotice: "Avis",
|
|
1179
1110
|
alertMessage: "Message",
|
|
1180
1111
|
remove: "Supprimer",
|
|
1181
|
-
closeTab: "Fermer l'onglet"
|
|
1112
|
+
closeTab: "Fermer l'onglet",
|
|
1113
|
+
breadcrumb: "Fil d'Ariane"
|
|
1182
1114
|
},
|
|
1183
1115
|
"../assets/locales/id.json": {
|
|
1184
1116
|
valueMissing: "Kolom ini wajib diisi",
|
|
@@ -1218,7 +1150,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1218
1150
|
alertNotice: "Pemberitahuan",
|
|
1219
1151
|
alertMessage: "Pesan",
|
|
1220
1152
|
remove: "Hapus",
|
|
1221
|
-
closeTab: "Tutup tab"
|
|
1153
|
+
closeTab: "Tutup tab",
|
|
1154
|
+
breadcrumb: "Navigasi remah roti"
|
|
1222
1155
|
},
|
|
1223
1156
|
"../assets/locales/ja.json": {
|
|
1224
1157
|
valueMissing: "この項目は必須です",
|
|
@@ -1258,7 +1191,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1258
1191
|
alertNotice: "通知",
|
|
1259
1192
|
alertMessage: "メッセージ",
|
|
1260
1193
|
remove: "削除",
|
|
1261
|
-
closeTab: "タブを閉じる"
|
|
1194
|
+
closeTab: "タブを閉じる",
|
|
1195
|
+
breadcrumb: "パンくずリスト"
|
|
1262
1196
|
},
|
|
1263
1197
|
"../assets/locales/ko.json": {
|
|
1264
1198
|
valueMissing: "필수 항목입니다",
|
|
@@ -1298,7 +1232,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1298
1232
|
alertNotice: "알림",
|
|
1299
1233
|
alertMessage: "메시지",
|
|
1300
1234
|
remove: "제거",
|
|
1301
|
-
closeTab: "탭 닫기"
|
|
1235
|
+
closeTab: "탭 닫기",
|
|
1236
|
+
breadcrumb: "탐색 경로"
|
|
1302
1237
|
},
|
|
1303
1238
|
"../assets/locales/pt-BR.json": {
|
|
1304
1239
|
valueMissing: "Este campo é obrigatório",
|
|
@@ -1338,7 +1273,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1338
1273
|
alertNotice: "Nota",
|
|
1339
1274
|
alertMessage: "Mensagem",
|
|
1340
1275
|
remove: "Remover",
|
|
1341
|
-
closeTab: "Fechar aba"
|
|
1276
|
+
closeTab: "Fechar aba",
|
|
1277
|
+
breadcrumb: "Trilha de navegação"
|
|
1342
1278
|
},
|
|
1343
1279
|
"../assets/locales/ru.json": {
|
|
1344
1280
|
valueMissing: "Это поле обязательно для заполнения",
|
|
@@ -1378,7 +1314,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1378
1314
|
alertNotice: "Уведомление",
|
|
1379
1315
|
alertMessage: "Сообщение",
|
|
1380
1316
|
remove: "Удалить",
|
|
1381
|
-
closeTab: "Закрыть вкладку"
|
|
1317
|
+
closeTab: "Закрыть вкладку",
|
|
1318
|
+
breadcrumb: "Навигационная цепочка"
|
|
1382
1319
|
},
|
|
1383
1320
|
"../assets/locales/th.json": {
|
|
1384
1321
|
valueMissing: "จำเป็นต้องกรอกข้อมูลนี้",
|
|
@@ -1418,7 +1355,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1418
1355
|
alertNotice: "ประกาศ",
|
|
1419
1356
|
alertMessage: "ข้อความ",
|
|
1420
1357
|
remove: "ลบ",
|
|
1421
|
-
closeTab: "ปิดแท็บ"
|
|
1358
|
+
closeTab: "ปิดแท็บ",
|
|
1359
|
+
breadcrumb: "เส้นทางการนำทาง"
|
|
1422
1360
|
},
|
|
1423
1361
|
"../assets/locales/vi.json": {
|
|
1424
1362
|
valueMissing: "Trường này là bắt buộc",
|
|
@@ -1458,7 +1396,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1458
1396
|
alertNotice: "Lưu ý",
|
|
1459
1397
|
alertMessage: "Thông báo",
|
|
1460
1398
|
remove: "Xóa",
|
|
1461
|
-
closeTab: "Đóng tab"
|
|
1399
|
+
closeTab: "Đóng tab",
|
|
1400
|
+
breadcrumb: "Đường dẫn điều hướng"
|
|
1462
1401
|
},
|
|
1463
1402
|
"../assets/locales/zh-CN.json": {
|
|
1464
1403
|
valueMissing: "此项为必填项",
|
|
@@ -1498,7 +1437,8 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1498
1437
|
alertNotice: "提示",
|
|
1499
1438
|
alertMessage: "消息",
|
|
1500
1439
|
remove: "移除",
|
|
1501
|
-
closeTab: "关闭标签页"
|
|
1440
|
+
closeTab: "关闭标签页",
|
|
1441
|
+
breadcrumb: "面包屑导航"
|
|
1502
1442
|
},
|
|
1503
1443
|
"../assets/locales/zh-TW.json": {
|
|
1504
1444
|
valueMissing: "此欄位為必填",
|
|
@@ -1538,14 +1478,15 @@ var b = new Map(Object.entries(/* #__PURE__ */ Object.assign({
|
|
|
1538
1478
|
alertNotice: "提示",
|
|
1539
1479
|
alertMessage: "訊息",
|
|
1540
1480
|
remove: "移除",
|
|
1541
|
-
closeTab: "關閉分頁"
|
|
1481
|
+
closeTab: "關閉分頁",
|
|
1482
|
+
breadcrumb: "麵包屑導覽"
|
|
1542
1483
|
}
|
|
1543
|
-
})).map(([e, t]) => [(e.split("/").pop()?.replace(".json", "") || "").toLowerCase(), t])),
|
|
1544
|
-
function
|
|
1484
|
+
})).map(([e, t]) => [(e.split("/").pop()?.replace(".json", "") || "").toLowerCase(), t])), d = /* @__PURE__ */ new Map();
|
|
1485
|
+
function f() {
|
|
1545
1486
|
return typeof document < "u" && document.documentElement?.lang ? document.documentElement.lang : typeof window < "u" && typeof navigator < "u" && navigator.language ? navigator.language : "en";
|
|
1546
1487
|
}
|
|
1547
|
-
var
|
|
1548
|
-
function
|
|
1488
|
+
var p = f();
|
|
1489
|
+
function m(e) {
|
|
1549
1490
|
let t = e.toLowerCase(), n = t.split("-")[0];
|
|
1550
1491
|
return n === t ? [t, "en"] : [
|
|
1551
1492
|
t,
|
|
@@ -1553,56 +1494,143 @@ function w(e) {
|
|
|
1553
1494
|
"en"
|
|
1554
1495
|
];
|
|
1555
1496
|
}
|
|
1556
|
-
function
|
|
1497
|
+
function h(e, t) {
|
|
1557
1498
|
return t ? e.replace(/\{(\w+)\}/g, (e, n) => t[n] == null ? `{${n}}` : String(t[n])) : e;
|
|
1558
1499
|
}
|
|
1559
|
-
function
|
|
1560
|
-
for (let n of
|
|
1561
|
-
let e =
|
|
1500
|
+
function g(e, t) {
|
|
1501
|
+
for (let n of m(e)) {
|
|
1502
|
+
let e = d.get(n)?.[t] ?? u.get(n)?.[t];
|
|
1562
1503
|
if (e) return e;
|
|
1563
1504
|
}
|
|
1564
|
-
return
|
|
1505
|
+
return u.get("en")[t];
|
|
1565
1506
|
}
|
|
1566
|
-
var
|
|
1507
|
+
var _ = /* @__PURE__ */ new Map(), v = class {
|
|
1567
1508
|
constructor() {}
|
|
1568
1509
|
static set(e) {
|
|
1569
|
-
|
|
1510
|
+
p = e;
|
|
1570
1511
|
}
|
|
1571
1512
|
static get() {
|
|
1572
|
-
return
|
|
1513
|
+
return p;
|
|
1573
1514
|
}
|
|
1574
1515
|
static register(e, t) {
|
|
1575
|
-
let n = e.toLowerCase(), r =
|
|
1576
|
-
|
|
1516
|
+
let n = e.toLowerCase(), r = d.get(n) ?? u.get(n) ?? u.get("en");
|
|
1517
|
+
d.set(n, {
|
|
1577
1518
|
...r,
|
|
1578
1519
|
...t
|
|
1579
1520
|
});
|
|
1580
1521
|
}
|
|
1581
1522
|
static getValue(e, t) {
|
|
1582
|
-
return
|
|
1523
|
+
return h(g(p, e), t);
|
|
1583
1524
|
}
|
|
1584
1525
|
static namespace(e) {
|
|
1585
1526
|
return {
|
|
1586
1527
|
name: e,
|
|
1587
1528
|
register(t, n) {
|
|
1588
|
-
let r =
|
|
1529
|
+
let r = _.get(e) ?? /* @__PURE__ */ new Map(), i = t.toLowerCase();
|
|
1589
1530
|
r.set(i, {
|
|
1590
1531
|
...r.get(i),
|
|
1591
1532
|
...n
|
|
1592
|
-
}),
|
|
1533
|
+
}), _.set(e, r);
|
|
1593
1534
|
},
|
|
1594
1535
|
text(t, n) {
|
|
1595
|
-
let r =
|
|
1596
|
-
for (let e of
|
|
1536
|
+
let r = _.get(e);
|
|
1537
|
+
for (let e of m(p)) {
|
|
1597
1538
|
let i = r?.get(e)?.[t];
|
|
1598
|
-
if (i) return
|
|
1539
|
+
if (i) return h(i, n);
|
|
1599
1540
|
}
|
|
1600
1541
|
return t;
|
|
1601
1542
|
}
|
|
1602
1543
|
};
|
|
1603
1544
|
}
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1545
|
+
};
|
|
1546
|
+
//#endregion
|
|
1547
|
+
//#region src/renderers/format.ts
|
|
1548
|
+
function y(e, t) {
|
|
1549
|
+
return e == null ? "" : typeof t == "function" ? t(e) : b(t) ? S(e, t) : x(e, t);
|
|
1550
|
+
}
|
|
1551
|
+
function b(e) {
|
|
1552
|
+
return /[yMdHhms]/.test(e);
|
|
1553
|
+
}
|
|
1554
|
+
function x(e, t) {
|
|
1555
|
+
let n = typeof e == "number" ? e : Number(e);
|
|
1556
|
+
if (isNaN(n)) return String(e);
|
|
1557
|
+
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 = {
|
|
1558
|
+
minimumFractionDigits: c,
|
|
1559
|
+
maximumFractionDigits: c,
|
|
1560
|
+
useGrouping: o.includes(",")
|
|
1561
|
+
}, u;
|
|
1562
|
+
return r ? u = new Intl.NumberFormat(v.get(), {
|
|
1563
|
+
...l,
|
|
1564
|
+
style: "percent"
|
|
1565
|
+
}).format(n) : (u = new Intl.NumberFormat(v.get(), l).format(n), a && (u = a + u)), u + "";
|
|
1566
|
+
}
|
|
1567
|
+
function S(e, t) {
|
|
1568
|
+
let n;
|
|
1569
|
+
if (e instanceof Date) n = e;
|
|
1570
|
+
else if (typeof e == "string" || typeof e == "number") n = new Date(e);
|
|
1571
|
+
else return String(e);
|
|
1572
|
+
if (isNaN(n.getTime())) return String(e);
|
|
1573
|
+
let r = String(n.getFullYear()), i = r.slice(-2), a = String(n.getMonth() + 1).padStart(2, "0"), o = String(n.getDate()).padStart(2, "0"), s = String(n.getHours()).padStart(2, "0"), c = String(n.getHours() % 12 || 12).padStart(2, "0"), l = String(n.getMinutes()).padStart(2, "0"), u = String(n.getSeconds()).padStart(2, "0");
|
|
1574
|
+
return t.replace("yyyy", r).replace("yy", i).replace("MM", a).replace("dd", o).replace("HH", s).replace("hh", c).replace("mm", l).replace("ss", u);
|
|
1575
|
+
}
|
|
1576
|
+
//#endregion
|
|
1577
|
+
//#region node_modules/@iyulab/components/dist/utilities/format.js
|
|
1578
|
+
function C(e) {
|
|
1579
|
+
let [t, n, r] = e.split("-").map(Number);
|
|
1580
|
+
return Number.isNaN(t) || Number.isNaN(n) || Number.isNaN(r) ? new Date(e) : new Date(t, n - 1, r);
|
|
1581
|
+
}
|
|
1582
|
+
function w(e) {
|
|
1583
|
+
return typeof e == "string" ? C(e) : e;
|
|
1584
|
+
}
|
|
1585
|
+
function T(e, t, n) {
|
|
1586
|
+
return new Intl.NumberFormat(n ?? v.get(), t).format(e);
|
|
1587
|
+
}
|
|
1588
|
+
function E(e, t, n) {
|
|
1589
|
+
let r = w(e);
|
|
1590
|
+
return Number.isNaN(r.getTime()) ? String(e) : new Intl.DateTimeFormat(n ?? v.get(), t).format(r);
|
|
1591
|
+
}
|
|
1592
|
+
//#endregion
|
|
1593
|
+
//#region src/renderers/cell-renderer.ts
|
|
1594
|
+
function D(e, t, n) {
|
|
1595
|
+
return n.renderer ? n.renderer(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) : y(e, n.format) : ee(e, n);
|
|
1596
|
+
}
|
|
1597
|
+
function ee(e, t) {
|
|
1598
|
+
if (e == null) return "";
|
|
1599
|
+
switch (t.type) {
|
|
1600
|
+
case "number": return re(e);
|
|
1601
|
+
case "boolean": return i`<span class="ft-bool">${e ? "✔" : ""}</span>`;
|
|
1602
|
+
case "date": return ie(e);
|
|
1603
|
+
case "datetime": return O(e);
|
|
1604
|
+
case "select": return te(e, t);
|
|
1605
|
+
default: return String(e);
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
function te(e, t) {
|
|
1609
|
+
if (!t.options || t.options.length === 0 || typeof t.options[0] == "string") return e == null ? "" : String(e);
|
|
1610
|
+
let n = t.options.find((t) => t.value === e);
|
|
1611
|
+
return n ? n.label : e == null ? "" : String(e);
|
|
1612
|
+
}
|
|
1613
|
+
var ne = {
|
|
1614
|
+
year: "numeric",
|
|
1615
|
+
month: "numeric",
|
|
1616
|
+
day: "numeric",
|
|
1617
|
+
hour: "numeric",
|
|
1618
|
+
minute: "numeric",
|
|
1619
|
+
second: "numeric"
|
|
1620
|
+
};
|
|
1621
|
+
function re(e) {
|
|
1622
|
+
return typeof e == "number" ? Number.isInteger(e) ? T(e) : T(e, { minimumFractionDigits: 1 }) : String(e);
|
|
1623
|
+
}
|
|
1624
|
+
function ie(e) {
|
|
1625
|
+
return e instanceof Date || typeof e == "string" ? E(e) : String(e);
|
|
1626
|
+
}
|
|
1627
|
+
function O(e) {
|
|
1628
|
+
return e instanceof Date || typeof e == "string" ? E(e, ne) : String(e);
|
|
1629
|
+
}
|
|
1630
|
+
//#endregion
|
|
1631
|
+
//#region src/locale.ts
|
|
1632
|
+
var k = v.namespace("flex-table");
|
|
1633
|
+
k.register("en", {
|
|
1606
1634
|
showHiddenColumns: "Show hidden column(s)",
|
|
1607
1635
|
columnMenu: "Column menu",
|
|
1608
1636
|
cellActions: "Cell actions",
|
|
@@ -1632,8 +1660,30 @@ O.register("en", {
|
|
|
1632
1660
|
closeFind: "Close (Escape)",
|
|
1633
1661
|
replaceWithPlaceholder: "Replace with...",
|
|
1634
1662
|
replace: "Replace",
|
|
1635
|
-
replaceAll: "Replace all"
|
|
1636
|
-
|
|
1663
|
+
replaceAll: "Replace all",
|
|
1664
|
+
sortAscending: "Sort ascending",
|
|
1665
|
+
sortDescending: "Sort descending",
|
|
1666
|
+
filter: "Filter…",
|
|
1667
|
+
clearFilter: "Clear filter",
|
|
1668
|
+
hideColumn: "Hide column",
|
|
1669
|
+
showColumn: "Show: {header}",
|
|
1670
|
+
autoFitWidth: "Auto-fit width",
|
|
1671
|
+
wider: "Wider",
|
|
1672
|
+
narrower: "Narrower",
|
|
1673
|
+
columnMenuFor: "Column menu: {header}",
|
|
1674
|
+
columnMenuRegion: "{header} column",
|
|
1675
|
+
copy: "Copy",
|
|
1676
|
+
insertRowAbove: "Insert row above",
|
|
1677
|
+
insertRowBelow: "Insert row below",
|
|
1678
|
+
deleteRow: "Delete row",
|
|
1679
|
+
filterByThisValue: "Filter by this value",
|
|
1680
|
+
addComment: "Add Comment",
|
|
1681
|
+
editComment: "Edit Comment",
|
|
1682
|
+
deleteComment: "Delete Comment",
|
|
1683
|
+
booleanTrue: "True",
|
|
1684
|
+
booleanFalse: "False",
|
|
1685
|
+
dropFileToImport: "Drop file to import (.xlsx / .csv)"
|
|
1686
|
+
}), k.register("ko", {
|
|
1637
1687
|
showHiddenColumns: "숨긴 열 보기",
|
|
1638
1688
|
columnMenu: "열 메뉴",
|
|
1639
1689
|
cellActions: "셀 작업",
|
|
@@ -1663,12 +1713,34 @@ O.register("en", {
|
|
|
1663
1713
|
closeFind: "닫기 (Escape)",
|
|
1664
1714
|
replaceWithPlaceholder: "바꿀 내용...",
|
|
1665
1715
|
replace: "바꾸기",
|
|
1666
|
-
replaceAll: "모두 바꾸기"
|
|
1716
|
+
replaceAll: "모두 바꾸기",
|
|
1717
|
+
sortAscending: "오름차순 정렬",
|
|
1718
|
+
sortDescending: "내림차순 정렬",
|
|
1719
|
+
filter: "필터…",
|
|
1720
|
+
clearFilter: "필터 지우기",
|
|
1721
|
+
hideColumn: "열 숨기기",
|
|
1722
|
+
showColumn: "{header} 보기",
|
|
1723
|
+
autoFitWidth: "너비 자동 맞춤",
|
|
1724
|
+
wider: "넓게",
|
|
1725
|
+
narrower: "좁게",
|
|
1726
|
+
columnMenuFor: "{header} 열 메뉴",
|
|
1727
|
+
columnMenuRegion: "{header} 열",
|
|
1728
|
+
copy: "복사",
|
|
1729
|
+
insertRowAbove: "위에 행 삽입",
|
|
1730
|
+
insertRowBelow: "아래에 행 삽입",
|
|
1731
|
+
deleteRow: "행 삭제",
|
|
1732
|
+
filterByThisValue: "이 값으로 필터",
|
|
1733
|
+
addComment: "메모 추가",
|
|
1734
|
+
editComment: "메모 편집",
|
|
1735
|
+
deleteComment: "메모 삭제",
|
|
1736
|
+
booleanTrue: "참",
|
|
1737
|
+
booleanFalse: "거짓",
|
|
1738
|
+
dropFileToImport: "가져올 파일을 놓으세요 (.xlsx / .csv)"
|
|
1667
1739
|
});
|
|
1668
|
-
var
|
|
1740
|
+
var A = (e, t) => k.text(e, t);
|
|
1669
1741
|
//#endregion
|
|
1670
1742
|
//#region src/core/selection.ts
|
|
1671
|
-
function
|
|
1743
|
+
function ae(e) {
|
|
1672
1744
|
return {
|
|
1673
1745
|
startRow: Math.min(e.startRow, e.endRow),
|
|
1674
1746
|
startCol: Math.min(e.startCol, e.endCol),
|
|
@@ -1676,7 +1748,7 @@ function ee(e) {
|
|
|
1676
1748
|
endCol: Math.max(e.startCol, e.endCol)
|
|
1677
1749
|
};
|
|
1678
1750
|
}
|
|
1679
|
-
var
|
|
1751
|
+
var oe = class {
|
|
1680
1752
|
constructor() {
|
|
1681
1753
|
this.activeCell = null, this.rangeAnchor = null, this.range = null, this.extraRanges = [], this._rowCount = 0, this._colCount = 0;
|
|
1682
1754
|
}
|
|
@@ -1703,7 +1775,7 @@ var te = class {
|
|
|
1703
1775
|
return e < 0 || e >= this._rowCount || t < 0 || t >= this._colCount ? this.activeCell : (!this.rangeAnchor && this.activeCell && (this.rangeAnchor = { ...this.activeCell }), this.activeCell = {
|
|
1704
1776
|
row: e,
|
|
1705
1777
|
col: t
|
|
1706
|
-
}, this.rangeAnchor && (this.range =
|
|
1778
|
+
}, this.rangeAnchor && (this.range = ae({
|
|
1707
1779
|
startRow: this.rangeAnchor.row,
|
|
1708
1780
|
startCol: this.rangeAnchor.col,
|
|
1709
1781
|
endRow: e,
|
|
@@ -1774,7 +1846,7 @@ var te = class {
|
|
|
1774
1846
|
shiftMoveRight() {
|
|
1775
1847
|
return this.activeCell ? this.setActiveWithRange(this.activeCell.row, this.activeCell.col + 1) : null;
|
|
1776
1848
|
}
|
|
1777
|
-
},
|
|
1849
|
+
}, se = class {
|
|
1778
1850
|
constructor() {
|
|
1779
1851
|
this.current = null;
|
|
1780
1852
|
}
|
|
@@ -1795,7 +1867,7 @@ var te = class {
|
|
|
1795
1867
|
let e = this.current;
|
|
1796
1868
|
return this.current = null, e;
|
|
1797
1869
|
}
|
|
1798
|
-
},
|
|
1870
|
+
}, j = class {
|
|
1799
1871
|
constructor() {
|
|
1800
1872
|
this._selected = /* @__PURE__ */ new Set(), this._mode = "multi", this._rowCount = 0;
|
|
1801
1873
|
}
|
|
@@ -1856,7 +1928,7 @@ var te = class {
|
|
|
1856
1928
|
};
|
|
1857
1929
|
//#endregion
|
|
1858
1930
|
//#region src/core/filtering.ts
|
|
1859
|
-
function
|
|
1931
|
+
function ce(e, t, n) {
|
|
1860
1932
|
if (t.length === 0) return Array.from({ length: e.length }, (e, t) => t);
|
|
1861
1933
|
let r = [];
|
|
1862
1934
|
for (let i = 0; i < e.length; i++) {
|
|
@@ -1875,9 +1947,9 @@ function j(e, t, n) {
|
|
|
1875
1947
|
}
|
|
1876
1948
|
//#endregion
|
|
1877
1949
|
//#region src/core/undo.ts
|
|
1878
|
-
var
|
|
1950
|
+
var le = 100, M = class {
|
|
1879
1951
|
constructor() {
|
|
1880
|
-
this._undoStack = [], this._redoStack = [], this._maxSize =
|
|
1952
|
+
this._undoStack = [], this._redoStack = [], this._maxSize = le;
|
|
1881
1953
|
}
|
|
1882
1954
|
get maxSize() {
|
|
1883
1955
|
return this._maxSize;
|
|
@@ -1914,7 +1986,7 @@ var re = 100, M = class {
|
|
|
1914
1986
|
};
|
|
1915
1987
|
//#endregion
|
|
1916
1988
|
//#region src/clipboard/clipboard.ts
|
|
1917
|
-
function
|
|
1989
|
+
function N(e, t, n) {
|
|
1918
1990
|
let r = [];
|
|
1919
1991
|
for (let i = n.startRow; i <= n.endRow; i++) {
|
|
1920
1992
|
let a = e[i], o = [];
|
|
@@ -1926,7 +1998,7 @@ function ie(e, t, n) {
|
|
|
1926
1998
|
}
|
|
1927
1999
|
return r.join("\n");
|
|
1928
2000
|
}
|
|
1929
|
-
function
|
|
2001
|
+
function P(e) {
|
|
1930
2002
|
let t = e.replace(/\r\n/g, "\n").replace(/\r/g, "\n"), n = [], r = [], i = 0, a = t.length;
|
|
1931
2003
|
for (; i <= a;) {
|
|
1932
2004
|
if (i === a) {
|
|
@@ -1956,7 +2028,7 @@ function N(e) {
|
|
|
1956
2028
|
}
|
|
1957
2029
|
return n;
|
|
1958
2030
|
}
|
|
1959
|
-
function
|
|
2031
|
+
function F(e, t) {
|
|
1960
2032
|
if (e === "") return null;
|
|
1961
2033
|
switch (t.type) {
|
|
1962
2034
|
case "number": {
|
|
@@ -1969,7 +2041,7 @@ function P(e, t) {
|
|
|
1969
2041
|
}
|
|
1970
2042
|
//#endregion
|
|
1971
2043
|
//#region src/export/xlsx-writer.ts
|
|
1972
|
-
var
|
|
2044
|
+
var ue = (() => {
|
|
1973
2045
|
let e = /* @__PURE__ */ new Uint32Array(256);
|
|
1974
2046
|
for (let t = 0; t < 256; t++) {
|
|
1975
2047
|
let n = t;
|
|
@@ -1978,56 +2050,56 @@ var ae = (() => {
|
|
|
1978
2050
|
}
|
|
1979
2051
|
return e;
|
|
1980
2052
|
})();
|
|
1981
|
-
function
|
|
2053
|
+
function de(e) {
|
|
1982
2054
|
let t = 4294967295;
|
|
1983
|
-
for (let n = 0; n < e.length; n++) t =
|
|
2055
|
+
for (let n = 0; n < e.length; n++) t = ue[(t ^ e[n]) & 255] ^ t >>> 8;
|
|
1984
2056
|
return (t ^ 4294967295) >>> 0;
|
|
1985
2057
|
}
|
|
1986
|
-
var
|
|
1987
|
-
function
|
|
2058
|
+
var I = new TextEncoder();
|
|
2059
|
+
function fe(e) {
|
|
1988
2060
|
let t = [], n = [], r = 0;
|
|
1989
2061
|
for (let i of e) {
|
|
1990
|
-
let e =
|
|
2062
|
+
let e = I.encode(i.name), a = de(i.data), o = i.data.length, s = new ArrayBuffer(30 + e.length), c = new DataView(s);
|
|
1991
2063
|
c.setUint32(0, 67324752, !0), c.setUint16(4, 20, !0), c.setUint16(6, 0, !0), c.setUint16(8, 0, !0), c.setUint16(10, 0, !0), c.setUint16(12, 33, !0), c.setUint32(14, a, !0), c.setUint32(18, o, !0), c.setUint32(22, o, !0), c.setUint16(26, e.length, !0), c.setUint16(28, 0, !0), new Uint8Array(s, 30).set(e), t.push(new Uint8Array(s)), t.push(i.data);
|
|
1992
2064
|
let l = new ArrayBuffer(46 + e.length), u = new DataView(l);
|
|
1993
2065
|
u.setUint32(0, 33639248, !0), u.setUint16(4, 20, !0), u.setUint16(6, 20, !0), u.setUint16(8, 0, !0), u.setUint16(10, 0, !0), u.setUint16(12, 0, !0), u.setUint16(14, 33, !0), u.setUint32(16, a, !0), u.setUint32(20, o, !0), u.setUint32(24, o, !0), u.setUint16(28, e.length, !0), u.setUint16(30, 0, !0), u.setUint16(32, 0, !0), u.setUint16(34, 0, !0), u.setUint16(36, 0, !0), u.setUint32(38, 0, !0), u.setUint32(42, r, !0), new Uint8Array(l, 46).set(e), n.push(new Uint8Array(l)), r += 30 + e.length + o;
|
|
1994
2066
|
}
|
|
1995
|
-
let i =
|
|
1996
|
-
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),
|
|
2067
|
+
let i = L(n), a = /* @__PURE__ */ new ArrayBuffer(22), o = new DataView(a);
|
|
2068
|
+
return o.setUint32(0, 101010256, !0), o.setUint16(4, 0, !0), o.setUint16(6, 0, !0), o.setUint16(8, e.length, !0), o.setUint16(10, e.length, !0), o.setUint32(12, i.length, !0), o.setUint32(16, r, !0), o.setUint16(20, 0, !0), L([
|
|
1997
2069
|
...t,
|
|
1998
2070
|
i,
|
|
1999
2071
|
new Uint8Array(a)
|
|
2000
2072
|
]);
|
|
2001
2073
|
}
|
|
2002
|
-
function
|
|
2074
|
+
function L(e) {
|
|
2003
2075
|
let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
|
|
2004
2076
|
for (let t of e) n.set(t, r), r += t.length;
|
|
2005
2077
|
return n;
|
|
2006
2078
|
}
|
|
2007
|
-
function
|
|
2079
|
+
function R(e) {
|
|
2008
2080
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2009
2081
|
}
|
|
2010
|
-
function
|
|
2082
|
+
function z(e) {
|
|
2011
2083
|
let t = "";
|
|
2012
2084
|
for (e++; e > 0;) t = String.fromCharCode(64 + (e % 26 || 26)) + t, e = Math.floor((e - 1) / 26);
|
|
2013
2085
|
return t;
|
|
2014
2086
|
}
|
|
2015
|
-
function
|
|
2016
|
-
return
|
|
2087
|
+
function B(e, t) {
|
|
2088
|
+
return z(t) + (e + 1);
|
|
2017
2089
|
}
|
|
2018
|
-
function
|
|
2090
|
+
function V(e) {
|
|
2019
2091
|
let t = Date.UTC(1899, 11, 30);
|
|
2020
2092
|
return (e.getTime() - t) / 864e5;
|
|
2021
2093
|
}
|
|
2022
|
-
var
|
|
2023
|
-
function
|
|
2024
|
-
let n = [], r = t.map((e, t) => `<c r="${
|
|
2094
|
+
var pe = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\n <Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/>\n <Default Extension=\"xml\" ContentType=\"application/xml\"/>\n <Override PartName=\"/xl/workbook.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\"/>\n <Override PartName=\"/xl/worksheets/sheet1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\"/>\n <Override PartName=\"/xl/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\"/>\n</Types>", me = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n <Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"xl/workbook.xml\"/>\n</Relationships>", he = "<?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>", ge = "<?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>", _e = "<?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>";
|
|
2095
|
+
function ve(e, t) {
|
|
2096
|
+
let n = [], r = t.map((e, t) => `<c r="${B(0, t)}" t="str" s="2"><v>${R(e.header)}</v></c>`);
|
|
2025
2097
|
return n.push(`<row r="1">${r.join("")}</row>`), e.forEach((e, r) => {
|
|
2026
2098
|
let i = t.map((t, n) => {
|
|
2027
|
-
let i =
|
|
2099
|
+
let i = B(r + 1, n), a = e[t.key];
|
|
2028
2100
|
if (a == null) return `<c r="${i}" t="str"><v></v></c>`;
|
|
2029
2101
|
let o = t.type ?? "text";
|
|
2030
|
-
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>${
|
|
2102
|
+
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>${V(a).toFixed(6)}</v></c>` : o === "boolean" ? `<c r="${i}" t="b"><v>${+!!a}</v></c>` : `<c r="${i}" t="str"><v>${R(String(a))}</v></c>`;
|
|
2031
2103
|
});
|
|
2032
2104
|
n.push(`<row r="${r + 2}">${i.join("")}</row>`);
|
|
2033
2105
|
}), `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
@@ -2035,32 +2107,32 @@ function V(e, t) {
|
|
|
2035
2107
|
<sheetData>${n.join("")}</sheetData>
|
|
2036
2108
|
</worksheet>`;
|
|
2037
2109
|
}
|
|
2038
|
-
function
|
|
2039
|
-
let n =
|
|
2040
|
-
return
|
|
2110
|
+
function ye(e, t) {
|
|
2111
|
+
let n = ve(e, t);
|
|
2112
|
+
return fe([
|
|
2041
2113
|
{
|
|
2042
2114
|
name: "[Content_Types].xml",
|
|
2043
|
-
data:
|
|
2115
|
+
data: I.encode(pe)
|
|
2044
2116
|
},
|
|
2045
2117
|
{
|
|
2046
2118
|
name: "_rels/.rels",
|
|
2047
|
-
data:
|
|
2119
|
+
data: I.encode(me)
|
|
2048
2120
|
},
|
|
2049
2121
|
{
|
|
2050
2122
|
name: "xl/workbook.xml",
|
|
2051
|
-
data:
|
|
2123
|
+
data: I.encode(he)
|
|
2052
2124
|
},
|
|
2053
2125
|
{
|
|
2054
2126
|
name: "xl/_rels/workbook.xml.rels",
|
|
2055
|
-
data:
|
|
2127
|
+
data: I.encode(ge)
|
|
2056
2128
|
},
|
|
2057
2129
|
{
|
|
2058
2130
|
name: "xl/worksheets/sheet1.xml",
|
|
2059
|
-
data:
|
|
2131
|
+
data: I.encode(n)
|
|
2060
2132
|
},
|
|
2061
2133
|
{
|
|
2062
2134
|
name: "xl/styles.xml",
|
|
2063
|
-
data:
|
|
2135
|
+
data: I.encode(_e)
|
|
2064
2136
|
}
|
|
2065
2137
|
]);
|
|
2066
2138
|
}
|
|
@@ -2070,20 +2142,20 @@ function H(e, t, n) {
|
|
|
2070
2142
|
switch (n) {
|
|
2071
2143
|
case "csv": return U(e, t, ",");
|
|
2072
2144
|
case "tsv": return U(e, t, " ");
|
|
2073
|
-
case "json": return
|
|
2074
|
-
case "xlsx": return
|
|
2145
|
+
case "json": return xe(e, t);
|
|
2146
|
+
case "xlsx": return ye(e, t);
|
|
2075
2147
|
}
|
|
2076
2148
|
}
|
|
2077
|
-
function
|
|
2149
|
+
function be(e, t) {
|
|
2078
2150
|
return e == null ? "" : (t.type === "date" || t.type === "datetime") && e instanceof Date ? e.toISOString() : String(e);
|
|
2079
2151
|
}
|
|
2080
2152
|
function U(e, t, n) {
|
|
2081
|
-
return [t.map((e) => W(e.header, n)).join(n), ...e.map((e) => t.map((t) => W(
|
|
2153
|
+
return [t.map((e) => W(e.header, n)).join(n), ...e.map((e) => t.map((t) => W(be(e[t.key], t), n)).join(n))].join("\n");
|
|
2082
2154
|
}
|
|
2083
2155
|
function W(e, t) {
|
|
2084
2156
|
return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? "\"" + e.replace(/"/g, "\"\"") + "\"" : e;
|
|
2085
2157
|
}
|
|
2086
|
-
function
|
|
2158
|
+
function xe(e, t) {
|
|
2087
2159
|
let n = e.map((e) => {
|
|
2088
2160
|
let n = {};
|
|
2089
2161
|
for (let r of t) {
|
|
@@ -2094,35 +2166,35 @@ function he(e, t) {
|
|
|
2094
2166
|
});
|
|
2095
2167
|
return JSON.stringify(n, null, 2);
|
|
2096
2168
|
}
|
|
2097
|
-
function
|
|
2169
|
+
function Se(e, t, n) {
|
|
2098
2170
|
let r = new Blob([e], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
2099
2171
|
a.href = i, a.download = t, a.style.display = "none", document.body.appendChild(a), a.click(), document.body.removeChild(a), setTimeout(() => URL.revokeObjectURL(i), 100);
|
|
2100
2172
|
}
|
|
2101
|
-
var
|
|
2173
|
+
var Ce = {
|
|
2102
2174
|
csv: "text/csv;charset=utf-8",
|
|
2103
2175
|
tsv: "text/tab-separated-values;charset=utf-8",
|
|
2104
2176
|
json: "application/json;charset=utf-8",
|
|
2105
2177
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
2106
|
-
},
|
|
2178
|
+
}, we = {
|
|
2107
2179
|
csv: ".csv",
|
|
2108
2180
|
tsv: ".tsv",
|
|
2109
2181
|
json: ".json",
|
|
2110
2182
|
xlsx: ".xlsx"
|
|
2111
2183
|
};
|
|
2112
|
-
function
|
|
2113
|
-
return
|
|
2184
|
+
function Te(e) {
|
|
2185
|
+
return Ce[e];
|
|
2114
2186
|
}
|
|
2115
|
-
function
|
|
2116
|
-
return
|
|
2187
|
+
function Ee(e) {
|
|
2188
|
+
return we[e];
|
|
2117
2189
|
}
|
|
2118
2190
|
//#endregion
|
|
2119
2191
|
//#region src/export/xlsx-reader.ts
|
|
2120
|
-
function
|
|
2192
|
+
function De(e) {
|
|
2121
2193
|
for (let t = e.byteLength - 22; t >= 0; t--) if (e.getUint32(t, !0) === 101010256) return t;
|
|
2122
2194
|
throw Error("XLSX: End of central directory not found — not a valid ZIP file");
|
|
2123
2195
|
}
|
|
2124
|
-
function
|
|
2125
|
-
let t =
|
|
2196
|
+
function Oe(e) {
|
|
2197
|
+
let t = De(e), n = e.getUint32(t + 16, !0), r = e.getUint32(t + 12, !0), i = new TextDecoder("utf-8"), a = [], o = n, s = n + r;
|
|
2126
2198
|
for (; o < s && e.getUint32(o, !0) === 33639248;) {
|
|
2127
2199
|
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));
|
|
2128
2200
|
a.push({
|
|
@@ -2135,7 +2207,7 @@ function Se(e) {
|
|
|
2135
2207
|
}
|
|
2136
2208
|
return a;
|
|
2137
2209
|
}
|
|
2138
|
-
async function
|
|
2210
|
+
async function ke(e) {
|
|
2139
2211
|
let t = new DecompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
|
|
2140
2212
|
n.write(e), n.close();
|
|
2141
2213
|
let i = [];
|
|
@@ -2148,32 +2220,32 @@ async function Ce(e) {
|
|
|
2148
2220
|
for (let e of i) o.set(e, s), s += e.length;
|
|
2149
2221
|
return o;
|
|
2150
2222
|
}
|
|
2151
|
-
async function
|
|
2223
|
+
async function Ae(e, t) {
|
|
2152
2224
|
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);
|
|
2153
2225
|
if (t.compressionMethod === 0) return o.slice();
|
|
2154
|
-
if (t.compressionMethod === 8) return
|
|
2226
|
+
if (t.compressionMethod === 8) return ke(o);
|
|
2155
2227
|
throw Error(`XLSX: Unsupported compression method ${t.compressionMethod}`);
|
|
2156
2228
|
}
|
|
2157
|
-
async function
|
|
2158
|
-
let t = new DataView(e), n =
|
|
2159
|
-
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await
|
|
2229
|
+
async function je(e) {
|
|
2230
|
+
let t = new DataView(e), n = Oe(t), r = /* @__PURE__ */ new Map();
|
|
2231
|
+
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await Ae(t, e));
|
|
2160
2232
|
return r;
|
|
2161
2233
|
}
|
|
2162
|
-
var
|
|
2234
|
+
var Me = new TextDecoder("utf-8");
|
|
2163
2235
|
function G(e) {
|
|
2164
|
-
let t =
|
|
2236
|
+
let t = Me.decode(e);
|
|
2165
2237
|
return new DOMParser().parseFromString(t, "application/xml");
|
|
2166
2238
|
}
|
|
2167
|
-
function
|
|
2239
|
+
function Ne(e) {
|
|
2168
2240
|
if (!e) return [];
|
|
2169
2241
|
let t = G(e);
|
|
2170
2242
|
return Array.from(t.querySelectorAll("si")).map((e) => Array.from(e.querySelectorAll("t")).map((e) => e.textContent ?? "").join(""));
|
|
2171
2243
|
}
|
|
2172
|
-
function
|
|
2244
|
+
function Pe(e) {
|
|
2173
2245
|
let t = (e - 1) * 864e5 + Date.UTC(1899, 11, 30);
|
|
2174
2246
|
return new Date(t).toISOString().slice(0, 10);
|
|
2175
2247
|
}
|
|
2176
|
-
function
|
|
2248
|
+
function Fe(e, t) {
|
|
2177
2249
|
let n = G(e).querySelectorAll("row");
|
|
2178
2250
|
if (n.length === 0) return [];
|
|
2179
2251
|
let r = 0, i = /* @__PURE__ */ new Map();
|
|
@@ -2181,7 +2253,7 @@ function ke(e, t) {
|
|
|
2181
2253
|
let n = parseInt(e.getAttribute("r") ?? "1", 10) - 1, a = /* @__PURE__ */ new Map();
|
|
2182
2254
|
i.set(n, a);
|
|
2183
2255
|
for (let n of e.querySelectorAll("c")) {
|
|
2184
|
-
let e =
|
|
2256
|
+
let e = Ie(n.getAttribute("r") ?? "");
|
|
2185
2257
|
e > r && (r = e);
|
|
2186
2258
|
let i = n.getAttribute("t") ?? "", o = n.getAttribute("s") ?? "", s = n.querySelector("v")?.textContent ?? "", c = n.querySelector("is > t")?.textContent ?? null, l;
|
|
2187
2259
|
if (i === "s") l = t[parseInt(s, 10)] ?? "";
|
|
@@ -2190,7 +2262,7 @@ function ke(e, t) {
|
|
|
2190
2262
|
else if (s === "") l = "";
|
|
2191
2263
|
else {
|
|
2192
2264
|
let e = parseFloat(s);
|
|
2193
|
-
l = !isNaN(e) && o !== "" && parseInt(o, 10) > 0 && e >= 1 && e <= 73050 ?
|
|
2265
|
+
l = !isNaN(e) && o !== "" && parseInt(o, 10) > 0 && e >= 1 && e <= 73050 ? Pe(e) : s;
|
|
2194
2266
|
}
|
|
2195
2267
|
a.set(e, l);
|
|
2196
2268
|
}
|
|
@@ -2204,13 +2276,13 @@ function ke(e, t) {
|
|
|
2204
2276
|
}
|
|
2205
2277
|
return o;
|
|
2206
2278
|
}
|
|
2207
|
-
function
|
|
2279
|
+
function Ie(e) {
|
|
2208
2280
|
let t = 0, n = 0;
|
|
2209
2281
|
for (; n < e.length && e[n] >= "A" && e[n] <= "Z";) t = t * 26 + (e.charCodeAt(n) - 64), n++;
|
|
2210
2282
|
return t - 1;
|
|
2211
2283
|
}
|
|
2212
|
-
async function
|
|
2213
|
-
let t = await
|
|
2284
|
+
async function Le(e) {
|
|
2285
|
+
let t = await je(e), n = Ne(t.get("xl/sharedStrings.xml")), r = t.get("xl/worksheets/sheet1.xml");
|
|
2214
2286
|
if (!r) {
|
|
2215
2287
|
for (let [e, n] of t) if (e.toLowerCase().includes("worksheets/sheet")) {
|
|
2216
2288
|
r = n;
|
|
@@ -2218,7 +2290,7 @@ async function je(e) {
|
|
|
2218
2290
|
}
|
|
2219
2291
|
}
|
|
2220
2292
|
if (!r) throw Error("XLSX: No worksheet found");
|
|
2221
|
-
let i =
|
|
2293
|
+
let i = Fe(r, n);
|
|
2222
2294
|
return i.length === 0 ? {
|
|
2223
2295
|
headers: [],
|
|
2224
2296
|
rows: []
|
|
@@ -2244,9 +2316,9 @@ var q = {
|
|
|
2244
2316
|
lt: "<",
|
|
2245
2317
|
gte: "≥",
|
|
2246
2318
|
lte: "≤"
|
|
2247
|
-
}, J = 120, Y = 40, X = 20, Z = 32, Q = 5,
|
|
2319
|
+
}, J = 120, Y = 40, X = 20, Z = 32, Q = 5, Re = 200, $ = class extends n {
|
|
2248
2320
|
constructor(...e) {
|
|
2249
|
-
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this._rowHeightFromCss = Z, this.showRowNumbers = !1, this.theme = void 0, this.maxRows = 0, this.editable = !0, this.showFilters = !1, this.showContextMenu = !1, this.frozenRows = 0, this.emptyMessage = "No data", this.noMatchingMessage = "No matching data", this.loading = !1, this.importEnabled = !1, this.selectable = !1, this.dataMode = "client", this.footerData = null, this.stylesheets = [], this._scrollTop = 0, this._scrollLeft = 0, this._viewportHeight = 0, this._viewportWidth = 0, this._colLeftOffsets = [], this._totalRowWidth = 0, this._baseStyleSheets = [], this._activeCell = null, this._editingCell = null, this._sortCriteria = [], this._selection = new
|
|
2321
|
+
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this._rowHeightFromCss = Z, this.showRowNumbers = !1, this.theme = void 0, this.maxRows = 0, this.editable = !0, this.showFilters = !1, this.showContextMenu = !1, this.frozenRows = 0, this.emptyMessage = "No data", this.noMatchingMessage = "No matching data", this.loading = !1, this.importEnabled = !1, this.selectable = !1, this.dataMode = "client", this.footerData = null, this.stylesheets = [], this._scrollTop = 0, this._scrollLeft = 0, this._viewportHeight = 0, this._viewportWidth = 0, this._colLeftOffsets = [], this._totalRowWidth = 0, this._baseStyleSheets = [], this._activeCell = null, this._editingCell = null, this._sortCriteria = [], this._selection = new oe(), this._editing = new se(), this._rowSelection = new j(), this._undo = new M(), this._filters = [], this._filteredIndices = [], this._sortedIndices = [], this._openFilterKey = null, this._rowSelectionVersion = 0, this._lastCheckboxRowIndex = null, this._checkboxShiftPending = !1, this._autocompleteState = null, this._headerMenu = null, this._bodyContextMenu = null, this._commentPopup = null, this._viewDirty = !0, this._isDragging = !1, this._wasDrag = !1, this._resizing = null, this._resizeCleanup = null, this._wasHeaderDrag = !1, this._wasRowDrag = !1, this._colDrag = null, this._colDragIndicatorLeft = null, this._fillDrag = null, this._rowDrag = null, this._rowDragIndicatorY = null, this._findState = null, this._columnWidths = /* @__PURE__ */ new Map(), this._hostResizeObserver = null, this._comments = /* @__PURE__ */ new Map(), this._isDragOver = !1, this._warnedUnconstrained = !1, this._onCommentPopupOutsideClick = () => {
|
|
2250
2322
|
this._commitCommentPopup();
|
|
2251
2323
|
}, 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();
|
|
2252
2324
|
}
|
|
@@ -2616,7 +2688,7 @@ var q = {
|
|
|
2616
2688
|
return H(this._sortedIndices.map((e) => this.data[e]), this.visibleColumns, e);
|
|
2617
2689
|
}
|
|
2618
2690
|
exportToFile(e, t) {
|
|
2619
|
-
|
|
2691
|
+
Se(this.exportToString(e), t ?? `export${Ee(e)}`, Te(e));
|
|
2620
2692
|
}
|
|
2621
2693
|
setComment(e, t, n) {
|
|
2622
2694
|
let r = this.getComment(e, t);
|
|
@@ -2673,10 +2745,10 @@ var q = {
|
|
|
2673
2745
|
async importFromFile(e) {
|
|
2674
2746
|
let t = e.name.toLowerCase();
|
|
2675
2747
|
if (t.endsWith(".xlsx")) {
|
|
2676
|
-
let t = await
|
|
2748
|
+
let t = await Le(await e.arrayBuffer());
|
|
2677
2749
|
this._applyImportedSheet(t);
|
|
2678
2750
|
} else if (t.endsWith(".csv") || t.endsWith(".tsv")) {
|
|
2679
|
-
let t =
|
|
2751
|
+
let t = P(await e.text());
|
|
2680
2752
|
this._applyImportedRows(t);
|
|
2681
2753
|
} else console.warn(`flex-table importFromFile: unsupported file type "${e.name}"`);
|
|
2682
2754
|
}
|
|
@@ -2687,7 +2759,7 @@ var q = {
|
|
|
2687
2759
|
let a = t.get(e);
|
|
2688
2760
|
if (!a) return;
|
|
2689
2761
|
let o = this.columns.find((e) => e.key === a);
|
|
2690
|
-
r[a] = o ?
|
|
2762
|
+
r[a] = o ? F(n[i] ?? "", o) : n[i] ?? null;
|
|
2691
2763
|
}), r;
|
|
2692
2764
|
}), r = [...this.data];
|
|
2693
2765
|
this.data = n, this._undo.push({
|
|
@@ -2712,7 +2784,7 @@ var q = {
|
|
|
2712
2784
|
let a = n.get(t);
|
|
2713
2785
|
if (!a) return;
|
|
2714
2786
|
let o = this.columns.find((e) => e.key === a);
|
|
2715
|
-
r[a] = o ?
|
|
2787
|
+
r[a] = o ? F(e[i] ?? "", o) : e[i] ?? null;
|
|
2716
2788
|
}), r;
|
|
2717
2789
|
}), i = [...this.data];
|
|
2718
2790
|
this.data = r, this._undo.push({
|
|
@@ -2858,7 +2930,7 @@ var q = {
|
|
|
2858
2930
|
this._filteredIndices = Array.from({ length: this.data.length }, (e, t) => t), this._sortedIndices = this._filteredIndices;
|
|
2859
2931
|
return;
|
|
2860
2932
|
}
|
|
2861
|
-
if (this._filteredIndices =
|
|
2933
|
+
if (this._filteredIndices = ce(this.data, this._filters, (e, t, n) => {
|
|
2862
2934
|
this.dispatchEvent(new CustomEvent("filter-error", {
|
|
2863
2935
|
detail: {
|
|
2864
2936
|
error: e,
|
|
@@ -2888,7 +2960,7 @@ var q = {
|
|
|
2888
2960
|
e !== this._viewportHeight && (this._viewportHeight = e), t !== this._viewportWidth && (this._viewportWidth = t), this._warnIfUnconstrained();
|
|
2889
2961
|
}
|
|
2890
2962
|
_warnIfUnconstrained() {
|
|
2891
|
-
this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount <
|
|
2963
|
+
this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount < Re || 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.`));
|
|
2892
2964
|
}
|
|
2893
2965
|
_onScroll() {
|
|
2894
2966
|
this._scrollTop = this.scrollTop, this._scrollLeft = this.scrollLeft;
|
|
@@ -3018,7 +3090,7 @@ var q = {
|
|
|
3018
3090
|
}
|
|
3019
3091
|
let t = this.shadowRoot?.querySelector(".ft-editor");
|
|
3020
3092
|
if (t) {
|
|
3021
|
-
let n =
|
|
3093
|
+
let n = F(t.value, e);
|
|
3022
3094
|
this._applyEdit(n);
|
|
3023
3095
|
} else this._cancelEdit();
|
|
3024
3096
|
}
|
|
@@ -3246,7 +3318,7 @@ var q = {
|
|
|
3246
3318
|
async _handleCopy(e) {
|
|
3247
3319
|
let t = this._selection.getEffectiveRange();
|
|
3248
3320
|
if (!t) return;
|
|
3249
|
-
let n = this.visibleColumns, r =
|
|
3321
|
+
let n = this.visibleColumns, r = N(this._sortedIndices.map((e) => this.data[e]), n, t);
|
|
3250
3322
|
try {
|
|
3251
3323
|
await navigator.clipboard.writeText(r);
|
|
3252
3324
|
} catch (e) {
|
|
@@ -3272,7 +3344,7 @@ var q = {
|
|
|
3272
3344
|
if (!this._activeCell) return;
|
|
3273
3345
|
let e = await this._readClipboardText();
|
|
3274
3346
|
if (e == null) return;
|
|
3275
|
-
let t =
|
|
3347
|
+
let t = P(e);
|
|
3276
3348
|
if (t.length === 0) return;
|
|
3277
3349
|
let n = this._expandRowsForPaste(this._activeCell.row, t.length), r = this._applyPasteData(this._activeCell, t);
|
|
3278
3350
|
if (r.length > 0 || n.length > 0) {
|
|
@@ -3330,7 +3402,7 @@ var q = {
|
|
|
3330
3402
|
for (let a = 0; a < t[i].length; a++) {
|
|
3331
3403
|
let s = e.col + a;
|
|
3332
3404
|
if (s >= n.length) break;
|
|
3333
|
-
let c = n[s], l = this.data[o][c.key], u =
|
|
3405
|
+
let c = n[s], l = this.data[o][c.key], u = F(t[i][a], c);
|
|
3334
3406
|
this.data[o][c.key] = u, r.push({
|
|
3335
3407
|
row: o,
|
|
3336
3408
|
col: s,
|
|
@@ -3395,7 +3467,7 @@ var q = {
|
|
|
3395
3467
|
for (let r = e.startCol + 1; r <= e.endCol; r++) {
|
|
3396
3468
|
let e = t[r];
|
|
3397
3469
|
if (!e || !this._isCellEditable(e)) continue;
|
|
3398
|
-
let a =
|
|
3470
|
+
let a = F(o == null ? "" : String(o), e);
|
|
3399
3471
|
n.push({
|
|
3400
3472
|
row: i,
|
|
3401
3473
|
key: e.key,
|
|
@@ -3554,7 +3626,7 @@ var q = {
|
|
|
3554
3626
|
@click=${n ? (t) => this._onHeaderClick(t, e) : void 0}>
|
|
3555
3627
|
${x ? i`
|
|
3556
3628
|
<button class="ft-hidden-col-indicator"
|
|
3557
|
-
title=${
|
|
3629
|
+
title=${A("showHiddenColumns")}
|
|
3558
3630
|
@click=${(t) => {
|
|
3559
3631
|
t.stopPropagation(), this._showHiddenBefore(e);
|
|
3560
3632
|
}}>❯</button>
|
|
@@ -3564,8 +3636,8 @@ var q = {
|
|
|
3564
3636
|
${o >= 0 ? i`<span class="ft-sort-order">${o + 1}</span>` : ""}
|
|
3565
3637
|
<button class="ft-column-menu-btn ${s ? "ft-filter-active" : ""}"
|
|
3566
3638
|
type="button"
|
|
3567
|
-
title=${
|
|
3568
|
-
aria-label=${
|
|
3639
|
+
title=${A("columnMenu")}
|
|
3640
|
+
aria-label=${A("columnMenuFor", { header: e.header })}
|
|
3569
3641
|
aria-haspopup="menu"
|
|
3570
3642
|
aria-expanded=${this._headerMenu?.key === e.key ? "true" : "false"}
|
|
3571
3643
|
@mousedown=${(e) => e.stopPropagation()}
|
|
@@ -3684,26 +3756,26 @@ var q = {
|
|
|
3684
3756
|
}}>${t}</button>
|
|
3685
3757
|
`;
|
|
3686
3758
|
return i`
|
|
3687
|
-
<div class="ft-header-menu" role="menu" aria-label=${
|
|
3759
|
+
<div class="ft-header-menu" role="menu" aria-label=${A("columnMenuRegion", { header: o.header })}
|
|
3688
3760
|
style="position: fixed; left: ${t}px; top: ${n}px; z-index: 200;"
|
|
3689
3761
|
@mousedown=${(e) => e.stopPropagation()}
|
|
3690
3762
|
@keydown=${(e) => this._onHeaderMenuKeydown(e)}>
|
|
3691
3763
|
${o.sortable === !1 ? a : i`
|
|
3692
|
-
${c("sort-asc", "
|
|
3693
|
-
${c("sort-desc", "
|
|
3764
|
+
${c("sort-asc", A("sortAscending"), () => this._applySortFromMenu(e, "asc"))}
|
|
3765
|
+
${c("sort-desc", A("sortDescending"), () => this._applySortFromMenu(e, "desc"))}
|
|
3694
3766
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3695
3767
|
`}
|
|
3696
3768
|
${this.showFilters ? i`
|
|
3697
|
-
${c("filter", "
|
|
3698
|
-
${s ? c("clear-filter", "
|
|
3769
|
+
${c("filter", A("filter"), () => this._openFilterFromMenu(e))}
|
|
3770
|
+
${s ? c("clear-filter", A("clearFilter"), () => this._clearColumnFilter(e)) : a}
|
|
3699
3771
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3700
3772
|
` : a}
|
|
3701
|
-
${c("hide", "
|
|
3702
|
-
${r.map((e) => c("show",
|
|
3773
|
+
${c("hide", A("hideColumn"), () => this._setColumnHidden(e, !0))}
|
|
3774
|
+
${r.map((e) => c("show", A("showColumn", { header: e.header }), () => this._setColumnHidden(e.key, !1)))}
|
|
3703
3775
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3704
|
-
${c("autofit", "
|
|
3705
|
-
${c("wider", "
|
|
3706
|
-
${c("narrower", "
|
|
3776
|
+
${c("autofit", A("autoFitWidth"), () => this._autoFitColumn(e))}
|
|
3777
|
+
${c("wider", A("wider"), () => this._resizeColumnBy(e, X), !0)}
|
|
3778
|
+
${c("narrower", A("narrower"), () => this._resizeColumnBy(e, -20), !0)}
|
|
3707
3779
|
</div>
|
|
3708
3780
|
`;
|
|
3709
3781
|
}
|
|
@@ -3721,26 +3793,26 @@ var q = {
|
|
|
3721
3793
|
}}>${e}</button>
|
|
3722
3794
|
`, f = i`<div class="ft-context-menu-separator" role="separator"></div>`;
|
|
3723
3795
|
return i`
|
|
3724
|
-
<div class="ft-body-context-menu" role="menu" aria-label=${
|
|
3796
|
+
<div class="ft-body-context-menu" role="menu" aria-label=${A("cellActions")}
|
|
3725
3797
|
style="position: fixed; left: ${n}px; top: ${r}px; z-index: 200;"
|
|
3726
3798
|
@mousedown=${(e) => e.stopPropagation()}
|
|
3727
3799
|
@keydown=${(e) => this._onMenuKeydown(e, ".ft-body-context-menu", l)}>
|
|
3728
|
-
${d("
|
|
3800
|
+
${d(A("copy"), () => this._handleCopy(!1))}
|
|
3729
3801
|
${f}
|
|
3730
|
-
${d("
|
|
3731
|
-
${d("
|
|
3732
|
-
${d("
|
|
3802
|
+
${d(A("insertRowAbove"), () => this.addRow(void 0, t))}
|
|
3803
|
+
${d(A("insertRowBelow"), () => this.addRow(void 0, t + 1))}
|
|
3804
|
+
${d(A("deleteRow"), () => this.deleteRows([t]), !0)}
|
|
3733
3805
|
${f}
|
|
3734
|
-
${d("
|
|
3806
|
+
${d(A("hideColumn"), () => this._setColumnHidden(o.key, !0))}
|
|
3735
3807
|
${f}
|
|
3736
|
-
${d("
|
|
3737
|
-
${d("
|
|
3808
|
+
${d(`${A("sortAscending")} ↑`, () => this._applySortFromMenu(o.key, "asc"))}
|
|
3809
|
+
${d(`${A("sortDescending")} ↓`, () => this._applySortFromMenu(o.key, "desc"))}
|
|
3738
3810
|
${f}
|
|
3739
|
-
${d("
|
|
3740
|
-
${c ? d("
|
|
3811
|
+
${d(A("filterByThisValue"), () => this.setFilter(o.key, (e) => e === s))}
|
|
3812
|
+
${c ? d(A("clearFilter"), () => this.removeFilter(o.key)) : a}
|
|
3741
3813
|
${f}
|
|
3742
|
-
${d(u ? "
|
|
3743
|
-
${u ? d("
|
|
3814
|
+
${d(A(u ? "editComment" : "addComment"), () => this._openCommentPopup(t, o.key, n, r))}
|
|
3815
|
+
${u ? d(A("deleteComment"), () => this.setComment(t, o.key, null), !0) : a}
|
|
3744
3816
|
</div>
|
|
3745
3817
|
`;
|
|
3746
3818
|
}
|
|
@@ -3772,13 +3844,13 @@ var q = {
|
|
|
3772
3844
|
@mousedown=${(e) => e.stopPropagation()}>
|
|
3773
3845
|
<textarea class="ft-comment-popup-textarea"
|
|
3774
3846
|
rows="4"
|
|
3775
|
-
placeholder=${
|
|
3847
|
+
placeholder=${A("addCommentPlaceholder")}
|
|
3776
3848
|
@keydown=${(e) => {
|
|
3777
3849
|
e.key === "Escape" && (e.preventDefault(), this._cancelCommentPopup()), e.key === "Enter" && (e.ctrlKey || e.metaKey) && (e.preventDefault(), this._commitCommentPopup());
|
|
3778
3850
|
}}></textarea>
|
|
3779
3851
|
<div class="ft-comment-popup-buttons">
|
|
3780
|
-
<button class="ft-comment-popup-cancel" @click=${() => this._cancelCommentPopup()}>${
|
|
3781
|
-
<button class="ft-comment-popup-save" @click=${() => this._commitCommentPopup()}>${
|
|
3852
|
+
<button class="ft-comment-popup-cancel" @click=${() => this._cancelCommentPopup()}>${A("cancel")}</button>
|
|
3853
|
+
<button class="ft-comment-popup-save" @click=${() => this._commitCommentPopup()}>${A("save")}</button>
|
|
3782
3854
|
</div>
|
|
3783
3855
|
</div>
|
|
3784
3856
|
`;
|
|
@@ -3814,7 +3886,7 @@ var q = {
|
|
|
3814
3886
|
<div class="ft-filter-dropdown" @click=${(e) => e.stopPropagation()}>
|
|
3815
3887
|
${t === "boolean" ? this._renderBooleanFilter(e) : t === "number" ? this._renderNumberFilter(e) : t === "date" || t === "datetime" ? this._renderDateFilter(e) : this._renderTextFilter(e)}
|
|
3816
3888
|
<div class="ft-filter-actions">
|
|
3817
|
-
<button class="ft-filter-clear" @click=${() => this._clearColumnFilter(e.key)}>${
|
|
3889
|
+
<button class="ft-filter-clear" @click=${() => this._clearColumnFilter(e.key)}>${A("clear")}</button>
|
|
3818
3890
|
</div>
|
|
3819
3891
|
</div>
|
|
3820
3892
|
`;
|
|
@@ -3847,7 +3919,7 @@ var q = {
|
|
|
3847
3919
|
let n = this._emptyFilterState.get(e) ?? "";
|
|
3848
3920
|
return i`
|
|
3849
3921
|
<div class="ft-filter-empty-row">
|
|
3850
|
-
<label>${
|
|
3922
|
+
<label>${A("blankCells")}</label>
|
|
3851
3923
|
<select class="ft-filter-mode-select"
|
|
3852
3924
|
.value=${n}
|
|
3853
3925
|
@change=${(n) => {
|
|
@@ -3857,9 +3929,9 @@ var q = {
|
|
|
3857
3929
|
@keydown=${(e) => {
|
|
3858
3930
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
3859
3931
|
}}>
|
|
3860
|
-
<option value="">${
|
|
3861
|
-
<option value="empty">${
|
|
3862
|
-
<option value="non-empty">${
|
|
3932
|
+
<option value="">${A("blankAll")}</option>
|
|
3933
|
+
<option value="empty">${A("emptyOnly")}</option>
|
|
3934
|
+
<option value="non-empty">${A("nonEmptyOnly")}</option>
|
|
3863
3935
|
</select>
|
|
3864
3936
|
</div>
|
|
3865
3937
|
`;
|
|
@@ -3935,13 +4007,13 @@ var q = {
|
|
|
3935
4007
|
@keydown=${(e) => {
|
|
3936
4008
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
3937
4009
|
}}>
|
|
3938
|
-
<option value="contains">${
|
|
3939
|
-
<option value="starts">${
|
|
3940
|
-
<option value="ends">${
|
|
3941
|
-
<option value="wildcard">${
|
|
4010
|
+
<option value="contains">${A("contains")}</option>
|
|
4011
|
+
<option value="starts">${A("startsWith")}</option>
|
|
4012
|
+
<option value="ends">${A("endsWith")}</option>
|
|
4013
|
+
<option value="wildcard">${A("wildcard")}</option>
|
|
3942
4014
|
</select>
|
|
3943
4015
|
</div>
|
|
3944
|
-
<input class="ft-filter-input" type="text" placeholder=${
|
|
4016
|
+
<input class="ft-filter-input" type="text" placeholder=${A("searchPlaceholder")}
|
|
3945
4017
|
.value=${t.value}
|
|
3946
4018
|
@input=${(t) => {
|
|
3947
4019
|
let n = t.target.value, r = this._textFilterState.get(e.key) ?? {
|
|
@@ -3992,7 +4064,7 @@ var q = {
|
|
|
3992
4064
|
}}>
|
|
3993
4065
|
${Object.keys(q).map((e) => i`<option value=${e}>${q[e]}</option>`)}
|
|
3994
4066
|
</select>
|
|
3995
|
-
<input class="ft-filter-input ft-num-cond-input" type="number" placeholder=${
|
|
4067
|
+
<input class="ft-filter-input ft-num-cond-input" type="number" placeholder=${A("valuePlaceholder")}
|
|
3996
4068
|
.value=${n.value == null ? "" : String(n.value)}
|
|
3997
4069
|
@input=${(n) => {
|
|
3998
4070
|
let r = n.target.value, i = this._numberFilterState.get(e) ?? this._defaultNumState();
|
|
@@ -4053,13 +4125,13 @@ var q = {
|
|
|
4053
4125
|
let t = e.type === "datetime" ? "datetime-local" : "date", n = this._dateFilterState.get(e.key) ?? {};
|
|
4054
4126
|
return i`
|
|
4055
4127
|
<div class="ft-filter-range">
|
|
4056
|
-
<input class="ft-filter-input" type=${t} placeholder=${
|
|
4128
|
+
<input class="ft-filter-input" type=${t} placeholder=${A("fromPlaceholder")}
|
|
4057
4129
|
.value=${n.from ?? ""}
|
|
4058
4130
|
@input=${(t) => this._applyDateFilter(e.key, t, "from")}
|
|
4059
4131
|
@keydown=${(e) => {
|
|
4060
4132
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
4061
4133
|
}}>
|
|
4062
|
-
<input class="ft-filter-input" type=${t} placeholder=${
|
|
4134
|
+
<input class="ft-filter-input" type=${t} placeholder=${A("toPlaceholder")}
|
|
4063
4135
|
.value=${n.to ?? ""}
|
|
4064
4136
|
@input=${(t) => this._applyDateFilter(e.key, t, "to")}
|
|
4065
4137
|
@keydown=${(e) => {
|
|
@@ -4085,9 +4157,9 @@ var q = {
|
|
|
4085
4157
|
@keydown=${(e) => {
|
|
4086
4158
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
4087
4159
|
}}>
|
|
4088
|
-
<option value="all">${
|
|
4089
|
-
<option value="true">\u2714
|
|
4090
|
-
<option value="false">\u2718
|
|
4160
|
+
<option value="all">${A("all")}</option>
|
|
4161
|
+
<option value="true">\u2714 ${A("booleanTrue")}</option>
|
|
4162
|
+
<option value="false">\u2718 ${A("booleanFalse")}</option>
|
|
4091
4163
|
</select>
|
|
4092
4164
|
${this._renderEmptyFilterRow(e.key)}
|
|
4093
4165
|
`;
|
|
@@ -4507,39 +4579,39 @@ var q = {
|
|
|
4507
4579
|
e.key === "Enter" && e.target instanceof HTMLInputElement && e.target.classList.contains("ft-find-input") && (e.shiftKey ? this._findPrev() : this._findNext());
|
|
4508
4580
|
}}>
|
|
4509
4581
|
<div class="ft-find-row">
|
|
4510
|
-
<input class="ft-find-input" type="text" placeholder=${
|
|
4582
|
+
<input class="ft-find-input" type="text" placeholder=${A("findPlaceholder")}
|
|
4511
4583
|
.value=${t}
|
|
4512
4584
|
@input=${(e) => {
|
|
4513
4585
|
this._findState.query = e.target.value, this._findSearch();
|
|
4514
4586
|
}}>
|
|
4515
4587
|
<span class="ft-find-count">${c > 0 ? `${l}/${c}` : t ? "0 results" : ""}</span>
|
|
4516
|
-
<button @click=${() => this._findPrev()} title=${
|
|
4517
|
-
<button @click=${() => this._findNext()} title=${
|
|
4518
|
-
<label title=${
|
|
4588
|
+
<button @click=${() => this._findPrev()} title=${A("findPrevious")}>◀</button>
|
|
4589
|
+
<button @click=${() => this._findNext()} title=${A("findNext")}>▶</button>
|
|
4590
|
+
<label title=${A("matchCase")}><input type="checkbox" ?checked=${r} @change=${(e) => {
|
|
4519
4591
|
this._findState.matchCase = e.target.checked, this._findSearch();
|
|
4520
4592
|
}}> Aa</label>
|
|
4521
|
-
<label title=${
|
|
4593
|
+
<label title=${A("wholeCell")}><input type="checkbox" ?checked=${a} @change=${(e) => {
|
|
4522
4594
|
this._findState.wholeCell = e.target.checked, this._findSearch();
|
|
4523
4595
|
}}> [ ]</label>
|
|
4524
|
-
<button @click=${() => this._closeFindPanel()} title=${
|
|
4596
|
+
<button @click=${() => this._closeFindPanel()} title=${A("closeFind")}>✕</button>
|
|
4525
4597
|
</div>
|
|
4526
4598
|
${e === "replace" ? i`
|
|
4527
4599
|
<div class="ft-find-row">
|
|
4528
|
-
<input class="ft-find-replace-input" type="text" placeholder=${
|
|
4600
|
+
<input class="ft-find-replace-input" type="text" placeholder=${A("replaceWithPlaceholder")}
|
|
4529
4601
|
.value=${n}
|
|
4530
4602
|
@input=${(e) => {
|
|
4531
4603
|
this._findState.replaceWith = e.target.value;
|
|
4532
4604
|
}}>
|
|
4533
|
-
<button @click=${() => this._replaceOne()} ?disabled=${c === 0}>${
|
|
4534
|
-
<button @click=${() => this._replaceAll()} ?disabled=${c === 0}>${
|
|
4605
|
+
<button @click=${() => this._replaceOne()} ?disabled=${c === 0}>${A("replace")}</button>
|
|
4606
|
+
<button @click=${() => this._replaceAll()} ?disabled=${c === 0}>${A("replaceAll")}</button>
|
|
4535
4607
|
</div>
|
|
4536
4608
|
` : ""}
|
|
4537
4609
|
</div>
|
|
4538
4610
|
`;
|
|
4539
4611
|
}
|
|
4540
4612
|
render() {
|
|
4541
|
-
let e = this.visibleColumns, t = this.importEnabled && this._isDragOver ? i`<div class="ft-import-overlay"
|
|
4542
|
-
if (e.length === 0) return i`${t}${n}<div class="ft-empty">${
|
|
4613
|
+
let e = this.visibleColumns, t = this.importEnabled && this._isDragOver ? i`<div class="ft-import-overlay">${A("dropFileToImport")}</div>` : a, n = this.loading ? i`<div class="ft-loading-overlay"></div>` : a;
|
|
4614
|
+
if (e.length === 0) return i`${t}${n}<div class="ft-empty">${A("noColumnsDefined")}</div>`;
|
|
4543
4615
|
let r = this.headerHeight, o = this._totalRowWidth, { start: s, end: c } = this.visibleColRange, l = [];
|
|
4544
4616
|
for (let t = 0; t < e.length; t++) (e[t].pinned === "left" || e[t].pinned === "right") && (t < s || t >= c) && l.push(t);
|
|
4545
4617
|
let u = 0, d = this._scrollLeft, f = this.selectable ? i`<div class="ft-checkbox-header"
|
|
@@ -4669,48 +4741,48 @@ var q = {
|
|
|
4669
4741
|
`;
|
|
4670
4742
|
}
|
|
4671
4743
|
_renderCell(e, t, n, r) {
|
|
4672
|
-
let o = this._activeCell?.row === n && this._activeCell?.col === r, s = this._editingCell?.row === n && this._editingCell?.col === r, c = this._selection.isInRange(n, r), l = t.pinned === "left", u = t.pinned === "right", d = l || u, f = this._getColWidth(t), p = this.rowHeight,
|
|
4673
|
-
|
|
4674
|
-
let
|
|
4744
|
+
let o = this._activeCell?.row === n && this._activeCell?.col === r, s = this._editingCell?.row === n && this._editingCell?.col === r, c = this._selection.isInRange(n, r), l = t.pinned === "left", u = t.pinned === "right", d = l || u, f = this._getColWidth(t), p = this.rowHeight, m = this._colLeftOffsets[r] ?? 0, h;
|
|
4745
|
+
h = l ? `position: absolute; top: 0; left: ${this._scrollLeft + this._getPinnedLeft(r)}px; width: ${f}px; height: ${p}px; z-index: 2;` : u ? `position: absolute; top: 0; left: ${this._getPinnedRightLeft(r)}px; width: ${f}px; height: ${p}px; z-index: 2;` : `left: ${m}px; width: ${f}px; height: ${p}px;`;
|
|
4746
|
+
let g = !this._isCellEditable(t);
|
|
4675
4747
|
if (t.conditionalRules && t.conditionalRules.length > 0) {
|
|
4676
4748
|
let n = e[t.key], r = {};
|
|
4677
4749
|
for (let i of t.conditionalRules) i.when(n, e, t) && (i.style.background && (r.background = i.style.background), i.style.color && (r.color = i.style.color), i.style.fontWeight && (r["font-weight"] = i.style.fontWeight), i.style.fontStyle && (r["font-style"] = i.style.fontStyle));
|
|
4678
4750
|
let i = Object.entries(r).map(([e, t]) => `${e}: ${t}`).join("; ");
|
|
4679
|
-
i && (
|
|
4751
|
+
i && (h += " " + i + ";");
|
|
4680
4752
|
}
|
|
4681
4753
|
if (s) return i`
|
|
4682
4754
|
<div class="ft-cell ft-editing ft-active ${d ? "ft-pinned" : ""}" role="gridcell"
|
|
4683
4755
|
data-col-index=${r}
|
|
4684
4756
|
aria-selected="true"
|
|
4685
|
-
aria-readonly=${
|
|
4686
|
-
style=${
|
|
4757
|
+
aria-readonly=${g ? "true" : a}
|
|
4758
|
+
style=${h}>
|
|
4687
4759
|
${this._renderEditor(e, t)}
|
|
4688
4760
|
</div>
|
|
4689
4761
|
`;
|
|
4690
|
-
let
|
|
4762
|
+
let _ = o || c, v = this._isCellInvalid(n, r), y = (this._findState?.results ?? []).findIndex((e) => e.row === n && e.col === r), b = y >= 0, x = b && y === this._findState.currentIndex, S = [
|
|
4691
4763
|
"ft-cell",
|
|
4692
4764
|
`ft-type-${t.type ?? "text"}`,
|
|
4693
4765
|
o ? "ft-active" : "",
|
|
4694
4766
|
c ? "ft-selected" : "",
|
|
4695
4767
|
d ? "ft-pinned" : "",
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
].filter(Boolean).join(" "),
|
|
4768
|
+
v ? "ft-invalid" : "",
|
|
4769
|
+
x ? "ft-find-current" : b ? "ft-find-match" : ""
|
|
4770
|
+
].filter(Boolean).join(" "), C = this._toDataIndex(n), w = this._comments.get(C)?.get(t.key) ?? null, T = w !== null, E = T ? i`<div class="ft-comment-indicator" title=${w}></div>` : a;
|
|
4699
4771
|
return i`
|
|
4700
|
-
<div class=${
|
|
4772
|
+
<div class=${T ? S + " ft-has-comment" : S}
|
|
4701
4773
|
role="gridcell"
|
|
4702
4774
|
data-col-index=${r}
|
|
4703
|
-
aria-selected=${
|
|
4704
|
-
aria-readonly=${
|
|
4705
|
-
aria-invalid=${
|
|
4706
|
-
title=${
|
|
4707
|
-
style=${
|
|
4775
|
+
aria-selected=${_ ? "true" : "false"}
|
|
4776
|
+
aria-readonly=${g ? "true" : a}
|
|
4777
|
+
aria-invalid=${v ? "true" : a}
|
|
4778
|
+
title=${v ?? a}
|
|
4779
|
+
style=${h}
|
|
4708
4780
|
@mousedown=${(e) => this._onCellMouseDown(e, n, r)}
|
|
4709
4781
|
@mouseenter=${() => this._onCellMouseEnter(n, r)}
|
|
4710
4782
|
@click=${(e) => this._onCellClickEvent(e, n, r)}
|
|
4711
4783
|
@dblclick=${() => this._onCellDblClick(n, r)}>
|
|
4712
|
-
${
|
|
4713
|
-
${
|
|
4784
|
+
${E}
|
|
4785
|
+
${D(e[t.key], e, t)}
|
|
4714
4786
|
</div>
|
|
4715
4787
|
`;
|
|
4716
4788
|
}
|
|
@@ -4848,4 +4920,4 @@ K([s({ type: Array })], $.prototype, "columns", void 0), K([s({
|
|
|
4848
4920
|
attribute: "max-undo-size"
|
|
4849
4921
|
})], $.prototype, "maxUndoSize", null), K([c()], $.prototype, "_scrollTop", void 0), K([c()], $.prototype, "_scrollLeft", void 0), K([c()], $.prototype, "_viewportHeight", void 0), K([c()], $.prototype, "_viewportWidth", void 0), K([c()], $.prototype, "_activeCell", void 0), K([c()], $.prototype, "_editingCell", void 0), K([c()], $.prototype, "_sortCriteria", void 0), K([c()], $.prototype, "_openFilterKey", void 0), K([c()], $.prototype, "_rowSelectionVersion", void 0), K([c()], $.prototype, "_autocompleteState", void 0), K([c()], $.prototype, "_headerMenu", void 0), K([c()], $.prototype, "_bodyContextMenu", void 0), K([c()], $.prototype, "_commentPopup", void 0), K([c()], $.prototype, "_isDragOver", void 0), $ = K([o("flex-table")], $);
|
|
4850
4922
|
//#endregion
|
|
4851
|
-
export {
|
|
4923
|
+
export { k as a, j as i, H as n, D as o, M as r, $ as t };
|