@iyulab/flex-table 0.39.0 → 0.40.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 +60 -0
- package/README.md +49 -34
- package/dist/array/index.d.ts +2 -3
- package/dist/array/index.js +2 -56
- package/dist/array/use-array-source.d.ts +1 -24
- package/dist/array/view.d.ts +24 -0
- package/dist/{flex-table-JGaGcJTl.js → flex-table-Dl5CYn-V.js} +174 -162
- package/dist/flex-table.d.ts +1 -1
- package/dist/flex-table.js +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/models/types.d.ts +20 -8
- package/dist/odata/index.d.ts +2 -2
- package/dist/odata/index.js +2 -2
- package/dist/odata/query.d.ts +72 -0
- package/dist/odata/use-odata-source.d.ts +0 -51
- package/dist/query-Dw4iO0ir.js +37 -0
- package/dist/react-events.test.d.ts +1 -0
- package/dist/react.d.ts +15 -4
- package/dist/react.js +150 -7
- package/dist/view-DiLr-TdY.js +13 -0
- package/package.json +3 -2
- package/skills/iyulab-flex-table/SKILL.md +135 -0
- package/skills/iyulab-flex-table/references/api.md +173 -0
- package/skills/iyulab-flex-table/references/react.md +177 -0
- package/skills/iyulab-flex-table/references/styling.md +108 -0
- package/dist/use-odata-source-BiZrIEVV.js +0 -118
|
@@ -329,12 +329,11 @@ var l = r`
|
|
|
329
329
|
color: var(--ft-active-color);
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
.ft-cell.ft-type-number {
|
|
333
|
-
text-align: right;
|
|
334
|
-
font-variant-numeric: tabular-nums;
|
|
335
|
-
}
|
|
332
|
+
.ft-cell.ft-type-number { font-variant-numeric: tabular-nums; }
|
|
336
333
|
|
|
337
|
-
|
|
334
|
+
/* 셀 정렬은 열의 실효 정렬(align, 없으면 type 기본값)에서 온다 — 논리값이라 RTL 에서 뒤집힌다. */
|
|
335
|
+
.ft-cell.ft-align-center { text-align: center; }
|
|
336
|
+
.ft-cell.ft-align-end { text-align: end; }
|
|
338
337
|
.ft-bool { color: var(--ft-bool-color); }
|
|
339
338
|
|
|
340
339
|
.ft-empty {
|
|
@@ -1628,7 +1627,7 @@ function D(e, t, n) {
|
|
|
1628
1627
|
//#endregion
|
|
1629
1628
|
//#region src/renderers/cell-renderer.ts
|
|
1630
1629
|
function O(e, t, n) {
|
|
1631
|
-
return n.
|
|
1630
|
+
return n.render ? n.render(e, t, n) : n.format ? typeof n.format == "function" ? n.format(e, t, n) : b(e, n.format) : ee(e, n);
|
|
1632
1631
|
}
|
|
1633
1632
|
function ee(e, t) {
|
|
1634
1633
|
if (e == null) return "";
|
|
@@ -1784,7 +1783,7 @@ function oe(e) {
|
|
|
1784
1783
|
endCol: Math.max(e.startCol, e.endCol)
|
|
1785
1784
|
};
|
|
1786
1785
|
}
|
|
1787
|
-
var
|
|
1786
|
+
var se = class {
|
|
1788
1787
|
constructor() {
|
|
1789
1788
|
this.activeCell = null, this.rangeAnchor = null, this.range = null, this.extraRanges = [], this._rowCount = 0, this._colCount = 0;
|
|
1790
1789
|
}
|
|
@@ -1882,7 +1881,7 @@ var j = class {
|
|
|
1882
1881
|
shiftMoveRight() {
|
|
1883
1882
|
return this.activeCell ? this.setActiveWithRange(this.activeCell.row, this.activeCell.col + 1) : null;
|
|
1884
1883
|
}
|
|
1885
|
-
},
|
|
1884
|
+
}, ce = class {
|
|
1886
1885
|
constructor() {
|
|
1887
1886
|
this.current = null;
|
|
1888
1887
|
}
|
|
@@ -1903,7 +1902,7 @@ var j = class {
|
|
|
1903
1902
|
let e = this.current;
|
|
1904
1903
|
return this.current = null, e;
|
|
1905
1904
|
}
|
|
1906
|
-
},
|
|
1905
|
+
}, j = class {
|
|
1907
1906
|
constructor() {
|
|
1908
1907
|
this._selected = /* @__PURE__ */ new Set(), this._mode = "multi", this._rowCount = 0;
|
|
1909
1908
|
}
|
|
@@ -1964,7 +1963,7 @@ var j = class {
|
|
|
1964
1963
|
};
|
|
1965
1964
|
//#endregion
|
|
1966
1965
|
//#region src/core/filtering.ts
|
|
1967
|
-
function
|
|
1966
|
+
function le(e, t, n) {
|
|
1968
1967
|
if (t.length === 0) return Array.from({ length: e.length }, (e, t) => t);
|
|
1969
1968
|
let r = [];
|
|
1970
1969
|
for (let i = 0; i < e.length; i++) {
|
|
@@ -1983,9 +1982,9 @@ function ce(e, t, n) {
|
|
|
1983
1982
|
}
|
|
1984
1983
|
//#endregion
|
|
1985
1984
|
//#region src/core/undo.ts
|
|
1986
|
-
var
|
|
1985
|
+
var ue = 100, M = class {
|
|
1987
1986
|
constructor() {
|
|
1988
|
-
this._undoStack = [], this._redoStack = [], this._maxSize =
|
|
1987
|
+
this._undoStack = [], this._redoStack = [], this._maxSize = ue;
|
|
1989
1988
|
}
|
|
1990
1989
|
get maxSize() {
|
|
1991
1990
|
return this._maxSize;
|
|
@@ -2022,7 +2021,7 @@ var le = 100, N = class {
|
|
|
2022
2021
|
};
|
|
2023
2022
|
//#endregion
|
|
2024
2023
|
//#region src/clipboard/clipboard.ts
|
|
2025
|
-
function
|
|
2024
|
+
function de(e, t, n) {
|
|
2026
2025
|
let r = [];
|
|
2027
2026
|
for (let i = n.startRow; i <= n.endRow; i++) {
|
|
2028
2027
|
let a = e[i], o = [];
|
|
@@ -2034,7 +2033,7 @@ function ue(e, t, n) {
|
|
|
2034
2033
|
}
|
|
2035
2034
|
return r.join("\n");
|
|
2036
2035
|
}
|
|
2037
|
-
function
|
|
2036
|
+
function N(e) {
|
|
2038
2037
|
let t = e.replace(/\r\n/g, "\n").replace(/\r/g, "\n"), n = [], r = [], i = 0, a = t.length;
|
|
2039
2038
|
for (; i <= a;) {
|
|
2040
2039
|
if (i === a) {
|
|
@@ -2064,7 +2063,7 @@ function P(e) {
|
|
|
2064
2063
|
}
|
|
2065
2064
|
return n;
|
|
2066
2065
|
}
|
|
2067
|
-
function
|
|
2066
|
+
function P(e, t) {
|
|
2068
2067
|
if (e === "") return null;
|
|
2069
2068
|
switch (t.type) {
|
|
2070
2069
|
case "number": {
|
|
@@ -2077,7 +2076,7 @@ function F(e, t) {
|
|
|
2077
2076
|
}
|
|
2078
2077
|
//#endregion
|
|
2079
2078
|
//#region src/export/xlsx-writer.ts
|
|
2080
|
-
var
|
|
2079
|
+
var fe = (() => {
|
|
2081
2080
|
let e = /* @__PURE__ */ new Uint32Array(256);
|
|
2082
2081
|
for (let t = 0; t < 256; t++) {
|
|
2083
2082
|
let n = t;
|
|
@@ -2086,56 +2085,56 @@ var de = (() => {
|
|
|
2086
2085
|
}
|
|
2087
2086
|
return e;
|
|
2088
2087
|
})();
|
|
2089
|
-
function
|
|
2088
|
+
function pe(e) {
|
|
2090
2089
|
let t = 4294967295;
|
|
2091
|
-
for (let n = 0; n < e.length; n++) t =
|
|
2090
|
+
for (let n = 0; n < e.length; n++) t = fe[(t ^ e[n]) & 255] ^ t >>> 8;
|
|
2092
2091
|
return (t ^ 4294967295) >>> 0;
|
|
2093
2092
|
}
|
|
2094
|
-
var
|
|
2095
|
-
function
|
|
2093
|
+
var F = new TextEncoder();
|
|
2094
|
+
function me(e) {
|
|
2096
2095
|
let t = [], n = [], r = 0;
|
|
2097
2096
|
for (let i of e) {
|
|
2098
|
-
let e =
|
|
2097
|
+
let e = F.encode(i.name), a = pe(i.data), o = i.data.length, s = new ArrayBuffer(30 + e.length), c = new DataView(s);
|
|
2099
2098
|
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);
|
|
2100
2099
|
let l = new ArrayBuffer(46 + e.length), u = new DataView(l);
|
|
2101
2100
|
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;
|
|
2102
2101
|
}
|
|
2103
|
-
let i =
|
|
2104
|
-
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),
|
|
2102
|
+
let i = I(n), a = /* @__PURE__ */ new ArrayBuffer(22), o = new DataView(a);
|
|
2103
|
+
return o.setUint32(0, 101010256, !0), o.setUint16(4, 0, !0), o.setUint16(6, 0, !0), o.setUint16(8, e.length, !0), o.setUint16(10, e.length, !0), o.setUint32(12, i.length, !0), o.setUint32(16, r, !0), o.setUint16(20, 0, !0), I([
|
|
2105
2104
|
...t,
|
|
2106
2105
|
i,
|
|
2107
2106
|
new Uint8Array(a)
|
|
2108
2107
|
]);
|
|
2109
2108
|
}
|
|
2110
|
-
function
|
|
2109
|
+
function I(e) {
|
|
2111
2110
|
let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
|
|
2112
2111
|
for (let t of e) n.set(t, r), r += t.length;
|
|
2113
2112
|
return n;
|
|
2114
2113
|
}
|
|
2115
|
-
function
|
|
2114
|
+
function L(e) {
|
|
2116
2115
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2117
2116
|
}
|
|
2118
|
-
function
|
|
2117
|
+
function he(e) {
|
|
2119
2118
|
let t = "";
|
|
2120
2119
|
for (e++; e > 0;) t = String.fromCharCode(64 + (e % 26 || 26)) + t, e = Math.floor((e - 1) / 26);
|
|
2121
2120
|
return t;
|
|
2122
2121
|
}
|
|
2123
|
-
function
|
|
2124
|
-
return
|
|
2122
|
+
function R(e, t) {
|
|
2123
|
+
return he(t) + (e + 1);
|
|
2125
2124
|
}
|
|
2126
|
-
function
|
|
2125
|
+
function ge(e) {
|
|
2127
2126
|
let t = Date.UTC(1899, 11, 30);
|
|
2128
2127
|
return (e.getTime() - t) / 864e5;
|
|
2129
2128
|
}
|
|
2130
|
-
var
|
|
2131
|
-
function
|
|
2132
|
-
let n = [], r = t.map((e, t) => `<c r="${
|
|
2129
|
+
var _e = "<?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>", ve = "<?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>", ye = "<?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>", 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/worksheet\" Target=\"worksheets/sheet1.xml\"/>\n <Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\" Target=\"styles.xml\"/>\n</Relationships>", xe = "<?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>";
|
|
2130
|
+
function Se(e, t) {
|
|
2131
|
+
let n = [], r = t.map((e, t) => `<c r="${R(0, t)}" t="str" s="2"><v>${L(e.label)}</v></c>`);
|
|
2133
2132
|
return n.push(`<row r="1">${r.join("")}</row>`), e.forEach((e, r) => {
|
|
2134
2133
|
let i = t.map((t, n) => {
|
|
2135
|
-
let i =
|
|
2134
|
+
let i = R(r + 1, n), a = e[t.key];
|
|
2136
2135
|
if (a == null) return `<c r="${i}" t="str"><v></v></c>`;
|
|
2137
2136
|
let o = t.type ?? "text";
|
|
2138
|
-
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>${
|
|
2137
|
+
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>${ge(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>`;
|
|
2139
2138
|
});
|
|
2140
2139
|
n.push(`<row r="${r + 2}">${i.join("")}</row>`);
|
|
2141
2140
|
}), `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
@@ -2143,55 +2142,55 @@ function be(e, t) {
|
|
|
2143
2142
|
<sheetData>${n.join("")}</sheetData>
|
|
2144
2143
|
</worksheet>`;
|
|
2145
2144
|
}
|
|
2146
|
-
function
|
|
2147
|
-
let n =
|
|
2148
|
-
return
|
|
2145
|
+
function Ce(e, t) {
|
|
2146
|
+
let n = Se(e, t);
|
|
2147
|
+
return me([
|
|
2149
2148
|
{
|
|
2150
2149
|
name: "[Content_Types].xml",
|
|
2151
|
-
data:
|
|
2150
|
+
data: F.encode(_e)
|
|
2152
2151
|
},
|
|
2153
2152
|
{
|
|
2154
2153
|
name: "_rels/.rels",
|
|
2155
|
-
data:
|
|
2154
|
+
data: F.encode(ve)
|
|
2156
2155
|
},
|
|
2157
2156
|
{
|
|
2158
2157
|
name: "xl/workbook.xml",
|
|
2159
|
-
data:
|
|
2158
|
+
data: F.encode(ye)
|
|
2160
2159
|
},
|
|
2161
2160
|
{
|
|
2162
2161
|
name: "xl/_rels/workbook.xml.rels",
|
|
2163
|
-
data:
|
|
2162
|
+
data: F.encode(be)
|
|
2164
2163
|
},
|
|
2165
2164
|
{
|
|
2166
2165
|
name: "xl/worksheets/sheet1.xml",
|
|
2167
|
-
data:
|
|
2166
|
+
data: F.encode(n)
|
|
2168
2167
|
},
|
|
2169
2168
|
{
|
|
2170
2169
|
name: "xl/styles.xml",
|
|
2171
|
-
data:
|
|
2170
|
+
data: F.encode(xe)
|
|
2172
2171
|
}
|
|
2173
2172
|
]);
|
|
2174
2173
|
}
|
|
2175
2174
|
//#endregion
|
|
2176
2175
|
//#region src/export/export.ts
|
|
2177
|
-
function
|
|
2176
|
+
function z(e, t, n) {
|
|
2178
2177
|
switch (n) {
|
|
2179
|
-
case "csv": return
|
|
2180
|
-
case "tsv": return
|
|
2181
|
-
case "json": return
|
|
2182
|
-
case "xlsx": return
|
|
2178
|
+
case "csv": return B(e, t, ",");
|
|
2179
|
+
case "tsv": return B(e, t, " ");
|
|
2180
|
+
case "json": return Te(e, t);
|
|
2181
|
+
case "xlsx": return Ce(e, t);
|
|
2183
2182
|
}
|
|
2184
2183
|
}
|
|
2185
|
-
function
|
|
2184
|
+
function we(e, t) {
|
|
2186
2185
|
return e == null ? "" : (t.type === "date" || t.type === "datetime") && e instanceof Date ? e.toISOString() : String(e);
|
|
2187
2186
|
}
|
|
2188
|
-
function
|
|
2189
|
-
return [t.map((e) =>
|
|
2187
|
+
function B(e, t, n) {
|
|
2188
|
+
return [t.map((e) => V(e.label, n)).join(n), ...e.map((e) => t.map((t) => V(we(e[t.key], t), n)).join(n))].join("\n");
|
|
2190
2189
|
}
|
|
2191
|
-
function
|
|
2190
|
+
function V(e, t) {
|
|
2192
2191
|
return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? "\"" + e.replace(/"/g, "\"\"") + "\"" : e;
|
|
2193
2192
|
}
|
|
2194
|
-
function
|
|
2193
|
+
function Te(e, t) {
|
|
2195
2194
|
let n = e.map((e) => {
|
|
2196
2195
|
let n = {};
|
|
2197
2196
|
for (let r of t) {
|
|
@@ -2202,35 +2201,35 @@ function Ce(e, t) {
|
|
|
2202
2201
|
});
|
|
2203
2202
|
return JSON.stringify(n, null, 2);
|
|
2204
2203
|
}
|
|
2205
|
-
function
|
|
2204
|
+
function Ee(e, t, n) {
|
|
2206
2205
|
let r = new Blob([e], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
2207
2206
|
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);
|
|
2208
2207
|
}
|
|
2209
|
-
var
|
|
2208
|
+
var De = {
|
|
2210
2209
|
csv: "text/csv;charset=utf-8",
|
|
2211
2210
|
tsv: "text/tab-separated-values;charset=utf-8",
|
|
2212
2211
|
json: "application/json;charset=utf-8",
|
|
2213
2212
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
2214
|
-
},
|
|
2213
|
+
}, Oe = {
|
|
2215
2214
|
csv: ".csv",
|
|
2216
2215
|
tsv: ".tsv",
|
|
2217
2216
|
json: ".json",
|
|
2218
2217
|
xlsx: ".xlsx"
|
|
2219
2218
|
};
|
|
2220
|
-
function
|
|
2221
|
-
return
|
|
2219
|
+
function ke(e) {
|
|
2220
|
+
return De[e];
|
|
2222
2221
|
}
|
|
2223
|
-
function
|
|
2224
|
-
return
|
|
2222
|
+
function Ae(e) {
|
|
2223
|
+
return Oe[e];
|
|
2225
2224
|
}
|
|
2226
2225
|
//#endregion
|
|
2227
2226
|
//#region src/export/xlsx-reader.ts
|
|
2228
|
-
function
|
|
2227
|
+
function je(e) {
|
|
2229
2228
|
for (let t = e.byteLength - 22; t >= 0; t--) if (e.getUint32(t, !0) === 101010256) return t;
|
|
2230
2229
|
throw Error("XLSX: End of central directory not found — not a valid ZIP file");
|
|
2231
2230
|
}
|
|
2232
|
-
function
|
|
2233
|
-
let t =
|
|
2231
|
+
function Me(e) {
|
|
2232
|
+
let t = je(e), n = e.getUint32(t + 16, !0), r = e.getUint32(t + 12, !0), i = new TextDecoder("utf-8"), a = [], o = n, s = n + r;
|
|
2234
2233
|
for (; o < s && e.getUint32(o, !0) === 33639248;) {
|
|
2235
2234
|
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));
|
|
2236
2235
|
a.push({
|
|
@@ -2243,7 +2242,7 @@ function Ae(e) {
|
|
|
2243
2242
|
}
|
|
2244
2243
|
return a;
|
|
2245
2244
|
}
|
|
2246
|
-
async function
|
|
2245
|
+
async function Ne(e) {
|
|
2247
2246
|
let t = new DecompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
|
|
2248
2247
|
n.write(e), n.close();
|
|
2249
2248
|
let i = [];
|
|
@@ -2256,28 +2255,28 @@ async function je(e) {
|
|
|
2256
2255
|
for (let e of i) o.set(e, s), s += e.length;
|
|
2257
2256
|
return o;
|
|
2258
2257
|
}
|
|
2259
|
-
async function
|
|
2258
|
+
async function Pe(e, t) {
|
|
2260
2259
|
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);
|
|
2261
2260
|
if (t.compressionMethod === 0) return o.slice();
|
|
2262
|
-
if (t.compressionMethod === 8) return
|
|
2261
|
+
if (t.compressionMethod === 8) return Ne(o);
|
|
2263
2262
|
throw Error(`XLSX: Unsupported compression method ${t.compressionMethod}`);
|
|
2264
2263
|
}
|
|
2265
|
-
async function
|
|
2266
|
-
let t = new DataView(e), n =
|
|
2267
|
-
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await
|
|
2264
|
+
async function Fe(e) {
|
|
2265
|
+
let t = new DataView(e), n = Me(t), r = /* @__PURE__ */ new Map();
|
|
2266
|
+
for (let e of n) e.compressedSize === 0 && e.name.endsWith("/") || r.set(e.name, await Pe(t, e));
|
|
2268
2267
|
return r;
|
|
2269
2268
|
}
|
|
2270
|
-
var
|
|
2271
|
-
function
|
|
2272
|
-
let t =
|
|
2269
|
+
var Ie = new TextDecoder("utf-8");
|
|
2270
|
+
function H(e) {
|
|
2271
|
+
let t = Ie.decode(e);
|
|
2273
2272
|
return new DOMParser().parseFromString(t, "application/xml");
|
|
2274
2273
|
}
|
|
2275
|
-
function
|
|
2274
|
+
function Le(e) {
|
|
2276
2275
|
if (!e) return [];
|
|
2277
|
-
let t =
|
|
2276
|
+
let t = H(e);
|
|
2278
2277
|
return Array.from(t.querySelectorAll("si")).map((e) => Array.from(e.querySelectorAll("t")).map((e) => e.textContent ?? "").join(""));
|
|
2279
2278
|
}
|
|
2280
|
-
var
|
|
2279
|
+
var Re = /* @__PURE__ */ new Set([
|
|
2281
2280
|
14,
|
|
2282
2281
|
15,
|
|
2283
2282
|
16,
|
|
@@ -2297,37 +2296,37 @@ var Ie = /* @__PURE__ */ new Set([
|
|
|
2297
2296
|
57,
|
|
2298
2297
|
58
|
|
2299
2298
|
]);
|
|
2300
|
-
function
|
|
2299
|
+
function ze(e) {
|
|
2301
2300
|
let t = e.replace(/"[^"]*"/g, "").replace(/\\./g, "").replace(/\[[^\]]*\]/g, "").split(";")[0];
|
|
2302
2301
|
return /[dy]/i.test(t);
|
|
2303
2302
|
}
|
|
2304
|
-
function
|
|
2303
|
+
function Be(e) {
|
|
2305
2304
|
let t = /* @__PURE__ */ new Set();
|
|
2306
2305
|
if (!e) return t;
|
|
2307
|
-
let n =
|
|
2306
|
+
let n = H(e), r = /* @__PURE__ */ new Map();
|
|
2308
2307
|
for (let e of Array.from(n.querySelectorAll("numFmts > numFmt"))) r.set(parseInt(e.getAttribute("numFmtId") ?? "", 10), e.getAttribute("formatCode") ?? "");
|
|
2309
2308
|
return Array.from(n.querySelectorAll("cellXfs > xf")).forEach((e, n) => {
|
|
2310
2309
|
let i = parseInt(e.getAttribute("numFmtId") ?? "0", 10), a = r.get(i);
|
|
2311
|
-
(a === void 0 ?
|
|
2310
|
+
(a === void 0 ? Re.has(i) : ze(a)) && t.add(n);
|
|
2312
2311
|
}), t;
|
|
2313
2312
|
}
|
|
2314
|
-
function
|
|
2313
|
+
function Ve(e) {
|
|
2315
2314
|
if (!e) return !1;
|
|
2316
|
-
let t =
|
|
2315
|
+
let t = H(e).querySelector("workbookPr")?.getAttribute("date1904");
|
|
2317
2316
|
return t === "1" || t === "true";
|
|
2318
2317
|
}
|
|
2319
|
-
function
|
|
2318
|
+
function He(e, t) {
|
|
2320
2319
|
return new Date((t ? Date.UTC(1904, 0, 1) : Date.UTC(1899, 11, 30)) + Math.floor(e) * 864e5).toISOString().slice(0, 10);
|
|
2321
2320
|
}
|
|
2322
|
-
function
|
|
2323
|
-
let i =
|
|
2321
|
+
function Ue(e, t, n, r) {
|
|
2322
|
+
let i = H(e).querySelectorAll("row");
|
|
2324
2323
|
if (i.length === 0) return [];
|
|
2325
2324
|
let a = 0, o = /* @__PURE__ */ new Map();
|
|
2326
2325
|
for (let e of i) {
|
|
2327
2326
|
let i = parseInt(e.getAttribute("r") ?? "1", 10) - 1, s = /* @__PURE__ */ new Map();
|
|
2328
2327
|
o.set(i, s);
|
|
2329
2328
|
for (let i of e.querySelectorAll("c")) {
|
|
2330
|
-
let e =
|
|
2329
|
+
let e = We(i.getAttribute("r") ?? "");
|
|
2331
2330
|
e > a && (a = e);
|
|
2332
2331
|
let o = i.getAttribute("t") ?? "", c = i.getAttribute("s") ?? "", l = i.querySelector("v")?.textContent ?? "", u = i.querySelector("is > t")?.textContent ?? null, d;
|
|
2333
2332
|
if (o === "s") d = t[parseInt(l, 10)] ?? "";
|
|
@@ -2336,7 +2335,7 @@ function Ve(e, t, n, r) {
|
|
|
2336
2335
|
else if (l === "") d = "";
|
|
2337
2336
|
else {
|
|
2338
2337
|
let e = parseFloat(l);
|
|
2339
|
-
d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ?
|
|
2338
|
+
d = c !== "" && n.has(parseInt(c, 10)) && !isNaN(e) && e >= 0 ? He(e, r) : l;
|
|
2340
2339
|
}
|
|
2341
2340
|
s.set(e, d);
|
|
2342
2341
|
}
|
|
@@ -2350,13 +2349,13 @@ function Ve(e, t, n, r) {
|
|
|
2350
2349
|
}
|
|
2351
2350
|
return c;
|
|
2352
2351
|
}
|
|
2353
|
-
function
|
|
2352
|
+
function We(e) {
|
|
2354
2353
|
let t = 0, n = 0;
|
|
2355
2354
|
for (; n < e.length && e[n] >= "A" && e[n] <= "Z";) t = t * 26 + (e.charCodeAt(n) - 64), n++;
|
|
2356
2355
|
return t - 1;
|
|
2357
2356
|
}
|
|
2358
|
-
async function
|
|
2359
|
-
let t = await
|
|
2357
|
+
async function U(e) {
|
|
2358
|
+
let t = await Fe(e), n = Le(t.get("xl/sharedStrings.xml")), r = t.get("xl/worksheets/sheet1.xml");
|
|
2360
2359
|
if (!r) {
|
|
2361
2360
|
for (let [e, n] of t) if (e.toLowerCase().includes("worksheets/sheet")) {
|
|
2362
2361
|
r = n;
|
|
@@ -2364,7 +2363,7 @@ async function G(e) {
|
|
|
2364
2363
|
}
|
|
2365
2364
|
}
|
|
2366
2365
|
if (!r) throw Error("XLSX: No worksheet found");
|
|
2367
|
-
let i =
|
|
2366
|
+
let i = Be(t.get("xl/styles.xml")), a = Ve(t.get("xl/workbook.xml")), o = Ue(r, n, i, a);
|
|
2368
2367
|
return o.length === 0 ? {
|
|
2369
2368
|
headers: [],
|
|
2370
2369
|
rows: []
|
|
@@ -2374,6 +2373,16 @@ async function G(e) {
|
|
|
2374
2373
|
};
|
|
2375
2374
|
}
|
|
2376
2375
|
//#endregion
|
|
2376
|
+
//#region src/models/types.ts
|
|
2377
|
+
function W(e) {
|
|
2378
|
+
return e.align ? e.align : e.type === "number" ? "end" : e.type === "boolean" ? "center" : "start";
|
|
2379
|
+
}
|
|
2380
|
+
//#endregion
|
|
2381
|
+
//#region node_modules/@iyulab/components/dist/utilities/keyboard.js
|
|
2382
|
+
function G(e) {
|
|
2383
|
+
return e.isComposing || e.keyCode === 229;
|
|
2384
|
+
}
|
|
2385
|
+
//#endregion
|
|
2377
2386
|
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
|
|
2378
2387
|
function K(e, t, n, r) {
|
|
2379
2388
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
@@ -2390,9 +2399,9 @@ var q = {
|
|
|
2390
2399
|
lt: "<",
|
|
2391
2400
|
gte: "≥",
|
|
2392
2401
|
lte: "≤"
|
|
2393
|
-
}, J = 120, Y = 40, X = 20, Z = 32, Q = 5,
|
|
2402
|
+
}, J = 120, Y = 40, X = 20, Z = 32, Q = 5, Ge = 200, $ = class extends n {
|
|
2394
2403
|
constructor(...e) {
|
|
2395
|
-
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
|
|
2404
|
+
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 se(), this._editing = new ce(), 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 = () => {
|
|
2396
2405
|
this._commitCommentPopup();
|
|
2397
2406
|
}, 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();
|
|
2398
2407
|
}
|
|
@@ -2757,12 +2766,12 @@ var q = {
|
|
|
2757
2766
|
if (!t) return "";
|
|
2758
2767
|
let n = this.visibleColumns.slice(t.startCol, t.endCol + 1), r = [];
|
|
2759
2768
|
for (let e = t.startRow; e <= t.endRow; e++) r.push(this.data[this._toDataIndex(e)]);
|
|
2760
|
-
return
|
|
2769
|
+
return z(r, n, e);
|
|
2761
2770
|
}
|
|
2762
|
-
return
|
|
2771
|
+
return z(this._sortedIndices.map((e) => this.data[e]), this.visibleColumns, e);
|
|
2763
2772
|
}
|
|
2764
2773
|
exportToFile(e, t) {
|
|
2765
|
-
|
|
2774
|
+
Ee(this.exportToString(e), t ?? `export${Ae(e)}`, ke(e));
|
|
2766
2775
|
}
|
|
2767
2776
|
setComment(e, t, n) {
|
|
2768
2777
|
let r = this.getComment(e, t);
|
|
@@ -2819,10 +2828,10 @@ var q = {
|
|
|
2819
2828
|
async importFromFile(e) {
|
|
2820
2829
|
let t = e.name.toLowerCase();
|
|
2821
2830
|
if (t.endsWith(".xlsx")) {
|
|
2822
|
-
let t = await
|
|
2831
|
+
let t = await U(await e.arrayBuffer());
|
|
2823
2832
|
this._applyImportedSheet(t);
|
|
2824
2833
|
} else if (t.endsWith(".csv") || t.endsWith(".tsv")) {
|
|
2825
|
-
let t =
|
|
2834
|
+
let t = N(await e.text());
|
|
2826
2835
|
this._applyImportedRows(t);
|
|
2827
2836
|
} else console.warn(`flex-table importFromFile: unsupported file type "${e.name}"`);
|
|
2828
2837
|
}
|
|
@@ -2833,7 +2842,7 @@ var q = {
|
|
|
2833
2842
|
let a = t.get(e);
|
|
2834
2843
|
if (!a) return;
|
|
2835
2844
|
let o = this.columns.find((e) => e.key === a);
|
|
2836
|
-
r[a] = o ?
|
|
2845
|
+
r[a] = o ? P(n[i] ?? "", o) : n[i] ?? null;
|
|
2837
2846
|
}), r;
|
|
2838
2847
|
}), r = [...this.data];
|
|
2839
2848
|
this.data = n, this._undo.push({
|
|
@@ -2858,7 +2867,7 @@ var q = {
|
|
|
2858
2867
|
let a = n.get(t);
|
|
2859
2868
|
if (!a) return;
|
|
2860
2869
|
let o = this.columns.find((e) => e.key === a);
|
|
2861
|
-
r[a] = o ?
|
|
2870
|
+
r[a] = o ? P(e[i] ?? "", o) : e[i] ?? null;
|
|
2862
2871
|
}), r;
|
|
2863
2872
|
}), i = [...this.data];
|
|
2864
2873
|
this.data = r, this._undo.push({
|
|
@@ -2878,12 +2887,12 @@ var q = {
|
|
|
2878
2887
|
_buildHeaderColumnMap(e) {
|
|
2879
2888
|
let t = /* @__PURE__ */ new Map();
|
|
2880
2889
|
for (let n of e) {
|
|
2881
|
-
let e = this.columns.find((e) => e.
|
|
2890
|
+
let e = this.columns.find((e) => e.label === n);
|
|
2882
2891
|
if (e) {
|
|
2883
2892
|
t.set(n, e.key);
|
|
2884
2893
|
continue;
|
|
2885
2894
|
}
|
|
2886
|
-
let r = this.columns.find((e) => e.
|
|
2895
|
+
let r = this.columns.find((e) => e.label.toLowerCase() === n.toLowerCase());
|
|
2887
2896
|
r && t.set(n, r.key);
|
|
2888
2897
|
}
|
|
2889
2898
|
return t;
|
|
@@ -3012,7 +3021,7 @@ var q = {
|
|
|
3012
3021
|
this._filteredIndices = Array.from({ length: this.data.length }, (e, t) => t), this._sortedIndices = this._filteredIndices;
|
|
3013
3022
|
return;
|
|
3014
3023
|
}
|
|
3015
|
-
if (this._filteredIndices =
|
|
3024
|
+
if (this._filteredIndices = le(this.data, this._filters, (e, t, n) => {
|
|
3016
3025
|
this.dispatchEvent(new CustomEvent("filter-error", {
|
|
3017
3026
|
detail: {
|
|
3018
3027
|
error: e,
|
|
@@ -3042,7 +3051,7 @@ var q = {
|
|
|
3042
3051
|
e !== this._viewportHeight && (this._viewportHeight = e), t !== this._viewportWidth && (this._viewportWidth = t), this._warnIfUnconstrained();
|
|
3043
3052
|
}
|
|
3044
3053
|
_warnIfUnconstrained() {
|
|
3045
|
-
this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount <
|
|
3054
|
+
this._warnedUnconstrained || process.env.NODE_ENV === "production" || this._visibleRowCount < Ge || 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.`));
|
|
3046
3055
|
}
|
|
3047
3056
|
_onScroll() {
|
|
3048
3057
|
this._scrollTop = this.scrollTop, this._scrollLeft = this.scrollLeft;
|
|
@@ -3172,7 +3181,7 @@ var q = {
|
|
|
3172
3181
|
}
|
|
3173
3182
|
let t = this.shadowRoot?.querySelector(".ft-editor");
|
|
3174
3183
|
if (t) {
|
|
3175
|
-
let n =
|
|
3184
|
+
let n = P(t.value, e);
|
|
3176
3185
|
this._applyEdit(n);
|
|
3177
3186
|
} else this._cancelEdit();
|
|
3178
3187
|
}
|
|
@@ -3246,35 +3255,37 @@ var q = {
|
|
|
3246
3255
|
}));
|
|
3247
3256
|
}
|
|
3248
3257
|
_onEditorKeyDown(e) {
|
|
3249
|
-
if (
|
|
3250
|
-
if (
|
|
3251
|
-
e.
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
e.
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3258
|
+
if (!G(e)) {
|
|
3259
|
+
if (this._autocompleteState && this._autocompleteState.candidates.length > 0) {
|
|
3260
|
+
if (e.key === "ArrowDown") {
|
|
3261
|
+
e.preventDefault(), e.stopPropagation();
|
|
3262
|
+
let t = this._autocompleteState.candidates.length;
|
|
3263
|
+
this._autocompleteState = {
|
|
3264
|
+
...this._autocompleteState,
|
|
3265
|
+
activeIndex: Math.min(this._autocompleteState.activeIndex + 1, t - 1)
|
|
3266
|
+
};
|
|
3267
|
+
return;
|
|
3268
|
+
}
|
|
3269
|
+
if (e.key === "ArrowUp") {
|
|
3270
|
+
e.preventDefault(), e.stopPropagation(), this._autocompleteState = {
|
|
3271
|
+
...this._autocompleteState,
|
|
3272
|
+
activeIndex: Math.max(this._autocompleteState.activeIndex - 1, -1)
|
|
3273
|
+
};
|
|
3274
|
+
return;
|
|
3275
|
+
}
|
|
3276
|
+
if (e.key === "Enter" && this._autocompleteState.activeIndex >= 0) {
|
|
3277
|
+
e.preventDefault(), e.stopPropagation();
|
|
3278
|
+
let t = this._autocompleteState.candidates[this._autocompleteState.activeIndex];
|
|
3279
|
+
this._selectAutocompleteCandidate(t);
|
|
3280
|
+
return;
|
|
3281
|
+
}
|
|
3282
|
+
if (e.key === "Escape") {
|
|
3283
|
+
e.preventDefault(), e.stopPropagation(), this._autocompleteState = null;
|
|
3284
|
+
return;
|
|
3285
|
+
}
|
|
3275
3286
|
}
|
|
3287
|
+
e.key === "Enter" ? (e.preventDefault(), e.stopPropagation(), this._commitEdit(), this._selection.moveDown(), this._syncActiveCell()) : e.key === "Tab" ? (e.preventDefault(), e.stopPropagation(), this._commitEdit(), e.shiftKey ? this._selection.movePrev() : this._selection.moveNext(), this._syncActiveCell()) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), this._cancelEdit());
|
|
3276
3288
|
}
|
|
3277
|
-
e.key === "Enter" ? (e.preventDefault(), e.stopPropagation(), this._commitEdit(), this._selection.moveDown(), this._syncActiveCell()) : e.key === "Tab" ? (e.preventDefault(), e.stopPropagation(), this._commitEdit(), e.shiftKey ? this._selection.movePrev() : this._selection.moveNext(), this._syncActiveCell()) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), this._cancelEdit());
|
|
3278
3289
|
}
|
|
3279
3290
|
_getAutocompleteCandidates(e, t) {
|
|
3280
3291
|
let n = t.toLowerCase(), r = /* @__PURE__ */ new Set(), i = [];
|
|
@@ -3312,7 +3323,7 @@ var q = {
|
|
|
3312
3323
|
].includes(t) && this._handleCtrlKey(e)) return;
|
|
3313
3324
|
}
|
|
3314
3325
|
if (t.length !== 0 && this._visibleRowCount !== 0) {
|
|
3315
|
-
if ((e.key === "Enter" || e.key === "F2") && this._activeCell) {
|
|
3326
|
+
if ((e.key === "Enter" || e.key === "F2") && this._activeCell && !G(e)) {
|
|
3316
3327
|
e.preventDefault();
|
|
3317
3328
|
let n = t[this._activeCell.col];
|
|
3318
3329
|
n && this._isCellEditable(n) ? this._startEdit() : e.key === "Enter" && this._fireRowActivate(n);
|
|
@@ -3400,7 +3411,7 @@ var q = {
|
|
|
3400
3411
|
async _handleCopy(e) {
|
|
3401
3412
|
let t = this._selection.getEffectiveRange();
|
|
3402
3413
|
if (!t) return;
|
|
3403
|
-
let n = this.visibleColumns, r =
|
|
3414
|
+
let n = this.visibleColumns, r = de(this._sortedIndices.map((e) => this.data[e]), n, t);
|
|
3404
3415
|
try {
|
|
3405
3416
|
await navigator.clipboard.writeText(r);
|
|
3406
3417
|
} catch (e) {
|
|
@@ -3426,7 +3437,7 @@ var q = {
|
|
|
3426
3437
|
if (!this._activeCell) return;
|
|
3427
3438
|
let e = await this._readClipboardText();
|
|
3428
3439
|
if (e == null) return;
|
|
3429
|
-
let t =
|
|
3440
|
+
let t = N(e);
|
|
3430
3441
|
if (t.length === 0) return;
|
|
3431
3442
|
let n = this._expandRowsForPaste(this._activeCell.row, t.length), r = this._applyPasteData(this._activeCell, t);
|
|
3432
3443
|
if (r.length > 0 || n.length > 0) {
|
|
@@ -3484,7 +3495,7 @@ var q = {
|
|
|
3484
3495
|
for (let a = 0; a < t[i].length; a++) {
|
|
3485
3496
|
let s = e.col + a;
|
|
3486
3497
|
if (s >= n.length) break;
|
|
3487
|
-
let c = n[s], l = this.data[o][c.key], u =
|
|
3498
|
+
let c = n[s], l = this.data[o][c.key], u = P(t[i][a], c);
|
|
3488
3499
|
this.data[o][c.key] = u, r.push({
|
|
3489
3500
|
row: o,
|
|
3490
3501
|
col: s,
|
|
@@ -3549,7 +3560,7 @@ var q = {
|
|
|
3549
3560
|
for (let r = e.startCol + 1; r <= e.endCol; r++) {
|
|
3550
3561
|
let e = t[r];
|
|
3551
3562
|
if (!e || !this._isCellEditable(e)) continue;
|
|
3552
|
-
let a =
|
|
3563
|
+
let a = P(o == null ? "" : String(o), e);
|
|
3553
3564
|
n.push({
|
|
3554
3565
|
row: i,
|
|
3555
3566
|
key: e.key,
|
|
@@ -3686,40 +3697,40 @@ var q = {
|
|
|
3686
3697
|
return Math.min(n, i);
|
|
3687
3698
|
}
|
|
3688
3699
|
_renderHeaderCell(e, t) {
|
|
3689
|
-
let n = e.sortable !== !1, r = this._sortCriteria.find((t) => t.key === e.key), o = this._sortCriteria.length > 1 ? this._sortCriteria.findIndex((t) => t.key === e.key) : -1, s = this._filters.some((t) => t.key === e.key), c = e.pinned === "left", l = e.pinned === "right", u = [
|
|
3700
|
+
let n = e.sortable !== !1, r = this._sortCriteria.find((t) => t.key === e.key), o = this._sortCriteria.length > 1 ? this._sortCriteria.findIndex((t) => t.key === e.key) : -1, s = this._filters.some((t) => t.key === e.key), c = e.pinned === "left", l = e.pinned === "right", u = c || l, d = e.headerAlign ?? W(e), f = [
|
|
3690
3701
|
"ft-header-cell",
|
|
3691
3702
|
n ? "ft-sortable" : "",
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
].filter(Boolean).join(" "),
|
|
3696
|
-
|
|
3697
|
-
let
|
|
3698
|
-
if (
|
|
3699
|
-
let
|
|
3703
|
+
u ? "ft-pinned" : "",
|
|
3704
|
+
d === "center" ? "ft-header-align-center" : "",
|
|
3705
|
+
d === "end" ? "ft-header-align-end" : ""
|
|
3706
|
+
].filter(Boolean).join(" "), p = n ? r ? r.direction === "asc" ? "ascending" : "descending" : "none" : void 0, m = this._getColWidth(e), h = this.headerHeight, g = this._colLeftOffsets[t] ?? 0, _;
|
|
3707
|
+
_ = c ? `position: absolute; top: 0; left: ${this._scrollLeft + this._getPinnedLeft(t)}px; width: ${m}px; height: ${h}px; z-index: 4;` : l ? `position: absolute; top: 0; left: ${this._getPinnedRightLeft(t)}px; width: ${m}px; height: ${h}px; z-index: 4;` : `left: ${g}px; width: ${m}px; height: ${h}px;`;
|
|
3708
|
+
let v = this._colDrag?.active && this._colDrag.colIndex === t, y = [...f.split(" "), v ? "ft-col-dragging" : ""].filter(Boolean).join(" "), b = this.columns, x = b.findIndex((t) => t.key === e.key), S = [];
|
|
3709
|
+
if (x > 0) for (let e = x - 1; e >= 0 && b[e].hidden; e--) S.push(b[e]);
|
|
3710
|
+
let C = S.length > 0;
|
|
3700
3711
|
return i`
|
|
3701
|
-
<div class=${
|
|
3712
|
+
<div class=${y}
|
|
3702
3713
|
role="columnheader"
|
|
3703
3714
|
data-col-index=${t}
|
|
3704
|
-
style=${
|
|
3705
|
-
aria-sort=${
|
|
3715
|
+
style=${_}
|
|
3716
|
+
aria-sort=${p ?? a}
|
|
3706
3717
|
@contextmenu=${(t) => this._onHeaderContextMenu(t, e)}
|
|
3707
3718
|
@mousedown=${(n) => this._onHeaderMouseDown(n, e, t)}
|
|
3708
3719
|
@click=${n ? (t) => this._onHeaderClick(t, e) : void 0}>
|
|
3709
|
-
${
|
|
3720
|
+
${C ? i`
|
|
3710
3721
|
<button class="ft-hidden-col-indicator"
|
|
3711
3722
|
title=${A("showHiddenColumns")}
|
|
3712
3723
|
@click=${(t) => {
|
|
3713
3724
|
t.stopPropagation(), this._showHiddenBefore(e);
|
|
3714
3725
|
}}>❯</button>
|
|
3715
3726
|
` : ""}
|
|
3716
|
-
<span>${e.
|
|
3727
|
+
<span>${e.label}</span>
|
|
3717
3728
|
${r ? i`<span class="ft-sort-indicator">${r.direction === "asc" ? "▲" : "▼"}</span>` : ""}
|
|
3718
3729
|
${o >= 0 ? i`<span class="ft-sort-order">${o + 1}</span>` : ""}
|
|
3719
3730
|
<button class="ft-column-menu-btn ${s ? "ft-filter-active" : ""}"
|
|
3720
3731
|
type="button"
|
|
3721
3732
|
title=${A("columnMenu")}
|
|
3722
|
-
aria-label=${A("columnMenuFor", { header: e.
|
|
3733
|
+
aria-label=${A("columnMenuFor", { header: e.label })}
|
|
3723
3734
|
aria-haspopup="menu"
|
|
3724
3735
|
aria-expanded=${this._headerMenu?.key === e.key ? "true" : "false"}
|
|
3725
3736
|
@mousedown=${(e) => e.stopPropagation()}
|
|
@@ -3752,7 +3763,7 @@ var q = {
|
|
|
3752
3763
|
}, this.dispatchEvent(new CustomEvent("header-context-menu", {
|
|
3753
3764
|
detail: {
|
|
3754
3765
|
key: t.key,
|
|
3755
|
-
|
|
3766
|
+
label: t.label,
|
|
3756
3767
|
x: e.clientX,
|
|
3757
3768
|
y: e.clientY
|
|
3758
3769
|
},
|
|
@@ -3838,8 +3849,8 @@ var q = {
|
|
|
3838
3849
|
}}>${t}</button>
|
|
3839
3850
|
`;
|
|
3840
3851
|
return i`
|
|
3841
|
-
<div class="ft-header-menu" role="menu" aria-label=${A("columnMenuRegion", { header: o.
|
|
3842
|
-
style="position: fixed; left: ${t}px; top: ${n}px; z-index:
|
|
3852
|
+
<div class="ft-header-menu" role="menu" aria-label=${A("columnMenuRegion", { header: o.label })}
|
|
3853
|
+
style="position: fixed; left: ${t}px; top: ${n}px; z-index: var(--u-layer-floating, 1000);"
|
|
3843
3854
|
@mousedown=${(e) => e.stopPropagation()}
|
|
3844
3855
|
@keydown=${(e) => this._onHeaderMenuKeydown(e)}>
|
|
3845
3856
|
${o.sortable === !1 ? a : i`
|
|
@@ -3853,7 +3864,7 @@ var q = {
|
|
|
3853
3864
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3854
3865
|
` : a}
|
|
3855
3866
|
${c("hide", A("hideColumn"), () => this._setColumnHidden(e, !0))}
|
|
3856
|
-
${r.map((e) => c("show", A("showColumn", { header: e.
|
|
3867
|
+
${r.map((e) => c("show", A("showColumn", { header: e.label }), () => this._setColumnHidden(e.key, !1)))}
|
|
3857
3868
|
<div class="ft-header-menu-separator" role="separator"></div>
|
|
3858
3869
|
${c("autofit", A("autoFitWidth"), () => this._autoFitColumn(e))}
|
|
3859
3870
|
${c("wider", A("wider"), () => this._resizeColumnBy(e, X), !0)}
|
|
@@ -3876,7 +3887,7 @@ var q = {
|
|
|
3876
3887
|
`, f = i`<div class="ft-context-menu-separator" role="separator"></div>`;
|
|
3877
3888
|
return i`
|
|
3878
3889
|
<div class="ft-body-context-menu" role="menu" aria-label=${A("cellActions")}
|
|
3879
|
-
style="position: fixed; left: ${n}px; top: ${r}px; z-index:
|
|
3890
|
+
style="position: fixed; left: ${n}px; top: ${r}px; z-index: var(--u-layer-floating, 1000);"
|
|
3880
3891
|
@mousedown=${(e) => e.stopPropagation()}
|
|
3881
3892
|
@keydown=${(e) => this._onMenuKeydown(e, ".ft-body-context-menu", l)}>
|
|
3882
3893
|
${d(A("copy"), () => this._handleCopy(!1))}
|
|
@@ -3922,7 +3933,7 @@ var q = {
|
|
|
3922
3933
|
let { x: e, y: t } = this._commentPopup, n = e + 240 > window.innerWidth ? e - 240 : e, r = t + 150 > window.innerHeight ? t - 150 : t;
|
|
3923
3934
|
return i`
|
|
3924
3935
|
<div class="ft-comment-popup"
|
|
3925
|
-
style="position: fixed; left: ${n}px; top: ${r}px; z-index:
|
|
3936
|
+
style="position: fixed; left: ${n}px; top: ${r}px; z-index: calc(var(--u-layer-floating, 1000) + 1);"
|
|
3926
3937
|
@mousedown=${(e) => e.stopPropagation()}>
|
|
3927
3938
|
<textarea class="ft-comment-popup-textarea"
|
|
3928
3939
|
rows="4"
|
|
@@ -4316,10 +4327,10 @@ var q = {
|
|
|
4316
4327
|
}
|
|
4317
4328
|
_startColumnGhost(e) {
|
|
4318
4329
|
let t = document.createElement("div");
|
|
4319
|
-
t.textContent = this._colDrag.col.
|
|
4330
|
+
t.textContent = this._colDrag.col.label ?? this._colDrag.col.key, t.style.cssText = [
|
|
4320
4331
|
"position:fixed",
|
|
4321
4332
|
"pointer-events:none",
|
|
4322
|
-
"z-index:9999",
|
|
4333
|
+
"z-index:var(--u-layer-overlay, 9999)",
|
|
4323
4334
|
"opacity:0.85",
|
|
4324
4335
|
`background:${getComputedStyle(this).getPropertyValue("--ft-header-bg") || "#f0f0f0"}`,
|
|
4325
4336
|
`border:2px solid ${getComputedStyle(this).getPropertyValue("--ft-active-color") || "#3b82f6"}`,
|
|
@@ -4486,7 +4497,7 @@ var q = {
|
|
|
4486
4497
|
a.textContent = i, a.style.cssText = [
|
|
4487
4498
|
"position:fixed",
|
|
4488
4499
|
"pointer-events:none",
|
|
4489
|
-
"z-index:9999",
|
|
4500
|
+
"z-index:var(--u-layer-overlay, 9999)",
|
|
4490
4501
|
"opacity:0.85",
|
|
4491
4502
|
"background:#e8f0fe",
|
|
4492
4503
|
"border:2px solid #3b82f6",
|
|
@@ -4658,7 +4669,7 @@ var q = {
|
|
|
4658
4669
|
this._closeFindPanel();
|
|
4659
4670
|
return;
|
|
4660
4671
|
}
|
|
4661
|
-
e.key === "Enter" && e.target instanceof HTMLInputElement && e.target.classList.contains("ft-find-input") && (e.shiftKey ? this._findPrev() : this._findNext());
|
|
4672
|
+
e.key === "Enter" && !G(e) && e.target instanceof HTMLInputElement && e.target.classList.contains("ft-find-input") && (e.shiftKey ? this._findPrev() : this._findNext());
|
|
4662
4673
|
}}>
|
|
4663
4674
|
<div class="ft-find-row">
|
|
4664
4675
|
<input class="ft-find-input" type="text" placeholder=${A("findPlaceholder")}
|
|
@@ -4844,6 +4855,7 @@ var q = {
|
|
|
4844
4855
|
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 = [
|
|
4845
4856
|
"ft-cell",
|
|
4846
4857
|
`ft-type-${t.type ?? "text"}`,
|
|
4858
|
+
`ft-align-${W(t)}`,
|
|
4847
4859
|
o ? "ft-active" : "",
|
|
4848
4860
|
c ? "ft-selected" : "",
|
|
4849
4861
|
d ? "ft-pinned" : "",
|
|
@@ -5002,4 +5014,4 @@ K([s({ type: Array })], $.prototype, "columns", void 0), K([s({
|
|
|
5002
5014
|
attribute: "max-undo-size"
|
|
5003
5015
|
})], $.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")], $);
|
|
5004
5016
|
//#endregion
|
|
5005
|
-
export {
|
|
5017
|
+
export { j as a, M as i, W as n, k as o, z as r, O as s, $ as t };
|