@stonecrop/atable 0.2.44 → 0.2.45

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/dist/atable.js CHANGED
@@ -1,73 +1,73 @@
1
- var Fe = Object.defineProperty;
2
- var Ge = (e, t, n) => t in e ? Fe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var T = (e, t, n) => Ge(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { onMounted as V, ref as w, watch as k, onBeforeUnmount as Ue, computed as b, unref as m, getCurrentScope as le, onScopeDispose as ie, getCurrentInstance as se, nextTick as Oe, defineComponent as D, inject as Q, useTemplateRef as Z, openBlock as h, createElementBlock as E, normalizeClass as H, createBlock as U, resolveDynamicComponent as Te, mergeProps as re, toDisplayString as N, Fragment as X, createElementVNode as P, renderSlot as S, createCommentVNode as J, withDirectives as te, vShow as Re, toRef as qe, readonly as Ye, customRef as Xe, reactive as L, renderList as ne, normalizeStyle as q, createTextVNode as Je, provide as Qe, createVNode as he, withCtx as ye } from "vue";
5
- function De(e) {
6
- return le() ? (ie(e), !0) : !1;
1
+ var Ge = Object.defineProperty;
2
+ var Ue = (e, t, n) => t in e ? Ge(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var T = (e, t, n) => Ue(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { onMounted as z, ref as y, watch as k, onBeforeUnmount as qe, computed as b, unref as m, getCurrentScope as le, onScopeDispose as se, getCurrentInstance as ie, nextTick as Te, defineComponent as D, inject as Q, useTemplateRef as Z, openBlock as w, createElementBlock as g, normalizeClass as j, createBlock as U, resolveDynamicComponent as Re, mergeProps as re, toDisplayString as N, Fragment as X, createElementVNode as P, renderSlot as S, createCommentVNode as J, withDirectives as te, vShow as De, toRef as Ye, readonly as Xe, customRef as Je, reactive as L, renderList as ne, normalizeStyle as q, createTextVNode as Qe, provide as Ze, createVNode as ye, withCtx as be } from "vue";
5
+ function Le(e) {
6
+ return le() ? (se(e), !0) : !1;
7
7
  }
8
8
  function ae(e) {
9
9
  return typeof e == "function" ? e() : m(e);
10
10
  }
11
- const Ze = typeof window < "u" && typeof document < "u";
11
+ const Ke = typeof window < "u" && typeof document < "u";
12
12
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
13
- const Ke = (e) => e != null, _e = Object.prototype.toString, et = (e) => _e.call(e) === "[object Object]", tt = () => {
14
- }, F = Ze ? window : void 0;
13
+ const _e = (e) => e != null, et = Object.prototype.toString, tt = (e) => et.call(e) === "[object Object]", nt = () => {
14
+ }, F = Ke ? window : void 0;
15
15
  function B(e) {
16
16
  var t;
17
17
  const n = ae(e);
18
18
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
19
19
  }
20
- function z(...e) {
21
- let t, n, l, i;
22
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, i] = e, t = F) : [t, n, l, i] = e, !t)
23
- return tt;
20
+ function V(...e) {
21
+ let t, n, l, s;
22
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, s] = e, t = F) : [t, n, l, s] = e, !t)
23
+ return nt;
24
24
  Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);
25
25
  const o = [], c = () => {
26
26
  o.forEach((u) => u()), o.length = 0;
27
- }, s = (u, p, a, f) => (u.addEventListener(p, a, f), () => u.removeEventListener(p, a, f)), r = k(
28
- () => [B(t), ae(i)],
27
+ }, i = (u, p, a, f) => (u.addEventListener(p, a, f), () => u.removeEventListener(p, a, f)), r = k(
28
+ () => [B(t), ae(s)],
29
29
  ([u, p]) => {
30
30
  if (c(), !u)
31
31
  return;
32
- const a = et(p) ? { ...p } : p;
32
+ const a = tt(p) ? { ...p } : p;
33
33
  o.push(
34
- ...n.flatMap((f) => l.map((v) => s(u, f, v, a)))
34
+ ...n.flatMap((f) => l.map((v) => i(u, f, v, a)))
35
35
  );
36
36
  },
37
37
  { immediate: !0, flush: "post" }
38
38
  ), d = () => {
39
39
  r(), c();
40
40
  };
41
- return De(d), d;
41
+ return Le(d), d;
42
42
  }
43
- function nt() {
44
- const e = w(!1), t = se();
45
- return t && V(() => {
43
+ function ot() {
44
+ const e = y(!1), t = ie();
45
+ return t && z(() => {
46
46
  e.value = !0;
47
47
  }, t), e;
48
48
  }
49
- function ot(e) {
50
- const t = nt();
49
+ function lt(e) {
50
+ const t = ot();
51
51
  return b(() => (t.value, !!e()));
52
52
  }
53
- function lt(e, t, n = {}) {
54
- const { window: l = F, ...i } = n;
53
+ function st(e, t, n = {}) {
54
+ const { window: l = F, ...s } = n;
55
55
  let o;
56
- const c = ot(() => l && "MutationObserver" in l), s = () => {
56
+ const c = lt(() => l && "MutationObserver" in l), i = () => {
57
57
  o && (o.disconnect(), o = void 0);
58
58
  }, r = b(() => {
59
- const a = ae(e), f = (Array.isArray(a) ? a : [a]).map(B).filter(Ke);
59
+ const a = ae(e), f = (Array.isArray(a) ? a : [a]).map(B).filter(_e);
60
60
  return new Set(f);
61
61
  }), d = k(
62
62
  () => r.value,
63
63
  (a) => {
64
- s(), c.value && a.size && (o = new MutationObserver(t), a.forEach((f) => o.observe(f, i)));
64
+ i(), c.value && a.size && (o = new MutationObserver(t), a.forEach((f) => o.observe(f, s)));
65
65
  },
66
66
  { immediate: !0, flush: "post" }
67
67
  ), u = () => o == null ? void 0 : o.takeRecords(), p = () => {
68
- d(), s();
68
+ d(), i();
69
69
  };
70
- return De(p), {
70
+ return Le(p), {
71
71
  isSupported: c,
72
72
  stop: p,
73
73
  takeRecords: u
@@ -78,7 +78,7 @@ function it(e = {}) {
78
78
  const {
79
79
  window: n = F,
80
80
  deep: l = !0,
81
- triggerOnRemoval: i = !1
81
+ triggerOnRemoval: s = !1
82
82
  } = e, o = (t = e.document) != null ? t : n == null ? void 0 : n.document, c = () => {
83
83
  var d;
84
84
  let u = o == null ? void 0 : o.activeElement;
@@ -86,49 +86,49 @@ function it(e = {}) {
86
86
  for (; u != null && u.shadowRoot; )
87
87
  u = (d = u == null ? void 0 : u.shadowRoot) == null ? void 0 : d.activeElement;
88
88
  return u;
89
- }, s = w(), r = () => {
90
- s.value = c();
89
+ }, i = y(), r = () => {
90
+ i.value = c();
91
91
  };
92
- return n && (z(n, "blur", (d) => {
92
+ return n && (V(n, "blur", (d) => {
93
93
  d.relatedTarget === null && r();
94
- }, !0), z(n, "focus", r, !0)), i && lt(o, (d) => {
94
+ }, !0), V(n, "focus", r, !0)), s && st(o, (d) => {
95
95
  d.filter((u) => u.removedNodes.length).map((u) => Array.from(u.removedNodes)).flat().forEach((u) => {
96
- u === s.value && r();
96
+ u === i.value && r();
97
97
  });
98
98
  }, {
99
99
  childList: !0,
100
100
  subtree: !0
101
- }), r(), s;
101
+ }), r(), i;
102
102
  }
103
- const st = "focusin", rt = "focusout";
104
- function at(e, t = {}) {
105
- const { window: n = F } = t, l = b(() => B(e)), i = w(!1), o = b(() => i.value), c = it(t);
106
- return !n || !c.value ? { focused: o } : (z(l, st, () => i.value = !0), z(l, rt, () => i.value = !1), { focused: o });
103
+ const rt = "focusin", at = "focusout";
104
+ function ct(e, t = {}) {
105
+ const { window: n = F } = t, l = b(() => B(e)), s = y(!1), o = b(() => s.value), c = it(t);
106
+ return !n || !c.value ? { focused: o } : (V(l, rt, () => s.value = !0), V(l, at, () => s.value = !1), { focused: o });
107
107
  }
108
- function ct(e, { window: t = F, scrollTarget: n } = {}) {
109
- const l = w(!1), i = () => {
108
+ function dt(e, { window: t = F, scrollTarget: n } = {}) {
109
+ const l = y(!1), s = () => {
110
110
  if (!t) return;
111
111
  const o = t.document, c = B(e);
112
112
  if (!c)
113
113
  l.value = !1;
114
114
  else {
115
- const s = c.getBoundingClientRect();
116
- l.value = s.top <= (t.innerHeight || o.documentElement.clientHeight) && s.left <= (t.innerWidth || o.documentElement.clientWidth) && s.bottom >= 0 && s.right >= 0;
115
+ const i = c.getBoundingClientRect();
116
+ l.value = i.top <= (t.innerHeight || o.documentElement.clientHeight) && i.left <= (t.innerWidth || o.documentElement.clientWidth) && i.bottom >= 0 && i.right >= 0;
117
117
  }
118
118
  };
119
119
  return k(
120
120
  () => B(e),
121
- () => i(),
121
+ () => s(),
122
122
  { immediate: !0, flush: "post" }
123
- ), t && z(n || t, "scroll", i, {
123
+ ), t && V(n || t, "scroll", s, {
124
124
  capture: !1,
125
125
  passive: !0
126
126
  }), l;
127
127
  }
128
128
  const $ = (e) => {
129
- let t = ct(e).value;
129
+ let t = dt(e).value;
130
130
  return t = t && e.offsetHeight > 0, t;
131
- }, O = (e) => e.tabIndex >= 0, be = (e) => {
131
+ }, O = (e) => e.tabIndex >= 0, ge = (e) => {
132
132
  const t = e.target;
133
133
  return ce(t);
134
134
  }, ce = (e) => {
@@ -137,33 +137,33 @@ const $ = (e) => {
137
137
  if (e instanceof HTMLTableCellElement) {
138
138
  const l = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
139
139
  if (l) {
140
- const i = Array.from(l.children)[e.cellIndex];
141
- i && (n = i);
140
+ const s = Array.from(l.children)[e.cellIndex];
141
+ s && (n = s);
142
142
  }
143
143
  } else if (e instanceof HTMLTableRowElement) {
144
144
  const l = e.previousElementSibling;
145
145
  l && (n = l);
146
146
  }
147
147
  return n && (!O(n) || !$(n)) ? ce(n) : n;
148
- }, dt = (e) => {
148
+ }, ut = (e) => {
149
149
  var t;
150
150
  const n = e.target;
151
151
  let l;
152
152
  if (n instanceof HTMLTableCellElement) {
153
- const i = (t = n.parentElement) == null ? void 0 : t.parentElement;
154
- if (i) {
155
- const o = i.firstElementChild.children[n.cellIndex];
153
+ const s = (t = n.parentElement) == null ? void 0 : t.parentElement;
154
+ if (s) {
155
+ const o = s.firstElementChild.children[n.cellIndex];
156
156
  o && (l = o);
157
157
  }
158
158
  } else if (n instanceof HTMLTableRowElement) {
159
- const i = n.parentElement;
160
- if (i) {
161
- const o = i.firstElementChild;
159
+ const s = n.parentElement;
160
+ if (s) {
161
+ const o = s.firstElementChild;
162
162
  o && (l = o);
163
163
  }
164
164
  }
165
165
  return l && (!O(l) || !$(l)) ? de(l) : l;
166
- }, ge = (e) => {
166
+ }, xe = (e) => {
167
167
  const t = e.target;
168
168
  return de(t);
169
169
  }, de = (e) => {
@@ -172,33 +172,33 @@ const $ = (e) => {
172
172
  if (e instanceof HTMLTableCellElement) {
173
173
  const l = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
174
174
  if (l) {
175
- const i = Array.from(l.children)[e.cellIndex];
176
- i && (n = i);
175
+ const s = Array.from(l.children)[e.cellIndex];
176
+ s && (n = s);
177
177
  }
178
178
  } else if (e instanceof HTMLTableRowElement) {
179
179
  const l = e.nextElementSibling;
180
180
  l && (n = l);
181
181
  }
182
182
  return n && (!O(n) || !$(n)) ? de(n) : n;
183
- }, ut = (e) => {
183
+ }, ft = (e) => {
184
184
  var t;
185
185
  const n = e.target;
186
186
  let l;
187
187
  if (n instanceof HTMLTableCellElement) {
188
- const i = (t = n.parentElement) == null ? void 0 : t.parentElement;
189
- if (i) {
190
- const o = i.lastElementChild.children[n.cellIndex];
188
+ const s = (t = n.parentElement) == null ? void 0 : t.parentElement;
189
+ if (s) {
190
+ const o = s.lastElementChild.children[n.cellIndex];
191
191
  o && (l = o);
192
192
  }
193
193
  } else if (n instanceof HTMLTableRowElement) {
194
- const i = n.parentElement;
195
- if (i) {
196
- const o = i.lastElementChild;
194
+ const s = n.parentElement;
195
+ if (s) {
196
+ const o = s.lastElementChild;
197
197
  o && (l = o);
198
198
  }
199
199
  }
200
200
  return l && (!O(l) || !$(l)) ? ce(l) : l;
201
- }, xe = (e) => {
201
+ }, Ee = (e) => {
202
202
  const t = e.target;
203
203
  return ue(t);
204
204
  }, ue = (e) => {
@@ -211,7 +211,7 @@ const $ = (e) => {
211
211
  n = l == null ? void 0 : l.lastElementChild;
212
212
  }
213
213
  return n && (!O(n) || !$(n)) ? ue(n) : n;
214
- }, Ee = (e) => {
214
+ }, ke = (e) => {
215
215
  const t = e.target;
216
216
  return fe(t);
217
217
  }, fe = (e) => {
@@ -224,90 +224,90 @@ const $ = (e) => {
224
224
  n = l == null ? void 0 : l.firstElementChild;
225
225
  }
226
226
  return n && (!O(n) || !$(n)) ? fe(n) : n;
227
- }, ke = (e) => {
227
+ }, Ce = (e) => {
228
228
  const t = e.target.parentElement.firstElementChild;
229
229
  return t && (!O(t) || !$(t)) ? fe(t) : t;
230
- }, Ce = (e) => {
230
+ }, Ae = (e) => {
231
231
  const t = e.target.parentElement.lastElementChild;
232
232
  return t && (!O(t) || !$(t)) ? ue(t) : t;
233
- }, G = ["alt", "control", "shift", "meta"], ft = {
233
+ }, G = ["alt", "control", "shift", "meta"], pt = {
234
234
  ArrowUp: "up",
235
235
  ArrowDown: "down",
236
236
  ArrowLeft: "left",
237
237
  ArrowRight: "right"
238
238
  }, pe = {
239
239
  "keydown.up": (e) => {
240
- const t = be(e);
240
+ const t = ge(e);
241
241
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
242
242
  },
243
243
  "keydown.down": (e) => {
244
- const t = ge(e);
244
+ const t = xe(e);
245
245
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
246
246
  },
247
247
  "keydown.left": (e) => {
248
- const t = xe(e);
248
+ const t = Ee(e);
249
249
  e.preventDefault(), e.stopPropagation(), t && t.focus();
250
250
  },
251
251
  "keydown.right": (e) => {
252
- const t = Ee(e);
252
+ const t = ke(e);
253
253
  e.preventDefault(), e.stopPropagation(), t && t.focus();
254
254
  },
255
255
  "keydown.control.up": (e) => {
256
- const t = dt(e);
256
+ const t = ut(e);
257
257
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
258
258
  },
259
259
  "keydown.control.down": (e) => {
260
- const t = ut(e);
260
+ const t = ft(e);
261
261
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
262
262
  },
263
263
  "keydown.control.left": (e) => {
264
- const t = ke(e);
264
+ const t = Ce(e);
265
265
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
266
266
  },
267
267
  "keydown.control.right": (e) => {
268
- const t = Ce(e);
268
+ const t = Ae(e);
269
269
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
270
270
  },
271
271
  "keydown.end": (e) => {
272
- const t = Ce(e);
272
+ const t = Ae(e);
273
273
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
274
274
  },
275
275
  "keydown.enter": (e) => {
276
276
  if (e.target instanceof HTMLTableCellElement) {
277
277
  e.preventDefault(), e.stopPropagation();
278
- const t = ge(e);
278
+ const t = xe(e);
279
279
  t && t.focus();
280
280
  }
281
281
  },
282
282
  "keydown.shift.enter": (e) => {
283
283
  if (e.target instanceof HTMLTableCellElement) {
284
284
  e.preventDefault(), e.stopPropagation();
285
- const t = be(e);
285
+ const t = ge(e);
286
286
  t && t.focus();
287
287
  }
288
288
  },
289
289
  "keydown.home": (e) => {
290
- const t = ke(e);
290
+ const t = Ce(e);
291
291
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
292
292
  },
293
293
  "keydown.tab": (e) => {
294
- const t = Ee(e);
294
+ const t = ke(e);
295
295
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
296
296
  },
297
297
  "keydown.shift.tab": (e) => {
298
- const t = xe(e);
298
+ const t = Ee(e);
299
299
  t && (e.preventDefault(), e.stopPropagation(), t.focus());
300
300
  }
301
301
  };
302
302
  function me(e) {
303
303
  const t = (c) => {
304
- let s = null;
305
- return c.parent && (typeof c.parent == "string" ? s = document.querySelector(c.parent) : c.parent instanceof HTMLElement ? s = c.parent : s = c.parent.value), s;
304
+ let i = null;
305
+ return c.parent && (typeof c.parent == "string" ? i = document.querySelector(c.parent) : c.parent instanceof HTMLElement ? i = c.parent : i = c.parent.value), i;
306
306
  }, n = (c) => {
307
- const s = t(c);
307
+ const i = t(c);
308
308
  let r = [];
309
309
  if (typeof c.selectors == "string")
310
- r = s ? Array.from(s.querySelectorAll(c.selectors)) : Array.from(document.querySelectorAll(c.selectors));
310
+ r = i ? Array.from(i.querySelectorAll(c.selectors)) : Array.from(document.querySelectorAll(c.selectors));
311
311
  else if (Array.isArray(c.selectors))
312
312
  for (const d of c.selectors)
313
313
  d instanceof HTMLElement ? r.push(d) : r.push(d.$el);
@@ -320,85 +320,85 @@ function me(e) {
320
320
  r.push(c.selectors.value);
321
321
  return r;
322
322
  }, l = (c) => {
323
- const s = t(c);
323
+ const i = t(c);
324
324
  let r = [];
325
- return c.selectors ? r = n(c) : s && (r = Array.from(s.children).filter((d) => O(d) && $(d))), r;
326
- }, i = (c) => (s) => {
327
- const r = ft[s.key] || s.key.toLowerCase();
325
+ return c.selectors ? r = n(c) : i && (r = Array.from(i.children).filter((d) => O(d) && $(d))), r;
326
+ }, s = (c) => (i) => {
327
+ const r = pt[i.key] || i.key.toLowerCase();
328
328
  if (G.includes(r)) return;
329
329
  const d = c.handlers || pe;
330
330
  for (const u of Object.keys(d)) {
331
331
  const [p, ...a] = u.split(".");
332
332
  if (p === "keydown" && a.includes(r)) {
333
- const f = d[u], v = a.filter((y) => G.includes(y)), g = G.some((y) => {
334
- const A = y.charAt(0).toUpperCase() + y.slice(1);
335
- return s.getModifierState(A);
333
+ const f = d[u], v = a.filter((h) => G.includes(h)), E = G.some((h) => {
334
+ const C = h.charAt(0).toUpperCase() + h.slice(1);
335
+ return i.getModifierState(C);
336
336
  });
337
337
  if (v.length > 0) {
338
- if (g) {
339
- for (const y of G)
340
- if (a.includes(y)) {
341
- const A = y.charAt(0).toUpperCase() + y.slice(1);
342
- s.getModifierState(A) && f(s);
338
+ if (E) {
339
+ for (const h of G)
340
+ if (a.includes(h)) {
341
+ const C = h.charAt(0).toUpperCase() + h.slice(1);
342
+ i.getModifierState(C) && f(i);
343
343
  }
344
344
  }
345
345
  } else
346
- g || f(s);
346
+ E || f(i);
347
347
  }
348
348
  }
349
349
  }, o = [];
350
- V(() => {
350
+ z(() => {
351
351
  for (const c of e) {
352
- const s = t(c), r = l(c), d = i(c), u = s ? [s] : r;
352
+ const i = t(c), r = l(c), d = s(c), u = i ? [i] : r;
353
353
  for (const p of u) {
354
- const { focused: a } = at(w(p)), f = k(a, (v) => {
354
+ const { focused: a } = ct(y(p)), f = k(a, (v) => {
355
355
  v ? p.addEventListener("keydown", d) : p.removeEventListener("keydown", d);
356
356
  });
357
357
  o.push(f);
358
358
  }
359
359
  }
360
- }), Ue(() => {
360
+ }), qe(() => {
361
361
  for (const c of o)
362
362
  c();
363
363
  });
364
364
  }
365
365
  function ve(e) {
366
- return le() ? (ie(e), !0) : !1;
366
+ return le() ? (se(e), !0) : !1;
367
367
  }
368
368
  function K(e) {
369
369
  return typeof e == "function" ? e() : m(e);
370
370
  }
371
- const pt = typeof window < "u" && typeof document < "u";
371
+ const mt = typeof window < "u" && typeof document < "u";
372
372
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
373
- const mt = (e) => e != null, vt = Object.prototype.toString, wt = (e) => vt.call(e) === "[object Object]", ht = () => {
373
+ const vt = (e) => e != null, ht = Object.prototype.toString, wt = (e) => ht.call(e) === "[object Object]", yt = () => {
374
374
  };
375
- function yt(e) {
376
- return se();
375
+ function bt(e) {
376
+ return ie();
377
377
  }
378
- function bt(e, t = !0, n) {
379
- yt() ? V(e, n) : t ? e() : Oe(e);
378
+ function gt(e, t = !0, n) {
379
+ bt() ? z(e, n) : t ? e() : Te(e);
380
380
  }
381
- const we = pt ? window : void 0;
381
+ const he = mt ? window : void 0;
382
382
  function R(e) {
383
383
  var t;
384
384
  const n = K(e);
385
385
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
386
386
  }
387
- function Ae(...e) {
388
- let t, n, l, i;
389
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, i] = e, t = we) : [t, n, l, i] = e, !t)
390
- return ht;
387
+ function Ie(...e) {
388
+ let t, n, l, s;
389
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, s] = e, t = he) : [t, n, l, s] = e, !t)
390
+ return yt;
391
391
  Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);
392
392
  const o = [], c = () => {
393
393
  o.forEach((u) => u()), o.length = 0;
394
- }, s = (u, p, a, f) => (u.addEventListener(p, a, f), () => u.removeEventListener(p, a, f)), r = k(
395
- () => [R(t), K(i)],
394
+ }, i = (u, p, a, f) => (u.addEventListener(p, a, f), () => u.removeEventListener(p, a, f)), r = k(
395
+ () => [R(t), K(s)],
396
396
  ([u, p]) => {
397
397
  if (c(), !u)
398
398
  return;
399
399
  const a = wt(p) ? { ...p } : p;
400
400
  o.push(
401
- ...n.flatMap((f) => l.map((v) => s(u, f, v, a)))
401
+ ...n.flatMap((f) => l.map((v) => i(u, f, v, a)))
402
402
  );
403
403
  },
404
404
  { immediate: !0, flush: "post" }
@@ -407,32 +407,32 @@ function Ae(...e) {
407
407
  };
408
408
  return ve(d), d;
409
409
  }
410
- function gt() {
411
- const e = w(!1), t = se();
412
- return t && V(() => {
410
+ function xt() {
411
+ const e = y(!1), t = ie();
412
+ return t && z(() => {
413
413
  e.value = !0;
414
414
  }, t), e;
415
415
  }
416
- function Le(e) {
417
- const t = gt();
416
+ function Me(e) {
417
+ const t = xt();
418
418
  return b(() => (t.value, !!e()));
419
419
  }
420
- function Me(e, t, n = {}) {
421
- const { window: l = we, ...i } = n;
420
+ function Pe(e, t, n = {}) {
421
+ const { window: l = he, ...s } = n;
422
422
  let o;
423
- const c = Le(() => l && "MutationObserver" in l), s = () => {
423
+ const c = Me(() => l && "MutationObserver" in l), i = () => {
424
424
  o && (o.disconnect(), o = void 0);
425
425
  }, r = b(() => {
426
- const a = K(e), f = (Array.isArray(a) ? a : [a]).map(R).filter(mt);
426
+ const a = K(e), f = (Array.isArray(a) ? a : [a]).map(R).filter(vt);
427
427
  return new Set(f);
428
428
  }), d = k(
429
429
  () => r.value,
430
430
  (a) => {
431
- s(), c.value && a.size && (o = new MutationObserver(t), a.forEach((f) => o.observe(f, i)));
431
+ i(), c.value && a.size && (o = new MutationObserver(t), a.forEach((f) => o.observe(f, s)));
432
432
  },
433
433
  { immediate: !0, flush: "post" }
434
434
  ), u = () => o == null ? void 0 : o.takeRecords(), p = () => {
435
- d(), s();
435
+ d(), i();
436
436
  };
437
437
  return ve(p), {
438
438
  isSupported: c,
@@ -440,10 +440,10 @@ function Me(e, t, n = {}) {
440
440
  takeRecords: u
441
441
  };
442
442
  }
443
- function xt(e, t, n = {}) {
444
- const { window: l = we, ...i } = n;
443
+ function Et(e, t, n = {}) {
444
+ const { window: l = he, ...s } = n;
445
445
  let o;
446
- const c = Le(() => l && "ResizeObserver" in l), s = () => {
446
+ const c = Me(() => l && "ResizeObserver" in l), i = () => {
447
447
  o && (o.disconnect(), o = void 0);
448
448
  }, r = b(() => {
449
449
  const p = K(e);
@@ -451,47 +451,47 @@ function xt(e, t, n = {}) {
451
451
  }), d = k(
452
452
  r,
453
453
  (p) => {
454
- if (s(), c.value && l) {
454
+ if (i(), c.value && l) {
455
455
  o = new ResizeObserver(t);
456
456
  for (const a of p)
457
- a && o.observe(a, i);
457
+ a && o.observe(a, s);
458
458
  }
459
459
  },
460
460
  { immediate: !0, flush: "post" }
461
461
  ), u = () => {
462
- s(), d();
462
+ i(), d();
463
463
  };
464
464
  return ve(u), {
465
465
  isSupported: c,
466
466
  stop: u
467
467
  };
468
468
  }
469
- function Et(e, t = {}) {
469
+ function kt(e, t = {}) {
470
470
  const {
471
471
  reset: n = !0,
472
472
  windowResize: l = !0,
473
- windowScroll: i = !0,
473
+ windowScroll: s = !0,
474
474
  immediate: o = !0,
475
475
  updateTiming: c = "sync"
476
- } = t, s = w(0), r = w(0), d = w(0), u = w(0), p = w(0), a = w(0), f = w(0), v = w(0);
477
- function g() {
478
- const A = R(e);
479
- if (!A) {
480
- n && (s.value = 0, r.value = 0, d.value = 0, u.value = 0, p.value = 0, a.value = 0, f.value = 0, v.value = 0);
476
+ } = t, i = y(0), r = y(0), d = y(0), u = y(0), p = y(0), a = y(0), f = y(0), v = y(0);
477
+ function E() {
478
+ const C = R(e);
479
+ if (!C) {
480
+ n && (i.value = 0, r.value = 0, d.value = 0, u.value = 0, p.value = 0, a.value = 0, f.value = 0, v.value = 0);
481
481
  return;
482
482
  }
483
- const C = A.getBoundingClientRect();
484
- s.value = C.height, r.value = C.bottom, d.value = C.left, u.value = C.right, p.value = C.top, a.value = C.width, f.value = C.x, v.value = C.y;
483
+ const A = C.getBoundingClientRect();
484
+ i.value = A.height, r.value = A.bottom, d.value = A.left, u.value = A.right, p.value = A.top, a.value = A.width, f.value = A.x, v.value = A.y;
485
485
  }
486
- function y() {
487
- c === "sync" ? g() : c === "next-frame" && requestAnimationFrame(() => g());
486
+ function h() {
487
+ c === "sync" ? E() : c === "next-frame" && requestAnimationFrame(() => E());
488
488
  }
489
- return xt(e, y), k(() => R(e), (A) => !A && y()), Me(e, y, {
489
+ return Et(e, h), k(() => R(e), (C) => !C && h()), Pe(e, h, {
490
490
  attributeFilter: ["style", "class"]
491
- }), i && Ae("scroll", y, { capture: !0, passive: !0 }), l && Ae("resize", y, { passive: !0 }), bt(() => {
492
- o && y();
491
+ }), s && Ie("scroll", h, { capture: !0, passive: !0 }), l && Ie("resize", h, { passive: !0 }), gt(() => {
492
+ o && h();
493
493
  }), {
494
- height: s,
494
+ height: i,
495
495
  bottom: r,
496
496
  left: d,
497
497
  right: u,
@@ -499,10 +499,13 @@ function Et(e, t = {}) {
499
499
  width: a,
500
500
  x: f,
501
501
  y: v,
502
- update: y
502
+ update: h
503
503
  };
504
504
  }
505
- const kt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ct = { key: 1 }, Pe = /* @__PURE__ */ D({
505
+ const Ct = (e) => {
506
+ const t = new DOMParser().parseFromString(e, "text/html");
507
+ return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);
508
+ }, At = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], It = ["innerHTML"], St = { key: 2 }, We = /* @__PURE__ */ D({
506
509
  __name: "ACell",
507
510
  props: {
508
511
  colIndex: {},
@@ -513,21 +516,21 @@ const kt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
513
516
  pinned: { type: Boolean }
514
517
  },
515
518
  setup(e) {
516
- var C;
517
- const t = Q(e.tableid), n = Z("cell"), l = w(""), i = w(!1), { bottom: o, left: c } = Et(n), s = t.table, r = t.columns[e.colIndex], d = t.rows[e.rowIndex], u = b(() => r.align || "center"), p = b(() => r.width || "40ch"), a = b(() => {
519
+ var we;
520
+ const t = Q(e.tableid), n = Z("cell"), l = y(""), s = y(!1), { bottom: o, left: c } = kt(n), i = t.table, r = t.columns[e.colIndex], d = t.rows[e.rowIndex], u = b(() => r.align || "center"), p = b(() => r.width || "40ch"), a = b(() => {
518
521
  const x = t.cellData(e.colIndex, e.rowIndex), I = r.format;
519
- return I ? typeof I == "function" ? I(x, { table: s, row: d, column: r }) : typeof I == "string" ? Function(`"use strict";return (${I})`)()(x, { table: s, row: d, column: r }) : x : x;
520
- }), f = () => {
521
- r.mask, r.modalComponent && (t.modal.visible = !0, t.modal.colIndex = e.colIndex, t.modal.rowIndex = e.rowIndex, t.modal.parent = n.value, t.modal.top = o.value, t.modal.left = c.value, t.modal.width = p.value, typeof r.modalComponent == "function" ? t.modal.component = r.modalComponent({ table: s, row: d, column: r }) : t.modal.component = r.modalComponent, t.modal.componentProps = r.modalComponentExtraProps);
522
+ return I ? typeof I == "function" ? I(x, { table: i, row: d, column: r }) : typeof I == "string" ? Function(`"use strict";return (${I})`)()(x, { table: i, row: d, column: r }) : x : x;
523
+ }), f = b(() => typeof a.value == "string" ? Ct(a.value) : !1), v = () => {
524
+ r.mask, r.modalComponent && (t.modal.visible = !0, t.modal.colIndex = e.colIndex, t.modal.rowIndex = e.rowIndex, t.modal.parent = n.value, t.modal.top = o.value, t.modal.left = c.value, t.modal.width = p.value, typeof r.modalComponent == "function" ? t.modal.component = r.modalComponent({ table: i, row: d, column: r }) : t.modal.component = r.modalComponent, t.modal.componentProps = r.modalComponentExtraProps);
522
525
  };
523
526
  if (e.addNavigation) {
524
527
  let x = {
525
528
  ...pe,
526
- "keydown.f2": f,
527
- "keydown.alt.up": f,
528
- "keydown.alt.down": f,
529
- "keydown.alt.left": f,
530
- "keydown.alt.right": f
529
+ "keydown.f2": v,
530
+ "keydown.alt.up": v,
531
+ "keydown.alt.down": v,
532
+ "keydown.alt.left": v,
533
+ "keydown.alt.right": v
531
534
  };
532
535
  typeof e.addNavigation == "object" && (x = {
533
536
  ...x,
@@ -539,18 +542,18 @@ const kt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
539
542
  }
540
543
  ]);
541
544
  }
542
- const v = () => {
545
+ const E = () => {
543
546
  n.value && (l.value = n.value.textContent);
544
- }, g = () => {
545
- n.value && n.value.textContent !== l.value && (l.value = n.value.textContent, n.value.dispatchEvent(new Event("change")), i.value = !0, r.format || t.setCellData(e.rowIndex, e.colIndex, l.value));
546
- }, y = (x, I) => I && x === 0 && I > 0 ? `${I}ch` : "inherit", A = {
547
+ }, h = () => {
548
+ n.value && n.value.textContent !== l.value && (l.value = n.value.textContent, n.value.dispatchEvent(new Event("change")), s.value = !0, r.format || t.setCellData(e.rowIndex, e.colIndex, l.value));
549
+ }, C = (x, I) => I && x === 0 && I > 0 ? `${I}ch` : "inherit", A = {
547
550
  textAlign: u.value,
548
551
  width: p.value,
549
- backgroundColor: i.value ? "var(--cell-modified-color)" : "inherit",
550
- fontWeight: i.value ? "bold" : "inherit",
551
- paddingLeft: y(e.colIndex, (C = t.display[e.rowIndex]) == null ? void 0 : C.indent)
552
+ backgroundColor: s.value ? "var(--cell-modified-color)" : "inherit",
553
+ fontWeight: s.value ? "bold" : "inherit",
554
+ paddingLeft: C(e.colIndex, (we = t.display[e.rowIndex]) == null ? void 0 : we.indent)
552
555
  };
553
- return (x, I) => (h(), E("td", {
556
+ return (x, I) => (w(), g("td", {
554
557
  ref: "cell",
555
558
  "data-colindex": x.colIndex,
556
559
  "data-rowindex": x.rowIndex,
@@ -559,21 +562,24 @@ const kt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
559
562
  tabindex: x.tabIndex,
560
563
  spellcheck: !1,
561
564
  style: A,
562
- onFocus: v,
563
- onPaste: g,
564
- onBlur: g,
565
- onInput: g,
566
- onClick: f,
567
- onMousedown: f,
568
- class: H(["atable__cell", x.pinned ? "sticky-column" : ""])
565
+ onFocus: E,
566
+ onPaste: h,
567
+ onBlur: h,
568
+ onInput: h,
569
+ onClick: v,
570
+ onMousedown: v,
571
+ class: j(["atable__cell", x.pinned ? "sticky-column" : ""])
569
572
  }, [
570
- m(r).cellComponent ? (h(), U(Te(m(r).cellComponent), re({
573
+ m(r).cellComponent ? (w(), U(Re(m(r).cellComponent), re({
571
574
  key: 0,
572
575
  value: a.value
573
- }, m(r).cellComponentProps), null, 16, ["value"])) : (h(), E("span", Ct, N(a.value), 1))
574
- ], 42, kt));
576
+ }, m(r).cellComponentProps), null, 16, ["value"])) : f.value ? (w(), g("span", {
577
+ key: 1,
578
+ innerHTML: a.value
579
+ }, null, 8, It)) : (w(), g("span", St, N(a.value), 1))
580
+ ], 42, At));
575
581
  }
576
- }), At = ["tabindex"], It = ["tabindex"], St = ["colspan"], $t = /* @__PURE__ */ D({
582
+ }), $t = ["tabindex"], Ot = ["tabindex"], Tt = ["colspan"], Rt = /* @__PURE__ */ D({
577
583
  __name: "AExpansionRow",
578
584
  props: {
579
585
  rowIndex: {},
@@ -584,35 +590,35 @@ const kt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
584
590
  setup(e) {
585
591
  const t = Q(e.tableid), n = Z("rowEl"), l = b(() => t.display[e.rowIndex].expanded ? "▼" : "►");
586
592
  if (e.addNavigation) {
587
- const i = {
593
+ const s = {
588
594
  "keydown.control.g": (o) => {
589
595
  o.stopPropagation(), o.preventDefault(), t.toggleRowExpand(e.rowIndex);
590
596
  }
591
597
  };
592
- typeof e.addNavigation == "object" && Object.assign(i, e.addNavigation), me([
598
+ typeof e.addNavigation == "object" && Object.assign(s, e.addNavigation), me([
593
599
  {
594
600
  selectors: n,
595
- handlers: i
601
+ handlers: s
596
602
  }
597
603
  ]);
598
604
  }
599
- return (i, o) => (h(), E(X, null, [
600
- P("tr", re(i.$attrs, {
605
+ return (s, o) => (w(), g(X, null, [
606
+ P("tr", re(s.$attrs, {
601
607
  ref: "rowEl",
602
- tabindex: i.tabIndex,
608
+ tabindex: s.tabIndex,
603
609
  class: "expandable-row"
604
610
  }), [
605
611
  P("td", {
606
612
  tabIndex: -1,
607
- onClick: o[0] || (o[0] = (c) => m(t).toggleRowExpand(i.rowIndex)),
613
+ onClick: o[0] || (o[0] = (c) => m(t).toggleRowExpand(s.rowIndex)),
608
614
  class: "row-index"
609
615
  }, N(l.value), 1),
610
- S(i.$slots, "row")
611
- ], 16, At),
612
- m(t).display[i.rowIndex].expanded ? (h(), E("tr", {
616
+ S(s.$slots, "row")
617
+ ], 16, $t),
618
+ m(t).display[s.rowIndex].expanded ? (w(), g("tr", {
613
619
  key: 0,
614
620
  ref: "rowExpanded",
615
- tabindex: i.tabIndex,
621
+ tabindex: s.tabIndex,
616
622
  class: "expanded-row"
617
623
  }, [
618
624
  P("td", {
@@ -620,12 +626,12 @@ const kt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
620
626
  colspan: m(t).columns.length + 1,
621
627
  class: "expanded-row-content"
622
628
  }, [
623
- S(i.$slots, "content")
624
- ], 8, St)
625
- ], 8, It)) : J("", !0)
629
+ S(s.$slots, "content")
630
+ ], 8, Tt)
631
+ ], 8, Ot)) : J("", !0)
626
632
  ], 64));
627
633
  }
628
- }), Ot = ["tabindex"], We = /* @__PURE__ */ D({
634
+ }), Dt = ["tabindex"], He = /* @__PURE__ */ D({
629
635
  __name: "ARow",
630
636
  props: {
631
637
  rowIndex: {},
@@ -634,90 +640,90 @@ const kt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable"
634
640
  addNavigation: { type: [Boolean, Object], default: !1 }
635
641
  },
636
642
  setup(e) {
637
- const t = Q(e.tableid), n = Z("rowEl"), l = b(() => t.columns.some((s) => s.pinned)), i = b(() => t.config.view !== "tree" || t.display[e.rowIndex].isRoot || t.display[e.rowIndex].open), o = b(() => t.config.view !== "tree" ? "" : t.display[e.rowIndex].isRoot || t.display[e.rowIndex].isParent ? t.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), c = (s) => {
638
- t.toggleRowExpand(s);
643
+ const t = Q(e.tableid), n = Z("rowEl"), l = b(() => t.columns.some((i) => i.pinned)), s = b(() => t.config.view !== "tree" || t.display[e.rowIndex].isRoot || t.display[e.rowIndex].open), o = b(() => t.config.view !== "tree" ? "" : t.display[e.rowIndex].isRoot || t.display[e.rowIndex].isParent ? t.display[e.rowIndex].childrenOpen ? "-" : "+" : ""), c = (i) => {
644
+ t.toggleRowExpand(i);
639
645
  };
640
646
  if (e.addNavigation) {
641
- let s = pe;
642
- typeof e.addNavigation == "object" && (s = {
643
- ...s,
647
+ let i = pe;
648
+ typeof e.addNavigation == "object" && (i = {
649
+ ...i,
644
650
  ...e.addNavigation
645
651
  }), me([
646
652
  {
647
653
  selectors: n,
648
- handlers: s
654
+ handlers: i
649
655
  }
650
656
  ]);
651
657
  }
652
- return (s, r) => te((h(), E("tr", {
658
+ return (i, r) => te((w(), g("tr", {
653
659
  ref: "rowEl",
654
- tabindex: s.tabIndex,
660
+ tabindex: i.tabIndex,
655
661
  class: "table-row"
656
662
  }, [
657
- S(s.$slots, "index", {}, () => [
658
- m(t).config.view === "list" ? (h(), E("td", {
663
+ S(i.$slots, "index", {}, () => [
664
+ m(t).config.view === "list" ? (w(), g("td", {
659
665
  key: 0,
660
666
  tabIndex: -1,
661
- class: H(["list-index", l.value ? "sticky-index" : ""])
662
- }, N(s.rowIndex + 1), 3)) : m(t).config.view === "tree" ? (h(), E("td", {
667
+ class: j(["list-index", l.value ? "sticky-index" : ""])
668
+ }, N(i.rowIndex + 1), 3)) : m(t).config.view === "tree" ? (w(), g("td", {
663
669
  key: 1,
664
670
  tabIndex: -1,
665
- class: H(["tree-index", l.value ? "sticky-index" : ""]),
666
- onClick: r[0] || (r[0] = (d) => c(s.rowIndex))
671
+ class: j(["tree-index", l.value ? "sticky-index" : ""]),
672
+ onClick: r[0] || (r[0] = (d) => c(i.rowIndex))
667
673
  }, N(o.value), 3)) : J("", !0)
668
674
  ]),
669
- S(s.$slots, "default")
670
- ], 8, Ot)), [
671
- [Re, i.value]
675
+ S(i.$slots, "default")
676
+ ], 8, Dt)), [
677
+ [De, s.value]
672
678
  ]);
673
679
  }
674
680
  });
675
681
  function je(e) {
676
- return le() ? (ie(e), !0) : !1;
682
+ return le() ? (se(e), !0) : !1;
677
683
  }
678
684
  function W(e) {
679
685
  return typeof e == "function" ? e() : m(e);
680
686
  }
681
- const He = typeof window < "u" && typeof document < "u";
687
+ const Ne = typeof window < "u" && typeof document < "u";
682
688
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
683
- const Tt = Object.prototype.toString, Rt = (e) => Tt.call(e) === "[object Object]", j = () => {
684
- }, oe = /* @__PURE__ */ Dt();
685
- function Dt() {
689
+ const Lt = Object.prototype.toString, Mt = (e) => Lt.call(e) === "[object Object]", H = () => {
690
+ }, oe = /* @__PURE__ */ Pt();
691
+ function Pt() {
686
692
  var e, t;
687
- return He && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
693
+ return Ne && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
688
694
  }
689
- const Ie = {
695
+ const Se = {
690
696
  mounted: "mounted",
691
697
  updated: "updated",
692
698
  unmounted: "unmounted"
693
699
  };
694
- function Lt(...e) {
700
+ function Wt(...e) {
695
701
  if (e.length !== 1)
696
- return qe(...e);
702
+ return Ye(...e);
697
703
  const t = e[0];
698
- return typeof t == "function" ? Ye(Xe(() => ({ get: t, set: j }))) : w(t);
704
+ return typeof t == "function" ? Xe(Je(() => ({ get: t, set: H }))) : y(t);
699
705
  }
700
706
  function M(e) {
701
707
  var t;
702
708
  const n = W(e);
703
709
  return (t = n == null ? void 0 : n.$el) != null ? t : n;
704
710
  }
705
- const Ne = He ? window : void 0;
711
+ const Be = Ne ? window : void 0;
706
712
  function Y(...e) {
707
- let t, n, l, i;
708
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, i] = e, t = Ne) : [t, n, l, i] = e, !t)
709
- return j;
713
+ let t, n, l, s;
714
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, s] = e, t = Be) : [t, n, l, s] = e, !t)
715
+ return H;
710
716
  Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);
711
717
  const o = [], c = () => {
712
718
  o.forEach((u) => u()), o.length = 0;
713
- }, s = (u, p, a, f) => (u.addEventListener(p, a, f), () => u.removeEventListener(p, a, f)), r = k(
714
- () => [M(t), W(i)],
719
+ }, i = (u, p, a, f) => (u.addEventListener(p, a, f), () => u.removeEventListener(p, a, f)), r = k(
720
+ () => [M(t), W(s)],
715
721
  ([u, p]) => {
716
722
  if (c(), !u)
717
723
  return;
718
- const a = Rt(p) ? { ...p } : p;
724
+ const a = Mt(p) ? { ...p } : p;
719
725
  o.push(
720
- ...n.flatMap((f) => l.map((v) => s(u, f, v, a)))
726
+ ...n.flatMap((f) => l.map((v) => i(u, f, v, a)))
721
727
  );
722
728
  },
723
729
  { immediate: !0, flush: "post" }
@@ -726,14 +732,14 @@ function Y(...e) {
726
732
  };
727
733
  return je(d), d;
728
734
  }
729
- let Se = !1;
730
- function $e(e, t, n = {}) {
731
- const { window: l = Ne, ignore: i = [], capture: o = !0, detectIframe: c = !1 } = n;
735
+ let $e = !1;
736
+ function Oe(e, t, n = {}) {
737
+ const { window: l = Be, ignore: s = [], capture: o = !0, detectIframe: c = !1 } = n;
732
738
  if (!l)
733
- return j;
734
- oe && !Se && (Se = !0, Array.from(l.document.body.children).forEach((a) => a.addEventListener("click", j)), l.document.documentElement.addEventListener("click", j));
735
- let s = !0;
736
- const r = (a) => i.some((f) => {
739
+ return H;
740
+ oe && !$e && ($e = !0, Array.from(l.document.body.children).forEach((a) => a.addEventListener("click", H)), l.document.documentElement.addEventListener("click", H));
741
+ let i = !0;
742
+ const r = (a) => s.some((f) => {
737
743
  if (typeof f == "string")
738
744
  return Array.from(l.document.querySelectorAll(f)).some((v) => v === a.target || a.composedPath().includes(v));
739
745
  {
@@ -744,8 +750,8 @@ function $e(e, t, n = {}) {
744
750
  Y(l, "click", (a) => {
745
751
  const f = M(e);
746
752
  if (!(!f || f === a.target || a.composedPath().includes(f))) {
747
- if (a.detail === 0 && (s = !r(a)), !s) {
748
- s = !0;
753
+ if (a.detail === 0 && (i = !r(a)), !i) {
754
+ i = !0;
749
755
  return;
750
756
  }
751
757
  t(a);
@@ -753,7 +759,7 @@ function $e(e, t, n = {}) {
753
759
  }, { passive: !0, capture: o }),
754
760
  Y(l, "pointerdown", (a) => {
755
761
  const f = M(e);
756
- s = !r(a) && !!(f && !a.composedPath().includes(f));
762
+ i = !r(a) && !!(f && !a.composedPath().includes(f));
757
763
  }, { passive: !0 }),
758
764
  c && Y(l, "blur", (a) => {
759
765
  setTimeout(() => {
@@ -765,45 +771,45 @@ function $e(e, t, n = {}) {
765
771
  ].filter(Boolean);
766
772
  return () => u.forEach((a) => a());
767
773
  }
768
- const Mt = {
769
- [Ie.mounted](e, t) {
774
+ const Ht = {
775
+ [Se.mounted](e, t) {
770
776
  const n = !t.modifiers.bubble;
771
777
  if (typeof t.value == "function")
772
- e.__onClickOutside_stop = $e(e, t.value, { capture: n });
778
+ e.__onClickOutside_stop = Oe(e, t.value, { capture: n });
773
779
  else {
774
- const [l, i] = t.value;
775
- e.__onClickOutside_stop = $e(e, l, Object.assign({ capture: n }, i));
780
+ const [l, s] = t.value;
781
+ e.__onClickOutside_stop = Oe(e, l, Object.assign({ capture: n }, s));
776
782
  }
777
783
  },
778
- [Ie.unmounted](e) {
784
+ [Se.unmounted](e) {
779
785
  e.__onClickOutside_stop();
780
786
  }
781
787
  };
782
788
  function _(e) {
783
789
  return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
784
790
  }
785
- function Be(e) {
791
+ function Ve(e) {
786
792
  const t = window.getComputedStyle(e);
787
793
  if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
788
794
  return !0;
789
795
  {
790
796
  const n = e.parentNode;
791
- return !n || n.tagName === "BODY" ? !1 : Be(n);
797
+ return !n || n.tagName === "BODY" ? !1 : Ve(n);
792
798
  }
793
799
  }
794
- function Pt(e) {
800
+ function jt(e) {
795
801
  const t = e || window.event, n = t.target;
796
- return Be(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
802
+ return Ve(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
797
803
  }
798
804
  const ee = /* @__PURE__ */ new WeakMap();
799
- function Wt(e, t = !1) {
800
- const n = w(t);
801
- let l = null, i = "";
802
- k(Lt(e), (s) => {
803
- const r = _(W(s));
805
+ function Nt(e, t = !1) {
806
+ const n = y(t);
807
+ let l = null, s = "";
808
+ k(Wt(e), (i) => {
809
+ const r = _(W(i));
804
810
  if (r) {
805
811
  const d = r;
806
- if (ee.get(d) || ee.set(d, d.style.overflow), d.style.overflow !== "hidden" && (i = d.style.overflow), d.style.overflow === "hidden")
812
+ if (ee.get(d) || ee.set(d, d.style.overflow), d.style.overflow !== "hidden" && (s = d.style.overflow), d.style.overflow === "hidden")
807
813
  return n.value = !0;
808
814
  if (n.value)
809
815
  return d.style.overflow = "hidden";
@@ -812,42 +818,42 @@ function Wt(e, t = !1) {
812
818
  immediate: !0
813
819
  });
814
820
  const o = () => {
815
- const s = _(W(e));
816
- !s || n.value || (oe && (l = Y(
817
- s,
821
+ const i = _(W(e));
822
+ !i || n.value || (oe && (l = Y(
823
+ i,
818
824
  "touchmove",
819
825
  (r) => {
820
- Pt(r);
826
+ jt(r);
821
827
  },
822
828
  { passive: !1 }
823
- )), s.style.overflow = "hidden", n.value = !0);
829
+ )), i.style.overflow = "hidden", n.value = !0);
824
830
  }, c = () => {
825
- const s = _(W(e));
826
- !s || !n.value || (oe && (l == null || l()), s.style.overflow = i, ee.delete(s), n.value = !1);
831
+ const i = _(W(e));
832
+ !i || !n.value || (oe && (l == null || l()), i.style.overflow = s, ee.delete(i), n.value = !1);
827
833
  };
828
834
  return je(c), b({
829
835
  get() {
830
836
  return n.value;
831
837
  },
832
- set(s) {
833
- s ? o() : c();
838
+ set(i) {
839
+ i ? o() : c();
834
840
  }
835
841
  });
836
842
  }
837
- function jt() {
843
+ function Bt() {
838
844
  let e = !1;
839
- const t = w(!1);
845
+ const t = y(!1);
840
846
  return (n, l) => {
841
847
  if (t.value = l.value, e)
842
848
  return;
843
849
  e = !0;
844
- const i = Wt(n, l.value);
845
- k(t, (o) => i.value = o);
850
+ const s = Nt(n, l.value);
851
+ k(t, (o) => s.value = o);
846
852
  };
847
853
  }
848
- jt();
849
- class Ht {
850
- constructor(t, n, l, i, o, c) {
854
+ Bt();
855
+ class Vt {
856
+ constructor(t, n, l, s, o, c) {
851
857
  T(this, "id");
852
858
  T(this, "rows");
853
859
  T(this, "columns");
@@ -855,13 +861,13 @@ class Ht {
855
861
  T(this, "table");
856
862
  T(this, "display");
857
863
  T(this, "modal");
858
- this.id = t || crypto.randomUUID(), this.rows = l, this.columns = L(n), this.config = L(i), this.table = o || L(this.createTableObject()), this.display = this.createDisplayObject(c), this.modal = L({ visible: !1 });
864
+ this.id = t || crypto.randomUUID(), this.rows = l, this.columns = L(n), this.config = L(s), this.table = o || L(this.createTableObject()), this.display = this.createDisplayObject(c), this.modal = L({ visible: !1 });
859
865
  }
860
866
  createTableObject() {
861
867
  const t = {};
862
868
  for (const [n, l] of this.columns.entries())
863
- for (const [i, o] of this.rows.entries())
864
- t[`${n}:${i}`] = o[l.name];
869
+ for (const [s, o] of this.rows.entries())
870
+ t[`${n}:${s}`] = o[l.name];
865
871
  return t;
866
872
  }
867
873
  createDisplayObject(t) {
@@ -869,13 +875,13 @@ class Ht {
869
875
  if (t && "0:0" in t)
870
876
  return t;
871
877
  const l = /* @__PURE__ */ new Set();
872
- for (let i = this.rows.length - 1; i >= 0; i--) {
873
- const o = this.rows[i];
874
- o.parent && l.add(o.parent), n[i] = {
878
+ for (let s = this.rows.length - 1; s >= 0; s--) {
879
+ const o = this.rows[s];
880
+ o.parent && l.add(o.parent), n[s] = {
875
881
  childrenOpen: !1,
876
882
  expanded: !1,
877
883
  indent: o.indent || null,
878
- isParent: l.has(i),
884
+ isParent: l.has(s),
879
885
  isRoot: o.parent === null || o.parent === void 0,
880
886
  modified: !1,
881
887
  open: o.parent === null || o.parent === void 0,
@@ -895,8 +901,8 @@ class Ht {
895
901
  }
896
902
  setCellData(t, n, l) {
897
903
  this.table[`${n}:${t}`] !== l && (this.display[t].modified = !0), this.table[`${n}:${t}`] = l;
898
- const i = this.columns[n];
899
- return this.rows[t][i.name] = l, this.table[`${n}:${t}`];
904
+ const s = this.columns[n];
905
+ return this.rows[t][s.name] = l, this.table[`${n}:${t}`];
900
906
  }
901
907
  toggleRowExpand(t) {
902
908
  if (this.config.view === "tree") {
@@ -906,10 +912,10 @@ class Ht {
906
912
  } else this.config.view === "list-expansion" && (this.display[t].expanded = !this.display[t].expanded);
907
913
  }
908
914
  }
909
- const Nt = {
915
+ const zt = {
910
916
  key: 0,
911
917
  id: "resizable"
912
- }, Bt = {
918
+ }, Ft = {
913
919
  class: "atable-header-row",
914
920
  tabindex: "-1"
915
921
  }, ze = /* @__PURE__ */ D({
@@ -919,32 +925,32 @@ const Nt = {
919
925
  tableid: {}
920
926
  },
921
927
  setup(e) {
922
- const t = Q(e.tableid), n = b(() => t.columns.some((i) => i.pinned)), l = (i) => ({
923
- minWidth: i.width || "40ch",
924
- textAlign: i.align || "center",
928
+ const t = Q(e.tableid), n = b(() => t.columns.some((s) => s.pinned)), l = (s) => ({
929
+ minWidth: s.width || "40ch",
930
+ textAlign: s.align || "center",
925
931
  width: t.config.fullWidth ? "auto" : null
926
932
  });
927
- return (i, o) => i.columns.length ? (h(), E("thead", Nt, [
928
- P("tr", Bt, [
929
- m(t).zeroColumn ? (h(), E("th", {
933
+ return (s, o) => s.columns.length ? (w(), g("thead", zt, [
934
+ P("tr", Ft, [
935
+ m(t).zeroColumn ? (w(), g("th", {
930
936
  key: 0,
931
937
  id: "header-index",
932
- class: H(n.value ? "sticky-index" : "")
938
+ class: j(n.value ? "sticky-index" : "")
933
939
  }, null, 2)) : J("", !0),
934
- (h(!0), E(X, null, ne(i.columns, (c, s) => (h(), E("th", {
940
+ (w(!0), g(X, null, ne(s.columns, (c, i) => (w(), g("th", {
935
941
  key: c.name,
936
942
  tabindex: "-1",
937
943
  style: q(l(c)),
938
- class: H(c.pinned ? "sticky-column" : "")
944
+ class: j(c.pinned ? "sticky-column" : "")
939
945
  }, [
940
- S(i.$slots, "default", {}, () => [
941
- Je(N(c.label || String.fromCharCode(s + 97).toUpperCase()), 1)
946
+ S(s.$slots, "default", {}, () => [
947
+ Qe(N(c.label || String.fromCharCode(i + 97).toUpperCase()), 1)
942
948
  ])
943
949
  ], 6))), 128))
944
950
  ])
945
951
  ])) : J("", !0);
946
952
  }
947
- }), Ve = /* @__PURE__ */ D({
953
+ }), Fe = /* @__PURE__ */ D({
948
954
  __name: "ATableModal",
949
955
  props: {
950
956
  colIndex: {},
@@ -955,7 +961,7 @@ const Nt = {
955
961
  const t = (n) => {
956
962
  n.stopPropagation();
957
963
  };
958
- return (n, l) => (h(), E("div", {
964
+ return (n, l) => (w(), g("div", {
959
965
  class: "amodal",
960
966
  tabindex: "-1",
961
967
  onClick: t,
@@ -964,7 +970,7 @@ const Nt = {
964
970
  S(n.$slots, "default")
965
971
  ], 32));
966
972
  }
967
- }), zt = /* @__PURE__ */ D({
973
+ }), Gt = /* @__PURE__ */ D({
968
974
  __name: "ATable",
969
975
  props: {
970
976
  id: {},
@@ -975,15 +981,15 @@ const Nt = {
975
981
  },
976
982
  emits: ["update:modelValue"],
977
983
  setup(e, { emit: t }) {
978
- const n = t, l = Z("table"), i = e.modelValue ? e.modelValue : e.rows, o = new Ht(e.id, e.columns, i, e.config);
979
- Qe(o.id, o), k(
984
+ const n = t, l = Z("table"), s = e.modelValue ? e.modelValue : e.rows, o = new Vt(e.id, e.columns, s, e.config);
985
+ Ze(o.id, o), k(
980
986
  () => o.rows,
981
987
  (r) => {
982
988
  n("update:modelValue", r);
983
989
  },
984
990
  { deep: !0 }
985
- ), V(() => {
986
- e.columns.some((r) => r.pinned) && (c(), o.config.view === "tree" && Me(l, c, { childList: !0, subtree: !0 }));
991
+ ), z(() => {
992
+ e.columns.some((r) => r.pinned) && (c(), o.config.view === "tree" && Pe(l, c, { childList: !0, subtree: !0 }));
987
993
  });
988
994
  const c = () => {
989
995
  const r = l.value, d = r.rows[0], u = r.rows[1], p = d ? Array.from(d.cells) : [];
@@ -994,11 +1000,11 @@ const Nt = {
994
1000
  for (const a of r.rows) {
995
1001
  let f = 0;
996
1002
  const v = [];
997
- for (const g of a.cells)
998
- (g.classList.contains("sticky-column") || g.classList.contains("sticky-index")) && (g.style.left = `${f}px`, f += g.offsetWidth, v.push(g));
1003
+ for (const E of a.cells)
1004
+ (E.classList.contains("sticky-column") || E.classList.contains("sticky-index")) && (E.style.left = `${f}px`, f += E.offsetWidth, v.push(E));
999
1005
  v.length > 0 && v[v.length - 1].classList.add("sticky-column-edge");
1000
1006
  }
1001
- }, s = (r) => {
1007
+ }, i = (r) => {
1002
1008
  var d;
1003
1009
  r.target instanceof Node && (d = o.modal.parent) != null && d.contains(r.target) || o.modal.visible && (o.modal.visible = !1);
1004
1010
  };
@@ -1006,31 +1012,31 @@ const Nt = {
1006
1012
  if (r.key === "Escape" && o.modal.visible) {
1007
1013
  o.modal.visible = !1;
1008
1014
  const d = o.modal.parent;
1009
- d && Oe().then(() => {
1015
+ d && Te().then(() => {
1010
1016
  d.focus();
1011
1017
  });
1012
1018
  }
1013
- }), (r, d) => te((h(), E("table", {
1019
+ }), (r, d) => te((w(), g("table", {
1014
1020
  ref: "table",
1015
1021
  class: "atable",
1016
1022
  style: q({ width: m(o).config.fullWidth ? "100%" : "auto" })
1017
1023
  }, [
1018
1024
  S(r.$slots, "header", { data: m(o) }, () => [
1019
- he(ze, {
1025
+ ye(ze, {
1020
1026
  columns: m(o).columns,
1021
1027
  tableid: m(o).id
1022
1028
  }, null, 8, ["columns", "tableid"])
1023
1029
  ]),
1024
1030
  P("tbody", null, [
1025
1031
  S(r.$slots, "body", { data: m(o) }, () => [
1026
- (h(!0), E(X, null, ne(m(o).rows, (u, p) => (h(), U(We, {
1032
+ (w(!0), g(X, null, ne(m(o).rows, (u, p) => (w(), U(He, {
1027
1033
  key: u.id,
1028
1034
  row: u,
1029
1035
  rowIndex: p,
1030
1036
  tableid: m(o).id
1031
1037
  }, {
1032
- default: ye(() => [
1033
- (h(!0), E(X, null, ne(m(o).columns, (a, f) => (h(), U(Pe, {
1038
+ default: be(() => [
1039
+ (w(!0), g(X, null, ne(m(o).columns, (a, f) => (w(), U(We, {
1034
1040
  key: a.name,
1035
1041
  tableid: m(o).id,
1036
1042
  col: a,
@@ -1052,7 +1058,7 @@ const Nt = {
1052
1058
  ]),
1053
1059
  S(r.$slots, "footer", { data: m(o) }),
1054
1060
  S(r.$slots, "modal", { data: m(o) }, () => [
1055
- te(he(Ve, {
1061
+ te(ye(Fe, {
1056
1062
  colIndex: m(o).modal.colIndex,
1057
1063
  rowIndex: m(o).modal.rowIndex,
1058
1064
  tableid: m(o).id,
@@ -1062,8 +1068,8 @@ const Nt = {
1062
1068
  maxWidth: m(o).modal.width + "px"
1063
1069
  })
1064
1070
  }, {
1065
- default: ye(() => [
1066
- (h(), U(Te(m(o).modal.component), re({
1071
+ default: be(() => [
1072
+ (w(), U(Re(m(o).modal.component), re({
1067
1073
  key: `${m(o).modal.rowIndex}:${m(o).modal.colIndex}`,
1068
1074
  colIndex: m(o).modal.colIndex,
1069
1075
  rowIndex: m(o).modal.rowIndex,
@@ -1072,25 +1078,25 @@ const Nt = {
1072
1078
  ]),
1073
1079
  _: 1
1074
1080
  }, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
1075
- [Re, m(o).modal.visible]
1081
+ [De, m(o).modal.visible]
1076
1082
  ])
1077
1083
  ])
1078
1084
  ], 4)), [
1079
- [m(Mt), s]
1085
+ [m(Ht), i]
1080
1086
  ]);
1081
1087
  }
1082
1088
  });
1083
- function Ut(e) {
1084
- e.component("ACell", Pe), e.component("AExpansionRow", $t), e.component("ARow", We), e.component("ATable", zt), e.component("ATableHeader", ze), e.component("ATableModal", Ve);
1089
+ function Xt(e) {
1090
+ e.component("ACell", We), e.component("AExpansionRow", Rt), e.component("ARow", He), e.component("ATable", Gt), e.component("ATableHeader", ze), e.component("ATableModal", Fe);
1085
1091
  }
1086
1092
  export {
1087
- Pe as ACell,
1088
- $t as AExpansionRow,
1089
- We as ARow,
1090
- zt as ATable,
1093
+ We as ACell,
1094
+ Rt as AExpansionRow,
1095
+ He as ARow,
1096
+ Gt as ATable,
1091
1097
  ze as ATableHeader,
1092
- Ve as ATableModal,
1093
- Ht as TableDataStore,
1094
- Ut as install
1098
+ Fe as ATableModal,
1099
+ Vt as TableDataStore,
1100
+ Xt as install
1095
1101
  };
1096
1102
  //# sourceMappingURL=atable.js.map