@stonecrop/atable 0.3.1 → 0.3.2
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.d.ts +28 -14
- package/dist/atable.js +64 -57
- package/dist/atable.js.map +1 -1
- package/dist/atable.umd.cjs +1 -1
- package/dist/atable.umd.cjs.map +1 -1
- package/dist/src/stores/table.d.ts +12 -12
- package/dist/src/stores/table.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +16 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/ACell.vue +10 -3
- package/src/types/index.ts +16 -2
package/dist/atable.d.ts
CHANGED
|
@@ -61,9 +61,9 @@ width?: string;
|
|
|
61
61
|
pinned?: boolean;
|
|
62
62
|
cellComponent?: string;
|
|
63
63
|
cellComponentProps?: Record<string, any>;
|
|
64
|
-
modalComponent?: string | ((context
|
|
64
|
+
modalComponent?: string | ((context: CellContext) => string);
|
|
65
65
|
modalComponentExtraProps?: Record<string, any>;
|
|
66
|
-
format?: string | ((value: any, context
|
|
66
|
+
format?: string | ((value: any, context: CellContext) => string);
|
|
67
67
|
mask?: (value: any) => any;
|
|
68
68
|
}[], TableColumn[] | {
|
|
69
69
|
name: string;
|
|
@@ -75,9 +75,9 @@ width?: string;
|
|
|
75
75
|
pinned?: boolean;
|
|
76
76
|
cellComponent?: string;
|
|
77
77
|
cellComponentProps?: Record<string, any>;
|
|
78
|
-
modalComponent?: string | ((context
|
|
78
|
+
modalComponent?: string | ((context: CellContext) => string);
|
|
79
79
|
modalComponentExtraProps?: Record<string, any>;
|
|
80
|
-
format?: string | ((value: any, context
|
|
80
|
+
format?: string | ((value: any, context: CellContext) => string);
|
|
81
81
|
mask?: (value: any) => any;
|
|
82
82
|
}[]>;
|
|
83
83
|
rows: Ref< {
|
|
@@ -163,9 +163,9 @@ width?: string;
|
|
|
163
163
|
pinned?: boolean;
|
|
164
164
|
cellComponent?: string;
|
|
165
165
|
cellComponentProps?: Record<string, any>;
|
|
166
|
-
modalComponent?: string | ((context
|
|
166
|
+
modalComponent?: string | ((context: CellContext) => string);
|
|
167
167
|
modalComponentExtraProps?: Record<string, any>;
|
|
168
|
-
format?: string | ((value: any, context
|
|
168
|
+
format?: string | ((value: any, context: CellContext) => string);
|
|
169
169
|
mask?: (value: any) => any;
|
|
170
170
|
}[], TableColumn[] | {
|
|
171
171
|
name: string;
|
|
@@ -177,9 +177,9 @@ width?: string;
|
|
|
177
177
|
pinned?: boolean;
|
|
178
178
|
cellComponent?: string;
|
|
179
179
|
cellComponentProps?: Record<string, any>;
|
|
180
|
-
modalComponent?: string | ((context
|
|
180
|
+
modalComponent?: string | ((context: CellContext) => string);
|
|
181
181
|
modalComponentExtraProps?: Record<string, any>;
|
|
182
|
-
format?: string | ((value: any, context
|
|
182
|
+
format?: string | ((value: any, context: CellContext) => string);
|
|
183
183
|
mask?: (value: any) => any;
|
|
184
184
|
}[]>;
|
|
185
185
|
rows: Ref< {
|
|
@@ -265,9 +265,9 @@ width?: string;
|
|
|
265
265
|
pinned?: boolean;
|
|
266
266
|
cellComponent?: string;
|
|
267
267
|
cellComponentProps?: Record<string, any>;
|
|
268
|
-
modalComponent?: string | ((context
|
|
268
|
+
modalComponent?: string | ((context: CellContext) => string);
|
|
269
269
|
modalComponentExtraProps?: Record<string, any>;
|
|
270
|
-
format?: string | ((value: any, context
|
|
270
|
+
format?: string | ((value: any, context: CellContext) => string);
|
|
271
271
|
mask?: (value: any) => any;
|
|
272
272
|
}[], TableColumn[] | {
|
|
273
273
|
name: string;
|
|
@@ -279,9 +279,9 @@ width?: string;
|
|
|
279
279
|
pinned?: boolean;
|
|
280
280
|
cellComponent?: string;
|
|
281
281
|
cellComponentProps?: Record<string, any>;
|
|
282
|
-
modalComponent?: string | ((context
|
|
282
|
+
modalComponent?: string | ((context: CellContext) => string);
|
|
283
283
|
modalComponentExtraProps?: Record<string, any>;
|
|
284
|
-
format?: string | ((value: any, context
|
|
284
|
+
format?: string | ((value: any, context: CellContext) => string);
|
|
285
285
|
mask?: (value: any) => any;
|
|
286
286
|
}[]>;
|
|
287
287
|
rows: Ref< {
|
|
@@ -379,9 +379,23 @@ export declare type TableColumn = {
|
|
|
379
379
|
pinned?: boolean;
|
|
380
380
|
cellComponent?: string;
|
|
381
381
|
cellComponentProps?: Record<string, any>;
|
|
382
|
-
|
|
382
|
+
/**
|
|
383
|
+
* The component to use for the modal. If a function is provided, it will be called with the cell context.
|
|
384
|
+
* The following properties are available on the cell context:
|
|
385
|
+
* - `row` - the row object
|
|
386
|
+
* - `column` - the column object
|
|
387
|
+
* - `table` - the table object
|
|
388
|
+
*
|
|
389
|
+
* The function should return the name of the component to use for the modal.
|
|
390
|
+
*
|
|
391
|
+
* Additionally, the following properties will be automatically passed to the modal component:
|
|
392
|
+
* - `colIndex` - the column index of the current cell
|
|
393
|
+
* - `rowIndex` - the row index of the current cell
|
|
394
|
+
* - `store` - the table data store
|
|
395
|
+
*/
|
|
396
|
+
modalComponent?: string | ((context: CellContext) => string);
|
|
383
397
|
modalComponentExtraProps?: Record<string, any>;
|
|
384
|
-
format?: string | ((value: any, context
|
|
398
|
+
format?: string | ((value: any, context: CellContext) => string);
|
|
385
399
|
mask?: (value: any) => any;
|
|
386
400
|
};
|
|
387
401
|
|
package/dist/atable.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { onMounted as Y, ref as x, watch as
|
|
1
|
+
import { onMounted as Y, ref as x, watch as T, onBeforeUnmount as qe, computed as $, unref as g, getCurrentScope as Te, onScopeDispose as Me, getCurrentInstance as se, nextTick as Re, toRef as Ge, readonly as Ye, customRef as Xe, defineComponent as W, useTemplateRef as ee, openBlock as E, createElementBlock as k, normalizeStyle as j, normalizeClass as z, createBlock as Z, resolveDynamicComponent as Oe, mergeProps as ae, toDisplayString as F, Fragment as _, createElementVNode as B, renderSlot as R, createCommentVNode as U, withDirectives as oe, vShow as Le, renderList as le, createTextVNode as Je, createVNode as ge, withCtx as ye } from "vue";
|
|
2
2
|
import { defineStore as Qe } from "pinia";
|
|
3
3
|
import './assets/index.css';function Pe(e) {
|
|
4
4
|
return Te() ? (Me(e), !0) : !1;
|
|
@@ -22,7 +22,7 @@ function G(...e) {
|
|
|
22
22
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
23
23
|
const a = [], l = () => {
|
|
24
24
|
a.forEach((u) => u()), a.length = 0;
|
|
25
|
-
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s =
|
|
25
|
+
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s = T(
|
|
26
26
|
() => [q(t), ie(r)],
|
|
27
27
|
([u, f]) => {
|
|
28
28
|
if (l(), !u)
|
|
@@ -56,7 +56,7 @@ function lt(e, t, n = {}) {
|
|
|
56
56
|
}, s = $(() => {
|
|
57
57
|
const d = ie(e), v = (Array.isArray(d) ? d : [d]).map(q).filter(Ke);
|
|
58
58
|
return new Set(v);
|
|
59
|
-
}), c =
|
|
59
|
+
}), c = T(
|
|
60
60
|
() => s.value,
|
|
61
61
|
(d) => {
|
|
62
62
|
i(), l.value && d.size && (a = new MutationObserver(t), d.forEach((v) => a.observe(v, r)));
|
|
@@ -114,7 +114,7 @@ function ct(e, { window: t = X, scrollTarget: n } = {}) {
|
|
|
114
114
|
o.value = i.top <= (t.innerHeight || a.documentElement.clientHeight) && i.left <= (t.innerWidth || a.documentElement.clientWidth) && i.bottom >= 0 && i.right >= 0;
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
|
-
return
|
|
117
|
+
return T(
|
|
118
118
|
() => q(e),
|
|
119
119
|
() => r(),
|
|
120
120
|
{ immediate: !0, flush: "post" }
|
|
@@ -225,7 +225,7 @@ const O = (e) => {
|
|
|
225
225
|
}, Ce = (e) => {
|
|
226
226
|
const t = e.target.parentElement.firstElementChild;
|
|
227
227
|
return t && (!L(t) || !O(t)) ? fe(t) : t;
|
|
228
|
-
},
|
|
228
|
+
}, Ie = (e) => {
|
|
229
229
|
const t = e.target.parentElement.lastElementChild;
|
|
230
230
|
return t && (!L(t) || !O(t)) ? de(t) : t;
|
|
231
231
|
}, Q = ["alt", "control", "shift", "meta"], ft = {
|
|
@@ -263,11 +263,11 @@ const O = (e) => {
|
|
|
263
263
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
264
264
|
},
|
|
265
265
|
"keydown.control.right": (e) => {
|
|
266
|
-
const t =
|
|
266
|
+
const t = Ie(e);
|
|
267
267
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
268
268
|
},
|
|
269
269
|
"keydown.end": (e) => {
|
|
270
|
-
const t =
|
|
270
|
+
const t = Ie(e);
|
|
271
271
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
272
272
|
},
|
|
273
273
|
"keydown.enter": (e) => {
|
|
@@ -349,7 +349,7 @@ function ve(e) {
|
|
|
349
349
|
for (const l of e) {
|
|
350
350
|
const i = t(l), s = o(l), c = r(l), u = i ? [i] : s;
|
|
351
351
|
for (const f of u) {
|
|
352
|
-
const { focused: d } = it(x(f)), v =
|
|
352
|
+
const { focused: d } = it(x(f)), v = T(d, (y) => {
|
|
353
353
|
y ? f.addEventListener("keydown", c) : f.removeEventListener("keydown", c);
|
|
354
354
|
});
|
|
355
355
|
a.push(v);
|
|
@@ -363,7 +363,7 @@ function ve(e) {
|
|
|
363
363
|
function J(e) {
|
|
364
364
|
return Te() ? (Me(e), !0) : !1;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function M(e) {
|
|
367
367
|
return typeof e == "function" ? e() : g(e);
|
|
368
368
|
}
|
|
369
369
|
const pe = typeof window < "u" && typeof document < "u";
|
|
@@ -389,18 +389,18 @@ function gt(e, t = !0, n) {
|
|
|
389
389
|
const we = pe ? window : void 0;
|
|
390
390
|
function D(e) {
|
|
391
391
|
var t;
|
|
392
|
-
const n =
|
|
392
|
+
const n = M(e);
|
|
393
393
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function Ae(...e) {
|
|
396
396
|
let t, n, o, r;
|
|
397
397
|
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, r] = e, t = we) : [t, n, o, r] = e, !t)
|
|
398
398
|
return P;
|
|
399
399
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
400
400
|
const a = [], l = () => {
|
|
401
401
|
a.forEach((u) => u()), a.length = 0;
|
|
402
|
-
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s =
|
|
403
|
-
() => [D(t),
|
|
402
|
+
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s = T(
|
|
403
|
+
() => [D(t), M(r)],
|
|
404
404
|
([u, f]) => {
|
|
405
405
|
if (l(), !u)
|
|
406
406
|
return;
|
|
@@ -431,9 +431,9 @@ function He(e, t, n = {}) {
|
|
|
431
431
|
const l = We(() => o && "MutationObserver" in o), i = () => {
|
|
432
432
|
a && (a.disconnect(), a = void 0);
|
|
433
433
|
}, s = $(() => {
|
|
434
|
-
const d =
|
|
434
|
+
const d = M(e), v = (Array.isArray(d) ? d : [d]).map(D).filter(mt);
|
|
435
435
|
return new Set(v);
|
|
436
|
-
}), c =
|
|
436
|
+
}), c = T(
|
|
437
437
|
() => s.value,
|
|
438
438
|
(d) => {
|
|
439
439
|
i(), l.value && d.size && (a = new MutationObserver(t), d.forEach((v) => a.observe(v, r)));
|
|
@@ -454,9 +454,9 @@ function bt(e, t, n = {}) {
|
|
|
454
454
|
const l = We(() => o && "ResizeObserver" in o), i = () => {
|
|
455
455
|
a && (a.disconnect(), a = void 0);
|
|
456
456
|
}, s = $(() => {
|
|
457
|
-
const f =
|
|
457
|
+
const f = M(e);
|
|
458
458
|
return Array.isArray(f) ? f.map((d) => D(d)) : [D(f)];
|
|
459
|
-
}), c =
|
|
459
|
+
}), c = T(
|
|
460
460
|
s,
|
|
461
461
|
(f) => {
|
|
462
462
|
if (i(), l.value && o) {
|
|
@@ -494,9 +494,9 @@ function xt(e, t = {}) {
|
|
|
494
494
|
function w() {
|
|
495
495
|
l === "sync" ? p() : l === "next-frame" && requestAnimationFrame(() => p());
|
|
496
496
|
}
|
|
497
|
-
return bt(e, w),
|
|
497
|
+
return bt(e, w), T(() => D(e), (m) => !m && w()), He(e, w, {
|
|
498
498
|
attributeFilter: ["style", "class"]
|
|
499
|
-
}), r &&
|
|
499
|
+
}), r && Ae("scroll", w, { capture: !0, passive: !0 }), o && Ae("resize", w, { passive: !0 }), gt(() => {
|
|
500
500
|
a && w();
|
|
501
501
|
}), {
|
|
502
502
|
height: i,
|
|
@@ -513,7 +513,7 @@ function xt(e, t = {}) {
|
|
|
513
513
|
const Et = (e) => {
|
|
514
514
|
const t = new DOMParser().parseFromString(e, "text/html");
|
|
515
515
|
return Array.from(t.body.childNodes).some((n) => n.nodeType === 1);
|
|
516
|
-
}, kt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ct = ["innerHTML"],
|
|
516
|
+
}, kt = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], Ct = ["innerHTML"], It = { key: 2 }, Ne = /* @__PURE__ */ W({
|
|
517
517
|
__name: "ACell",
|
|
518
518
|
props: {
|
|
519
519
|
colIndex: {},
|
|
@@ -524,7 +524,14 @@ const Et = (e) => {
|
|
|
524
524
|
pinned: { type: Boolean }
|
|
525
525
|
},
|
|
526
526
|
setup(e) {
|
|
527
|
-
const t = ee("cell"), { bottom: n, left: o } = xt(t), r = e.store.getCellData(e.colIndex, e.rowIndex), a = e.store.getCellDisplayValue(e.colIndex, e.rowIndex), l = x(""), i = x(!1), s = e.store.columns[e.colIndex], c = e.store.rows[e.rowIndex], u = s.align || "center", f = s.width || "40ch"
|
|
527
|
+
const t = ee("cell"), { bottom: n, left: o } = xt(t), r = e.store.getCellData(e.colIndex, e.rowIndex), a = x(e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), l = x(""), i = x(!1), s = e.store.columns[e.colIndex], c = e.store.rows[e.rowIndex], u = s.align || "center", f = s.width || "40ch";
|
|
528
|
+
T(
|
|
529
|
+
() => e.store.getCellData(e.colIndex, e.rowIndex),
|
|
530
|
+
(m) => {
|
|
531
|
+
a.value = e.store.getFormattedValue(e.colIndex, e.rowIndex, m);
|
|
532
|
+
}
|
|
533
|
+
);
|
|
534
|
+
const d = $(() => typeof a.value == "string" ? Et(a.value) : !1), v = $(() => {
|
|
528
535
|
var m;
|
|
529
536
|
return {
|
|
530
537
|
textAlign: u,
|
|
@@ -580,14 +587,14 @@ const Et = (e) => {
|
|
|
580
587
|
}, [
|
|
581
588
|
g(s).cellComponent ? (E(), Z(Oe(g(s).cellComponent), ae({
|
|
582
589
|
key: 0,
|
|
583
|
-
value:
|
|
590
|
+
value: a.value
|
|
584
591
|
}, g(s).cellComponentProps), null, 16, ["value"])) : d.value ? (E(), k("span", {
|
|
585
592
|
key: 1,
|
|
586
|
-
innerHTML:
|
|
587
|
-
}, null, 8, Ct)) : (E(), k("span",
|
|
593
|
+
innerHTML: a.value
|
|
594
|
+
}, null, 8, Ct)) : (E(), k("span", It, F(a.value), 1))
|
|
588
595
|
], 46, kt));
|
|
589
596
|
}
|
|
590
|
-
}),
|
|
597
|
+
}), At = ["tabindex"], St = ["tabindex"], $t = ["colspan"], Tt = /* @__PURE__ */ W({
|
|
591
598
|
__name: "AExpansionRow",
|
|
592
599
|
props: {
|
|
593
600
|
rowIndex: {},
|
|
@@ -622,7 +629,7 @@ const Et = (e) => {
|
|
|
622
629
|
class: "row-index"
|
|
623
630
|
}, F(n.value), 1),
|
|
624
631
|
R(o.$slots, "row")
|
|
625
|
-
], 16,
|
|
632
|
+
], 16, At),
|
|
626
633
|
o.store.display[o.rowIndex].expanded ? (E(), k("tr", {
|
|
627
634
|
key: 0,
|
|
628
635
|
ref: "rowExpanded",
|
|
@@ -686,7 +693,7 @@ const Et = (e) => {
|
|
|
686
693
|
}), je = pe ? window : void 0;
|
|
687
694
|
function V(e) {
|
|
688
695
|
var t;
|
|
689
|
-
const n =
|
|
696
|
+
const n = M(e);
|
|
690
697
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
691
698
|
}
|
|
692
699
|
function K(...e) {
|
|
@@ -696,8 +703,8 @@ function K(...e) {
|
|
|
696
703
|
Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
|
|
697
704
|
const a = [], l = () => {
|
|
698
705
|
a.forEach((u) => u()), a.length = 0;
|
|
699
|
-
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s =
|
|
700
|
-
() => [V(t),
|
|
706
|
+
}, i = (u, f, d, v) => (u.addEventListener(f, d, v), () => u.removeEventListener(f, d, v)), s = T(
|
|
707
|
+
() => [V(t), M(r)],
|
|
701
708
|
([u, f]) => {
|
|
702
709
|
if (l(), !u)
|
|
703
710
|
return;
|
|
@@ -719,7 +726,7 @@ function $e(e, t, n = {}) {
|
|
|
719
726
|
return P;
|
|
720
727
|
re && !Se && (Se = !0, Array.from(o.document.body.children).forEach((p) => p.addEventListener("click", P)), o.document.documentElement.addEventListener("click", P));
|
|
721
728
|
let i = !0;
|
|
722
|
-
const s = (p) =>
|
|
729
|
+
const s = (p) => M(r).some((w) => {
|
|
723
730
|
if (typeof w == "string")
|
|
724
731
|
return Array.from(o.document.querySelectorAll(w)).some((m) => m === p.target || p.composedPath().includes(m));
|
|
725
732
|
{
|
|
@@ -728,11 +735,11 @@ function $e(e, t, n = {}) {
|
|
|
728
735
|
}
|
|
729
736
|
});
|
|
730
737
|
function c(p) {
|
|
731
|
-
const w =
|
|
738
|
+
const w = M(p);
|
|
732
739
|
return w && w.$.subTree.shapeFlag === 16;
|
|
733
740
|
}
|
|
734
741
|
function u(p, w) {
|
|
735
|
-
const m =
|
|
742
|
+
const m = M(p), C = m.$.subTree && m.$.subTree.children;
|
|
736
743
|
return C == null || !Array.isArray(C) ? !1 : C.some((H) => H.el === w.target || w.composedPath().includes(H.el));
|
|
737
744
|
}
|
|
738
745
|
const f = (p) => {
|
|
@@ -800,8 +807,8 @@ const ne = /* @__PURE__ */ new WeakMap();
|
|
|
800
807
|
function Lt(e, t = !1) {
|
|
801
808
|
const n = x(t);
|
|
802
809
|
let o = null, r = "";
|
|
803
|
-
|
|
804
|
-
const s = te(
|
|
810
|
+
T(ht(e), (i) => {
|
|
811
|
+
const s = te(M(i));
|
|
805
812
|
if (s) {
|
|
806
813
|
const c = s;
|
|
807
814
|
if (ne.get(c) || ne.set(c, c.style.overflow), c.style.overflow !== "hidden" && (r = c.style.overflow), c.style.overflow === "hidden")
|
|
@@ -813,7 +820,7 @@ function Lt(e, t = !1) {
|
|
|
813
820
|
immediate: !0
|
|
814
821
|
});
|
|
815
822
|
const a = () => {
|
|
816
|
-
const i = te(
|
|
823
|
+
const i = te(M(e));
|
|
817
824
|
!i || n.value || (re && (o = K(
|
|
818
825
|
i,
|
|
819
826
|
"touchmove",
|
|
@@ -823,7 +830,7 @@ function Lt(e, t = !1) {
|
|
|
823
830
|
{ passive: !1 }
|
|
824
831
|
)), i.style.overflow = "hidden", n.value = !0);
|
|
825
832
|
}, l = () => {
|
|
826
|
-
const i = te(
|
|
833
|
+
const i = te(M(e));
|
|
827
834
|
!i || !n.value || (re && (o == null || o()), i.style.overflow = r, ne.delete(i), n.value = !1);
|
|
828
835
|
};
|
|
829
836
|
return J(l), $({
|
|
@@ -843,7 +850,7 @@ function Pt() {
|
|
|
843
850
|
return;
|
|
844
851
|
e = !0;
|
|
845
852
|
const r = Lt(n, o.value);
|
|
846
|
-
|
|
853
|
+
T(t, (a) => r.value = a);
|
|
847
854
|
};
|
|
848
855
|
}
|
|
849
856
|
Pt();
|
|
@@ -909,32 +916,32 @@ const Dt = {
|
|
|
909
916
|
return Qe(`table-${t}`, () => {
|
|
910
917
|
const o = () => {
|
|
911
918
|
const h = {};
|
|
912
|
-
for (const [b,
|
|
913
|
-
for (const [S,
|
|
914
|
-
h[`${b}:${S}`] = I
|
|
919
|
+
for (const [b, I] of a.value.entries())
|
|
920
|
+
for (const [S, A] of l.value.entries())
|
|
921
|
+
h[`${b}:${S}`] = A[I.name];
|
|
915
922
|
return h;
|
|
916
923
|
}, r = (h) => {
|
|
917
924
|
const b = [Object.assign({}, { rowModified: !1 })];
|
|
918
925
|
if (h && "0:0" in h)
|
|
919
926
|
return h;
|
|
920
|
-
const
|
|
927
|
+
const I = /* @__PURE__ */ new Set();
|
|
921
928
|
for (let S = l.value.length - 1; S >= 0; S--) {
|
|
922
|
-
const
|
|
923
|
-
|
|
929
|
+
const A = l.value[S];
|
|
930
|
+
A.parent && I.add(A.parent), b[S] = {
|
|
924
931
|
childrenOpen: !1,
|
|
925
932
|
expanded: !1,
|
|
926
|
-
indent:
|
|
927
|
-
isParent:
|
|
928
|
-
isRoot:
|
|
933
|
+
indent: A.indent || null,
|
|
934
|
+
isParent: I.has(S),
|
|
935
|
+
isRoot: A.parent === null || A.parent === void 0,
|
|
929
936
|
rowModified: !1,
|
|
930
|
-
open:
|
|
931
|
-
parent:
|
|
937
|
+
open: A.parent === null || A.parent === void 0,
|
|
938
|
+
parent: A.parent
|
|
932
939
|
};
|
|
933
940
|
}
|
|
934
941
|
return b;
|
|
935
|
-
}, a = x(e.columns), l = x(e.rows), i = x(e.config || {}), s = x(e.table || o()), c = x(r(e.display)), u = x(e.modal || { visible: !1 }), f = $(() => a.value.some((h) => h.pinned)), d = $(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), v = $(() => ["list", "tree", "list-expansion"].includes(i.value.view)), y = (h, b) => s.value[`${h}:${b}`], p = (h, b,
|
|
936
|
-
const S = `${h}:${b}`,
|
|
937
|
-
s.value[S] !==
|
|
942
|
+
}, a = x(e.columns), l = x(e.rows), i = x(e.config || {}), s = x(e.table || o()), c = x(r(e.display)), u = x(e.modal || { visible: !1 }), f = $(() => a.value.some((h) => h.pinned)), d = $(() => `${Math.ceil(l.value.length / 100 + 1)}ch`), v = $(() => ["list", "tree", "list-expansion"].includes(i.value.view)), y = (h, b) => s.value[`${h}:${b}`], p = (h, b, I) => {
|
|
943
|
+
const S = `${h}:${b}`, A = a.value[h];
|
|
944
|
+
s.value[S] !== I && (c.value[b].rowModified = !0), s.value[S] = I, l.value[b][A.name] = I;
|
|
938
945
|
}, w = (h) => ({
|
|
939
946
|
minWidth: h.width || "40ch",
|
|
940
947
|
textAlign: h.align || "center",
|
|
@@ -946,11 +953,11 @@ const Dt = {
|
|
|
946
953
|
c.value[b].parent === h && (c.value[b].open = !c.value[b].open, c.value[b].childrenOpen && H(b));
|
|
947
954
|
} else i.value.view === "list-expansion" && (c.value[h].expanded = !c.value[h].expanded);
|
|
948
955
|
}, Ue = (h, b) => {
|
|
949
|
-
const
|
|
950
|
-
return he(h, b,
|
|
951
|
-
}, he = (h, b,
|
|
952
|
-
const S = a.value[h],
|
|
953
|
-
return N ? typeof N == "function" ? N(
|
|
956
|
+
const I = y(h, b);
|
|
957
|
+
return he(h, b, I);
|
|
958
|
+
}, he = (h, b, I) => {
|
|
959
|
+
const S = a.value[h], A = l.value[b], N = S.format;
|
|
960
|
+
return N ? typeof N == "function" ? N(I, { table: s.value, row: A, column: S }) : typeof N == "string" ? Function(`"use strict";return (${N})`)()(I, { table: s.value, row: A, column: S }) : I : I;
|
|
954
961
|
};
|
|
955
962
|
return {
|
|
956
963
|
// state
|
|
@@ -997,7 +1004,7 @@ const Dt = {
|
|
|
997
1004
|
const [f, d, v] = u, y = c.getCellData(f, d);
|
|
998
1005
|
o("cellUpdate", [f, d, v, y]);
|
|
999
1006
|
}
|
|
1000
|
-
}),
|
|
1007
|
+
}), T(
|
|
1001
1008
|
() => l.rows,
|
|
1002
1009
|
(s) => {
|
|
1003
1010
|
o("update:modelValue", s);
|