@mikestools/usetable 0.0.5 → 0.0.6
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/README.md +94 -134
- package/dist/index.d.ts +210 -326
- package/dist/usetable.js +1400 -912
- package/dist/usetable.umd.cjs +1 -1
- package/package.json +4 -2
- package/showcase/examples/BasicExample.vue +1 -1
package/dist/usetable.js
CHANGED
|
@@ -1,1015 +1,1503 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function oe(l) {
|
|
12
|
-
const C = document.createElement("th");
|
|
13
|
-
return C.scope = "col", C.textContent = l, C;
|
|
14
|
-
}
|
|
15
|
-
function it(l, C, m) {
|
|
16
|
-
let c = m?.idGenerator ?? dt;
|
|
17
|
-
const B = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ new Set(), H = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Set();
|
|
18
|
-
function E() {
|
|
19
|
-
const e = l.tBodies;
|
|
20
|
-
return e.length > 0 ? e[0] : l.createTBody();
|
|
21
|
-
}
|
|
22
|
-
function v() {
|
|
23
|
-
const e = [], o = l.tBodies;
|
|
24
|
-
for (let n = 0; n < o.length; n++) {
|
|
25
|
-
const s = o[n];
|
|
26
|
-
for (let a = 0; a < s.rows.length; a++)
|
|
27
|
-
e.push(s.rows[a]);
|
|
28
|
-
}
|
|
29
|
-
return e;
|
|
30
|
-
}
|
|
31
|
-
function V(e, o, n) {
|
|
32
|
-
B.forEach((s) => s(e, o, n)), y();
|
|
33
|
-
}
|
|
34
|
-
function M(e, o, n) {
|
|
35
|
-
w.forEach((s) => s(e, o, n)), y();
|
|
36
|
-
}
|
|
37
|
-
function z(e, o, n, s) {
|
|
38
|
-
h.forEach((a) => a(e, o, n, s)), y();
|
|
39
|
-
}
|
|
40
|
-
function N(e, o, n, s) {
|
|
41
|
-
F.forEach((a) => a(e, o, n, s)), y();
|
|
42
|
-
}
|
|
43
|
-
function D() {
|
|
44
|
-
const e = i.getHeaders();
|
|
45
|
-
H.forEach((o) => o(e));
|
|
1
|
+
import { ref as H, unref as et, watch as tt, computed as D, onUnmounted as nt } from "vue";
|
|
2
|
+
function ot(t, C) {
|
|
3
|
+
const h = /* @__PURE__ */ new Set();
|
|
4
|
+
let s = null, b = !1;
|
|
5
|
+
function c(e, a, y) {
|
|
6
|
+
t.addEventListener(e, a, y);
|
|
7
|
+
const A = () => {
|
|
8
|
+
t.removeEventListener(e, a, y), h.delete(A);
|
|
9
|
+
};
|
|
10
|
+
return h.add(A), A;
|
|
46
11
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
const e = i.getData();
|
|
50
|
-
I.forEach((o) => o(e));
|
|
51
|
-
}
|
|
12
|
+
function v(e) {
|
|
13
|
+
return t.getAttribute(`aria-${e}`);
|
|
52
14
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
-
for (let n = 0; n < e.cells.length; n++)
|
|
56
|
-
o.push(U(e.cells[n]));
|
|
57
|
-
return o;
|
|
15
|
+
function w(e, a) {
|
|
16
|
+
a === null ? t.removeAttribute(`aria-${e}`) : t.setAttribute(`aria-${e}`, a);
|
|
58
17
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
getCaption() {
|
|
65
|
-
return l.caption;
|
|
18
|
+
return {
|
|
19
|
+
element: t,
|
|
20
|
+
// NODE PROPERTIES
|
|
21
|
+
get isConnected() {
|
|
22
|
+
return t.isConnected;
|
|
66
23
|
},
|
|
67
|
-
|
|
68
|
-
return
|
|
24
|
+
getTextContent() {
|
|
25
|
+
return t.textContent;
|
|
69
26
|
},
|
|
70
|
-
|
|
71
|
-
|
|
27
|
+
setTextContent(e) {
|
|
28
|
+
t.textContent = e;
|
|
72
29
|
},
|
|
73
|
-
|
|
74
|
-
|
|
30
|
+
// ELEMENT PROPERTIES
|
|
31
|
+
getId() {
|
|
32
|
+
return t.id;
|
|
75
33
|
},
|
|
76
|
-
|
|
77
|
-
|
|
34
|
+
setId(e) {
|
|
35
|
+
t.id = e;
|
|
78
36
|
},
|
|
79
|
-
|
|
80
|
-
return
|
|
81
|
-
},
|
|
82
|
-
getRow(e) {
|
|
83
|
-
return v()[e];
|
|
84
|
-
},
|
|
85
|
-
getRowById(e) {
|
|
86
|
-
const o = v();
|
|
87
|
-
for (const n of o)
|
|
88
|
-
if (n.dataset.id === e)
|
|
89
|
-
return n;
|
|
90
|
-
},
|
|
91
|
-
getCell(e, o) {
|
|
92
|
-
const n = i.getRow(e);
|
|
93
|
-
if (n)
|
|
94
|
-
return n.cells[o];
|
|
95
|
-
},
|
|
96
|
-
getCellByRowId(e, o) {
|
|
97
|
-
const n = i.getRowById(e);
|
|
98
|
-
if (n)
|
|
99
|
-
return n.cells[o];
|
|
100
|
-
},
|
|
101
|
-
// ======================================================================
|
|
102
|
-
// DATA ACCESS
|
|
103
|
-
// ======================================================================
|
|
104
|
-
getHeaders() {
|
|
105
|
-
const e = l.tHead;
|
|
106
|
-
if (!e || e.rows.length === 0) return [];
|
|
107
|
-
const o = e.rows[0], n = [];
|
|
108
|
-
for (let s = 0; s < o.cells.length; s++)
|
|
109
|
-
n.push(o.cells[s].textContent ?? "");
|
|
110
|
-
return n;
|
|
37
|
+
getTagName() {
|
|
38
|
+
return t.tagName;
|
|
111
39
|
},
|
|
112
|
-
|
|
113
|
-
return
|
|
40
|
+
getInnerHTML() {
|
|
41
|
+
return t.innerHTML;
|
|
114
42
|
},
|
|
115
|
-
|
|
116
|
-
|
|
43
|
+
setInnerHTML(e) {
|
|
44
|
+
t.innerHTML = e;
|
|
117
45
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (o)
|
|
121
|
-
return b(o);
|
|
46
|
+
getOuterHTML() {
|
|
47
|
+
return t.outerHTML;
|
|
122
48
|
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (o)
|
|
126
|
-
return b(o);
|
|
49
|
+
getInnerText() {
|
|
50
|
+
return t.innerText;
|
|
127
51
|
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (n)
|
|
131
|
-
return U(n);
|
|
52
|
+
setInnerText(e) {
|
|
53
|
+
t.innerText = e;
|
|
132
54
|
},
|
|
133
|
-
|
|
134
|
-
return
|
|
135
|
-
const s = n.cells[e];
|
|
136
|
-
return s ? U(s) : void 0;
|
|
137
|
-
});
|
|
55
|
+
getOuterText() {
|
|
56
|
+
return t.outerText;
|
|
138
57
|
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (!(!e || e.rows.length === 0))
|
|
142
|
-
return b(e.rows[0]);
|
|
58
|
+
setOuterText(e) {
|
|
59
|
+
t.outerText = e;
|
|
143
60
|
},
|
|
144
|
-
|
|
145
|
-
|
|
61
|
+
// HTMLELEMENT PROPERTIES
|
|
62
|
+
isHidden() {
|
|
63
|
+
return t.hidden;
|
|
64
|
+
},
|
|
65
|
+
setHidden(e) {
|
|
66
|
+
t.hidden = e;
|
|
67
|
+
},
|
|
68
|
+
show() {
|
|
69
|
+
t.hidden = !1;
|
|
70
|
+
},
|
|
71
|
+
hide() {
|
|
72
|
+
t.hidden = !0;
|
|
73
|
+
},
|
|
74
|
+
toggleVisibility(e) {
|
|
75
|
+
const a = e !== void 0 ? !e : !t.hidden;
|
|
76
|
+
return t.hidden = a, !a;
|
|
77
|
+
},
|
|
78
|
+
getTitle() {
|
|
79
|
+
return t.title;
|
|
80
|
+
},
|
|
81
|
+
setTitle(e) {
|
|
82
|
+
t.title = e;
|
|
83
|
+
},
|
|
84
|
+
getLang() {
|
|
85
|
+
return t.lang;
|
|
86
|
+
},
|
|
87
|
+
setLang(e) {
|
|
88
|
+
t.lang = e;
|
|
89
|
+
},
|
|
90
|
+
getDir() {
|
|
91
|
+
return t.dir;
|
|
92
|
+
},
|
|
93
|
+
setDir(e) {
|
|
94
|
+
t.dir = e;
|
|
95
|
+
},
|
|
96
|
+
getDraggable() {
|
|
97
|
+
return t.draggable;
|
|
98
|
+
},
|
|
99
|
+
setDraggable(e) {
|
|
100
|
+
t.draggable = e;
|
|
101
|
+
},
|
|
102
|
+
getSpellcheck() {
|
|
103
|
+
return t.spellcheck;
|
|
104
|
+
},
|
|
105
|
+
setSpellcheck(e) {
|
|
106
|
+
t.spellcheck = e;
|
|
107
|
+
},
|
|
108
|
+
getTranslate() {
|
|
109
|
+
return t.translate;
|
|
110
|
+
},
|
|
111
|
+
setTranslate(e) {
|
|
112
|
+
t.translate = e;
|
|
113
|
+
},
|
|
114
|
+
getInert() {
|
|
115
|
+
return t.inert;
|
|
116
|
+
},
|
|
117
|
+
setInert(e) {
|
|
118
|
+
t.inert = e;
|
|
119
|
+
},
|
|
120
|
+
getAccessKey() {
|
|
121
|
+
return t.accessKey;
|
|
122
|
+
},
|
|
123
|
+
setAccessKey(e) {
|
|
124
|
+
t.accessKey = e;
|
|
125
|
+
},
|
|
126
|
+
getAccessKeyLabel() {
|
|
127
|
+
return t.accessKeyLabel;
|
|
128
|
+
},
|
|
129
|
+
getAutocapitalize() {
|
|
130
|
+
return t.autocapitalize;
|
|
131
|
+
},
|
|
132
|
+
setAutocapitalize(e) {
|
|
133
|
+
t.autocapitalize = e;
|
|
134
|
+
},
|
|
135
|
+
// ACTIONS
|
|
136
|
+
click() {
|
|
137
|
+
t.click();
|
|
138
|
+
},
|
|
139
|
+
// POPOVER
|
|
140
|
+
getPopover() {
|
|
141
|
+
return t.popover;
|
|
142
|
+
},
|
|
143
|
+
setPopover(e) {
|
|
144
|
+
t.popover = e;
|
|
145
|
+
},
|
|
146
|
+
showPopover() {
|
|
147
|
+
t.showPopover();
|
|
148
|
+
},
|
|
149
|
+
hidePopover() {
|
|
150
|
+
t.hidePopover();
|
|
151
|
+
},
|
|
152
|
+
togglePopover(e) {
|
|
153
|
+
return t.togglePopover(e);
|
|
154
|
+
},
|
|
155
|
+
// CONTENT EDITABLE
|
|
156
|
+
isContentEditable() {
|
|
157
|
+
return t.isContentEditable;
|
|
158
|
+
},
|
|
159
|
+
getContentEditable() {
|
|
160
|
+
return t.contentEditable;
|
|
161
|
+
},
|
|
162
|
+
setContentEditable(e) {
|
|
163
|
+
t.contentEditable = e;
|
|
164
|
+
},
|
|
165
|
+
getEnterKeyHint() {
|
|
166
|
+
return t.enterKeyHint;
|
|
167
|
+
},
|
|
168
|
+
setEnterKeyHint(e) {
|
|
169
|
+
t.enterKeyHint = e;
|
|
170
|
+
},
|
|
171
|
+
getInputMode() {
|
|
172
|
+
return t.inputMode;
|
|
173
|
+
},
|
|
174
|
+
setInputMode(e) {
|
|
175
|
+
t.inputMode = e;
|
|
176
|
+
},
|
|
177
|
+
// FOCUS
|
|
178
|
+
focus(e) {
|
|
179
|
+
t.focus(e);
|
|
180
|
+
},
|
|
181
|
+
blur() {
|
|
182
|
+
t.blur();
|
|
183
|
+
},
|
|
184
|
+
hasFocus() {
|
|
185
|
+
return document.activeElement === t;
|
|
186
|
+
},
|
|
187
|
+
getTabIndex() {
|
|
188
|
+
return t.tabIndex;
|
|
189
|
+
},
|
|
190
|
+
setTabIndex(e) {
|
|
191
|
+
t.tabIndex = e;
|
|
192
|
+
},
|
|
193
|
+
// POINTER CAPTURE
|
|
194
|
+
setPointerCapture(e) {
|
|
195
|
+
t.setPointerCapture(e);
|
|
196
|
+
},
|
|
197
|
+
releasePointerCapture(e) {
|
|
198
|
+
t.releasePointerCapture(e);
|
|
199
|
+
},
|
|
200
|
+
hasPointerCapture(e) {
|
|
201
|
+
return t.hasPointerCapture(e);
|
|
202
|
+
},
|
|
203
|
+
// DATASET
|
|
204
|
+
getDataset() {
|
|
205
|
+
return t.dataset;
|
|
206
|
+
},
|
|
207
|
+
getData(e) {
|
|
208
|
+
return t.dataset[e];
|
|
209
|
+
},
|
|
210
|
+
setData(e, a) {
|
|
211
|
+
t.dataset[e] = a;
|
|
212
|
+
},
|
|
213
|
+
removeData(e) {
|
|
214
|
+
delete t.dataset[e];
|
|
215
|
+
},
|
|
216
|
+
hasData(e) {
|
|
217
|
+
return e in t.dataset;
|
|
218
|
+
},
|
|
219
|
+
getAllData() {
|
|
220
|
+
return { ...t.dataset };
|
|
221
|
+
},
|
|
222
|
+
setAllData(e) {
|
|
223
|
+
for (const a in e)
|
|
224
|
+
t.dataset[a] = e[a];
|
|
225
|
+
},
|
|
226
|
+
clearAllData() {
|
|
227
|
+
for (const e in t.dataset)
|
|
228
|
+
delete t.dataset[e];
|
|
229
|
+
},
|
|
230
|
+
// ATTRIBUTES
|
|
231
|
+
getAttribute(e) {
|
|
232
|
+
return t.getAttribute(e);
|
|
233
|
+
},
|
|
234
|
+
setAttribute(e, a) {
|
|
235
|
+
t.setAttribute(e, a);
|
|
236
|
+
},
|
|
237
|
+
removeAttribute(e) {
|
|
238
|
+
t.removeAttribute(e);
|
|
239
|
+
},
|
|
240
|
+
hasAttribute(e) {
|
|
241
|
+
return t.hasAttribute(e);
|
|
242
|
+
},
|
|
243
|
+
toggleAttribute(e, a) {
|
|
244
|
+
return t.toggleAttribute(e, a);
|
|
245
|
+
},
|
|
246
|
+
getAttributeNames() {
|
|
247
|
+
return t.getAttributeNames();
|
|
248
|
+
},
|
|
249
|
+
// CLASSES
|
|
250
|
+
addClass(...e) {
|
|
251
|
+
t.classList.add(...e);
|
|
252
|
+
},
|
|
253
|
+
removeClass(...e) {
|
|
254
|
+
t.classList.remove(...e);
|
|
255
|
+
},
|
|
256
|
+
toggleClass(e, a) {
|
|
257
|
+
return t.classList.toggle(e, a);
|
|
258
|
+
},
|
|
259
|
+
hasClass(e) {
|
|
260
|
+
return t.classList.contains(e);
|
|
261
|
+
},
|
|
262
|
+
replaceClass(e, a) {
|
|
263
|
+
return t.classList.replace(e, a);
|
|
264
|
+
},
|
|
265
|
+
getClassName() {
|
|
266
|
+
return t.className;
|
|
267
|
+
},
|
|
268
|
+
setClassName(e) {
|
|
269
|
+
t.className = e;
|
|
270
|
+
},
|
|
271
|
+
// STYLES
|
|
272
|
+
getStyleDeclaration() {
|
|
273
|
+
return t.style;
|
|
274
|
+
},
|
|
275
|
+
getStyle(e) {
|
|
276
|
+
return t.style.getPropertyValue(e);
|
|
277
|
+
},
|
|
278
|
+
setStyle(e, a, y) {
|
|
279
|
+
t.style.setProperty(e, a, y);
|
|
280
|
+
},
|
|
281
|
+
removeStyle(e) {
|
|
282
|
+
return t.style.removeProperty(e);
|
|
283
|
+
},
|
|
284
|
+
getCSSText() {
|
|
285
|
+
return t.style.cssText;
|
|
286
|
+
},
|
|
287
|
+
setCSSText(e) {
|
|
288
|
+
t.style.cssText = e;
|
|
289
|
+
},
|
|
290
|
+
getComputedStyle(e, a) {
|
|
291
|
+
return window.getComputedStyle(t, a).getPropertyValue(e);
|
|
292
|
+
},
|
|
293
|
+
getComputedStyleDeclaration(e) {
|
|
294
|
+
return window.getComputedStyle(t, e);
|
|
295
|
+
},
|
|
296
|
+
// DIMENSIONS
|
|
297
|
+
getBoundingClientRect() {
|
|
298
|
+
return t.getBoundingClientRect();
|
|
299
|
+
},
|
|
300
|
+
getClientRects() {
|
|
301
|
+
return t.getClientRects();
|
|
302
|
+
},
|
|
303
|
+
getClientWidth() {
|
|
304
|
+
return t.clientWidth;
|
|
305
|
+
},
|
|
306
|
+
getClientHeight() {
|
|
307
|
+
return t.clientHeight;
|
|
308
|
+
},
|
|
309
|
+
getClientTop() {
|
|
310
|
+
return t.clientTop;
|
|
311
|
+
},
|
|
312
|
+
getClientLeft() {
|
|
313
|
+
return t.clientLeft;
|
|
314
|
+
},
|
|
315
|
+
getScrollWidth() {
|
|
316
|
+
return t.scrollWidth;
|
|
317
|
+
},
|
|
318
|
+
getScrollHeight() {
|
|
319
|
+
return t.scrollHeight;
|
|
320
|
+
},
|
|
321
|
+
getScrollTop() {
|
|
322
|
+
return t.scrollTop;
|
|
323
|
+
},
|
|
324
|
+
setScrollTop(e) {
|
|
325
|
+
t.scrollTop = e;
|
|
326
|
+
},
|
|
327
|
+
getScrollLeft() {
|
|
328
|
+
return t.scrollLeft;
|
|
329
|
+
},
|
|
330
|
+
setScrollLeft(e) {
|
|
331
|
+
t.scrollLeft = e;
|
|
332
|
+
},
|
|
333
|
+
scrollTo(e) {
|
|
334
|
+
t.scrollTo(e);
|
|
335
|
+
},
|
|
336
|
+
scrollBy(e) {
|
|
337
|
+
t.scrollBy(e);
|
|
338
|
+
},
|
|
339
|
+
scrollIntoView(e) {
|
|
340
|
+
t.scrollIntoView(e);
|
|
341
|
+
},
|
|
342
|
+
// OFFSET DIMENSIONS
|
|
343
|
+
getOffsetWidth() {
|
|
344
|
+
return t.offsetWidth;
|
|
345
|
+
},
|
|
346
|
+
getOffsetHeight() {
|
|
347
|
+
return t.offsetHeight;
|
|
348
|
+
},
|
|
349
|
+
getOffsetTop() {
|
|
350
|
+
return t.offsetTop;
|
|
351
|
+
},
|
|
352
|
+
getOffsetLeft() {
|
|
353
|
+
return t.offsetLeft;
|
|
354
|
+
},
|
|
355
|
+
getOffsetParent() {
|
|
356
|
+
return t.offsetParent;
|
|
357
|
+
},
|
|
358
|
+
// HIERARCHY
|
|
359
|
+
getParent() {
|
|
360
|
+
return t.parentElement;
|
|
361
|
+
},
|
|
362
|
+
getParentNode() {
|
|
363
|
+
return t.parentNode;
|
|
364
|
+
},
|
|
365
|
+
getChildren() {
|
|
366
|
+
return t.children;
|
|
367
|
+
},
|
|
368
|
+
getFirstChild() {
|
|
369
|
+
return t.firstElementChild;
|
|
370
|
+
},
|
|
371
|
+
getLastChild() {
|
|
372
|
+
return t.lastElementChild;
|
|
373
|
+
},
|
|
374
|
+
getNextSibling() {
|
|
375
|
+
return t.nextElementSibling;
|
|
376
|
+
},
|
|
377
|
+
getPreviousSibling() {
|
|
378
|
+
return t.previousElementSibling;
|
|
379
|
+
},
|
|
380
|
+
getChildCount() {
|
|
381
|
+
return t.childElementCount;
|
|
382
|
+
},
|
|
383
|
+
hasChildren() {
|
|
384
|
+
return t.childElementCount > 0;
|
|
385
|
+
},
|
|
386
|
+
hasChildNodes() {
|
|
387
|
+
return t.hasChildNodes();
|
|
388
|
+
},
|
|
389
|
+
contains(e) {
|
|
390
|
+
return t.contains(e);
|
|
391
|
+
},
|
|
392
|
+
cloneNode(e) {
|
|
393
|
+
return t.cloneNode(e);
|
|
394
|
+
},
|
|
395
|
+
getRootNode(e) {
|
|
396
|
+
return t.getRootNode(e);
|
|
397
|
+
},
|
|
398
|
+
normalize() {
|
|
399
|
+
t.normalize();
|
|
400
|
+
},
|
|
401
|
+
isEqualNode(e) {
|
|
402
|
+
return t.isEqualNode(e);
|
|
403
|
+
},
|
|
404
|
+
isSameNode(e) {
|
|
405
|
+
return t.isSameNode(e);
|
|
406
|
+
},
|
|
407
|
+
compareDocumentPosition(e) {
|
|
408
|
+
return t.compareDocumentPosition(e);
|
|
409
|
+
},
|
|
410
|
+
// DOM MANIPULATION
|
|
411
|
+
append(...e) {
|
|
412
|
+
t.append(...e);
|
|
413
|
+
},
|
|
414
|
+
prepend(...e) {
|
|
415
|
+
t.prepend(...e);
|
|
416
|
+
},
|
|
417
|
+
insertBefore(...e) {
|
|
418
|
+
t.before(...e);
|
|
419
|
+
},
|
|
420
|
+
insertAfter(...e) {
|
|
421
|
+
t.after(...e);
|
|
422
|
+
},
|
|
423
|
+
remove() {
|
|
424
|
+
t.remove();
|
|
425
|
+
},
|
|
426
|
+
replaceWith(...e) {
|
|
427
|
+
t.replaceWith(...e);
|
|
428
|
+
},
|
|
429
|
+
replaceChildren(...e) {
|
|
430
|
+
t.replaceChildren(...e);
|
|
431
|
+
},
|
|
432
|
+
// QUERY
|
|
433
|
+
querySelector(e) {
|
|
434
|
+
return t.querySelector(e);
|
|
435
|
+
},
|
|
436
|
+
querySelectorAll(e) {
|
|
437
|
+
return t.querySelectorAll(e);
|
|
438
|
+
},
|
|
439
|
+
closest(e) {
|
|
440
|
+
return t.closest(e);
|
|
441
|
+
},
|
|
442
|
+
matches(e) {
|
|
443
|
+
return t.matches(e);
|
|
444
|
+
},
|
|
445
|
+
insertAdjacentHTML(e, a) {
|
|
446
|
+
t.insertAdjacentHTML(e, a);
|
|
447
|
+
},
|
|
448
|
+
insertAdjacentText(e, a) {
|
|
449
|
+
t.insertAdjacentText(e, a);
|
|
450
|
+
},
|
|
451
|
+
insertAdjacentElement(e, a) {
|
|
452
|
+
return t.insertAdjacentElement(e, a);
|
|
453
|
+
},
|
|
454
|
+
// EVENTS
|
|
455
|
+
dispatchEvent(e) {
|
|
456
|
+
return t.dispatchEvent(e);
|
|
457
|
+
},
|
|
458
|
+
// ARIA
|
|
459
|
+
getRole() {
|
|
460
|
+
return t.getAttribute("role");
|
|
461
|
+
},
|
|
462
|
+
setRole(e) {
|
|
463
|
+
e === null ? t.removeAttribute("role") : t.setAttribute("role", e);
|
|
464
|
+
},
|
|
465
|
+
getAriaLabel() {
|
|
466
|
+
return v("label");
|
|
467
|
+
},
|
|
468
|
+
setAriaLabel(e) {
|
|
469
|
+
w("label", e);
|
|
470
|
+
},
|
|
471
|
+
getAriaHidden() {
|
|
472
|
+
return v("hidden");
|
|
473
|
+
},
|
|
474
|
+
setAriaHidden(e) {
|
|
475
|
+
w("hidden", e);
|
|
476
|
+
},
|
|
477
|
+
getAriaDisabled() {
|
|
478
|
+
return v("disabled");
|
|
479
|
+
},
|
|
480
|
+
setAriaDisabled(e) {
|
|
481
|
+
w("disabled", e);
|
|
482
|
+
},
|
|
483
|
+
getAriaExpanded() {
|
|
484
|
+
return v("expanded");
|
|
485
|
+
},
|
|
486
|
+
setAriaExpanded(e) {
|
|
487
|
+
w("expanded", e);
|
|
488
|
+
},
|
|
489
|
+
getAriaSelected() {
|
|
490
|
+
return v("selected");
|
|
491
|
+
},
|
|
492
|
+
setAriaSelected(e) {
|
|
493
|
+
w("selected", e);
|
|
494
|
+
},
|
|
495
|
+
getAriaPressed() {
|
|
496
|
+
return v("pressed");
|
|
497
|
+
},
|
|
498
|
+
setAriaPressed(e) {
|
|
499
|
+
w("pressed", e);
|
|
500
|
+
},
|
|
501
|
+
getAriaChecked() {
|
|
502
|
+
return v("checked");
|
|
503
|
+
},
|
|
504
|
+
setAriaChecked(e) {
|
|
505
|
+
w("checked", e);
|
|
506
|
+
},
|
|
507
|
+
getAriaDescribedBy() {
|
|
508
|
+
return v("describedby");
|
|
509
|
+
},
|
|
510
|
+
setAriaDescribedBy(e) {
|
|
511
|
+
w("describedby", e);
|
|
512
|
+
},
|
|
513
|
+
getAriaLabelledBy() {
|
|
514
|
+
return v("labelledby");
|
|
515
|
+
},
|
|
516
|
+
setAriaLabelledBy(e) {
|
|
517
|
+
w("labelledby", e);
|
|
518
|
+
},
|
|
519
|
+
// EVENTS - Mouse
|
|
520
|
+
onClick(e) {
|
|
521
|
+
return c("click", e);
|
|
522
|
+
},
|
|
523
|
+
onDblClick(e) {
|
|
524
|
+
return c("dblclick", e);
|
|
525
|
+
},
|
|
526
|
+
onMouseDown(e) {
|
|
527
|
+
return c("mousedown", e);
|
|
528
|
+
},
|
|
529
|
+
onMouseUp(e) {
|
|
530
|
+
return c("mouseup", e);
|
|
531
|
+
},
|
|
532
|
+
onMouseEnter(e) {
|
|
533
|
+
return c("mouseenter", e);
|
|
534
|
+
},
|
|
535
|
+
onMouseLeave(e) {
|
|
536
|
+
return c("mouseleave", e);
|
|
537
|
+
},
|
|
538
|
+
onMouseMove(e) {
|
|
539
|
+
return c("mousemove", e);
|
|
540
|
+
},
|
|
541
|
+
onMouseOver(e) {
|
|
542
|
+
return c("mouseover", e);
|
|
543
|
+
},
|
|
544
|
+
onMouseOut(e) {
|
|
545
|
+
return c("mouseout", e);
|
|
546
|
+
},
|
|
547
|
+
onContextMenu(e) {
|
|
548
|
+
return c("contextmenu", e);
|
|
549
|
+
},
|
|
550
|
+
onWheel(e) {
|
|
551
|
+
return c("wheel", e);
|
|
552
|
+
},
|
|
553
|
+
// EVENTS - Keyboard
|
|
554
|
+
onKeyDown(e) {
|
|
555
|
+
return c("keydown", e);
|
|
556
|
+
},
|
|
557
|
+
onKeyUp(e) {
|
|
558
|
+
return c("keyup", e);
|
|
559
|
+
},
|
|
560
|
+
// EVENTS - Focus
|
|
561
|
+
onFocus(e) {
|
|
562
|
+
return c("focus", e);
|
|
563
|
+
},
|
|
564
|
+
onBlur(e) {
|
|
565
|
+
return c("blur", e);
|
|
566
|
+
},
|
|
567
|
+
onFocusIn(e) {
|
|
568
|
+
return c("focusin", e);
|
|
569
|
+
},
|
|
570
|
+
onFocusOut(e) {
|
|
571
|
+
return c("focusout", e);
|
|
572
|
+
},
|
|
573
|
+
// EVENTS - Input
|
|
574
|
+
onInput(e) {
|
|
575
|
+
return c("input", e);
|
|
576
|
+
},
|
|
577
|
+
onChange(e) {
|
|
578
|
+
return c("change", e);
|
|
579
|
+
},
|
|
580
|
+
onBeforeInput(e) {
|
|
581
|
+
return c("beforeinput", e);
|
|
582
|
+
},
|
|
583
|
+
// EVENTS - Pointer
|
|
584
|
+
onPointerDown(e) {
|
|
585
|
+
return c("pointerdown", e);
|
|
586
|
+
},
|
|
587
|
+
onPointerUp(e) {
|
|
588
|
+
return c("pointerup", e);
|
|
589
|
+
},
|
|
590
|
+
onPointerMove(e) {
|
|
591
|
+
return c("pointermove", e);
|
|
592
|
+
},
|
|
593
|
+
onPointerEnter(e) {
|
|
594
|
+
return c("pointerenter", e);
|
|
595
|
+
},
|
|
596
|
+
onPointerLeave(e) {
|
|
597
|
+
return c("pointerleave", e);
|
|
598
|
+
},
|
|
599
|
+
onPointerCancel(e) {
|
|
600
|
+
return c("pointercancel", e);
|
|
601
|
+
},
|
|
602
|
+
// EVENTS - Touch
|
|
603
|
+
onTouchStart(e) {
|
|
604
|
+
return c("touchstart", e);
|
|
605
|
+
},
|
|
606
|
+
onTouchEnd(e) {
|
|
607
|
+
return c("touchend", e);
|
|
608
|
+
},
|
|
609
|
+
onTouchMove(e) {
|
|
610
|
+
return c("touchmove", e);
|
|
611
|
+
},
|
|
612
|
+
onTouchCancel(e) {
|
|
613
|
+
return c("touchcancel", e);
|
|
614
|
+
},
|
|
615
|
+
// EVENTS - Drag
|
|
616
|
+
onDragStart(e) {
|
|
617
|
+
return c("dragstart", e);
|
|
618
|
+
},
|
|
619
|
+
onDrag(e) {
|
|
620
|
+
return c("drag", e);
|
|
621
|
+
},
|
|
622
|
+
onDragEnd(e) {
|
|
623
|
+
return c("dragend", e);
|
|
624
|
+
},
|
|
625
|
+
onDragEnter(e) {
|
|
626
|
+
return c("dragenter", e);
|
|
627
|
+
},
|
|
628
|
+
onDragOver(e) {
|
|
629
|
+
return c("dragover", e);
|
|
630
|
+
},
|
|
631
|
+
onDragLeave(e) {
|
|
632
|
+
return c("dragleave", e);
|
|
633
|
+
},
|
|
634
|
+
onDrop(e) {
|
|
635
|
+
return c("drop", e);
|
|
636
|
+
},
|
|
637
|
+
// EVENTS - Clipboard
|
|
638
|
+
onCopy(e) {
|
|
639
|
+
return c("copy", e);
|
|
640
|
+
},
|
|
641
|
+
onCut(e) {
|
|
642
|
+
return c("cut", e);
|
|
643
|
+
},
|
|
644
|
+
onPaste(e) {
|
|
645
|
+
return c("paste", e);
|
|
646
|
+
},
|
|
647
|
+
// EVENTS - Animation/Transition
|
|
648
|
+
onAnimationStart(e) {
|
|
649
|
+
return c("animationstart", e);
|
|
650
|
+
},
|
|
651
|
+
onAnimationEnd(e) {
|
|
652
|
+
return c("animationend", e);
|
|
653
|
+
},
|
|
654
|
+
onAnimationIteration(e) {
|
|
655
|
+
return c("animationiteration", e);
|
|
656
|
+
},
|
|
657
|
+
onAnimationCancel(e) {
|
|
658
|
+
return c("animationcancel", e);
|
|
659
|
+
},
|
|
660
|
+
onTransitionStart(e) {
|
|
661
|
+
return c("transitionstart", e);
|
|
662
|
+
},
|
|
663
|
+
onTransitionEnd(e) {
|
|
664
|
+
return c("transitionend", e);
|
|
665
|
+
},
|
|
666
|
+
onTransitionRun(e) {
|
|
667
|
+
return c("transitionrun", e);
|
|
668
|
+
},
|
|
669
|
+
onTransitionCancel(e) {
|
|
670
|
+
return c("transitioncancel", e);
|
|
671
|
+
},
|
|
672
|
+
// EVENTS - Scroll
|
|
673
|
+
onScroll(e) {
|
|
674
|
+
return c("scroll", e);
|
|
675
|
+
},
|
|
676
|
+
onScrollEnd(e) {
|
|
677
|
+
return c("scrollend", e);
|
|
678
|
+
},
|
|
679
|
+
// EVENTS - Generic
|
|
680
|
+
on(e, a, y) {
|
|
681
|
+
return c(e, a, y);
|
|
682
|
+
},
|
|
683
|
+
// LIFECYCLE
|
|
684
|
+
sync() {
|
|
685
|
+
},
|
|
686
|
+
destroy() {
|
|
687
|
+
if (!b) {
|
|
688
|
+
b = !0;
|
|
689
|
+
for (const e of h) e();
|
|
690
|
+
h.clear(), s?.disconnect(), s = null;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
const V = /* @__PURE__ */ Symbol("idGenerated");
|
|
696
|
+
function ne() {
|
|
697
|
+
return crypto.randomUUID();
|
|
698
|
+
}
|
|
699
|
+
function at(t, C = ne) {
|
|
700
|
+
return "id" in t && typeof t.id == "string" && t.id.length > 0 ? t : {
|
|
701
|
+
...t,
|
|
702
|
+
id: C(),
|
|
703
|
+
[V]: !0
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
function rt(t) {
|
|
707
|
+
return V in t && t[V] === !0;
|
|
708
|
+
}
|
|
709
|
+
function st(t) {
|
|
710
|
+
return typeof t == "string" && t.length > 0;
|
|
711
|
+
}
|
|
712
|
+
function it(t, C) {
|
|
713
|
+
return t.find((h) => h.id === C);
|
|
714
|
+
}
|
|
715
|
+
function ct(t, C) {
|
|
716
|
+
return t.findIndex((h) => h.id === C);
|
|
717
|
+
}
|
|
718
|
+
function dt(t) {
|
|
719
|
+
if (!rt(t))
|
|
720
|
+
return t;
|
|
721
|
+
const { id: C, ...h } = t;
|
|
722
|
+
return h;
|
|
723
|
+
}
|
|
724
|
+
function E(t, C) {
|
|
725
|
+
t.textContent = "", C != null && (C instanceof Node ? t.appendChild(C) : t.textContent = String(C));
|
|
726
|
+
}
|
|
727
|
+
function W(t) {
|
|
728
|
+
return t.childNodes.length === 1 && t.firstChild instanceof HTMLElement ? t.firstChild : t.textContent ?? "";
|
|
729
|
+
}
|
|
730
|
+
function k(t) {
|
|
731
|
+
const C = [];
|
|
732
|
+
for (let h = 0; h < t.cells.length; h++)
|
|
733
|
+
C.push(W(t.cells[h]));
|
|
734
|
+
return C;
|
|
735
|
+
}
|
|
736
|
+
function lt(t, C, h) {
|
|
737
|
+
const s = ot(t), b = h?.idGenerator ?? ne, c = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set();
|
|
738
|
+
function e() {
|
|
739
|
+
return t.tBodies.length > 0 ? t.tBodies[0] : t.createTBody();
|
|
740
|
+
}
|
|
741
|
+
function a() {
|
|
742
|
+
const o = [];
|
|
743
|
+
for (let r = 0; r < t.tBodies.length; r++) {
|
|
744
|
+
const l = t.tBodies[r];
|
|
745
|
+
for (let i = 0; i < l.rows.length; i++)
|
|
746
|
+
o.push(l.rows[i]);
|
|
747
|
+
}
|
|
748
|
+
return o;
|
|
749
|
+
}
|
|
750
|
+
function y(o, r) {
|
|
751
|
+
c.forEach((l) => l(o, r)), R();
|
|
752
|
+
}
|
|
753
|
+
function A(o, r) {
|
|
754
|
+
v.forEach((l) => l(o, r)), R();
|
|
755
|
+
}
|
|
756
|
+
function R() {
|
|
757
|
+
w.forEach((o) => o());
|
|
758
|
+
}
|
|
759
|
+
const f = {
|
|
760
|
+
...s,
|
|
761
|
+
// === NATIVE TABLE STRUCTURE ===
|
|
762
|
+
getTableCaption() {
|
|
763
|
+
return t.caption;
|
|
764
|
+
},
|
|
765
|
+
setTableCaption(o) {
|
|
766
|
+
t.caption = o;
|
|
146
767
|
},
|
|
147
|
-
getColumnCount() {
|
|
148
|
-
const e = i.getHeaders();
|
|
149
|
-
if (e.length > 0) return e.length;
|
|
150
|
-
const o = v();
|
|
151
|
-
return o.length > 0 ? o[0].cells.length : 0;
|
|
152
|
-
},
|
|
153
|
-
getRowId(e) {
|
|
154
|
-
return i.getRow(e)?.dataset.id;
|
|
155
|
-
},
|
|
156
|
-
getRowIndex(e) {
|
|
157
|
-
const o = v();
|
|
158
|
-
for (let n = 0; n < o.length; n++)
|
|
159
|
-
if (o[n].dataset.id === e)
|
|
160
|
-
return n;
|
|
161
|
-
return -1;
|
|
162
|
-
},
|
|
163
|
-
getAllRowIds() {
|
|
164
|
-
const e = v(), o = [];
|
|
165
|
-
for (const n of e)
|
|
166
|
-
n.dataset.id && o.push(n.dataset.id);
|
|
167
|
-
return o;
|
|
168
|
-
},
|
|
169
|
-
// ======================================================================
|
|
170
|
-
// STRUCTURE METHODS
|
|
171
|
-
// ======================================================================
|
|
172
768
|
createCaption() {
|
|
173
|
-
return
|
|
769
|
+
return t.createCaption();
|
|
174
770
|
},
|
|
175
771
|
deleteCaption() {
|
|
176
|
-
|
|
772
|
+
t.deleteCaption();
|
|
773
|
+
},
|
|
774
|
+
getTHead() {
|
|
775
|
+
return t.tHead;
|
|
776
|
+
},
|
|
777
|
+
setTHead(o) {
|
|
778
|
+
t.tHead = o;
|
|
177
779
|
},
|
|
178
780
|
createTHead() {
|
|
179
|
-
return
|
|
781
|
+
return t.createTHead();
|
|
180
782
|
},
|
|
181
783
|
deleteTHead() {
|
|
182
|
-
|
|
784
|
+
t.deleteTHead();
|
|
785
|
+
},
|
|
786
|
+
getTFoot() {
|
|
787
|
+
return t.tFoot;
|
|
788
|
+
},
|
|
789
|
+
setTFoot(o) {
|
|
790
|
+
t.tFoot = o;
|
|
183
791
|
},
|
|
184
792
|
createTFoot() {
|
|
185
|
-
return
|
|
793
|
+
return t.createTFoot();
|
|
186
794
|
},
|
|
187
795
|
deleteTFoot() {
|
|
188
|
-
|
|
796
|
+
t.deleteTFoot();
|
|
797
|
+
},
|
|
798
|
+
getTBodies() {
|
|
799
|
+
return t.tBodies;
|
|
189
800
|
},
|
|
190
801
|
createTBody() {
|
|
191
|
-
return
|
|
192
|
-
},
|
|
193
|
-
// ======================================================================
|
|
194
|
-
// SECTION-SPECIFIC ROW METHODS
|
|
195
|
-
// ======================================================================
|
|
196
|
-
getSectionRows(e) {
|
|
197
|
-
return e.rows;
|
|
198
|
-
},
|
|
199
|
-
insertSectionRow(e, o, n, s) {
|
|
200
|
-
const a = n ?? e.rows.length, d = e.insertRow(a);
|
|
201
|
-
s ? d.dataset.id = s : e === l.tBodies[0] && (d.dataset.id = c());
|
|
202
|
-
for (const g of o) {
|
|
203
|
-
const f = d.insertCell();
|
|
204
|
-
T(f, g);
|
|
205
|
-
}
|
|
206
|
-
return l.tBodies && Array.from(l.tBodies).includes(e) && V([...o], a, d.dataset.id), d;
|
|
207
|
-
},
|
|
208
|
-
deleteSectionRow(e, o) {
|
|
209
|
-
if (o < 0 || o >= e.rows.length) return;
|
|
210
|
-
const n = e.rows[o], s = b(n), a = n.dataset.id;
|
|
211
|
-
return e.deleteRow(o), l.tBodies && Array.from(l.tBodies).includes(e) && M(s, o, a), s;
|
|
212
|
-
},
|
|
213
|
-
getSectionRowCount(e) {
|
|
214
|
-
return e.rows.length;
|
|
215
|
-
},
|
|
216
|
-
addHeadRow(e, o) {
|
|
217
|
-
let n = l.tHead;
|
|
218
|
-
return n || (n = l.createTHead()), i.insertSectionRow(n, e, o);
|
|
219
|
-
},
|
|
220
|
-
removeHeadRow(e) {
|
|
221
|
-
const o = l.tHead;
|
|
222
|
-
if (!o) return;
|
|
223
|
-
const n = i.deleteSectionRow(o, e);
|
|
224
|
-
return n && D(), n;
|
|
225
|
-
},
|
|
226
|
-
getHeadRowCount() {
|
|
227
|
-
const e = l.tHead;
|
|
228
|
-
return e ? e.rows.length : 0;
|
|
229
|
-
},
|
|
230
|
-
addFootRow(e, o) {
|
|
231
|
-
let n = l.tFoot;
|
|
232
|
-
n || (n = l.createTFoot());
|
|
233
|
-
const s = i.insertSectionRow(n, e, o);
|
|
234
|
-
return y(), s;
|
|
235
|
-
},
|
|
236
|
-
removeFootRow(e) {
|
|
237
|
-
const o = l.tFoot;
|
|
238
|
-
if (!o) return;
|
|
239
|
-
const n = i.deleteSectionRow(o, e);
|
|
240
|
-
return n && y(), n;
|
|
241
|
-
},
|
|
242
|
-
getFootRowCount() {
|
|
243
|
-
const e = l.tFoot;
|
|
244
|
-
return e ? e.rows.length : 0;
|
|
245
|
-
},
|
|
246
|
-
addBodyRow(e, o, n, s) {
|
|
247
|
-
const a = l.tBodies;
|
|
248
|
-
let d;
|
|
249
|
-
return o !== void 0 && o >= 0 && o < a.length ? d = a[o] : d = E(), i.insertSectionRow(d, e, n, s);
|
|
250
|
-
},
|
|
251
|
-
removeBodyRow(e, o) {
|
|
252
|
-
const n = l.tBodies;
|
|
253
|
-
if (n.length === 0) return;
|
|
254
|
-
let s;
|
|
255
|
-
return o !== void 0 && o >= 0 && o < n.length ? s = n[o] : s = n[0], i.deleteSectionRow(s, e);
|
|
256
|
-
},
|
|
257
|
-
getBodyRowCount(e) {
|
|
258
|
-
const o = l.tBodies;
|
|
259
|
-
if (o.length === 0) return 0;
|
|
260
|
-
if (e !== void 0 && e >= 0 && e < o.length)
|
|
261
|
-
return o[e].rows.length;
|
|
262
|
-
let n = 0;
|
|
263
|
-
for (let s = 0; s < o.length; s++)
|
|
264
|
-
n += o[s].rows.length;
|
|
265
|
-
return n;
|
|
266
|
-
},
|
|
267
|
-
// ======================================================================
|
|
268
|
-
// HEADER METHODS
|
|
269
|
-
// ======================================================================
|
|
270
|
-
setHeaders(e) {
|
|
271
|
-
let o = l.tHead;
|
|
272
|
-
for (o || (o = l.createTHead()); o.rows.length > 0; )
|
|
273
|
-
o.deleteRow(0);
|
|
274
|
-
const n = o.insertRow();
|
|
275
|
-
for (const s of e)
|
|
276
|
-
n.appendChild(oe(s));
|
|
277
|
-
D();
|
|
278
|
-
},
|
|
279
|
-
setHeader(e, o) {
|
|
280
|
-
const n = l.tHead;
|
|
281
|
-
if (!n || n.rows.length === 0) return;
|
|
282
|
-
const s = n.rows[0].cells[e];
|
|
283
|
-
s && (s.textContent = o, D());
|
|
284
|
-
},
|
|
285
|
-
addHeader(e, o) {
|
|
286
|
-
let n = l.tHead;
|
|
287
|
-
n || (n = l.createTHead(), n.insertRow()), n.rows.length === 0 && n.insertRow();
|
|
288
|
-
const s = n.rows[0], a = oe(e);
|
|
289
|
-
o === void 0 || o >= s.cells.length ? s.appendChild(a) : s.insertBefore(a, s.cells[o]), D();
|
|
290
|
-
},
|
|
291
|
-
removeHeader(e) {
|
|
292
|
-
const o = l.tHead;
|
|
293
|
-
if (!o || o.rows.length === 0) return;
|
|
294
|
-
const n = o.rows[0];
|
|
295
|
-
e >= 0 && e < n.cells.length && (n.deleteCell(e), D());
|
|
296
|
-
},
|
|
297
|
-
// ======================================================================
|
|
298
|
-
// ROW METHODS
|
|
299
|
-
// ======================================================================
|
|
300
|
-
addRow(e, o, n) {
|
|
301
|
-
const s = E(), a = o ?? s.rows.length, d = s.insertRow(a), g = n ?? c();
|
|
302
|
-
d.dataset.id = g;
|
|
303
|
-
for (const f of e) {
|
|
304
|
-
const S = d.insertCell();
|
|
305
|
-
T(S, f);
|
|
306
|
-
}
|
|
307
|
-
return V([...e], a, g), d;
|
|
308
|
-
},
|
|
309
|
-
removeRow(e) {
|
|
310
|
-
const o = v();
|
|
311
|
-
if (e < 0 || e >= o.length) return;
|
|
312
|
-
const n = o[e], s = b(n), a = n.dataset.id;
|
|
313
|
-
return n.remove(), M(s, e, a), s;
|
|
314
|
-
},
|
|
315
|
-
removeRowById(e) {
|
|
316
|
-
const o = i.getRowIndex(e);
|
|
317
|
-
if (o !== -1)
|
|
318
|
-
return i.removeRow(o);
|
|
319
|
-
},
|
|
320
|
-
updateRow(e, o) {
|
|
321
|
-
const n = i.getRow(e);
|
|
322
|
-
if (!n) return;
|
|
323
|
-
const s = b(n), a = n.dataset.id;
|
|
324
|
-
for (let d = 0; d < o.length; d++) {
|
|
325
|
-
let g = n.cells[d];
|
|
326
|
-
g || (g = n.insertCell()), T(g, o[d]);
|
|
327
|
-
}
|
|
328
|
-
for (; n.cells.length > o.length; )
|
|
329
|
-
n.deleteCell(n.cells.length - 1);
|
|
330
|
-
z(e, s, [...o], a);
|
|
331
|
-
},
|
|
332
|
-
updateRowById(e, o) {
|
|
333
|
-
const n = i.getRowIndex(e);
|
|
334
|
-
n !== -1 && i.updateRow(n, o);
|
|
335
|
-
},
|
|
336
|
-
moveRow(e, o) {
|
|
337
|
-
const n = v();
|
|
338
|
-
if (e < 0 || e >= n.length || o < 0 || o >= n.length || e === o) return;
|
|
339
|
-
const s = n[e], a = s.parentElement;
|
|
340
|
-
if (o > e) {
|
|
341
|
-
const d = n[o];
|
|
342
|
-
a.insertBefore(s, d.nextSibling);
|
|
343
|
-
} else {
|
|
344
|
-
const d = n[o];
|
|
345
|
-
a.insertBefore(s, d);
|
|
346
|
-
}
|
|
347
|
-
y();
|
|
802
|
+
return t.createTBody();
|
|
348
803
|
},
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
if (e < 0 || e >= n.length || o < 0 || o >= n.length || e === o) return;
|
|
352
|
-
const s = n[e], a = n[o], d = s.parentElement, g = document.createElement("tr");
|
|
353
|
-
d.insertBefore(g, s), d.insertBefore(s, a), d.insertBefore(a, g), g.remove(), y();
|
|
804
|
+
getTableRows() {
|
|
805
|
+
return t.rows;
|
|
354
806
|
},
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
for (let o = 0; o < e.length; o++) {
|
|
358
|
-
const n = e[o];
|
|
359
|
-
for (; n.rows.length > 0; )
|
|
360
|
-
n.deleteRow(0);
|
|
361
|
-
}
|
|
362
|
-
y();
|
|
363
|
-
},
|
|
364
|
-
// ======================================================================
|
|
365
|
-
// COLUMN METHODS
|
|
366
|
-
// ======================================================================
|
|
367
|
-
addColumn(e, o, n) {
|
|
368
|
-
i.addHeader(e, n);
|
|
369
|
-
const s = v();
|
|
370
|
-
for (const d of s) {
|
|
371
|
-
const g = d.insertCell(n ?? d.cells.length);
|
|
372
|
-
T(g, o ?? "");
|
|
373
|
-
}
|
|
374
|
-
const a = l.tFoot;
|
|
375
|
-
if (a && a.rows.length > 0) {
|
|
376
|
-
const d = a.rows[0], g = d.insertCell(n ?? d.cells.length);
|
|
377
|
-
T(g, "");
|
|
378
|
-
}
|
|
379
|
-
y();
|
|
380
|
-
},
|
|
381
|
-
removeColumn(e) {
|
|
382
|
-
i.removeHeader(e);
|
|
383
|
-
const o = v();
|
|
384
|
-
for (const s of o)
|
|
385
|
-
e >= 0 && e < s.cells.length && s.deleteCell(e);
|
|
386
|
-
const n = l.tFoot;
|
|
387
|
-
if (n && n.rows.length > 0) {
|
|
388
|
-
const s = n.rows[0];
|
|
389
|
-
e >= 0 && e < s.cells.length && s.deleteCell(e);
|
|
390
|
-
}
|
|
391
|
-
y();
|
|
392
|
-
},
|
|
393
|
-
moveColumn(e, o) {
|
|
394
|
-
const n = i.getColumnCount();
|
|
395
|
-
if (e < 0 || e >= n || o < 0 || o >= n || e === o) return;
|
|
396
|
-
const s = (f) => {
|
|
397
|
-
if (e >= f.cells.length) return;
|
|
398
|
-
const S = f.cells[e];
|
|
399
|
-
o >= f.cells.length ? f.appendChild(S) : o > e ? f.insertBefore(S, f.cells[o + 1]) : f.insertBefore(S, f.cells[o]);
|
|
400
|
-
}, a = l.tHead;
|
|
401
|
-
if (a)
|
|
402
|
-
for (let f = 0; f < a.rows.length; f++)
|
|
403
|
-
s(a.rows[f]);
|
|
404
|
-
const d = v();
|
|
405
|
-
for (const f of d)
|
|
406
|
-
s(f);
|
|
407
|
-
const g = l.tFoot;
|
|
408
|
-
if (g)
|
|
409
|
-
for (let f = 0; f < g.rows.length; f++)
|
|
410
|
-
s(g.rows[f]);
|
|
411
|
-
D(), y();
|
|
412
|
-
},
|
|
413
|
-
swapColumns(e, o) {
|
|
414
|
-
const n = i.getColumnCount();
|
|
415
|
-
if (e < 0 || e >= n || o < 0 || o >= n || e === o) return;
|
|
416
|
-
const s = (f) => {
|
|
417
|
-
if (e >= f.cells.length || o >= f.cells.length) return;
|
|
418
|
-
const S = f.cells[e], G = f.cells[o], K = document.createElement("td");
|
|
419
|
-
f.insertBefore(K, S), f.insertBefore(S, G), f.insertBefore(G, K), K.remove();
|
|
420
|
-
}, a = l.tHead;
|
|
421
|
-
if (a)
|
|
422
|
-
for (let f = 0; f < a.rows.length; f++)
|
|
423
|
-
s(a.rows[f]);
|
|
424
|
-
const d = v();
|
|
425
|
-
for (const f of d)
|
|
426
|
-
s(f);
|
|
427
|
-
const g = l.tFoot;
|
|
428
|
-
if (g)
|
|
429
|
-
for (let f = 0; f < g.rows.length; f++)
|
|
430
|
-
s(g.rows[f]);
|
|
431
|
-
D(), y();
|
|
432
|
-
},
|
|
433
|
-
setColumnData(e, o) {
|
|
434
|
-
const n = v();
|
|
435
|
-
for (let s = 0; s < n.length && s < o.length; s++) {
|
|
436
|
-
const a = n[s].cells[e];
|
|
437
|
-
if (a) {
|
|
438
|
-
const d = U(a);
|
|
439
|
-
T(a, o[s]), d !== o[s] && N(s, e, d, o[s]);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
807
|
+
insertTableRow(o = -1) {
|
|
808
|
+
return t.insertRow(o);
|
|
442
809
|
},
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
// ======================================================================
|
|
446
|
-
setCell(e, o, n) {
|
|
447
|
-
const s = i.getCell(e, o);
|
|
448
|
-
if (!s) return;
|
|
449
|
-
const a = U(s);
|
|
450
|
-
T(s, n), N(e, o, a, n);
|
|
451
|
-
},
|
|
452
|
-
setCellByRowId(e, o, n) {
|
|
453
|
-
const s = i.getRowIndex(e);
|
|
454
|
-
s !== -1 && i.setCell(s, o, n);
|
|
455
|
-
},
|
|
456
|
-
setCellRange(e, o, n) {
|
|
457
|
-
for (let s = 0; s < n.length; s++) {
|
|
458
|
-
const a = n[s];
|
|
459
|
-
for (let d = 0; d < a.length; d++)
|
|
460
|
-
i.setCell(e + s, o + d, a[d]);
|
|
461
|
-
}
|
|
810
|
+
deleteTableRow(o) {
|
|
811
|
+
t.deleteRow(o);
|
|
462
812
|
},
|
|
463
|
-
//
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
for (
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
813
|
+
// === HEADERS ===
|
|
814
|
+
getHeaders() {
|
|
815
|
+
const o = t.tHead;
|
|
816
|
+
if (!o || o.rows.length === 0) return [];
|
|
817
|
+
const r = o.rows[0], l = [];
|
|
818
|
+
for (let i = 0; i < r.cells.length; i++)
|
|
819
|
+
l.push(r.cells[i].textContent ?? "");
|
|
820
|
+
return l;
|
|
821
|
+
},
|
|
822
|
+
setHeaders(o) {
|
|
823
|
+
let r = t.tHead;
|
|
824
|
+
for (r || (r = t.createTHead()); r.rows.length > 0; )
|
|
825
|
+
r.deleteRow(0);
|
|
826
|
+
const l = r.insertRow();
|
|
827
|
+
for (const i of o) {
|
|
828
|
+
const g = document.createElement("th");
|
|
829
|
+
g.scope = "col", g.textContent = i, l.appendChild(g);
|
|
474
830
|
}
|
|
475
831
|
},
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
832
|
+
addHeader(o, r) {
|
|
833
|
+
let l = t.tHead;
|
|
834
|
+
l || (l = t.createTHead(), l.insertRow()), l.rows.length === 0 && l.insertRow();
|
|
835
|
+
const i = l.rows[0], g = document.createElement("th");
|
|
836
|
+
g.scope = "col", g.textContent = o, r === void 0 || r >= i.cells.length ? i.appendChild(g) : i.insertBefore(g, i.cells[r]);
|
|
481
837
|
},
|
|
482
|
-
|
|
483
|
-
const
|
|
484
|
-
if (!
|
|
485
|
-
const
|
|
486
|
-
|
|
838
|
+
removeHeader(o) {
|
|
839
|
+
const r = t.tHead;
|
|
840
|
+
if (!r || r.rows.length === 0) return;
|
|
841
|
+
const l = r.rows[0];
|
|
842
|
+
o >= 0 && o < l.cells.length && l.deleteCell(o);
|
|
487
843
|
},
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
if (e)
|
|
491
|
-
for (; e.rows.length > 0; )
|
|
492
|
-
e.deleteRow(0);
|
|
493
|
-
},
|
|
494
|
-
// ======================================================================
|
|
495
|
-
// CAPTION METHODS
|
|
496
|
-
// ======================================================================
|
|
497
|
-
setCaption(e) {
|
|
498
|
-
const o = l.createCaption();
|
|
499
|
-
o.textContent = e;
|
|
844
|
+
clearHeaders() {
|
|
845
|
+
t.tHead && t.deleteTHead();
|
|
500
846
|
},
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
// ======================================================================
|
|
505
|
-
// BULK OPERATIONS
|
|
506
|
-
// ======================================================================
|
|
507
|
-
setData(e) {
|
|
508
|
-
i.clearRows();
|
|
509
|
-
const o = E();
|
|
510
|
-
for (const n of e) {
|
|
511
|
-
const s = o.insertRow();
|
|
512
|
-
s.dataset.id = c();
|
|
513
|
-
for (const a of n) {
|
|
514
|
-
const d = s.insertCell();
|
|
515
|
-
T(d, a);
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
y();
|
|
847
|
+
// === ROWS ===
|
|
848
|
+
getRowCount() {
|
|
849
|
+
return a().length;
|
|
519
850
|
},
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
l.removeChild(l.tBodies[0]);
|
|
523
|
-
D(), y();
|
|
851
|
+
getBodyRows() {
|
|
852
|
+
return a();
|
|
524
853
|
},
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
854
|
+
getRow(o) {
|
|
855
|
+
return a()[o] ?? null;
|
|
856
|
+
},
|
|
857
|
+
addRow(o, r) {
|
|
858
|
+
const l = e(), i = r ?? l.rows.length, g = l.insertRow(i), T = b();
|
|
859
|
+
g.dataset.id = T;
|
|
860
|
+
for (const B of o) {
|
|
861
|
+
const m = g.insertCell();
|
|
862
|
+
E(m, B);
|
|
863
|
+
}
|
|
864
|
+
return y(i, T), g;
|
|
865
|
+
},
|
|
866
|
+
removeRow(o) {
|
|
867
|
+
const l = a()[o];
|
|
868
|
+
if (!l) return null;
|
|
869
|
+
const i = k(l), g = l.dataset.id ?? null;
|
|
870
|
+
return l.remove(), A(o, g), i;
|
|
871
|
+
},
|
|
872
|
+
updateRow(o, r) {
|
|
873
|
+
const l = f.getRow(o);
|
|
874
|
+
if (l) {
|
|
875
|
+
for (let i = 0; i < r.length; i++) {
|
|
876
|
+
let g = l.cells[i];
|
|
877
|
+
g || (g = l.insertCell()), E(g, r[i]);
|
|
542
878
|
}
|
|
879
|
+
for (; l.cells.length > r.length; )
|
|
880
|
+
l.deleteCell(l.cells.length - 1);
|
|
881
|
+
R();
|
|
543
882
|
}
|
|
544
|
-
y();
|
|
545
|
-
},
|
|
546
|
-
getRecordData(e) {
|
|
547
|
-
return i.getRowDataById(e);
|
|
548
|
-
},
|
|
549
|
-
addRecord(e, o, n) {
|
|
550
|
-
const s = "id" in e && typeof e.id == "string" && e.id.length > 0 ? e.id : c(), a = { ...e, id: s }, d = o.map((g) => typeof g == "function" ? g(a) : a[g]);
|
|
551
|
-
return i.addRow(d, n, s), s;
|
|
552
|
-
},
|
|
553
|
-
updateRecordRow(e, o) {
|
|
554
|
-
const n = i.getRowIndex(e);
|
|
555
|
-
return n === -1 ? !1 : (i.updateRow(n, o), !0);
|
|
556
883
|
},
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
884
|
+
clearRows() {
|
|
885
|
+
for (let o = 0; o < t.tBodies.length; o++) {
|
|
886
|
+
const r = t.tBodies[o];
|
|
887
|
+
for (; r.rows.length > 0; )
|
|
888
|
+
r.deleteRow(0);
|
|
889
|
+
}
|
|
890
|
+
R();
|
|
891
|
+
},
|
|
892
|
+
// === ROWS BY ID ===
|
|
893
|
+
getRowById(o) {
|
|
894
|
+
const r = a();
|
|
895
|
+
for (const l of r)
|
|
896
|
+
if (l.dataset.id === o)
|
|
897
|
+
return l;
|
|
898
|
+
return null;
|
|
899
|
+
},
|
|
900
|
+
getRowId(o) {
|
|
901
|
+
return f.getRow(o)?.dataset.id ?? null;
|
|
902
|
+
},
|
|
903
|
+
addRowWithId(o, r, l) {
|
|
904
|
+
const i = e(), g = l ?? i.rows.length, T = i.insertRow(g);
|
|
905
|
+
T.dataset.id = r;
|
|
906
|
+
for (const B of o) {
|
|
907
|
+
const m = T.insertCell();
|
|
908
|
+
E(m, B);
|
|
909
|
+
}
|
|
910
|
+
return y(g, r), T;
|
|
562
911
|
},
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
912
|
+
removeRowById(o) {
|
|
913
|
+
const r = a();
|
|
914
|
+
for (let l = 0; l < r.length; l++)
|
|
915
|
+
if (r[l].dataset.id === o)
|
|
916
|
+
return f.removeRow(l);
|
|
917
|
+
return null;
|
|
568
918
|
},
|
|
569
|
-
|
|
570
|
-
|
|
919
|
+
// === CELLS ===
|
|
920
|
+
getCell(o, r) {
|
|
921
|
+
const l = f.getRow(o);
|
|
922
|
+
return l ? l.cells[r] ?? null : null;
|
|
571
923
|
},
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
onRowAdd(e) {
|
|
576
|
-
return B.add(e), () => B.delete(e);
|
|
924
|
+
getCellValue(o, r) {
|
|
925
|
+
const l = f.getCell(o, r);
|
|
926
|
+
return l ? W(l) : null;
|
|
577
927
|
},
|
|
578
|
-
|
|
579
|
-
|
|
928
|
+
setCell(o, r, l) {
|
|
929
|
+
const i = f.getCell(o, r);
|
|
930
|
+
i && (E(i, l), R());
|
|
580
931
|
},
|
|
581
|
-
|
|
582
|
-
|
|
932
|
+
// === COLUMNS ===
|
|
933
|
+
getColumnCount() {
|
|
934
|
+
const o = f.getHeaders();
|
|
935
|
+
if (o.length > 0) return o.length;
|
|
936
|
+
const r = a();
|
|
937
|
+
return r.length > 0 ? r[0].cells.length : 0;
|
|
938
|
+
},
|
|
939
|
+
addColumn(o, r) {
|
|
940
|
+
o !== void 0 && f.addHeader(o, r);
|
|
941
|
+
const l = a();
|
|
942
|
+
for (const g of l) {
|
|
943
|
+
const T = g.insertCell(r ?? g.cells.length);
|
|
944
|
+
E(T, "");
|
|
945
|
+
}
|
|
946
|
+
const i = t.tFoot;
|
|
947
|
+
if (i && i.rows.length > 0) {
|
|
948
|
+
const g = i.rows[0];
|
|
949
|
+
g.insertCell(r ?? g.cells.length);
|
|
950
|
+
}
|
|
951
|
+
R();
|
|
952
|
+
},
|
|
953
|
+
removeColumn(o) {
|
|
954
|
+
f.removeHeader(o);
|
|
955
|
+
const r = a();
|
|
956
|
+
for (const i of r)
|
|
957
|
+
o >= 0 && o < i.cells.length && i.deleteCell(o);
|
|
958
|
+
const l = t.tFoot;
|
|
959
|
+
if (l && l.rows.length > 0) {
|
|
960
|
+
const i = l.rows[0];
|
|
961
|
+
o >= 0 && o < i.cells.length && i.deleteCell(o);
|
|
962
|
+
}
|
|
963
|
+
R();
|
|
583
964
|
},
|
|
584
|
-
|
|
585
|
-
|
|
965
|
+
getColumnData(o) {
|
|
966
|
+
const r = a(), l = [];
|
|
967
|
+
for (const i of r) {
|
|
968
|
+
const g = i.cells[o];
|
|
969
|
+
g && l.push(W(g));
|
|
970
|
+
}
|
|
971
|
+
return l;
|
|
586
972
|
},
|
|
587
|
-
|
|
588
|
-
|
|
973
|
+
setColumnData(o, r) {
|
|
974
|
+
const l = a();
|
|
975
|
+
for (let i = 0; i < l.length && i < r.length; i++) {
|
|
976
|
+
const g = l[i].cells[o];
|
|
977
|
+
g && E(g, r[i]);
|
|
978
|
+
}
|
|
979
|
+
R();
|
|
980
|
+
},
|
|
981
|
+
// === BULK DATA ===
|
|
982
|
+
getTableData() {
|
|
983
|
+
return a().map(k);
|
|
984
|
+
},
|
|
985
|
+
setTableData(o) {
|
|
986
|
+
f.clearRows();
|
|
987
|
+
const r = e();
|
|
988
|
+
for (const l of o) {
|
|
989
|
+
const i = r.insertRow();
|
|
990
|
+
i.dataset.id = b();
|
|
991
|
+
for (const g of l) {
|
|
992
|
+
const T = i.insertCell();
|
|
993
|
+
E(T, g);
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
R();
|
|
997
|
+
},
|
|
998
|
+
// === FOOTER ===
|
|
999
|
+
getFooter() {
|
|
1000
|
+
const o = t.tFoot;
|
|
1001
|
+
return !o || o.rows.length === 0 ? null : k(o.rows[0]);
|
|
1002
|
+
},
|
|
1003
|
+
setFooter(o) {
|
|
1004
|
+
let r = t.tFoot;
|
|
1005
|
+
for (r || (r = t.createTFoot()); r.rows.length > 0; )
|
|
1006
|
+
r.deleteRow(0);
|
|
1007
|
+
const l = r.insertRow();
|
|
1008
|
+
for (const i of o) {
|
|
1009
|
+
const g = l.insertCell();
|
|
1010
|
+
E(g, i);
|
|
1011
|
+
}
|
|
589
1012
|
},
|
|
590
|
-
|
|
591
|
-
|
|
1013
|
+
clearFooter() {
|
|
1014
|
+
const o = t.tFoot;
|
|
1015
|
+
if (o)
|
|
1016
|
+
for (; o.rows.length > 0; )
|
|
1017
|
+
o.deleteRow(0);
|
|
592
1018
|
},
|
|
593
|
-
//
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
1019
|
+
// === CAPTION TEXT ===
|
|
1020
|
+
getCaptionText() {
|
|
1021
|
+
return t.caption?.textContent ?? null;
|
|
1022
|
+
},
|
|
1023
|
+
setCaptionText(o) {
|
|
1024
|
+
const r = t.createCaption();
|
|
1025
|
+
r.textContent = o;
|
|
1026
|
+
},
|
|
1027
|
+
// === ROW REORDERING ===
|
|
1028
|
+
moveRow(o, r) {
|
|
1029
|
+
const l = a();
|
|
1030
|
+
if (o < 0 || o >= l.length || r < 0 || r >= l.length || o === r) return;
|
|
1031
|
+
const i = l[o], g = l[r];
|
|
1032
|
+
!i.parentElement || !g.parentElement || (i.remove(), o < r ? g.after(i) : g.before(i), R());
|
|
1033
|
+
},
|
|
1034
|
+
swapRows(o, r) {
|
|
1035
|
+
const l = a();
|
|
1036
|
+
if (o < 0 || o >= l.length || r < 0 || r >= l.length || o === r) return;
|
|
1037
|
+
const i = l[o], g = l[r], T = document.createElement("tr");
|
|
1038
|
+
i.before(T), g.before(i), T.replaceWith(g), R();
|
|
1039
|
+
},
|
|
1040
|
+
// === EVENT SUBSCRIPTIONS ===
|
|
1041
|
+
onRowAdd(o) {
|
|
1042
|
+
return c.add(o), () => c.delete(o);
|
|
1043
|
+
},
|
|
1044
|
+
onRowRemove(o) {
|
|
1045
|
+
return v.add(o), () => v.delete(o);
|
|
1046
|
+
},
|
|
1047
|
+
onDataChange(o) {
|
|
1048
|
+
return w.add(o), () => w.delete(o);
|
|
598
1049
|
}
|
|
599
1050
|
};
|
|
600
|
-
return
|
|
1051
|
+
return h?.caption && f.setCaptionText(h.caption), h?.headers && f.setHeaders(h.headers), C && f.setTableData(C), h?.footer && f.setFooter(h.footer), f;
|
|
1052
|
+
}
|
|
1053
|
+
function K(t, C) {
|
|
1054
|
+
return `${t},${C}`;
|
|
601
1055
|
}
|
|
602
|
-
function
|
|
603
|
-
const
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
return
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
1056
|
+
function ft(t, C, h) {
|
|
1057
|
+
const s = H(null), b = H(0), c = H(!1), v = H(/* @__PURE__ */ new Set()), w = H(/* @__PURE__ */ new Set()), e = H(null), a = H(null), y = /* @__PURE__ */ new Set(), A = /* @__PURE__ */ new Set(), R = [];
|
|
1058
|
+
function f() {
|
|
1059
|
+
c.value || b.value++;
|
|
1060
|
+
}
|
|
1061
|
+
function o() {
|
|
1062
|
+
y.forEach((n) => n(v.value, w.value));
|
|
1063
|
+
}
|
|
1064
|
+
function r() {
|
|
1065
|
+
A.forEach((n) => n(a.value));
|
|
1066
|
+
}
|
|
1067
|
+
function l(n) {
|
|
1068
|
+
if (c.value || s.value) return;
|
|
1069
|
+
s.value = lt(n, C, h);
|
|
1070
|
+
const u = s.value.onDataChange(() => {
|
|
1071
|
+
f();
|
|
1072
|
+
});
|
|
1073
|
+
R.push(u);
|
|
1074
|
+
}
|
|
1075
|
+
const i = H(et(t));
|
|
1076
|
+
t !== null && typeof t == "object" && "value" in t ? tt(
|
|
1077
|
+
() => t.value,
|
|
1078
|
+
(n) => {
|
|
1079
|
+
i.value = n, n && !s.value && l(n);
|
|
1080
|
+
},
|
|
1081
|
+
{ immediate: !0 }
|
|
1082
|
+
) : t && l(t);
|
|
1083
|
+
const g = D(() => s.value !== null), T = D(() => (b.value, s.value?.getHeaders() ?? [])), B = D(() => (b.value, s.value?.getTableData() ?? [])), m = D(() => (b.value, s.value?.getRowCount() ?? 0)), F = D(() => (b.value, s.value?.getColumnCount() ?? 0)), oe = D(() => {
|
|
1084
|
+
if (b.value, !s.value) return [];
|
|
1085
|
+
const n = [], u = s.value.getRowCount();
|
|
1086
|
+
for (let d = 0; d < u; d++) {
|
|
1087
|
+
const p = s.value.getRowId(d);
|
|
1088
|
+
p && n.push(p);
|
|
1089
|
+
}
|
|
1090
|
+
return n;
|
|
1091
|
+
}), re = D(() => (b.value, s.value?.getFooter() ?? null)), le = D(() => (b.value, s.value?.getCaptionText() ?? null));
|
|
1092
|
+
function ue() {
|
|
1093
|
+
const n = s.value?.createCaption() ?? null;
|
|
1094
|
+
return f(), n;
|
|
1095
|
+
}
|
|
1096
|
+
function ae() {
|
|
1097
|
+
s.value?.deleteCaption(), f();
|
|
1098
|
+
}
|
|
1099
|
+
function se() {
|
|
1100
|
+
const n = s.value?.createTHead() ?? null;
|
|
1101
|
+
return f(), n;
|
|
1102
|
+
}
|
|
1103
|
+
function ie() {
|
|
1104
|
+
s.value?.deleteTHead(), f();
|
|
1105
|
+
}
|
|
1106
|
+
function ce() {
|
|
1107
|
+
const n = s.value?.createTFoot() ?? null;
|
|
1108
|
+
return f(), n;
|
|
1109
|
+
}
|
|
1110
|
+
function de() {
|
|
1111
|
+
s.value?.deleteTFoot(), f();
|
|
1112
|
+
}
|
|
1113
|
+
function fe() {
|
|
1114
|
+
const n = s.value?.createTBody() ?? null;
|
|
1115
|
+
return f(), n;
|
|
1116
|
+
}
|
|
1117
|
+
function ge(n) {
|
|
1118
|
+
s.value?.setHeaders(n), f();
|
|
1119
|
+
}
|
|
1120
|
+
function ve(n, u) {
|
|
1121
|
+
s.value?.addHeader(n, u), f();
|
|
1122
|
+
}
|
|
1123
|
+
function we(n) {
|
|
1124
|
+
s.value?.removeHeader(n), f();
|
|
1125
|
+
}
|
|
1126
|
+
function he() {
|
|
1127
|
+
s.value?.clearHeaders(), f();
|
|
1128
|
+
}
|
|
1129
|
+
function Ce(n, u) {
|
|
1130
|
+
return s.value?.addRow(n, u) ?? null;
|
|
1131
|
+
}
|
|
1132
|
+
function pe(n, u, d) {
|
|
1133
|
+
return s.value?.addRowWithId(n, u, d) ?? null;
|
|
1134
|
+
}
|
|
1135
|
+
function Te(n) {
|
|
1136
|
+
const u = /* @__PURE__ */ new Set();
|
|
1137
|
+
for (const d of v.value)
|
|
1138
|
+
d < n ? u.add(d) : d > n && u.add(d - 1);
|
|
1139
|
+
return v.value = u, s.value?.removeRow(n) ?? null;
|
|
1140
|
+
}
|
|
1141
|
+
function be(n) {
|
|
1142
|
+
return s.value?.removeRowById(n) ?? null;
|
|
1143
|
+
}
|
|
1144
|
+
function Re(n, u) {
|
|
1145
|
+
s.value?.updateRow(n, u), f();
|
|
1146
|
+
}
|
|
1147
|
+
function ye() {
|
|
1148
|
+
v.value = /* @__PURE__ */ new Set(), w.value = /* @__PURE__ */ new Set(), a.value = null, s.value?.clearRows(), f();
|
|
1149
|
+
}
|
|
1150
|
+
function me(n) {
|
|
1151
|
+
return s.value?.getRow(n) ?? null;
|
|
1152
|
+
}
|
|
1153
|
+
function Se(n) {
|
|
1154
|
+
return s.value?.getRowById(n) ?? null;
|
|
1155
|
+
}
|
|
1156
|
+
function Ae(n) {
|
|
1157
|
+
return s.value?.getRowId(n) ?? null;
|
|
1158
|
+
}
|
|
1159
|
+
function He(n, u) {
|
|
1160
|
+
if (s.value?.moveRow(n, u), v.value.has(n)) {
|
|
1161
|
+
const d = new Set(v.value);
|
|
1162
|
+
d.delete(n), d.add(u), v.value = d, o();
|
|
1163
|
+
}
|
|
1164
|
+
f();
|
|
1165
|
+
}
|
|
1166
|
+
function De(n, u) {
|
|
1167
|
+
s.value?.swapRows(n, u);
|
|
1168
|
+
const d = v.value.has(n), p = v.value.has(u);
|
|
1169
|
+
if (d !== p) {
|
|
1170
|
+
const S = new Set(v.value);
|
|
1171
|
+
d && (S.delete(n), S.add(u)), p && (S.delete(u), S.add(n)), v.value = S, o();
|
|
1172
|
+
}
|
|
1173
|
+
f();
|
|
1174
|
+
}
|
|
1175
|
+
function Ee(n, u) {
|
|
1176
|
+
s.value?.addColumn(n, u), f();
|
|
1177
|
+
}
|
|
1178
|
+
function Le(n) {
|
|
1179
|
+
s.value?.removeColumn(n), f();
|
|
1180
|
+
}
|
|
1181
|
+
function Fe(n) {
|
|
1182
|
+
return s.value?.getColumnData(n) ?? [];
|
|
1183
|
+
}
|
|
1184
|
+
function Be(n, u) {
|
|
1185
|
+
s.value?.setColumnData(n, u), f();
|
|
1186
|
+
}
|
|
1187
|
+
function O(n, u) {
|
|
1188
|
+
return s.value?.getCell(n, u) ?? null;
|
|
1189
|
+
}
|
|
1190
|
+
function Pe(n, u) {
|
|
1191
|
+
return s.value?.getCellValue(n, u) ?? null;
|
|
1192
|
+
}
|
|
1193
|
+
function Ie(n, u, d) {
|
|
1194
|
+
s.value?.setCell(n, u, d);
|
|
1195
|
+
}
|
|
1196
|
+
function Me() {
|
|
1197
|
+
return s.value?.getFooter() ?? null;
|
|
1198
|
+
}
|
|
1199
|
+
function Ne(n) {
|
|
1200
|
+
s.value?.setFooter(n), f();
|
|
1201
|
+
}
|
|
1202
|
+
function ke() {
|
|
1203
|
+
s.value?.clearFooter(), f();
|
|
1204
|
+
}
|
|
1205
|
+
function Ke() {
|
|
1206
|
+
return s.value?.getCaptionText() ?? null;
|
|
1207
|
+
}
|
|
1208
|
+
function Ve(n) {
|
|
1209
|
+
s.value?.setCaptionText(n), f();
|
|
1210
|
+
}
|
|
1211
|
+
function We() {
|
|
1212
|
+
return s.value?.getTableData() ?? [];
|
|
1213
|
+
}
|
|
1214
|
+
function Oe(n) {
|
|
1215
|
+
v.value = /* @__PURE__ */ new Set(), w.value = /* @__PURE__ */ new Set(), a.value = null, s.value?.setTableData(n), f();
|
|
1216
|
+
}
|
|
1217
|
+
function je() {
|
|
1218
|
+
f();
|
|
1219
|
+
}
|
|
1220
|
+
function j(n) {
|
|
1221
|
+
if (n < 0 || n >= m.value) return;
|
|
1222
|
+
const u = new Set(v.value);
|
|
1223
|
+
u.add(n), v.value = u, e.value = n, f(), o();
|
|
1224
|
+
}
|
|
1225
|
+
function U(n) {
|
|
1226
|
+
const u = new Set(v.value);
|
|
1227
|
+
u.delete(n), v.value = u, f(), o();
|
|
1228
|
+
}
|
|
1229
|
+
function I(n) {
|
|
1230
|
+
v.value.has(n) ? U(n) : j(n);
|
|
1231
|
+
}
|
|
1232
|
+
function z() {
|
|
1233
|
+
const n = m.value, u = /* @__PURE__ */ new Set();
|
|
1234
|
+
for (let d = 0; d < n; d++)
|
|
1235
|
+
u.add(d);
|
|
1236
|
+
v.value = u, f(), o();
|
|
1237
|
+
}
|
|
1238
|
+
function Ue() {
|
|
1239
|
+
v.value = /* @__PURE__ */ new Set(), e.value = null, f(), o();
|
|
1240
|
+
}
|
|
1241
|
+
function ze(n) {
|
|
1242
|
+
return v.value.has(n);
|
|
1243
|
+
}
|
|
1244
|
+
function q() {
|
|
1245
|
+
return Array.from(v.value).sort((n, u) => n - u);
|
|
1246
|
+
}
|
|
1247
|
+
function qe() {
|
|
1248
|
+
if (!s.value) return [];
|
|
1249
|
+
const n = q(), u = [];
|
|
1250
|
+
for (const d of n) {
|
|
1251
|
+
const p = s.value.getRow(d);
|
|
1252
|
+
if (p) {
|
|
1253
|
+
const S = [];
|
|
1254
|
+
for (let P = 0; P < p.cells.length; P++)
|
|
1255
|
+
S.push(s.value.getCellValue(d, P));
|
|
1256
|
+
u.push(S);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
return u;
|
|
1260
|
+
}
|
|
1261
|
+
function M(n, u) {
|
|
1262
|
+
const d = m.value;
|
|
1263
|
+
if (n < 0 || n >= d || u < 0 || u >= d) return;
|
|
1264
|
+
const p = new Set(v.value), S = Math.min(n, u), P = Math.max(n, u);
|
|
1265
|
+
for (let N = S; N <= P; N++)
|
|
1266
|
+
p.add(N);
|
|
1267
|
+
v.value = p, f(), o();
|
|
1268
|
+
}
|
|
1269
|
+
function Ge(n, u, d) {
|
|
1270
|
+
n < 0 || n >= m.value || (d && e.value !== null ? (u || (v.value = /* @__PURE__ */ new Set()), M(e.value, n)) : u ? (I(n), e.value = n) : (v.value = /* @__PURE__ */ new Set([n]), e.value = n, f(), o()));
|
|
1271
|
+
}
|
|
1272
|
+
function G(n, u) {
|
|
1273
|
+
if (n < 0 || n >= m.value || u < 0 || u >= F.value) return;
|
|
1274
|
+
const d = new Set(w.value);
|
|
1275
|
+
d.add(K(n, u)), w.value = d, f(), o();
|
|
1276
|
+
}
|
|
1277
|
+
function $(n, u) {
|
|
1278
|
+
const d = new Set(w.value);
|
|
1279
|
+
d.delete(K(n, u)), w.value = d, f(), o();
|
|
1280
|
+
}
|
|
1281
|
+
function _(n, u) {
|
|
1282
|
+
x(n, u) ? $(n, u) : G(n, u);
|
|
1283
|
+
}
|
|
1284
|
+
function x(n, u) {
|
|
1285
|
+
return w.value.has(K(n, u));
|
|
1286
|
+
}
|
|
1287
|
+
function J() {
|
|
1288
|
+
v.value = /* @__PURE__ */ new Set(), w.value = /* @__PURE__ */ new Set(), e.value = null, f(), o();
|
|
1289
|
+
}
|
|
1290
|
+
function L(n, u) {
|
|
1291
|
+
if (n < 0 || n >= m.value || u < 0 || u >= F.value) return;
|
|
1292
|
+
a.value = { row: n, column: u };
|
|
1293
|
+
const d = O(n, u);
|
|
1294
|
+
d && (d.setAttribute("tabindex", "0"), d.focus()), f(), r();
|
|
1295
|
+
}
|
|
1296
|
+
function Q() {
|
|
1297
|
+
a.value = null, f(), r();
|
|
1298
|
+
}
|
|
1299
|
+
function $e() {
|
|
1300
|
+
return a.value;
|
|
1301
|
+
}
|
|
1302
|
+
function _e(n, u) {
|
|
1303
|
+
const d = a.value;
|
|
1304
|
+
return d !== null && d.row === n && d.column === u;
|
|
1305
|
+
}
|
|
1306
|
+
function X() {
|
|
1307
|
+
const n = a.value;
|
|
1308
|
+
return !n || n.row <= 0 ? !1 : (L(n.row - 1, n.column), !0);
|
|
1309
|
+
}
|
|
1310
|
+
function Y() {
|
|
1311
|
+
const n = a.value;
|
|
1312
|
+
return !n || n.row >= m.value - 1 ? !1 : (L(n.row + 1, n.column), !0);
|
|
1313
|
+
}
|
|
1314
|
+
function Z() {
|
|
1315
|
+
const n = a.value;
|
|
1316
|
+
return !n || n.column <= 0 ? !1 : (L(n.row, n.column - 1), !0);
|
|
1317
|
+
}
|
|
1318
|
+
function ee() {
|
|
1319
|
+
const n = a.value;
|
|
1320
|
+
return !n || n.column >= F.value - 1 ? !1 : (L(n.row, n.column + 1), !0);
|
|
1321
|
+
}
|
|
1322
|
+
function xe() {
|
|
1323
|
+
const n = i.value;
|
|
1324
|
+
if (!n) return () => {
|
|
1325
|
+
};
|
|
1326
|
+
const u = (d) => {
|
|
678
1327
|
let p = !1;
|
|
679
|
-
switch (
|
|
1328
|
+
switch (d.key) {
|
|
680
1329
|
case "ArrowUp":
|
|
681
|
-
p =
|
|
1330
|
+
p = X();
|
|
682
1331
|
break;
|
|
683
1332
|
case "ArrowDown":
|
|
684
|
-
p =
|
|
1333
|
+
p = Y();
|
|
685
1334
|
break;
|
|
686
1335
|
case "ArrowLeft":
|
|
687
|
-
p =
|
|
1336
|
+
p = Z();
|
|
688
1337
|
break;
|
|
689
1338
|
case "ArrowRight":
|
|
690
|
-
p =
|
|
1339
|
+
p = ee();
|
|
691
1340
|
break;
|
|
692
1341
|
case "Home":
|
|
693
|
-
|
|
1342
|
+
a.value && (L(a.value.row, 0), p = !0);
|
|
694
1343
|
break;
|
|
695
1344
|
case "End":
|
|
696
|
-
|
|
697
|
-
ee();
|
|
698
|
-
else {
|
|
699
|
-
const P = c.getColumnCount();
|
|
700
|
-
L(R.row, P - 1);
|
|
701
|
-
}
|
|
702
|
-
p = !0;
|
|
703
|
-
break;
|
|
704
|
-
case "Enter":
|
|
705
|
-
case " ":
|
|
706
|
-
u.shiftKey ? G(R.row, R.row) : u.ctrlKey || u.metaKey ? g(R.row) : (S(), a(R.row)), p = !0;
|
|
1345
|
+
a.value && F.value > 0 && (L(a.value.row, F.value - 1), p = !0);
|
|
707
1346
|
break;
|
|
708
1347
|
case "Escape":
|
|
709
|
-
|
|
1348
|
+
J(), Q(), p = !0;
|
|
710
1349
|
break;
|
|
711
1350
|
case "a":
|
|
712
|
-
(
|
|
1351
|
+
(d.ctrlKey || d.metaKey) && (z(), p = !0);
|
|
1352
|
+
break;
|
|
1353
|
+
case "Enter":
|
|
1354
|
+
case " ":
|
|
1355
|
+
a.value && (d.shiftKey ? I(a.value.row) : _(a.value.row, a.value.column), p = !0);
|
|
713
1356
|
break;
|
|
714
1357
|
}
|
|
715
|
-
p && (
|
|
1358
|
+
p && (d.preventDefault(), d.stopPropagation());
|
|
716
1359
|
};
|
|
717
|
-
return
|
|
718
|
-
|
|
1360
|
+
return n.addEventListener("keydown", u), () => n.removeEventListener("keydown", u);
|
|
1361
|
+
}
|
|
1362
|
+
function Je(n) {
|
|
1363
|
+
return s.value ? s.value.onRowAdd(n) : () => {
|
|
719
1364
|
};
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
return
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
for (const
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
c.setHeaders(t), w();
|
|
743
|
-
}, pe = (t, r) => {
|
|
744
|
-
c.setHeader(t, r), w();
|
|
745
|
-
}, ye = (t, r) => {
|
|
746
|
-
c.addHeader(t, r), w();
|
|
747
|
-
}, He = (t) => {
|
|
748
|
-
c.removeHeader(t), w();
|
|
749
|
-
}, me = (t, r, u) => {
|
|
750
|
-
const R = c.addRow(t, r, u);
|
|
751
|
-
return w(), R;
|
|
752
|
-
}, Be = (t) => {
|
|
753
|
-
const r = c.removeRow(t);
|
|
754
|
-
return r && w(), r;
|
|
755
|
-
}, Fe = (t) => {
|
|
756
|
-
const r = c.removeRowById(t);
|
|
757
|
-
return r && w(), r;
|
|
758
|
-
}, Se = (t, r) => {
|
|
759
|
-
c.updateRow(t, r), w();
|
|
760
|
-
}, De = (t, r) => {
|
|
761
|
-
c.updateRowById(t, r), w();
|
|
762
|
-
}, Te = (t, r) => {
|
|
763
|
-
c.moveRow(t, r), w();
|
|
764
|
-
}, Ie = (t, r) => {
|
|
765
|
-
c.swapRows(t, r), w();
|
|
766
|
-
}, Ee = () => {
|
|
767
|
-
c.clearRows(), w();
|
|
768
|
-
}, be = (t, r, u) => {
|
|
769
|
-
c.addColumn(t, r, u), w();
|
|
770
|
-
}, Le = (t) => {
|
|
771
|
-
c.removeColumn(t), w();
|
|
772
|
-
}, Ae = (t, r) => {
|
|
773
|
-
c.moveColumn(t, r), w();
|
|
774
|
-
}, Ue = (t, r) => {
|
|
775
|
-
c.swapColumns(t, r), w();
|
|
776
|
-
}, Ge = (t, r) => {
|
|
777
|
-
c.setColumnData(t, r), w();
|
|
778
|
-
}, Ke = (t, r) => c.getCellValue(t, r), ke = (t, r, u) => {
|
|
779
|
-
c.setCell(t, r, u), w();
|
|
780
|
-
}, Ve = (t, r, u) => {
|
|
781
|
-
c.setCellByRowId(t, r, u), w();
|
|
782
|
-
}, Me = (t, r, u) => {
|
|
783
|
-
c.setCellRange(t, r, u), w();
|
|
784
|
-
}, Ne = (t, r) => c.getCell(t, r), Pe = (t) => c.getRowData(t), je = (t) => c.getRowDataById(t), ze = (t) => c.getRow(t), $e = (t) => c.getRowById(t), _e = (t) => c.getRowId(t), qe = (t) => c.getRowIndex(t), Je = (t) => c.getColumnData(t), Oe = (t) => {
|
|
785
|
-
c.setFooter(t), w();
|
|
786
|
-
}, Qe = (t, r) => {
|
|
787
|
-
c.setFooterCell(t, r), w();
|
|
788
|
-
}, We = (t) => c.getFooterCell(t), Xe = () => {
|
|
789
|
-
c.clearFooter(), w();
|
|
790
|
-
}, Ye = (t) => {
|
|
791
|
-
c.setCaption(t), w();
|
|
792
|
-
}, Ze = (t) => {
|
|
793
|
-
c.setData(t), w();
|
|
794
|
-
}, xe = () => {
|
|
795
|
-
c.reset(), _(), Q(), w();
|
|
796
|
-
}, et = () => {
|
|
797
|
-
c.sync(), w();
|
|
798
|
-
}, tt = (t) => c.onRowAdd(t), ot = (t) => c.onRowRemove(t), nt = (t) => c.onRowUpdate(t), rt = (t) => c.onCellChange(t), st = (t) => c.onHeaderChange(t), ct = (t) => c.onDataChange(t), lt = (t) => (I.add(t), () => I.delete(t)), at = (t) => (E.add(t), () => E.delete(t)), te = () => {
|
|
799
|
-
n(), s(), I.clear(), E.clear(), c.destroy();
|
|
800
|
-
};
|
|
801
|
-
return ut(() => {
|
|
1365
|
+
}
|
|
1366
|
+
function Qe(n) {
|
|
1367
|
+
return s.value ? s.value.onRowRemove(n) : () => {
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
function Xe(n) {
|
|
1371
|
+
return s.value ? s.value.onDataChange(n) : () => {
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
function Ye(n) {
|
|
1375
|
+
return y.add(n), () => y.delete(n);
|
|
1376
|
+
}
|
|
1377
|
+
function Ze(n) {
|
|
1378
|
+
return A.add(n), () => A.delete(n);
|
|
1379
|
+
}
|
|
1380
|
+
function te() {
|
|
1381
|
+
c.value = !0;
|
|
1382
|
+
for (const n of R)
|
|
1383
|
+
n();
|
|
1384
|
+
R.length = 0, s.value?.destroy(), s.value = null, v.value = /* @__PURE__ */ new Set(), w.value = /* @__PURE__ */ new Set(), a.value = null;
|
|
1385
|
+
}
|
|
1386
|
+
return nt(() => {
|
|
802
1387
|
te();
|
|
803
1388
|
}), {
|
|
804
|
-
//
|
|
805
|
-
instance:
|
|
1389
|
+
// Core
|
|
1390
|
+
instance: s,
|
|
1391
|
+
isInitialized: g,
|
|
1392
|
+
element: i,
|
|
806
1393
|
// Reactive state
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
version: B,
|
|
1394
|
+
headers: T,
|
|
1395
|
+
data: B,
|
|
1396
|
+
rowCount: m,
|
|
1397
|
+
columnCount: F,
|
|
1398
|
+
rowIds: oe,
|
|
1399
|
+
footerData: re,
|
|
1400
|
+
captionText: le,
|
|
1401
|
+
version: b,
|
|
816
1402
|
// Selection state
|
|
817
1403
|
selection: {
|
|
818
|
-
rows:
|
|
819
|
-
cells:
|
|
1404
|
+
rows: v,
|
|
1405
|
+
cells: w
|
|
820
1406
|
},
|
|
821
1407
|
// Focus state
|
|
822
1408
|
focus: {
|
|
823
|
-
cell:
|
|
1409
|
+
cell: a
|
|
824
1410
|
},
|
|
825
1411
|
// Structure methods
|
|
826
|
-
createCaption:
|
|
827
|
-
deleteCaption:
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
},
|
|
834
|
-
createTFoot: () => c.createTFoot(),
|
|
835
|
-
deleteTFoot: () => {
|
|
836
|
-
c.deleteTFoot(), w();
|
|
837
|
-
},
|
|
838
|
-
createTBody: () => c.createTBody(),
|
|
839
|
-
// Section-specific row methods
|
|
840
|
-
getSectionRows: (t) => c.getSectionRows(t),
|
|
841
|
-
insertSectionRow: (t, r, u, R) => {
|
|
842
|
-
const p = c.insertSectionRow(t, r, u, R);
|
|
843
|
-
return w(), p;
|
|
844
|
-
},
|
|
845
|
-
deleteSectionRow: (t, r) => {
|
|
846
|
-
const u = c.deleteSectionRow(t, r);
|
|
847
|
-
return u && w(), u;
|
|
848
|
-
},
|
|
849
|
-
getSectionRowCount: (t) => c.getSectionRowCount(t),
|
|
850
|
-
addHeadRow: (t, r) => {
|
|
851
|
-
const u = c.addHeadRow(t, r);
|
|
852
|
-
return w(), u;
|
|
853
|
-
},
|
|
854
|
-
removeHeadRow: (t) => {
|
|
855
|
-
const r = c.removeHeadRow(t);
|
|
856
|
-
return r && w(), r;
|
|
857
|
-
},
|
|
858
|
-
getHeadRowCount: () => c.getHeadRowCount(),
|
|
859
|
-
addFootRow: (t, r) => {
|
|
860
|
-
const u = c.addFootRow(t, r);
|
|
861
|
-
return w(), u;
|
|
862
|
-
},
|
|
863
|
-
removeFootRow: (t) => {
|
|
864
|
-
const r = c.removeFootRow(t);
|
|
865
|
-
return r && w(), r;
|
|
866
|
-
},
|
|
867
|
-
getFootRowCount: () => c.getFootRowCount(),
|
|
868
|
-
addBodyRow: (t, r, u, R) => {
|
|
869
|
-
const p = c.addBodyRow(t, r, u, R);
|
|
870
|
-
return w(), p;
|
|
871
|
-
},
|
|
872
|
-
removeBodyRow: (t, r) => {
|
|
873
|
-
const u = c.removeBodyRow(t, r);
|
|
874
|
-
return u && w(), u;
|
|
875
|
-
},
|
|
876
|
-
getBodyRowCount: (t) => c.getBodyRowCount(t),
|
|
1412
|
+
createCaption: ue,
|
|
1413
|
+
deleteCaption: ae,
|
|
1414
|
+
createTHead: se,
|
|
1415
|
+
deleteTHead: ie,
|
|
1416
|
+
createTFoot: ce,
|
|
1417
|
+
deleteTFoot: de,
|
|
1418
|
+
createTBody: fe,
|
|
877
1419
|
// Header methods
|
|
878
|
-
setHeaders:
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
1420
|
+
setHeaders: ge,
|
|
1421
|
+
addHeader: ve,
|
|
1422
|
+
removeHeader: we,
|
|
1423
|
+
clearHeaders: he,
|
|
882
1424
|
// Row methods
|
|
883
|
-
addRow:
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
1425
|
+
addRow: Ce,
|
|
1426
|
+
addRowWithId: pe,
|
|
1427
|
+
removeRow: Te,
|
|
1428
|
+
removeRowById: be,
|
|
1429
|
+
updateRow: Re,
|
|
1430
|
+
clearRows: ye,
|
|
1431
|
+
getRow: me,
|
|
1432
|
+
getRowById: Se,
|
|
1433
|
+
getRowId: Ae,
|
|
1434
|
+
moveRow: He,
|
|
1435
|
+
swapRows: De,
|
|
891
1436
|
// Column methods
|
|
892
|
-
addColumn:
|
|
1437
|
+
addColumn: Ee,
|
|
893
1438
|
removeColumn: Le,
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
setColumnData: Ge,
|
|
1439
|
+
getColumnData: Fe,
|
|
1440
|
+
setColumnData: Be,
|
|
897
1441
|
// Cell methods
|
|
898
|
-
getCell:
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
setCellRange: Me,
|
|
902
|
-
getCellElement: Ne,
|
|
903
|
-
// Row access methods
|
|
904
|
-
getRowData: Pe,
|
|
905
|
-
getRowDataById: je,
|
|
906
|
-
getRowElement: ze,
|
|
907
|
-
getRowById: $e,
|
|
908
|
-
getRowId: _e,
|
|
909
|
-
getRowIndex: qe,
|
|
910
|
-
getColumnData: Je,
|
|
1442
|
+
getCell: O,
|
|
1443
|
+
getCellValue: Pe,
|
|
1444
|
+
setCell: Ie,
|
|
911
1445
|
// Footer methods
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
clearFooter: Xe,
|
|
1446
|
+
getFooter: Me,
|
|
1447
|
+
setFooter: Ne,
|
|
1448
|
+
clearFooter: ke,
|
|
916
1449
|
// Caption methods
|
|
917
|
-
|
|
1450
|
+
getCaption: Ke,
|
|
1451
|
+
setCaption: Ve,
|
|
918
1452
|
// Bulk operations
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
sync:
|
|
1453
|
+
getData: We,
|
|
1454
|
+
setData: Oe,
|
|
1455
|
+
sync: je,
|
|
922
1456
|
// Selection methods
|
|
923
|
-
selectRow:
|
|
924
|
-
deselectRow:
|
|
925
|
-
toggleRowSelection:
|
|
926
|
-
selectAllRows:
|
|
927
|
-
deselectAllRows:
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
1457
|
+
selectRow: j,
|
|
1458
|
+
deselectRow: U,
|
|
1459
|
+
toggleRowSelection: I,
|
|
1460
|
+
selectAllRows: z,
|
|
1461
|
+
deselectAllRows: Ue,
|
|
1462
|
+
isRowSelected: ze,
|
|
1463
|
+
getSelectedRowIndices: q,
|
|
1464
|
+
getSelectedRowData: qe,
|
|
1465
|
+
selectRowRange: M,
|
|
1466
|
+
selectRowWithModifiers: Ge,
|
|
1467
|
+
selectCell: G,
|
|
1468
|
+
deselectCell: $,
|
|
1469
|
+
toggleCellSelection: _,
|
|
1470
|
+
isCellSelected: x,
|
|
1471
|
+
clearSelection: J,
|
|
937
1472
|
// Focus methods
|
|
938
1473
|
focusCell: L,
|
|
939
1474
|
clearFocus: Q,
|
|
940
|
-
getFocusedCell:
|
|
941
|
-
isCellFocused:
|
|
942
|
-
moveFocusUp:
|
|
943
|
-
moveFocusDown:
|
|
944
|
-
moveFocusLeft:
|
|
945
|
-
moveFocusRight:
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
removeRecord: fe,
|
|
955
|
-
hasRecord: ge,
|
|
956
|
-
getSelectedRecordIds: Re,
|
|
957
|
-
selectRecords: Ce,
|
|
958
|
-
deselectRecords: he,
|
|
959
|
-
// ID generator
|
|
960
|
-
setIdGenerator: (t) => c.setIdGenerator(t),
|
|
961
|
-
generateId: () => c.generateId(),
|
|
962
|
-
// Event hooks
|
|
963
|
-
onRowAdd: tt,
|
|
964
|
-
onRowRemove: ot,
|
|
965
|
-
onRowUpdate: nt,
|
|
966
|
-
onCellChange: rt,
|
|
967
|
-
onHeaderChange: st,
|
|
968
|
-
onDataChange: ct,
|
|
969
|
-
onSelectionChange: lt,
|
|
970
|
-
onFocusChange: at,
|
|
971
|
-
// Cleanup
|
|
1475
|
+
getFocusedCell: $e,
|
|
1476
|
+
isCellFocused: _e,
|
|
1477
|
+
moveFocusUp: X,
|
|
1478
|
+
moveFocusDown: Y,
|
|
1479
|
+
moveFocusLeft: Z,
|
|
1480
|
+
moveFocusRight: ee,
|
|
1481
|
+
enableKeyboardNavigation: xe,
|
|
1482
|
+
// Event subscriptions
|
|
1483
|
+
onRowAdd: Je,
|
|
1484
|
+
onRowRemove: Qe,
|
|
1485
|
+
onDataChange: Xe,
|
|
1486
|
+
onSelectionChange: Ye,
|
|
1487
|
+
onFocusChange: Ze,
|
|
1488
|
+
// Lifecycle
|
|
972
1489
|
destroy: te
|
|
973
1490
|
};
|
|
974
1491
|
}
|
|
975
|
-
const q = /* @__PURE__ */ Symbol("idGenerated");
|
|
976
|
-
function wt() {
|
|
977
|
-
return crypto.randomUUID();
|
|
978
|
-
}
|
|
979
|
-
function Ct(l, C = wt) {
|
|
980
|
-
return "id" in l && typeof l.id == "string" && l.id.length > 0 ? l : {
|
|
981
|
-
...l,
|
|
982
|
-
id: C(),
|
|
983
|
-
[q]: !0
|
|
984
|
-
};
|
|
985
|
-
}
|
|
986
|
-
function ft(l) {
|
|
987
|
-
return q in l && l[q] === !0;
|
|
988
|
-
}
|
|
989
|
-
function ht(l) {
|
|
990
|
-
return typeof l == "string" && l.length > 0;
|
|
991
|
-
}
|
|
992
|
-
function vt(l, C) {
|
|
993
|
-
return l.find((m) => m.id === C);
|
|
994
|
-
}
|
|
995
|
-
function pt(l, C) {
|
|
996
|
-
return l.findIndex((m) => m.id === C);
|
|
997
|
-
}
|
|
998
|
-
function yt(l) {
|
|
999
|
-
if (!ft(l))
|
|
1000
|
-
return l;
|
|
1001
|
-
const { id: C, ...m } = l;
|
|
1002
|
-
return m;
|
|
1003
|
-
}
|
|
1004
1492
|
export {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1493
|
+
V as ID_GENERATED,
|
|
1494
|
+
lt as createTable,
|
|
1495
|
+
at as ensureId,
|
|
1496
|
+
it as findById,
|
|
1497
|
+
ne as generateId,
|
|
1498
|
+
ct as indexById,
|
|
1499
|
+
st as isValidId,
|
|
1500
|
+
dt as stripGeneratedId,
|
|
1501
|
+
ft as useTable,
|
|
1502
|
+
rt as wasIdGenerated
|
|
1015
1503
|
};
|