@iyulab/flex-table 0.47.0 → 0.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/README.md +9 -6
- package/dist/{flex-table-h2noRChg.js → flex-table-CQNVaL0x.js} +177 -170
- package/dist/flex-table.d.ts +10 -3
- package/dist/flex-table.js +1 -1
- package/dist/react.js +1 -1
- package/package.json +2 -2
- package/skills/iyulab-flex-table/references/api.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.48.1] - 2026-10-06
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **Cmd+C and Cmd+X work in Safari again.** 0.48.0 moved the keys to the browser's copy/cut events
|
|
8
|
+
alone, and Safari fires no copy event without a text selection — a grid's selection is not one. The
|
|
9
|
+
keys now take the browser's event where it fires and write through the Clipboard API where it does
|
|
10
|
+
not (`copyFromKey`/`pasteFromKey` from `@iyulab/components` 2.1.0). A cut still clears only once
|
|
11
|
+
its text is on the clipboard.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- `clipboard-error` again covers the keys: `'copy'` when neither path put the text on the clipboard
|
|
16
|
+
(a cut then clears nothing), `'paste'` when neither could read it.
|
|
17
|
+
- Requires `@iyulab/components` 2.1.0 or later.
|
|
18
|
+
|
|
19
|
+
## [0.48.0] - 2026-10-06
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- **Ctrl+X no longer clears cells that never reached the clipboard.** The keys called the async
|
|
24
|
+
Clipboard API; when the write was refused — no permission, a page outside a secure context, a
|
|
25
|
+
browser without it — the table still cleared the cut range and fired `clipboard-cut`
|
|
26
|
+
(`clipboard-copy` for Ctrl+C). Ctrl+C, Ctrl+X and Ctrl+V now go through the browser's own
|
|
27
|
+
copy/cut/paste and `clipboardData`: they need no clipboard permission, work on any page, and a cut
|
|
28
|
+
range is cleared only once its text is on the clipboard.
|
|
29
|
+
- The context menu's Copy, which still writes through the Clipboard API, fires `clipboard-copy` only
|
|
30
|
+
when the write succeeds; a refused write fires `clipboard-error` alone.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- `clipboard-error` is now only the context menu's Copy (`action: 'copy'`). Paste no longer reads
|
|
35
|
+
through the Clipboard API, so it has no permission to be refused and never reports `'paste'`.
|
|
36
|
+
- Copy, cut and paste typed in a text field inside the grid (the cell editor, the find panel) are
|
|
37
|
+
that field's own and leave the cells alone.
|
|
38
|
+
|
|
39
|
+
### Documentation
|
|
40
|
+
|
|
41
|
+
- README: the keyboard table covers every key the grid handles, and the column example uses
|
|
42
|
+
`appearance="plain"` (the `variant` attribute was removed in `@iyulab/components` 2.0).
|
|
43
|
+
|
|
44
|
+
### Tests
|
|
45
|
+
|
|
46
|
+
- Real key input for Ctrl+C/X/V, Ctrl+Click on a header, and the column menu's Space / Home / End /
|
|
47
|
+
Escape, alongside the rest of the keyboard table.
|
|
48
|
+
|
|
3
49
|
## [0.47.0] - 2026-10-05
|
|
4
50
|
|
|
5
51
|
### Changed
|
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ npm install @iyulab/flex-table
|
|
|
50
50
|
- **Range Selection** — Shift+Arrow, Shift+Click for multi-cell selection
|
|
51
51
|
- **Column Selection** — Ctrl+Click header or `selectColumn()` API
|
|
52
52
|
- **Row Selection** — Checkbox-based row selection (`selectable`, single/multi mode)
|
|
53
|
-
- **Clipboard** — Ctrl+C/X/V with TSV format (Excel/Google Sheets compatible, RFC 4180)
|
|
53
|
+
- **Clipboard** — Ctrl+C/X/V with TSV format (Excel/Google Sheets compatible, RFC 4180), through the browser's own copy/cut/paste where it fires and the Clipboard API where it does not (Safari)
|
|
54
54
|
- **Sorting** — Click header to sort (asc/desc/none), Shift+click for multi-sort
|
|
55
55
|
- **Column Menu** — A 24×24 button in every header opens the column's menu: sort, filter, hide/show, auto-fit, wider/narrower (also opens on header right-click)
|
|
56
56
|
- **Column Resize** — Drag header border, double-click to auto-fit, Alt+Arrow keyboard resize, or the column menu
|
|
@@ -208,7 +208,7 @@ hover) always show them, and they are not printed.
|
|
|
208
208
|
|
|
209
209
|
```ts
|
|
210
210
|
{ key: 'actions', label: '', width: 72, editable: false, reveal: 'hover',
|
|
211
|
-
render: (_, row) => html`<u-button size="sm"
|
|
211
|
+
render: (_, row) => html`<u-button size="sm" appearance="plain" aria-label="Edit">…</u-button>` }
|
|
212
212
|
```
|
|
213
213
|
|
|
214
214
|
### Merging Repeated Values
|
|
@@ -334,7 +334,7 @@ All events use `CustomEvent` with `bubbles: true, composed: true`.
|
|
|
334
334
|
| `clipboard-copy` | `{ range, text }` | Range copied as TSV |
|
|
335
335
|
| `clipboard-cut` | `{ range, text }` | Range cut as TSV |
|
|
336
336
|
| `clipboard-paste` | `{ changes, addedRows }` | Data pasted from clipboard |
|
|
337
|
-
| `clipboard-error` | `{ action, error }` |
|
|
337
|
+
| `clipboard-error` | `{ action, error }` | Copy (`action: 'copy'`) could not put the text on the clipboard — no `clipboard-copy`/`clipboard-cut` follows and a cut clears nothing — or paste (`'paste'`) could not read it |
|
|
338
338
|
|
|
339
339
|
### State Events
|
|
340
340
|
|
|
@@ -429,13 +429,16 @@ package dependency; CSS custom properties are resolved at render time, not impor
|
|
|
429
429
|
|-----|--------|
|
|
430
430
|
| Arrow keys | Navigate cells |
|
|
431
431
|
| Tab / Shift+Tab | Move to next/previous cell |
|
|
432
|
-
| Enter / F2 | Start editing |
|
|
433
|
-
|
|
|
432
|
+
| Enter / F2 | Start editing (Enter on a non-editable cell fires `row-activate`) |
|
|
433
|
+
| Typing a printable character | Start editing an editable cell with that character |
|
|
434
|
+
| Escape | Cancel edit / clear selection / close the find panel |
|
|
434
435
|
| Home / End | Row start/end |
|
|
435
436
|
| Ctrl+Home / Ctrl+End | Table start/end |
|
|
436
|
-
| Shift+Arrow | Extend selection range |
|
|
437
|
+
| Shift+Arrow / Shift+Click | Extend selection range |
|
|
437
438
|
| Ctrl+C / Ctrl+X | Copy/Cut selection as TSV |
|
|
438
439
|
| Ctrl+V | Paste TSV data |
|
|
440
|
+
| Ctrl+D / Ctrl+R | Fill down / fill right |
|
|
441
|
+
| Ctrl+F / Ctrl+H | Find / find and replace |
|
|
439
442
|
| Delete / Backspace | Clear selected cells |
|
|
440
443
|
| Ctrl+Z | Undo |
|
|
441
444
|
| Ctrl+Shift+Z / Ctrl+Y | Redo |
|
|
@@ -6,8 +6,9 @@ import { formatDate as u, formatNumber as d, parseDate as f, parseDateTime as p,
|
|
|
6
6
|
import { decodeTsv as h, encodeTsv as g } from "@iyulab/components/dist/utilities/tsv.js";
|
|
7
7
|
import "@iyulab/components/dist/components/date-picker/UDatePicker.js";
|
|
8
8
|
import { isImeComposing as _ } from "@iyulab/components/dist/utilities/keyboard.js";
|
|
9
|
+
import { copyFromKey as v, pasteFromKey as y } from "@iyulab/components/dist/utilities/clipboard.js";
|
|
9
10
|
//#region src/styles/flex-table.styles.ts
|
|
10
|
-
var
|
|
11
|
+
var b = r`
|
|
11
12
|
/* --- Theme Variables (Light defaults) --- */
|
|
12
13
|
:host {
|
|
13
14
|
--ft-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
@@ -1017,13 +1018,13 @@ var v = r`
|
|
|
1017
1018
|
`;
|
|
1018
1019
|
//#endregion
|
|
1019
1020
|
//#region src/renderers/format.ts
|
|
1020
|
-
function
|
|
1021
|
-
return e == null ? "" : typeof t == "function" ? t(e) :
|
|
1021
|
+
function x(e, t) {
|
|
1022
|
+
return e == null ? "" : typeof t == "function" ? t(e) : S(t) ? w(e, t) : C(e, t);
|
|
1022
1023
|
}
|
|
1023
|
-
function
|
|
1024
|
+
function S(e) {
|
|
1024
1025
|
return /[yMdHhms]/.test(e);
|
|
1025
1026
|
}
|
|
1026
|
-
function
|
|
1027
|
+
function C(e, t) {
|
|
1027
1028
|
let n = typeof e == "number" ? e : Number(e);
|
|
1028
1029
|
if (isNaN(n)) return String(e);
|
|
1029
1030
|
let r = t.endsWith("%"), i = t.match(/^([^#0.,%]+)/), a = i ? i[1] : "", o = t.replace(/^[^#0.,%]+/, "").replace(/%$/, ""), s = o.match(/\.([0#]+)$/), c = s ? s[1].length : 0, u = {
|
|
@@ -1036,7 +1037,7 @@ function x(e, t) {
|
|
|
1036
1037
|
style: "percent"
|
|
1037
1038
|
}).format(n) : (d = new Intl.NumberFormat(l.get(), u).format(n), a && (d = a + d)), d + "";
|
|
1038
1039
|
}
|
|
1039
|
-
function
|
|
1040
|
+
function w(e, t) {
|
|
1040
1041
|
let n;
|
|
1041
1042
|
if (e instanceof Date) n = e;
|
|
1042
1043
|
else if (typeof e == "string" || typeof e == "number") n = new Date(e);
|
|
@@ -1047,26 +1048,26 @@ function S(e, t) {
|
|
|
1047
1048
|
}
|
|
1048
1049
|
//#endregion
|
|
1049
1050
|
//#region src/renderers/cell-renderer.ts
|
|
1050
|
-
function
|
|
1051
|
-
return n.render ? n.render(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) :
|
|
1051
|
+
function T(e, t, n) {
|
|
1052
|
+
return n.render ? n.render(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) : x(e, n.format) : E(e, n);
|
|
1052
1053
|
}
|
|
1053
|
-
function
|
|
1054
|
+
function E(e, t) {
|
|
1054
1055
|
if (e == null) return "";
|
|
1055
1056
|
switch (t.type) {
|
|
1056
|
-
case "number": return
|
|
1057
|
+
case "number": return ee(e);
|
|
1057
1058
|
case "boolean": return i`<span class="ft-bool">${e ? "✔" : ""}</span>`;
|
|
1058
|
-
case "date": return
|
|
1059
|
-
case "datetime": return
|
|
1060
|
-
case "select": return
|
|
1059
|
+
case "date": return te(e);
|
|
1060
|
+
case "datetime": return ne(e);
|
|
1061
|
+
case "select": return D(e, t);
|
|
1061
1062
|
default: return String(e);
|
|
1062
1063
|
}
|
|
1063
1064
|
}
|
|
1064
|
-
function
|
|
1065
|
+
function D(e, t) {
|
|
1065
1066
|
if (!t.options || t.options.length === 0 || typeof t.options[0] == "string") return e == null ? "" : String(e);
|
|
1066
1067
|
let n = t.options.find((t) => t.value === e);
|
|
1067
1068
|
return n ? n.label : e == null ? "" : String(e);
|
|
1068
1069
|
}
|
|
1069
|
-
var
|
|
1070
|
+
var O = {
|
|
1070
1071
|
year: "numeric",
|
|
1071
1072
|
month: "numeric",
|
|
1072
1073
|
day: "numeric",
|
|
@@ -1074,14 +1075,14 @@ var E = {
|
|
|
1074
1075
|
minute: "numeric",
|
|
1075
1076
|
second: "numeric"
|
|
1076
1077
|
};
|
|
1077
|
-
function
|
|
1078
|
+
function ee(e) {
|
|
1078
1079
|
return typeof e == "number" ? Number.isInteger(e) ? d(e) : d(e, { minimumFractionDigits: 1 }) : String(e);
|
|
1079
1080
|
}
|
|
1080
|
-
function
|
|
1081
|
+
function te(e) {
|
|
1081
1082
|
return e instanceof Date || typeof e == "string" ? u(e) : String(e);
|
|
1082
1083
|
}
|
|
1083
|
-
function
|
|
1084
|
-
return e instanceof Date || typeof e == "string" ? u(e,
|
|
1084
|
+
function ne(e) {
|
|
1085
|
+
return e instanceof Date || typeof e == "string" ? u(e, O) : String(e);
|
|
1085
1086
|
}
|
|
1086
1087
|
//#endregion
|
|
1087
1088
|
//#region src/locale.ts
|
|
@@ -1204,7 +1205,7 @@ k.register("en", {
|
|
|
1204
1205
|
var A = (e, t) => k.text(e, t);
|
|
1205
1206
|
//#endregion
|
|
1206
1207
|
//#region src/core/selection.ts
|
|
1207
|
-
function
|
|
1208
|
+
function re(e) {
|
|
1208
1209
|
return {
|
|
1209
1210
|
startRow: Math.min(e.startRow, e.endRow),
|
|
1210
1211
|
startCol: Math.min(e.startCol, e.endCol),
|
|
@@ -1212,7 +1213,7 @@ function te(e) {
|
|
|
1212
1213
|
endCol: Math.max(e.startCol, e.endCol)
|
|
1213
1214
|
};
|
|
1214
1215
|
}
|
|
1215
|
-
var
|
|
1216
|
+
var ie = class {
|
|
1216
1217
|
constructor() {
|
|
1217
1218
|
this.activeCell = null, this.rangeAnchor = null, this.range = null, this.extraRanges = [], this._rowCount = 0, this._colCount = 0;
|
|
1218
1219
|
}
|
|
@@ -1239,7 +1240,7 @@ var ne = class {
|
|
|
1239
1240
|
return e < 0 || e >= this._rowCount || t < 0 || t >= this._colCount ? this.activeCell : (!this.rangeAnchor && this.activeCell && (this.rangeAnchor = { ...this.activeCell }), this.activeCell = {
|
|
1240
1241
|
row: e,
|
|
1241
1242
|
col: t
|
|
1242
|
-
}, this.rangeAnchor && (this.range =
|
|
1243
|
+
}, this.rangeAnchor && (this.range = re({
|
|
1243
1244
|
startRow: this.rangeAnchor.row,
|
|
1244
1245
|
startCol: this.rangeAnchor.col,
|
|
1245
1246
|
endRow: e,
|
|
@@ -1310,7 +1311,7 @@ var ne = class {
|
|
|
1310
1311
|
shiftMoveRight() {
|
|
1311
1312
|
return this.activeCell ? this.setActiveWithRange(this.activeCell.row, this.activeCell.col + 1) : null;
|
|
1312
1313
|
}
|
|
1313
|
-
},
|
|
1314
|
+
}, ae = class {
|
|
1314
1315
|
constructor() {
|
|
1315
1316
|
this.current = null;
|
|
1316
1317
|
}
|
|
@@ -1392,7 +1393,7 @@ var ne = class {
|
|
|
1392
1393
|
};
|
|
1393
1394
|
//#endregion
|
|
1394
1395
|
//#region src/core/filtering.ts
|
|
1395
|
-
function
|
|
1396
|
+
function oe(e, t, n) {
|
|
1396
1397
|
if (t.length === 0) return Array.from({ length: e.length }, (e, t) => t);
|
|
1397
1398
|
let r = [];
|
|
1398
1399
|
for (let i = 0; i < e.length; i++) {
|
|
@@ -1411,9 +1412,9 @@ function ie(e, t, n) {
|
|
|
1411
1412
|
}
|
|
1412
1413
|
//#endregion
|
|
1413
1414
|
//#region src/core/undo.ts
|
|
1414
|
-
var
|
|
1415
|
+
var se = 100, ce = class {
|
|
1415
1416
|
constructor() {
|
|
1416
|
-
this._undoStack = [], this._redoStack = [], this._maxSize =
|
|
1417
|
+
this._undoStack = [], this._redoStack = [], this._maxSize = se;
|
|
1417
1418
|
}
|
|
1418
1419
|
get maxSize() {
|
|
1419
1420
|
return this._maxSize;
|
|
@@ -1450,7 +1451,7 @@ var ae = 100, M = class {
|
|
|
1450
1451
|
};
|
|
1451
1452
|
//#endregion
|
|
1452
1453
|
//#region src/clipboard/clipboard.ts
|
|
1453
|
-
function
|
|
1454
|
+
function le(e, t, n) {
|
|
1454
1455
|
let r = [];
|
|
1455
1456
|
for (let i = n.startRow; i <= n.endRow; i++) {
|
|
1456
1457
|
let a = e[i], o = [];
|
|
@@ -1462,7 +1463,7 @@ function oe(e, t, n) {
|
|
|
1462
1463
|
}
|
|
1463
1464
|
return g(r);
|
|
1464
1465
|
}
|
|
1465
|
-
function
|
|
1466
|
+
function M(e, t) {
|
|
1466
1467
|
if (e === "") return null;
|
|
1467
1468
|
switch (t.type) {
|
|
1468
1469
|
case "number": {
|
|
@@ -1477,19 +1478,19 @@ function N(e, t) {
|
|
|
1477
1478
|
default: return e;
|
|
1478
1479
|
}
|
|
1479
1480
|
}
|
|
1480
|
-
function
|
|
1481
|
+
function N(e) {
|
|
1481
1482
|
let t = String(e);
|
|
1482
1483
|
if (!Number.isFinite(e) || t.includes("e")) return t;
|
|
1483
1484
|
let n = new Intl.NumberFormat(l.get()).formatToParts(1.5).find((e) => e.type === "decimal")?.value;
|
|
1484
1485
|
return n && n !== "." ? t.replace(".", n) : t;
|
|
1485
1486
|
}
|
|
1486
|
-
function
|
|
1487
|
+
function ue(e) {
|
|
1487
1488
|
if (e == null || e === "") return "";
|
|
1488
1489
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? "" : `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
1489
1490
|
let t = String(e), n = /^(\d{4}-\d{2}-\d{2})(?:$|T)/.exec(t);
|
|
1490
1491
|
return n ? n[1] : t;
|
|
1491
1492
|
}
|
|
1492
|
-
function
|
|
1493
|
+
function de(e) {
|
|
1493
1494
|
if (e == null || e === "") return "";
|
|
1494
1495
|
let t = e instanceof Date ? "" : String(e), n = /^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})(?::\d{2}(?:\.\d+)?)?$/.exec(t);
|
|
1495
1496
|
if (n) return `${n[1]} ${n[2]}`;
|
|
@@ -1500,7 +1501,7 @@ function le(e) {
|
|
|
1500
1501
|
}
|
|
1501
1502
|
//#endregion
|
|
1502
1503
|
//#region src/export/xlsx-writer.ts
|
|
1503
|
-
var
|
|
1504
|
+
var fe = (() => {
|
|
1504
1505
|
let e = /* @__PURE__ */ new Uint32Array(256);
|
|
1505
1506
|
for (let t = 0; t < 256; t++) {
|
|
1506
1507
|
let n = t;
|
|
@@ -1509,23 +1510,23 @@ var ue = (() => {
|
|
|
1509
1510
|
}
|
|
1510
1511
|
return e;
|
|
1511
1512
|
})();
|
|
1512
|
-
function
|
|
1513
|
+
function pe(e) {
|
|
1513
1514
|
let t = 4294967295;
|
|
1514
|
-
for (let n = 0; n < e.length; n++) t =
|
|
1515
|
+
for (let n = 0; n < e.length; n++) t = fe[(t ^ e[n]) & 255] ^ t >>> 8;
|
|
1515
1516
|
return (t ^ 4294967295) >>> 0;
|
|
1516
1517
|
}
|
|
1517
1518
|
var P = new TextEncoder();
|
|
1518
|
-
function
|
|
1519
|
+
function me(e) {
|
|
1519
1520
|
return F(e.map((e) => ({
|
|
1520
1521
|
...e,
|
|
1521
1522
|
body: e.data,
|
|
1522
1523
|
method: 0
|
|
1523
1524
|
})));
|
|
1524
1525
|
}
|
|
1525
|
-
async function
|
|
1526
|
+
async function he(e) {
|
|
1526
1527
|
let t = [];
|
|
1527
1528
|
for (let n of e) {
|
|
1528
|
-
let e = await
|
|
1529
|
+
let e = await ge(n.data);
|
|
1529
1530
|
t.push(e.length < n.data.length ? {
|
|
1530
1531
|
...n,
|
|
1531
1532
|
body: e,
|
|
@@ -1538,7 +1539,7 @@ async function pe(e) {
|
|
|
1538
1539
|
}
|
|
1539
1540
|
return F(t);
|
|
1540
1541
|
}
|
|
1541
|
-
async function
|
|
1542
|
+
async function ge(e) {
|
|
1542
1543
|
let t = new CompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
|
|
1543
1544
|
n.write(e), n.close();
|
|
1544
1545
|
let i = [];
|
|
@@ -1552,7 +1553,7 @@ async function me(e) {
|
|
|
1552
1553
|
function F(e) {
|
|
1553
1554
|
let t = [], n = [], r = 0;
|
|
1554
1555
|
for (let i of e) {
|
|
1555
|
-
let e = P.encode(i.name), a =
|
|
1556
|
+
let e = P.encode(i.name), a = pe(i.data), o = i.data.length, s = i.body.length, c = i.method === 8 ? 20 : 10, l = new ArrayBuffer(30 + e.length), u = new DataView(l);
|
|
1556
1557
|
u.setUint32(0, 67324752, !0), u.setUint16(4, c, !0), u.setUint16(6, 0, !0), u.setUint16(8, i.method, !0), u.setUint16(10, 0, !0), u.setUint16(12, 33, !0), u.setUint32(14, a, !0), u.setUint32(18, s, !0), u.setUint32(22, o, !0), u.setUint16(26, e.length, !0), u.setUint16(28, 0, !0), new Uint8Array(l, 30).set(e), t.push(new Uint8Array(l)), t.push(i.body);
|
|
1557
1558
|
let d = new ArrayBuffer(46 + e.length), f = new DataView(d);
|
|
1558
1559
|
f.setUint32(0, 33639248, !0), f.setUint16(4, 20, !0), f.setUint16(6, c, !0), f.setUint16(8, 0, !0), f.setUint16(10, i.method, !0), f.setUint16(12, 0, !0), f.setUint16(14, 33, !0), f.setUint32(16, a, !0), f.setUint32(20, s, !0), f.setUint32(24, o, !0), f.setUint16(28, e.length, !0), f.setUint16(30, 0, !0), f.setUint16(32, 0, !0), f.setUint16(34, 0, !0), f.setUint16(36, 0, !0), f.setUint32(38, 0, !0), f.setUint32(42, r, !0), new Uint8Array(d, 46).set(e), n.push(new Uint8Array(d)), r += 30 + e.length + s;
|
|
@@ -1572,27 +1573,27 @@ function I(e) {
|
|
|
1572
1573
|
function L(e) {
|
|
1573
1574
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1574
1575
|
}
|
|
1575
|
-
function
|
|
1576
|
+
function _e(e) {
|
|
1576
1577
|
let t = "";
|
|
1577
1578
|
for (e++; e > 0;) t = String.fromCharCode(64 + (e % 26 || 26)) + t, e = Math.floor((e - 1) / 26);
|
|
1578
1579
|
return t;
|
|
1579
1580
|
}
|
|
1580
1581
|
function R(e, t) {
|
|
1581
|
-
return
|
|
1582
|
+
return _e(t) + (e + 1);
|
|
1582
1583
|
}
|
|
1583
|
-
function
|
|
1584
|
+
function ve(e) {
|
|
1584
1585
|
let t = Date.UTC(1899, 11, 30);
|
|
1585
1586
|
return (e.getTime() - t) / 864e5;
|
|
1586
1587
|
}
|
|
1587
|
-
var
|
|
1588
|
-
function
|
|
1588
|
+
var ye = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\n <Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/>\n <Default Extension=\"xml\" ContentType=\"application/xml\"/>\n <Override PartName=\"/xl/workbook.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\"/>\n <Override PartName=\"/xl/worksheets/sheet1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\"/>\n <Override PartName=\"/xl/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\"/>\n</Types>", be = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n <Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"xl/workbook.xml\"/>\n</Relationships>", xe = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<workbook xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">\n <sheets><sheet name=\"Sheet1\" sheetId=\"1\" r:id=\"rId1\"/></sheets>\n</workbook>", Se = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\n <Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\" Target=\"worksheets/sheet1.xml\"/>\n <Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\"/>\n</Relationships>", Ce = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<styleSheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\">\n <numFmts count=\"1\"><numFmt numFmtId=\"164\" formatCode=\"yyyy-mm-dd\"/></numFmts>\n <fonts count=\"2\">\n <font><sz val=\"11\"/><name val=\"Calibri\"/></font>\n <font><sz val=\"11\"/><b/><name val=\"Calibri\"/></font>\n </fonts>\n <fills count=\"2\">\n <fill><patternFill patternType=\"none\"/></fill>\n <fill><patternFill patternType=\"gray125\"/></fill>\n </fills>\n <borders count=\"1\"><border><left/><right/><top/><bottom/><diagonal/></border></borders>\n <cellStyleXfs count=\"1\"><xf numFmtId=\"0\" fontId=\"0\" fillId=\"0\" borderId=\"0\"/></cellStyleXfs>\n <cellXfs count=\"3\">\n <xf numFmtId=\"0\" fontId=\"0\" fillId=\"0\" borderId=\"0\" xfId=\"0\"/>\n <xf numFmtId=\"164\" fontId=\"0\" fillId=\"0\" borderId=\"0\" xfId=\"0\" applyNumberFormat=\"1\"/>\n <xf numFmtId=\"0\" fontId=\"1\" fillId=\"0\" borderId=\"0\" xfId=\"0\" applyFont=\"1\"/>\n </cellXfs>\n</styleSheet>";
|
|
1589
|
+
function we(e, t) {
|
|
1589
1590
|
let n = [], r = t.map((e, t) => `<c r="${R(0, t)}" t="str" s="2"><v>${L(e.label)}</v></c>`);
|
|
1590
1591
|
return n.push(`<row r="1">${r.join("")}</row>`), e.forEach((e, r) => {
|
|
1591
1592
|
let i = t.map((t, n) => {
|
|
1592
1593
|
let i = R(r + 1, n), a = e[t.key];
|
|
1593
1594
|
if (a == null) return `<c r="${i}" t="str"><v></v></c>`;
|
|
1594
1595
|
let o = t.type ?? "text";
|
|
1595
|
-
return o === "number" && typeof a == "number" ? `<c r="${i}"><v>${a}</v></c>` : (o === "date" || o === "datetime") && a instanceof Date ? `<c r="${i}" s="1"><v>${
|
|
1596
|
+
return o === "number" && typeof a == "number" ? `<c r="${i}"><v>${a}</v></c>` : (o === "date" || o === "datetime") && a instanceof Date ? `<c r="${i}" s="1"><v>${ve(a).toFixed(6)}</v></c>` : o === "boolean" ? `<c r="${i}" t="b"><v>${+!!a}</v></c>` : `<c r="${i}" t="str"><v>${L(String(a))}</v></c>`;
|
|
1596
1597
|
});
|
|
1597
1598
|
n.push(`<row r="${r + 2}">${i.join("")}</row>`);
|
|
1598
1599
|
}), `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
@@ -1600,30 +1601,30 @@ function Se(e, t) {
|
|
|
1600
1601
|
<sheetData>${n.join("")}</sheetData>
|
|
1601
1602
|
</worksheet>`;
|
|
1602
1603
|
}
|
|
1603
|
-
function
|
|
1604
|
-
return
|
|
1604
|
+
function Te(e, t) {
|
|
1605
|
+
return me(z(e, t));
|
|
1605
1606
|
}
|
|
1606
|
-
function
|
|
1607
|
-
return
|
|
1607
|
+
function Ee(e, t) {
|
|
1608
|
+
return he(z(e, t));
|
|
1608
1609
|
}
|
|
1609
1610
|
function z(e, t) {
|
|
1610
|
-
let n =
|
|
1611
|
+
let n = we(e, t);
|
|
1611
1612
|
return [
|
|
1612
1613
|
{
|
|
1613
1614
|
name: "[Content_Types].xml",
|
|
1614
|
-
data: P.encode(
|
|
1615
|
+
data: P.encode(ye)
|
|
1615
1616
|
},
|
|
1616
1617
|
{
|
|
1617
1618
|
name: "_rels/.rels",
|
|
1618
|
-
data: P.encode(
|
|
1619
|
+
data: P.encode(be)
|
|
1619
1620
|
},
|
|
1620
1621
|
{
|
|
1621
1622
|
name: "xl/workbook.xml",
|
|
1622
|
-
data: P.encode(
|
|
1623
|
+
data: P.encode(xe)
|
|
1623
1624
|
},
|
|
1624
1625
|
{
|
|
1625
1626
|
name: "xl/_rels/workbook.xml.rels",
|
|
1626
|
-
data: P.encode(
|
|
1627
|
+
data: P.encode(Se)
|
|
1627
1628
|
},
|
|
1628
1629
|
{
|
|
1629
1630
|
name: "xl/worksheets/sheet1.xml",
|
|
@@ -1631,7 +1632,7 @@ function z(e, t) {
|
|
|
1631
1632
|
},
|
|
1632
1633
|
{
|
|
1633
1634
|
name: "xl/styles.xml",
|
|
1634
|
-
data: P.encode(
|
|
1635
|
+
data: P.encode(Ce)
|
|
1635
1636
|
}
|
|
1636
1637
|
];
|
|
1637
1638
|
}
|
|
@@ -1641,24 +1642,24 @@ function B(e, t, n) {
|
|
|
1641
1642
|
switch (n) {
|
|
1642
1643
|
case "csv": return V(e, t, ",");
|
|
1643
1644
|
case "tsv": return V(e, t, " ");
|
|
1644
|
-
case "json": return
|
|
1645
|
-
case "xlsx": return
|
|
1645
|
+
case "json": return ke(e, t);
|
|
1646
|
+
case "xlsx": return Te(e, t);
|
|
1646
1647
|
}
|
|
1647
1648
|
}
|
|
1648
|
-
async function
|
|
1649
|
-
let r = n === "xlsx" ? await
|
|
1650
|
-
return new Blob([r], { type:
|
|
1649
|
+
async function De(e, t, n) {
|
|
1650
|
+
let r = n === "xlsx" ? await Ee(e, t) : B(e, t, n);
|
|
1651
|
+
return new Blob([r], { type: Ne(n) });
|
|
1651
1652
|
}
|
|
1652
|
-
function
|
|
1653
|
+
function Oe(e, t) {
|
|
1653
1654
|
return e == null ? "" : (t.type === "date" || t.type === "datetime") && e instanceof Date ? e.toISOString() : String(e);
|
|
1654
1655
|
}
|
|
1655
1656
|
function V(e, t, n) {
|
|
1656
|
-
return [t.map((e) => H(e.label, n)).join(n), ...e.map((e) => t.map((t) => H(
|
|
1657
|
+
return [t.map((e) => H(e.label, n)).join(n), ...e.map((e) => t.map((t) => H(Oe(e[t.key], t), n)).join(n))].join("\n");
|
|
1657
1658
|
}
|
|
1658
1659
|
function H(e, t) {
|
|
1659
1660
|
return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? "\"" + e.replace(/"/g, "\"\"") + "\"" : e;
|
|
1660
1661
|
}
|
|
1661
|
-
function
|
|
1662
|
+
function ke(e, t) {
|
|
1662
1663
|
let n = e.map((e) => {
|
|
1663
1664
|
let n = {};
|
|
1664
1665
|
for (let r of t) {
|
|
@@ -1669,35 +1670,35 @@ function De(e, t) {
|
|
|
1669
1670
|
});
|
|
1670
1671
|
return JSON.stringify(n, null, 2);
|
|
1671
1672
|
}
|
|
1672
|
-
function
|
|
1673
|
+
function Ae(e, t) {
|
|
1673
1674
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
1674
1675
|
r.href = n, r.download = t, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), setTimeout(() => URL.revokeObjectURL(n), 100);
|
|
1675
1676
|
}
|
|
1676
|
-
var
|
|
1677
|
+
var je = {
|
|
1677
1678
|
csv: "text/csv;charset=utf-8",
|
|
1678
1679
|
tsv: "text/tab-separated-values;charset=utf-8",
|
|
1679
1680
|
json: "application/json;charset=utf-8",
|
|
1680
1681
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
1681
|
-
},
|
|
1682
|
+
}, Me = {
|
|
1682
1683
|
csv: ".csv",
|
|
1683
1684
|
tsv: ".tsv",
|
|
1684
1685
|
json: ".json",
|
|
1685
1686
|
xlsx: ".xlsx"
|
|
1686
1687
|
};
|
|
1687
|
-
function
|
|
1688
|
-
return
|
|
1688
|
+
function Ne(e) {
|
|
1689
|
+
return je[e];
|
|
1689
1690
|
}
|
|
1690
|
-
function
|
|
1691
|
-
return
|
|
1691
|
+
function Pe(e) {
|
|
1692
|
+
return Me[e];
|
|
1692
1693
|
}
|
|
1693
1694
|
//#endregion
|
|
1694
1695
|
//#region src/export/xlsx-reader.ts
|
|
1695
|
-
function
|
|
1696
|
+
function Fe(e) {
|
|
1696
1697
|
for (let t = e.byteLength - 22; t >= 0; t--) if (e.getUint32(t, !0) === 101010256) return t;
|
|
1697
1698
|
throw Error("XLSX: End of central directory not found — not a valid ZIP file");
|
|
1698
1699
|
}
|
|
1699
|
-
function
|
|
1700
|
-
let t =
|
|
1700
|
+
function Ie(e) {
|
|
1701
|
+
let t = Fe(e), n = e.getUint32(t + 16, !0), r = e.getUint32(t + 12, !0), i = new TextDecoder("utf-8"), a = [], o = n, s = n + r;
|
|
1701
1702
|
for (; o < s && e.getUint32(o, !0) === 33639248;) {
|
|
1702
1703
|
let t = e.getUint16(o + 10, !0), n = e.getUint32(o + 20, !0), r = e.getUint32(o + 24, !0), s = e.getUint16(o + 28, !0), c = e.getUint16(o + 30, !0), l = e.getUint16(o + 32, !0), u = e.getUint32(o + 42, !0), d = i.decode(new Uint8Array(e.buffer, o + 46, s));
|
|
1703
1704
|
a.push({
|
|
@@ -1710,7 +1711,7 @@ function Pe(e) {
|
|
|
1710
1711
|
}
|
|
1711
1712
|
return a;
|
|
1712
1713
|
}
|
|
1713
|
-
async function
|
|
1714
|
+
async function Le(e) {
|
|
1714
1715
|
let t = new DecompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
|
|
1715
1716
|
n.write(e), n.close();
|
|
1716
1717
|
let i = [];
|
|
@@ -1723,28 +1724,28 @@ async function Fe(e) {
|
|
|
1723
1724
|
for (let e of i) o.set(e, s), s += e.length;
|
|
1724
1725
|
return o;
|
|
1725
1726
|
}
|
|
1726
|
-
async function
|
|
1727
|
+
async function Re(e, t) {
|
|
1727
1728
|
let n = t.localHeaderOffset, r = e.getUint16(n + 26, !0), i = e.getUint16(n + 28, !0), a = n + 30 + r + i, o = new Uint8Array(e.buffer, a, t.compressedSize);
|
|
1728
1729
|
if (t.compressionMethod === 0) return o.slice();
|
|
1729
|
-
if (t.compressionMethod === 8) return
|
|
1730
|
+
if (t.compressionMethod === 8) return Le(o);
|
|
1730
1731
|
throw Error(`XLSX: Unsupported compression method ${t.compressionMethod}`);
|
|
1731
1732
|
}
|
|
1732
|
-
async function
|
|
1733
|
-
let t = new DataView(e), n =
|
|
1734
|
-
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await
|
|
1733
|
+
async function ze(e) {
|
|
1734
|
+
let t = new DataView(e), n = Ie(t), r = /* @__PURE__ */ new Map();
|
|
1735
|
+
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await Re(t, e));
|
|
1735
1736
|
return r;
|
|
1736
1737
|
}
|
|
1737
|
-
var
|
|
1738
|
+
var Be = new TextDecoder("utf-8");
|
|
1738
1739
|
function U(e) {
|
|
1739
|
-
let t =
|
|
1740
|
+
let t = Be.decode(e);
|
|
1740
1741
|
return new DOMParser().parseFromString(t, "application/xml");
|
|
1741
1742
|
}
|
|
1742
|
-
function
|
|
1743
|
+
function Ve(e) {
|
|
1743
1744
|
if (!e) return [];
|
|
1744
1745
|
let t = U(e);
|
|
1745
1746
|
return Array.from(t.querySelectorAll("si")).map((e) => Array.from(e.querySelectorAll("t")).map((e) => e.textContent ?? "").join(""));
|
|
1746
1747
|
}
|
|
1747
|
-
var
|
|
1748
|
+
var He = /* @__PURE__ */ new Set([
|
|
1748
1749
|
14,
|
|
1749
1750
|
15,
|
|
1750
1751
|
16,
|
|
@@ -1764,29 +1765,29 @@ var Be = /* @__PURE__ */ new Set([
|
|
|
1764
1765
|
57,
|
|
1765
1766
|
58
|
|
1766
1767
|
]);
|
|
1767
|
-
function
|
|
1768
|
+
function Ue(e) {
|
|
1768
1769
|
let t = e.replace(/"[^"]*"/g, "").replace(/\\./g, "").replace(/\[[^\]]*\]/g, "").split(";")[0];
|
|
1769
1770
|
return /[dy]/i.test(t);
|
|
1770
1771
|
}
|
|
1771
|
-
function
|
|
1772
|
+
function We(e) {
|
|
1772
1773
|
let t = /* @__PURE__ */ new Set();
|
|
1773
1774
|
if (!e) return t;
|
|
1774
1775
|
let n = U(e), r = /* @__PURE__ */ new Map();
|
|
1775
1776
|
for (let e of Array.from(n.querySelectorAll("numFmts > numFmt"))) r.set(parseInt(e.getAttribute("numFmtId") ?? "", 10), e.getAttribute("formatCode") ?? "");
|
|
1776
1777
|
return Array.from(n.querySelectorAll("cellXfs > xf")).forEach((e, n) => {
|
|
1777
1778
|
let i = parseInt(e.getAttribute("numFmtId") ?? "0", 10), a = r.get(i);
|
|
1778
|
-
(a === void 0 ?
|
|
1779
|
+
(a === void 0 ? He.has(i) : Ue(a)) && t.add(n);
|
|
1779
1780
|
}), t;
|
|
1780
1781
|
}
|
|
1781
|
-
function
|
|
1782
|
+
function Ge(e) {
|
|
1782
1783
|
if (!e) return !1;
|
|
1783
1784
|
let t = U(e).querySelector("workbookPr")?.getAttribute("date1904");
|
|
1784
1785
|
return t === "1" || t === "true";
|
|
1785
1786
|
}
|
|
1786
|
-
function
|
|
1787
|
+
function Ke(e, t) {
|
|
1787
1788
|
return new Date((t ? Date.UTC(1904, 0, 1) : Date.UTC(1899, 11, 30)) + Math.floor(e) * 864e5).toISOString().slice(0, 10);
|
|
1788
1789
|
}
|
|
1789
|
-
function
|
|
1790
|
+
function qe(e, t, n, r) {
|
|
1790
1791
|
let i = U(e).querySelectorAll("row");
|
|
1791
1792
|
if (i.length === 0) return [];
|
|
1792
1793
|
let a = 0, o = /* @__PURE__ */ new Map();
|
|
@@ -1794,7 +1795,7 @@ function Ge(e, t, n, r) {
|
|
|
1794
1795
|
let i = parseInt(e.getAttribute("r") ?? "1", 10) - 1, s = /* @__PURE__ */ new Map();
|
|
1795
1796
|
o.set(i, s);
|
|
1796
1797
|
for (let i of e.querySelectorAll("c")) {
|
|
1797
|
-
let e =
|
|
1798
|
+
let e = Je(i.getAttribute("r") ?? "");
|
|
1798
1799
|
e > a && (a = e);
|
|
1799
1800
|
let o = i.getAttribute("t") ?? "", c = i.getAttribute("s") ?? "", l = i.querySelector("v")?.textContent ?? "", u = i.querySelector("is > t")?.textContent ?? null, d;
|
|
1800
1801
|
if (o === "s") d = t[parseInt(l, 10)] ?? "";
|
|
@@ -1803,7 +1804,7 @@ function Ge(e, t, n, r) {
|
|
|
1803
1804
|
else if (l === "") d = "";
|
|
1804
1805
|
else {
|
|
1805
1806
|
let e = parseFloat(l);
|
|
1806
|
-
d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ?
|
|
1807
|
+
d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ? Ke(e, r) : l;
|
|
1807
1808
|
}
|
|
1808
1809
|
s.set(e, d);
|
|
1809
1810
|
}
|
|
@@ -1817,13 +1818,13 @@ function Ge(e, t, n, r) {
|
|
|
1817
1818
|
}
|
|
1818
1819
|
return c;
|
|
1819
1820
|
}
|
|
1820
|
-
function
|
|
1821
|
+
function Je(e) {
|
|
1821
1822
|
let t = 0, n = 0;
|
|
1822
1823
|
for (; n < e.length && e[n] >= "A" && e[n] <= "Z";) t = t * 26 + (e.charCodeAt(n) - 64), n++;
|
|
1823
1824
|
return t - 1;
|
|
1824
1825
|
}
|
|
1825
|
-
async function
|
|
1826
|
-
let t = await
|
|
1826
|
+
async function Ye(e) {
|
|
1827
|
+
let t = await ze(e), n = Ve(t.get("xl/sharedStrings.xml")), r = t.get("xl/worksheets/sheet1.xml");
|
|
1827
1828
|
if (!r) {
|
|
1828
1829
|
for (let [e, n] of t) if (e.toLowerCase().includes("worksheets/sheet")) {
|
|
1829
1830
|
r = n;
|
|
@@ -1831,7 +1832,7 @@ async function qe(e) {
|
|
|
1831
1832
|
}
|
|
1832
1833
|
}
|
|
1833
1834
|
if (!r) throw Error("XLSX: No worksheet found");
|
|
1834
|
-
let i =
|
|
1835
|
+
let i = We(t.get("xl/styles.xml")), a = Ge(t.get("xl/workbook.xml")), o = qe(r, n, i, a);
|
|
1835
1836
|
return o.length === 0 ? {
|
|
1836
1837
|
headers: [],
|
|
1837
1838
|
rows: []
|
|
@@ -1855,21 +1856,21 @@ function G(e, t, n, r) {
|
|
|
1855
1856
|
}
|
|
1856
1857
|
//#endregion
|
|
1857
1858
|
//#region src/flex-table.ts
|
|
1858
|
-
var K = {
|
|
1859
|
+
var K = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable, q = {
|
|
1859
1860
|
eq: "=",
|
|
1860
1861
|
neq: "≠",
|
|
1861
1862
|
gt: ">",
|
|
1862
1863
|
lt: "<",
|
|
1863
1864
|
gte: "≥",
|
|
1864
1865
|
lte: "≤"
|
|
1865
|
-
},
|
|
1866
|
+
}, J = 120, Y = 40, X = 20, Xe = 32, Z = 5, Ze = 200, Q = class extends n {
|
|
1866
1867
|
constructor(...e) {
|
|
1867
|
-
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this._rowHeightFromCss =
|
|
1868
|
+
super(...e), this.columns = [], this._data = [], this._inUndoRedo = !1, this.clearUndoOnDataChange = !1, this.clearSelectionOnDataChange = !1, this._rowHeightFromCss = Xe, this._targetFloor = 0, this.showRowNumbers = !1, this.theme = void 0, this.maxRows = 0, this.editable = !0, this.showFilters = !1, this.showContextMenu = !1, this.frozenRows = 0, this.emptyMessage = "No data", this.noMatchingMessage = "No matching data", this.loading = !1, this.importEnabled = !1, this.selectable = !1, this.dataMode = "client", this.footerData = null, this.stylesheets = [], this._scrollTop = 0, this._scrollLeft = 0, this._viewportHeight = 0, this._viewportWidth = 0, this._colLeftOffsets = [], this._totalRowWidth = 0, this._baseStyleSheets = [], this._activeCell = null, this._editingCell = null, this._sortCriteria = [], this._selection = new ie(), this._editing = new ae(), this._rowSelection = new j(), this._undo = new ce(), this._filters = [], this._filteredIndices = [], this._sortedIndices = [], this._openFilterKey = null, this._rowSelectionVersion = 0, this._lastCheckboxRowIndex = null, this._checkboxShiftPending = !1, this._autocompleteState = null, this._headerMenu = null, this._bodyContextMenu = null, this._commentPopup = null, this._viewDirty = !0, this._isDragging = !1, this._wasDrag = !1, this._resizing = null, this._resizeCleanup = null, this._wasHeaderDrag = !1, this._wasRowDrag = !1, this._colDrag = null, this._colDragIndicatorLeft = null, this._fillDrag = null, this._rowDrag = null, this._rowDragIndicatorY = null, this._findState = null, this._columnWidths = /* @__PURE__ */ new Map(), this._hostResizeObserver = null, this._comments = /* @__PURE__ */ new Map(), this._isDragOver = !1, this._warnedUnconstrained = !1, this._onCommentPopupOutsideClick = () => {
|
|
1868
1869
|
this._commitCommentPopup();
|
|
1869
1870
|
}, this._invalidCells = /* @__PURE__ */ new Map(), this._textFilterState = /* @__PURE__ */ new Map(), this._numberFilterState = /* @__PURE__ */ new Map(), this._dateFilterState = /* @__PURE__ */ new Map(), this._emptyFilterState = /* @__PURE__ */ new Map();
|
|
1870
1871
|
}
|
|
1871
1872
|
static {
|
|
1872
|
-
this.styles =
|
|
1873
|
+
this.styles = b;
|
|
1873
1874
|
}
|
|
1874
1875
|
get data() {
|
|
1875
1876
|
return this._data;
|
|
@@ -1879,7 +1880,7 @@ var K = {
|
|
|
1879
1880
|
this._data = e, n && !this._inUndoRedo && (this.clearUndoOnDataChange && this._undo.clear(), this.clearSelectionOnDataChange && this._rowSelection.selectedCount > 0 && (this._rowSelection.deselectAll(), this._rowSelectionVersion++, this._dispatchRowSelectionEvent())), this.requestUpdate("data", t);
|
|
1880
1881
|
}
|
|
1881
1882
|
get rowHeight() {
|
|
1882
|
-
let e = this._rowHeightExplicit ?? this._rowHeightFromCss ??
|
|
1883
|
+
let e = this._rowHeightExplicit ?? this._rowHeightFromCss ?? Xe;
|
|
1883
1884
|
return Math.max(e, this._targetFloor);
|
|
1884
1885
|
}
|
|
1885
1886
|
set rowHeight(e) {
|
|
@@ -2236,10 +2237,10 @@ var K = {
|
|
|
2236
2237
|
rows: [],
|
|
2237
2238
|
cols: []
|
|
2238
2239
|
};
|
|
2239
|
-
return
|
|
2240
|
+
return De(n.rows, n.cols, e);
|
|
2240
2241
|
}
|
|
2241
2242
|
async exportToFile(e, t) {
|
|
2242
|
-
|
|
2243
|
+
Ae(await this.exportToBlob(e), t ?? `export${Pe(e)}`);
|
|
2243
2244
|
}
|
|
2244
2245
|
_exportSlice(e) {
|
|
2245
2246
|
if (e?.selectionOnly) {
|
|
@@ -2312,7 +2313,7 @@ var K = {
|
|
|
2312
2313
|
async importFromFile(e) {
|
|
2313
2314
|
let t = e.name.toLowerCase();
|
|
2314
2315
|
if (t.endsWith(".xlsx")) {
|
|
2315
|
-
let t = await
|
|
2316
|
+
let t = await Ye(await e.arrayBuffer());
|
|
2316
2317
|
this._applyImportedSheet(t);
|
|
2317
2318
|
} else if (t.endsWith(".csv") || t.endsWith(".tsv")) {
|
|
2318
2319
|
let t = await e.text(), n = h(t);
|
|
@@ -2326,7 +2327,7 @@ var K = {
|
|
|
2326
2327
|
let a = t.get(e);
|
|
2327
2328
|
if (!a) return;
|
|
2328
2329
|
let o = this.columns.find((e) => e.key === a);
|
|
2329
|
-
r[a] = o ?
|
|
2330
|
+
r[a] = o ? M(n[i] ?? "", o) : n[i] ?? null;
|
|
2330
2331
|
}), r;
|
|
2331
2332
|
}), r = [...this.data];
|
|
2332
2333
|
this.data = n, this._undo.push({
|
|
@@ -2351,7 +2352,7 @@ var K = {
|
|
|
2351
2352
|
let a = n.get(t);
|
|
2352
2353
|
if (!a) return;
|
|
2353
2354
|
let o = this.columns.find((e) => e.key === a);
|
|
2354
|
-
r[a] = o ?
|
|
2355
|
+
r[a] = o ? M(e[i] ?? "", o) : e[i] ?? null;
|
|
2355
2356
|
}), r;
|
|
2356
2357
|
}), i = [...this.data];
|
|
2357
2358
|
this.data = r, this._undo.push({
|
|
@@ -2404,8 +2405,8 @@ var K = {
|
|
|
2404
2405
|
return this._columnWidths.get(e);
|
|
2405
2406
|
}
|
|
2406
2407
|
_getColWidth(e) {
|
|
2407
|
-
let t = this._columnWidths.get(e.key) ?? e.width ??
|
|
2408
|
-
return Math.max(t, e.minWidth ??
|
|
2408
|
+
let t = this._columnWidths.get(e.key) ?? e.width ?? J;
|
|
2409
|
+
return Math.max(t, e.minWidth ?? Y);
|
|
2409
2410
|
}
|
|
2410
2411
|
get headerHeight() {
|
|
2411
2412
|
return this.rowHeight + 8;
|
|
@@ -2504,7 +2505,7 @@ var K = {
|
|
|
2504
2505
|
this._filteredIndices = Array.from({ length: this.data.length }, (e, t) => t), this._sortedIndices = this._filteredIndices;
|
|
2505
2506
|
return;
|
|
2506
2507
|
}
|
|
2507
|
-
if (this._filteredIndices =
|
|
2508
|
+
if (this._filteredIndices = oe(this.data, this._filters, (e, t, n) => {
|
|
2508
2509
|
this.dispatchEvent(new CustomEvent("filter-error", {
|
|
2509
2510
|
detail: {
|
|
2510
2511
|
error: e,
|
|
@@ -2543,7 +2544,7 @@ var K = {
|
|
|
2543
2544
|
e !== this._viewportHeight && (this._viewportHeight = e), t !== this._viewportWidth && (this._viewportWidth = t), this._warnIfUnconstrained();
|
|
2544
2545
|
}
|
|
2545
2546
|
_warnIfUnconstrained() {
|
|
2546
|
-
this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount <
|
|
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.`));
|
|
2547
2548
|
}
|
|
2548
2549
|
_onScroll() {
|
|
2549
2550
|
this._scrollTop = this.scrollTop, this._scrollLeft = this.scrollLeft;
|
|
@@ -2688,7 +2689,7 @@ var K = {
|
|
|
2688
2689
|
}
|
|
2689
2690
|
let t = this.shadowRoot?.querySelector(".ft-editor");
|
|
2690
2691
|
if (t) {
|
|
2691
|
-
let n =
|
|
2692
|
+
let n = M(t.value, e);
|
|
2692
2693
|
this._applyEdit(n);
|
|
2693
2694
|
} else this._cancelEdit();
|
|
2694
2695
|
}
|
|
@@ -2887,9 +2888,17 @@ var K = {
|
|
|
2887
2888
|
switch (e.key.toLowerCase()) {
|
|
2888
2889
|
case "z": return e.preventDefault(), e.shiftKey ? this.redo() : this.undo(), !0;
|
|
2889
2890
|
case "y": return e.preventDefault(), this.redo(), !0;
|
|
2890
|
-
case "c":
|
|
2891
|
-
case "x":
|
|
2892
|
-
|
|
2891
|
+
case "c":
|
|
2892
|
+
case "x": {
|
|
2893
|
+
if (K(e.composedPath()[0])) return !0;
|
|
2894
|
+
let t = this._selectionTsv();
|
|
2895
|
+
if (!t) return !0;
|
|
2896
|
+
let n = e.key.toLowerCase() === "x" && this.editable;
|
|
2897
|
+
return v(t.text).then((e) => {
|
|
2898
|
+
e ? this._afterCopy(t.range, t.text, n) : this._clipboardError("copy", /* @__PURE__ */ Error("The clipboard did not take the copied text"));
|
|
2899
|
+
}), !0;
|
|
2900
|
+
}
|
|
2901
|
+
case "v": return K(e.composedPath()[0]) || !this.editable || !this._activeCell || y().then((e) => this._pasteText(e), (e) => this._clipboardError("paste", e)), !0;
|
|
2893
2902
|
case "d": return e.preventDefault(), this.editable && this._handleFillDown(), !0;
|
|
2894
2903
|
case "r": return e.preventDefault(), this.editable && this._handleFillRight(), !0;
|
|
2895
2904
|
case "f": return e.preventDefault(), this._toggleFindPanel("find"), !0;
|
|
@@ -2901,12 +2910,12 @@ var K = {
|
|
|
2901
2910
|
if (!e.altKey || !this._activeCell || e.key !== "ArrowLeft" && e.key !== "ArrowRight") return !1;
|
|
2902
2911
|
e.preventDefault();
|
|
2903
2912
|
let n = t[this._activeCell.col];
|
|
2904
|
-
return n && this._resizeColumnBy(n.key, e.key === "ArrowRight" ?
|
|
2913
|
+
return n && this._resizeColumnBy(n.key, e.key === "ArrowRight" ? X : -20), !0;
|
|
2905
2914
|
}
|
|
2906
2915
|
_resizeColumnBy(e, t) {
|
|
2907
2916
|
let n = this.visibleColumns.findIndex((t) => t.key === e), r = this.visibleColumns[n];
|
|
2908
2917
|
if (!r) return;
|
|
2909
|
-
let i = this._columnWidths.get(r.key) ?? r.width ??
|
|
2918
|
+
let i = this._columnWidths.get(r.key) ?? r.width ?? J, a = r.minWidth ?? Y, o = Math.max(a, i + t);
|
|
2910
2919
|
this._columnWidths.set(r.key, o), this.requestUpdate(), this.dispatchEvent(new CustomEvent("column-resize", {
|
|
2911
2920
|
detail: {
|
|
2912
2921
|
key: r.key,
|
|
@@ -2932,35 +2941,47 @@ var K = {
|
|
|
2932
2941
|
default: return !1;
|
|
2933
2942
|
}
|
|
2934
2943
|
}
|
|
2935
|
-
|
|
2936
|
-
let
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2944
|
+
_selectionTsv() {
|
|
2945
|
+
let e = this._selection.getEffectiveRange();
|
|
2946
|
+
return e ? {
|
|
2947
|
+
range: e,
|
|
2948
|
+
text: le(this._sortedIndices.map((e) => this.data[e]), this.visibleColumns, e)
|
|
2949
|
+
} : null;
|
|
2950
|
+
}
|
|
2951
|
+
async _copyFromMenu() {
|
|
2952
|
+
let e = this._selectionTsv();
|
|
2953
|
+
if (e) {
|
|
2954
|
+
try {
|
|
2955
|
+
await navigator.clipboard.writeText(e.text);
|
|
2956
|
+
} catch (e) {
|
|
2957
|
+
this._clipboardError("copy", e);
|
|
2958
|
+
return;
|
|
2959
|
+
}
|
|
2960
|
+
this._afterCopy(e.range, e.text, !1);
|
|
2950
2961
|
}
|
|
2951
|
-
|
|
2962
|
+
}
|
|
2963
|
+
_clipboardError(e, t) {
|
|
2964
|
+
this.dispatchEvent(new CustomEvent("clipboard-error", {
|
|
2952
2965
|
detail: {
|
|
2953
|
-
|
|
2954
|
-
|
|
2966
|
+
action: e,
|
|
2967
|
+
error: t
|
|
2955
2968
|
},
|
|
2956
2969
|
bubbles: !0,
|
|
2957
2970
|
composed: !0
|
|
2958
2971
|
}));
|
|
2959
2972
|
}
|
|
2960
|
-
|
|
2973
|
+
_afterCopy(e, t, n) {
|
|
2974
|
+
n && this._clearRange(e), this.dispatchEvent(new CustomEvent(n ? "clipboard-cut" : "clipboard-copy", {
|
|
2975
|
+
detail: {
|
|
2976
|
+
range: e,
|
|
2977
|
+
text: t
|
|
2978
|
+
},
|
|
2979
|
+
bubbles: !0,
|
|
2980
|
+
composed: !0
|
|
2981
|
+
}));
|
|
2982
|
+
}
|
|
2983
|
+
_pasteText(e) {
|
|
2961
2984
|
if (!this._activeCell) return;
|
|
2962
|
-
let e = await this._readClipboardText();
|
|
2963
|
-
if (e == null) return;
|
|
2964
2985
|
let t = h(e);
|
|
2965
2986
|
if (t.length === 0) return;
|
|
2966
2987
|
let n = this._expandRowsForPaste(this._activeCell.row, t.length), r = this._applyPasteData(this._activeCell, t);
|
|
@@ -2988,20 +3009,6 @@ var K = {
|
|
|
2988
3009
|
composed: !0
|
|
2989
3010
|
}));
|
|
2990
3011
|
}
|
|
2991
|
-
async _readClipboardText() {
|
|
2992
|
-
try {
|
|
2993
|
-
return await navigator.clipboard.readText();
|
|
2994
|
-
} catch (e) {
|
|
2995
|
-
return this.dispatchEvent(new CustomEvent("clipboard-error", {
|
|
2996
|
-
detail: {
|
|
2997
|
-
action: "paste",
|
|
2998
|
-
error: e
|
|
2999
|
-
},
|
|
3000
|
-
bubbles: !0,
|
|
3001
|
-
composed: !0
|
|
3002
|
-
})), null;
|
|
3003
|
-
}
|
|
3004
|
-
}
|
|
3005
3012
|
_selectPastedRange(e, t) {
|
|
3006
3013
|
let n = Math.max(...t.map((e) => e.length)), r = Math.min(e.row + t.length, this._visibleRowCount) - 1, i = Math.min(e.col + n, this.visibleColumns.length) - 1;
|
|
3007
3014
|
(r !== e.row || i !== e.col) && (this._selection.setDimensions(this._visibleRowCount, this.visibleColumns.length), this._selection.setActive(e.row, e.col), this._selection.setActiveWithRange(r, i), this._activeCell = {
|
|
@@ -3026,7 +3033,7 @@ var K = {
|
|
|
3026
3033
|
for (let a = 0; a < t[i].length; a++) {
|
|
3027
3034
|
let s = e.col + a;
|
|
3028
3035
|
if (s >= n.length) break;
|
|
3029
|
-
let c = n[s], l = this.data[o][c.key], u =
|
|
3036
|
+
let c = n[s], l = this.data[o][c.key], u = M(t[i][a], c);
|
|
3030
3037
|
this.data[o][c.key] = u, r.push({
|
|
3031
3038
|
row: o,
|
|
3032
3039
|
col: s,
|
|
@@ -3091,7 +3098,7 @@ var K = {
|
|
|
3091
3098
|
for (let r = e.startCol + 1; r <= e.endCol; r++) {
|
|
3092
3099
|
let e = t[r];
|
|
3093
3100
|
if (!e || !this._isCellEditable(e)) continue;
|
|
3094
|
-
let a =
|
|
3101
|
+
let a = M(o == null ? "" : String(o), e);
|
|
3095
3102
|
n.push({
|
|
3096
3103
|
row: i,
|
|
3097
3104
|
key: e.key,
|
|
@@ -3400,7 +3407,7 @@ var K = {
|
|
|
3400
3407
|
${r.map((e) => c("show", A("showColumn", { header: e.label }), () => this._setColumnHidden(e.key, !1)))}
|
|
3401
3408
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3402
3409
|
${c("autofit", A("autoFitWidth"), () => this._autoFitColumn(e))}
|
|
3403
|
-
${c("wider", A("wider"), () => this._resizeColumnBy(e,
|
|
3410
|
+
${c("wider", A("wider"), () => this._resizeColumnBy(e, X), !0)}
|
|
3404
3411
|
${c("narrower", A("narrower"), () => this._resizeColumnBy(e, -20), !0)}
|
|
3405
3412
|
</div>
|
|
3406
3413
|
`;
|
|
@@ -3423,7 +3430,7 @@ var K = {
|
|
|
3423
3430
|
style="position: fixed; left: ${n}px; top: ${r}px; z-index: var(--u-layer-floating, 1000);"
|
|
3424
3431
|
@mousedown=${(e) => e.stopPropagation()}
|
|
3425
3432
|
@keydown=${(e) => this._onMenuKeydown(e, ".ft-body-context-menu", l)}>
|
|
3426
|
-
${d(A("copy"), () => this.
|
|
3433
|
+
${d(A("copy"), () => this._copyFromMenu())}
|
|
3427
3434
|
${f}
|
|
3428
3435
|
${d(A("insertRowAbove"), () => this.addRow(void 0, t))}
|
|
3429
3436
|
${d(A("insertRowBelow"), () => this.addRow(void 0, t + 1))}
|
|
@@ -3689,10 +3696,10 @@ var K = {
|
|
|
3689
3696
|
@keydown=${(e) => {
|
|
3690
3697
|
e.key === "Escape" && (this._openFilterKey = null), e.stopPropagation();
|
|
3691
3698
|
}}>
|
|
3692
|
-
${Object.keys(
|
|
3699
|
+
${Object.keys(q).map((e) => i`<option value=${e}>${q[e]}</option>`)}
|
|
3693
3700
|
</select>
|
|
3694
3701
|
<input class="ft-filter-input ft-num-cond-input" type="text" inputmode="decimal" placeholder=${A("valuePlaceholder")}
|
|
3695
|
-
.value=${n.text ?? (n.value == null ? "" :
|
|
3702
|
+
.value=${n.text ?? (n.value == null ? "" : N(n.value))}
|
|
3696
3703
|
aria-invalid=${n.text && n.value == null ? "true" : "false"}
|
|
3697
3704
|
@input=${(n) => {
|
|
3698
3705
|
let r = n.target.value, i = this._numberFilterState.get(e) ?? this._defaultNumState();
|
|
@@ -3801,7 +3808,7 @@ var K = {
|
|
|
3801
3808
|
if (!n) return;
|
|
3802
3809
|
let r = this.shadowRoot?.querySelectorAll(`.ft-cell[data-col-index="${t}"]`), i = 0, a = this.shadowRoot?.querySelector(`.ft-header-cell[data-col-index="${t}"]`);
|
|
3803
3810
|
if (a && (i = Math.max(i, a.scrollWidth)), r) for (let e of r) i = Math.max(i, e.scrollWidth);
|
|
3804
|
-
let o = n.minWidth ??
|
|
3811
|
+
let o = n.minWidth ?? Y, s = Math.max(o, i + 8);
|
|
3805
3812
|
this._columnWidths.set(n.key, s), this.requestUpdate(), this.dispatchEvent(new CustomEvent("column-resize", {
|
|
3806
3813
|
detail: {
|
|
3807
3814
|
key: n.key,
|
|
@@ -3814,7 +3821,7 @@ var K = {
|
|
|
3814
3821
|
}
|
|
3815
3822
|
_onResizeStart(e, t) {
|
|
3816
3823
|
e.preventDefault(), e.stopPropagation();
|
|
3817
|
-
let n = this.visibleColumns[t], r = this._columnWidths.get(n.key) ?? n.width ??
|
|
3824
|
+
let n = this.visibleColumns[t], r = this._columnWidths.get(n.key) ?? n.width ?? J;
|
|
3818
3825
|
this._resizing = {
|
|
3819
3826
|
colIndex: t,
|
|
3820
3827
|
startX: e.clientX,
|
|
@@ -3822,13 +3829,13 @@ var K = {
|
|
|
3822
3829
|
};
|
|
3823
3830
|
let i = (e) => {
|
|
3824
3831
|
if (!this._resizing) return;
|
|
3825
|
-
let t = e.clientX - this._resizing.startX, r = n.minWidth ??
|
|
3832
|
+
let t = e.clientX - this._resizing.startX, r = n.minWidth ?? Y, i = Math.max(r, this._resizing.startWidth + t);
|
|
3826
3833
|
this._columnWidths.set(n.key, i), this.requestUpdate();
|
|
3827
3834
|
}, a = () => {
|
|
3828
3835
|
document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", o), this._resizeCleanup = null;
|
|
3829
3836
|
}, o = () => {
|
|
3830
3837
|
if (a(), this._resizing) {
|
|
3831
|
-
let e = this._columnWidths.get(n.key) ??
|
|
3838
|
+
let e = this._columnWidths.get(n.key) ?? J;
|
|
3832
3839
|
this.dispatchEvent(new CustomEvent("column-resize", {
|
|
3833
3840
|
detail: {
|
|
3834
3841
|
key: n.key,
|
|
@@ -4417,7 +4424,7 @@ var K = {
|
|
|
4417
4424
|
${this._renderEditor(e, t)}
|
|
4418
4425
|
</div>
|
|
4419
4426
|
`;
|
|
4420
|
-
let v = s || l, y = this._isCellInvalid(n, r), b = (this._findState?.results ?? []).findIndex((e) => e.row === n && e.col === r), x = b >= 0, S = x && b === this._findState.currentIndex,
|
|
4427
|
+
let v = s || l, y = this._isCellInvalid(n, r), b = (this._findState?.results ?? []).findIndex((e) => e.row === n && e.col === r), x = b >= 0, S = x && b === this._findState.currentIndex, C = [
|
|
4421
4428
|
"ft-cell",
|
|
4422
4429
|
`ft-type-${t.type ?? "text"}`,
|
|
4423
4430
|
`ft-align-${W(t)}`,
|
|
@@ -4430,9 +4437,9 @@ var K = {
|
|
|
4430
4437
|
o?.continues ? "ft-merge-continued" : "",
|
|
4431
4438
|
o?.opensDown ? "ft-merge-open" : "",
|
|
4432
4439
|
t.reveal === "hover" ? "ft-reveal-hover" : ""
|
|
4433
|
-
].filter(Boolean).join(" "),
|
|
4440
|
+
].filter(Boolean).join(" "), w = this._toDataIndex(n), E = this._comments.get(w)?.get(t.key) ?? null, D = E !== null, O = D ? i`<div class="ft-comment-indicator" title=${E}></div>` : a;
|
|
4434
4441
|
return i`
|
|
4435
|
-
<div class=${D ?
|
|
4442
|
+
<div class=${D ? C + " ft-has-comment" : C}
|
|
4436
4443
|
role="gridcell"
|
|
4437
4444
|
aria-colindex=${r + 1}
|
|
4438
4445
|
data-col-index=${r}
|
|
@@ -4446,7 +4453,7 @@ var K = {
|
|
|
4446
4453
|
@click=${(e) => this._onCellClickEvent(e, n, r)}
|
|
4447
4454
|
@dblclick=${() => this._onCellDblClick(n, r)}>
|
|
4448
4455
|
${O}
|
|
4449
|
-
${
|
|
4456
|
+
${T(e[t.key], e, t)}
|
|
4450
4457
|
</div>
|
|
4451
4458
|
`;
|
|
4452
4459
|
}
|
|
@@ -4455,7 +4462,7 @@ var K = {
|
|
|
4455
4462
|
let n = e[t.key], r = n == null ? "" : String(n);
|
|
4456
4463
|
if (t.type === "number") return i`
|
|
4457
4464
|
<input class="ft-editor ft-editor-number" type="text" inputmode="decimal"
|
|
4458
|
-
.value=${typeof n == "number" ?
|
|
4465
|
+
.value=${typeof n == "number" ? N(n) : r}
|
|
4459
4466
|
@keydown=${this._onEditorKeyDown}
|
|
4460
4467
|
@blur=${() => this._commitEdit()}>
|
|
4461
4468
|
`;
|
|
@@ -4464,7 +4471,7 @@ var K = {
|
|
|
4464
4471
|
return i`
|
|
4465
4472
|
<u-date-picker class="ft-editor ft-editor-${t.type}" size="sm"
|
|
4466
4473
|
mode=${e ? "datetime" : "date"} ?confirm=${e}
|
|
4467
|
-
.value=${
|
|
4474
|
+
.value=${Qe(n, e)}
|
|
4468
4475
|
@keydown=${this._onEditorKeyDown}
|
|
4469
4476
|
@change=${() => this._commitEdit()}
|
|
4470
4477
|
@blur=${() => this._commitEdit()}></u-date-picker>
|
|
@@ -4566,12 +4573,12 @@ G([s({ type: Array })], Q.prototype, "columns", void 0), G([s({
|
|
|
4566
4573
|
type: Number,
|
|
4567
4574
|
attribute: "max-undo-size"
|
|
4568
4575
|
})], Q.prototype, "maxUndoSize", null), G([c()], Q.prototype, "_scrollTop", void 0), G([c()], Q.prototype, "_scrollLeft", void 0), G([c()], Q.prototype, "_viewportHeight", void 0), G([c()], Q.prototype, "_viewportWidth", void 0), G([c()], Q.prototype, "_activeCell", void 0), G([c()], Q.prototype, "_editingCell", void 0), G([c()], Q.prototype, "_sortCriteria", void 0), G([c()], Q.prototype, "_openFilterKey", void 0), G([c()], Q.prototype, "_rowSelectionVersion", void 0), G([c()], Q.prototype, "_autocompleteState", void 0), G([c()], Q.prototype, "_headerMenu", void 0), G([c()], Q.prototype, "_bodyContextMenu", void 0), G([c()], Q.prototype, "_commentPopup", void 0), G([c()], Q.prototype, "_isDragOver", void 0), Q = G([o("flex-table")], Q);
|
|
4569
|
-
function
|
|
4576
|
+
function Qe(e, t) {
|
|
4570
4577
|
if (t) {
|
|
4571
|
-
let t =
|
|
4578
|
+
let t = de(e);
|
|
4572
4579
|
return /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(t) ? t.replace(" ", "T") : void 0;
|
|
4573
4580
|
}
|
|
4574
|
-
let n =
|
|
4581
|
+
let n = ue(e);
|
|
4575
4582
|
return /^\d{4}-\d{2}-\d{2}$/.test(n) ? n : void 0;
|
|
4576
4583
|
}
|
|
4577
4584
|
function $(e) {
|
|
@@ -4582,4 +4589,4 @@ function $(e) {
|
|
|
4582
4589
|
}
|
|
4583
4590
|
}
|
|
4584
4591
|
//#endregion
|
|
4585
|
-
export { j as a,
|
|
4592
|
+
export { j as a, ce as i, W as n, k as o, B as r, T as s, Q as t };
|
package/dist/flex-table.d.ts
CHANGED
|
@@ -393,9 +393,16 @@ export declare class FlexTable extends LitElement {
|
|
|
393
393
|
/** Widen (positive) or narrow (negative) a visible column by `delta` px, never below its minimum. */
|
|
394
394
|
private _resizeColumnBy;
|
|
395
395
|
private _handleNavigation;
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
396
|
+
/**
|
|
397
|
+
* The selection as TSV in display (sorted) order, or `null` without a selection.
|
|
398
|
+
*/
|
|
399
|
+
private _selectionTsv;
|
|
400
|
+
/** The context menu's Copy — a click, not a key, so it goes through the async Clipboard API. */
|
|
401
|
+
private _copyFromMenu;
|
|
402
|
+
private _clipboardError;
|
|
403
|
+
/** Runs once the text is on the clipboard — only then is a cut range cleared. */
|
|
404
|
+
private _afterCopy;
|
|
405
|
+
private _pasteText;
|
|
399
406
|
/**
|
|
400
407
|
* After a paste, the cells it wrote are the selection — as in spreadsheets — so the reader sees
|
|
401
408
|
* what changed and can copy, clear or undo it as one block. The active cell stays where the
|
package/dist/flex-table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./flex-table-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./flex-table-CQNVaL0x.js";
|
|
2
2
|
export { o as FlexTable, e as RowSelectionState, t as UndoStack, n as effectiveAlign, i as exportData, r as flexTableLocale, a as renderCell };
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./flex-table-
|
|
1
|
+
import { t as e } from "./flex-table-CQNVaL0x.js";
|
|
2
2
|
import { i as t, t as n } from "./query-Dw4iO0ir.js";
|
|
3
3
|
import { t as r } from "./view-DiLr-TdY.js";
|
|
4
4
|
import i, { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/flex-table",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.1",
|
|
4
4
|
"description": "A minimalist, input-centric data grid web component",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/flex-table.js",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"odata-query": "^8.1.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@iyulab/components": ">=2.0
|
|
76
|
+
"@iyulab/components": ">=2.1.0",
|
|
77
77
|
"@lit/react": "^1.0.8",
|
|
78
78
|
"react": "^18.0.0 || ^19.0.0"
|
|
79
79
|
},
|
|
@@ -159,7 +159,7 @@ All are `CustomEvent`s with `bubbles: true, composed: true`. `row`/`index` are d
|
|
|
159
159
|
| `selection-change` | `{ selectedIndices, selectedRows }` |
|
|
160
160
|
| `clipboard-copy` / `clipboard-cut` | `{ range, text }` (TSV) |
|
|
161
161
|
| `clipboard-paste` | `{ changes, addedRows }` |
|
|
162
|
-
| `clipboard-error` | `{ action: 'copy' \| 'paste', error }` |
|
|
162
|
+
| `clipboard-error` | `{ action: 'copy' \| 'paste', error }` — copy could not put the text on the clipboard (no `clipboard-copy`/`clipboard-cut` follows; a cut clears nothing), or paste could not read it |
|
|
163
163
|
| `fill-handle-apply` | `{ sourceRange, targetRange, cells }` |
|
|
164
164
|
| `find-replace` | `{ type: 'replace' \| 'replace-all', cells }` |
|
|
165
165
|
| `comment-change` | `{ dataIndex, colKey, text }` |
|