@vtable-guild/vtable-guild 2.7.1 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/presets/antdv.css +36 -0
- package/css/presets/element-plus.css +38 -0
- package/css/style.css +436 -0
- package/css/tailwind3-utilities.css +337 -0
- package/css/tailwind3.css +99 -0
- package/css/tailwind4.css +99 -0
- package/css/transitions.css +25 -0
- package/dist/core/src/components/VirtualList/VirtualList.d.ts +6 -3
- package/dist/core/src/components/VirtualList/VirtualList.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/VirtualList.mjs +187 -180
- package/dist/core/src/components/VirtualList/VirtualScrollBar.d.ts +1 -1
- package/dist/core/src/components/VirtualList/hooks/useChildren.d.ts +2 -2
- package/dist/core/src/components/VirtualList/hooks/useChildren.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useChildren.mjs +12 -12
- package/dist/core/src/components/VirtualList/hooks/useGetSize.d.ts +1 -1
- package/dist/core/src/components/VirtualList/hooks/useGetSize.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useGetSize.mjs +1 -1
- package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts +2 -2
- package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useHeights.mjs +36 -36
- package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.mjs +11 -11
- package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.test.d.ts +2 -0
- package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.test.d.ts.map +1 -0
- package/dist/core/src/components/VirtualList/hooks/useScrollTo.d.ts +1 -1
- package/dist/core/src/components/VirtualList/hooks/useScrollTo.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/hooks/useScrollTo.mjs +30 -30
- package/dist/core/src/index.d.ts +1 -1
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/utils/types.d.ts +18 -0
- package/dist/core/src/utils/types.d.ts.map +1 -1
- package/dist/css/presets/antdv.css +36 -0
- package/dist/css/presets/element-plus.css +38 -0
- package/dist/css/style.css +436 -0
- package/dist/css/tailwind3-utilities.css +337 -0
- package/dist/css/tailwind3.css +99 -0
- package/dist/css/tailwind4.css +99 -0
- package/dist/css/transitions.css +25 -0
- package/dist/index.d.ts +0 -26
- package/dist/index.full.mjs +5116 -3769
- package/dist/index.mjs +85 -75
- package/dist/table/src/components/ColGroup.d.ts.map +1 -1
- package/dist/table/src/components/ColGroup.mjs +10 -10
- package/dist/table/src/components/ColumnWidthRow.d.ts +4 -0
- package/dist/table/src/components/ColumnWidthRow.d.ts.map +1 -0
- package/dist/table/src/components/ColumnWidthRow.mjs +23 -0
- package/dist/table/src/components/PaginationSizeSelect.d.ts +57 -0
- package/dist/table/src/components/PaginationSizeSelect.d.ts.map +1 -0
- package/dist/table/src/components/PaginationSizeSelect.mjs +138 -0
- package/dist/table/src/components/SelectionDropdown.d.ts +9 -0
- package/dist/table/src/components/SelectionDropdown.d.ts.map +1 -1
- package/dist/table/src/components/SelectionDropdown.mjs +32 -26
- package/dist/table/src/components/Table.d.ts +13 -2
- package/dist/table/src/components/Table.d.ts.map +1 -1
- package/dist/table/src/components/Table.mjs +496 -403
- package/dist/table/src/components/TableCell.d.ts.map +1 -1
- package/dist/table/src/components/TableCell.mjs +80 -74
- package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
- package/dist/table/src/components/TableHeaderCell.mjs +85 -83
- package/dist/table/src/components/TablePagination.d.ts +74 -0
- package/dist/table/src/components/TablePagination.d.ts.map +1 -0
- package/dist/table/src/components/TablePagination.mjs +350 -0
- package/dist/table/src/components/TablePagination.test.d.ts +2 -0
- package/dist/table/src/components/TablePagination.test.d.ts.map +1 -0
- package/dist/table/src/components/TablePaginationCompatClass.test.d.ts +2 -0
- package/dist/table/src/components/TablePaginationCompatClass.test.d.ts.map +1 -0
- package/dist/table/src/components/TablePaginationLayout.test.d.ts +2 -0
- package/dist/table/src/components/TablePaginationLayout.test.d.ts.map +1 -0
- package/dist/table/src/components/VTable.vue.d.ts.map +1 -1
- package/dist/table/src/components/VTable.vue.mjs +34 -26
- package/dist/table/src/components/VTableMinWidth.test.d.ts +2 -0
- package/dist/table/src/components/VTableMinWidth.test.d.ts.map +1 -0
- package/dist/table/src/components/VTableSummary.d.ts +15 -75
- package/dist/table/src/components/VTableSummary.d.ts.map +1 -1
- package/dist/table/src/components/VTableSummary.mjs +7 -7
- package/dist/table/src/components/VTableSummaryCell.d.ts.map +1 -1
- package/dist/table/src/components/VTableSummaryCell.mjs +26 -24
- package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
- package/dist/table/src/components/VirtualTableBody.mjs +107 -95
- package/dist/table/src/composables/useColumnLayout.d.ts +28 -0
- package/dist/table/src/composables/useColumnLayout.d.ts.map +1 -0
- package/dist/table/src/composables/useColumnLayout.mjs +259 -0
- package/dist/table/src/composables/useColumnLayout.test.d.ts +2 -0
- package/dist/table/src/composables/useColumnLayout.test.d.ts.map +1 -0
- package/dist/table/src/composables/useColumnMetrics.d.ts +5 -3
- package/dist/table/src/composables/useColumnMetrics.d.ts.map +1 -1
- package/dist/table/src/composables/useColumnMetrics.mjs +64 -55
- package/dist/table/src/composables/useExpand.d.ts +2 -0
- package/dist/table/src/composables/useExpand.d.ts.map +1 -1
- package/dist/table/src/composables/useExpand.mjs +42 -20
- package/dist/table/src/composables/usePagination.d.ts +15 -0
- package/dist/table/src/composables/usePagination.d.ts.map +1 -0
- package/dist/table/src/composables/usePagination.mjs +65 -0
- package/dist/table/src/composables/usePagination.test.d.ts +2 -0
- package/dist/table/src/composables/usePagination.test.d.ts.map +1 -0
- package/dist/table/src/composables/useResize.d.ts +1 -0
- package/dist/table/src/composables/useResize.d.ts.map +1 -1
- package/dist/table/src/composables/useResize.mjs +67 -39
- package/dist/table/src/composables/useScroll.d.ts +3 -0
- package/dist/table/src/composables/useScroll.d.ts.map +1 -1
- package/dist/table/src/composables/useScroll.mjs +43 -41
- package/dist/table/src/composables/useSelection.d.ts +2 -1
- package/dist/table/src/composables/useSelection.d.ts.map +1 -1
- package/dist/table/src/composables/useSelection.mjs +204 -155
- package/dist/table/src/composables/useTreeData.d.ts +4 -0
- package/dist/table/src/composables/useTreeData.d.ts.map +1 -1
- package/dist/table/src/composables/useTreeData.mjs +48 -43
- package/dist/table/src/context.d.ts +6 -1
- package/dist/table/src/context.d.ts.map +1 -1
- package/dist/table/src/index.d.ts +10 -87
- package/dist/table/src/index.d.ts.map +1 -1
- package/dist/table/src/index.mjs +12 -12
- package/dist/table/src/types/column.d.ts +8 -2
- package/dist/table/src/types/column.d.ts.map +1 -1
- package/dist/table/src/types/index.d.ts +1 -0
- package/dist/table/src/types/index.d.ts.map +1 -1
- package/dist/table/src/types/pagination.d.ts +66 -0
- package/dist/table/src/types/pagination.d.ts.map +1 -0
- package/dist/table/src/types/pagination.typecheck.d.ts +25 -0
- package/dist/table/src/types/pagination.typecheck.d.ts.map +1 -0
- package/dist/table/src/types/table.d.ts +8 -1
- package/dist/table/src/types/table.d.ts.map +1 -1
- package/dist/table/src/utils/columnWidth.d.ts +55 -7
- package/dist/table/src/utils/columnWidth.d.ts.map +1 -1
- package/dist/table/src/utils/columnWidth.mjs +91 -21
- package/dist/table/src/utils/paginationLayout.d.ts +13 -0
- package/dist/table/src/utils/paginationLayout.d.ts.map +1 -0
- package/dist/table/src/utils/paginationLayout.mjs +55 -0
- package/dist/table/src/utils/paginationLayout.test.d.ts +2 -0
- package/dist/table/src/utils/paginationLayout.test.d.ts.map +1 -0
- package/dist/table/src/utils/popupPosition.d.ts +4 -1
- package/dist/table/src/utils/popupPosition.d.ts.map +1 -1
- package/dist/table/src/utils/popupPosition.mjs +34 -15
- package/dist/theme/src/augment.d.ts +2 -0
- package/dist/theme/src/augment.d.ts.map +1 -1
- package/dist/theme/src/compat/antdv-pagination.d.ts +4 -0
- package/dist/theme/src/compat/antdv-pagination.d.ts.map +1 -0
- package/dist/theme/src/compat/antdv-pagination.mjs +29 -0
- package/dist/theme/src/index.d.ts +5 -0
- package/dist/theme/src/index.d.ts.map +1 -1
- package/dist/theme/src/pagination.d.ts +153 -0
- package/dist/theme/src/pagination.d.ts.map +1 -0
- package/dist/theme/src/pagination.mjs +144 -0
- package/dist/theme/src/presets/antdv/table-locale.d.ts +2 -2
- package/dist/theme/src/presets/antdv/table-locale.mjs +2 -2
- package/dist/theme/src/presets/antdv/table.d.ts +3 -0
- package/dist/theme/src/presets/antdv/table.d.ts.map +1 -1
- package/dist/theme/src/presets/antdv/table.mjs +3 -0
- package/dist/theme/src/presets/element-plus/table-locale.d.ts +2 -2
- package/dist/theme/src/presets/element-plus/table-locale.mjs +2 -2
- package/dist/theme/src/presets/element-plus/table.d.ts +3 -0
- package/dist/theme/src/presets/element-plus/table.d.ts.map +1 -1
- package/dist/theme/src/presets/element-plus/table.mjs +3 -0
- package/dist/theme/src/presets/index.d.ts.map +1 -1
- package/dist/theme/src/presets/index.mjs +60 -57
- package/dist/theme/src/presets/types.d.ts +1 -0
- package/dist/theme/src/presets/types.d.ts.map +1 -1
- package/dist/vtable-guild/src/augment.d.ts +15 -0
- package/dist/vtable-guild/src/augment.d.ts.map +1 -0
- package/dist/vtable-guild/src/index.d.ts +1 -0
- package/dist/vtable-guild/src/index.d.ts.map +1 -1
- package/package.json +4 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as r, inject as
|
|
2
|
-
import { TABLE_CONTEXT_KEY as
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as r, inject as a, watch as n } from "vue";
|
|
2
|
+
import { TABLE_CONTEXT_KEY as i } from "../context.mjs";
|
|
3
|
+
import l from "./VTableSummaryRow.mjs";
|
|
4
4
|
import u from "./VTableSummaryCell.mjs";
|
|
5
5
|
const f = /* @__PURE__ */ r({
|
|
6
6
|
name: "VTableSummary",
|
|
@@ -13,15 +13,15 @@ const f = /* @__PURE__ */ r({
|
|
|
13
13
|
setup(e, {
|
|
14
14
|
slots: t
|
|
15
15
|
}) {
|
|
16
|
-
const m =
|
|
17
|
-
return
|
|
18
|
-
m.registerSummaryFixed?.(
|
|
16
|
+
const m = a(i, {});
|
|
17
|
+
return n(() => e.fixed, (o) => {
|
|
18
|
+
m.registerSummaryFixed?.(o ?? !1);
|
|
19
19
|
}, {
|
|
20
20
|
immediate: !0
|
|
21
21
|
}), () => t.default?.();
|
|
22
22
|
}
|
|
23
23
|
}), b = Object.assign(f, {
|
|
24
|
-
Row:
|
|
24
|
+
Row: l,
|
|
25
25
|
Cell: u
|
|
26
26
|
});
|
|
27
27
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VTableSummaryCell.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableSummaryCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AAGtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;cAWZ,QAAQ,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;cAAnB,QAAQ,CAAC,SAAS,CAAC;;;;;;;;AANhD,
|
|
1
|
+
{"version":3,"file":"VTableSummaryCell.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VTableSummaryCell.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAA;AAGtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;cAWZ,QAAQ,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;cAAnB,QAAQ,CAAC,SAAS,CAAC;;;;;;;;AANhD,wBAmEE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as s, inject as f, computed as o, createVNode as S } from "vue";
|
|
2
2
|
import "../../../core/src/utils/tv.mjs";
|
|
3
3
|
import { TABLE_CONTEXT_KEY as y } from "../context.mjs";
|
|
4
|
-
import { getColumnKey as
|
|
4
|
+
import { getColumnKey as x } from "../composables/useColumns.mjs";
|
|
5
5
|
import { useFixedColumnStyle as C } from "../composables/useFixedColumnStyle.mjs";
|
|
6
|
-
import { TABLE_ALIGN_CLASSES as
|
|
6
|
+
import { TABLE_ALIGN_CLASSES as v } from "../../../theme/src/presets/antdv/table.mjs";
|
|
7
7
|
import { cn as b } from "tailwind-variants";
|
|
8
|
-
const
|
|
8
|
+
const E = /* @__PURE__ */ s({
|
|
9
9
|
name: "VTableSummaryCell",
|
|
10
10
|
props: {
|
|
11
11
|
index: {
|
|
@@ -25,44 +25,46 @@ const _ = /* @__PURE__ */ c({
|
|
|
25
25
|
default: void 0
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
-
setup(
|
|
28
|
+
setup(e, {
|
|
29
29
|
slots: i
|
|
30
30
|
}) {
|
|
31
|
-
const l = f(y, {}),
|
|
31
|
+
const l = f(y, {}), d = o(() => {
|
|
32
32
|
const t = l.displayColumns?.value;
|
|
33
33
|
if (!t) return null;
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
const
|
|
37
|
-
return l.fixedOffsets?.value?.get(
|
|
34
|
+
const n = t[e.index];
|
|
35
|
+
if (!n?.fixed) return null;
|
|
36
|
+
const u = x(n) ?? e.index;
|
|
37
|
+
return l.fixedOffsets?.value?.get(u) ?? null;
|
|
38
38
|
}), {
|
|
39
39
|
fixedStyle: a,
|
|
40
|
-
fixedClass:
|
|
40
|
+
fixedClass: r
|
|
41
41
|
} = C({
|
|
42
|
-
fixedInfo: () =>
|
|
43
|
-
}),
|
|
44
|
-
const t = l.subThemeSlots,
|
|
45
|
-
return b(t?.summaryCell() ?? "",
|
|
46
|
-
}), m =
|
|
42
|
+
fixedInfo: () => d.value
|
|
43
|
+
}), c = o(() => {
|
|
44
|
+
const t = l.subThemeSlots, n = e.align ? l.vtgClass?.(v[e.align]) ?? "" : "";
|
|
45
|
+
return b(t?.summaryCell() ?? "", n, r.value, l.columnLayout?.enabled.value && t?.widthLayoutCell());
|
|
46
|
+
}), m = o(() => {
|
|
47
47
|
const t = l.displayColumns?.value;
|
|
48
48
|
if (!t) return a.value;
|
|
49
|
-
const
|
|
50
|
-
return
|
|
51
|
-
...
|
|
52
|
-
...a.value ?? {}
|
|
49
|
+
const n = t[e.index], u = {};
|
|
50
|
+
return n?.width && (u.width = typeof n.width == "number" ? `${n.width}px` : String(n.width)), {
|
|
51
|
+
...u,
|
|
52
|
+
...a.value ?? {},
|
|
53
|
+
...l.columnLayout?.columnStyle(e.index, e.colSpan)
|
|
53
54
|
};
|
|
54
55
|
});
|
|
55
56
|
return () => {
|
|
56
|
-
const t =
|
|
57
|
+
const t = e.colSpan !== 1 ? e.colSpan : void 0, n = e.rowSpan !== 1 ? e.rowSpan : void 0;
|
|
57
58
|
return S("td", {
|
|
58
|
-
|
|
59
|
+
"data-vtg-col": e.index,
|
|
60
|
+
class: c.value,
|
|
59
61
|
style: m.value,
|
|
60
62
|
colspan: t,
|
|
61
|
-
rowspan:
|
|
63
|
+
rowspan: n
|
|
62
64
|
}, [i.default?.()]);
|
|
63
65
|
};
|
|
64
66
|
}
|
|
65
67
|
});
|
|
66
68
|
export {
|
|
67
|
-
|
|
69
|
+
E as default
|
|
68
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualTableBody.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VirtualTableBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,QAAQ,EAAE,MAAM,KAAK,CAAA;AAElD,OAAO,KAAK,EAAW,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"VirtualTableBody.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/VirtualTableBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,QAAQ,EAAE,MAAM,KAAK,CAAA;AAElD,OAAO,KAAK,EAAW,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAQpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAGpE,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAK/C,KAAK,sBAAsB,GAAG,iBAAiB,GAAG;IAChD,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;;;cAQgC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;;;;cACtC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAO3C,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;;;cAEhC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;;;;;;;;;;;IAK3F,wCAAwC;;;;;IAExC;;;OAGG;;;;;IAEH,qCAAqC;;cACJ,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC;;;IAC/D,gEAAgE;;cAE5C,QAAQ,CAAC,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;;;;cAIvC,QAAQ,CAAC,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;;;;;cA9BxC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;;;;cACtC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAO3C,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;;;;cAEhC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;;;;;;;;;;;IAK3F,wCAAwC;;;;;IAExC;;;OAGG;;;;;IAEH,qCAAqC;;cACJ,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC;;;IAC/D,gEAAgE;;cAE5C,QAAQ,CAAC,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;;;;cAIvC,QAAQ,CAAC,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;;;;;4BAJjC,sBAAsB,KAAK,IAAI;+BAhBT,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,GAAG;;;;;;AAb7F,wBAmaE"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as U, inject as Y, ref as C, computed as w, onBeforeUnmount as J, watch as Q, createVNode as r, isVNode as Z } from "vue";
|
|
2
2
|
import "../../../core/src/utils/tv.mjs";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
import ee from "./TableRow.mjs";
|
|
4
|
+
import te from "./TableCell.mjs";
|
|
5
|
+
import le from "./TableEmpty.mjs";
|
|
6
|
+
import oe from "./ExpandedRowTr.mjs";
|
|
7
|
+
import ne from "./ColGroup.mjs";
|
|
8
|
+
import ae from "./ColumnWidthRow.mjs";
|
|
9
|
+
import { TABLE_CONTEXT_KEY as re } from "../context.mjs";
|
|
10
|
+
import { resolveFixedColumnRanges as ie, useColumnWindow as se } from "../composables/useColumnWindow.mjs";
|
|
11
|
+
import { resolveRowDragClass as de } from "../composables/useRowDragSort.mjs";
|
|
12
|
+
import { getRowCompatClass as ue } from "../utils/compat.mjs";
|
|
13
|
+
import { resolveRowKey as N } from "../utils/rowKey.mjs";
|
|
14
|
+
import { sumDeclaredColumnWidths as ce, parseStylePxWidth as fe } from "../utils/columnWidth.mjs";
|
|
15
|
+
import me from "../../../core/src/components/VirtualList/VirtualList.mjs";
|
|
16
|
+
import { cn as W } from "tailwind-variants";
|
|
17
|
+
function we(e) {
|
|
18
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Z(e);
|
|
18
19
|
}
|
|
19
|
-
const
|
|
20
|
+
const qe = /* @__PURE__ */ U({
|
|
20
21
|
name: "VirtualTableBody",
|
|
21
22
|
props: {
|
|
22
23
|
dataSource: {
|
|
@@ -95,101 +96,110 @@ const Te = /* @__PURE__ */ $({
|
|
|
95
96
|
default: "hover"
|
|
96
97
|
}
|
|
97
98
|
},
|
|
98
|
-
setup(e
|
|
99
|
-
|
|
99
|
+
setup(e, {
|
|
100
|
+
expose: F
|
|
101
|
+
}) {
|
|
102
|
+
const n = Y(re, {}), c = C();
|
|
103
|
+
F({
|
|
104
|
+
scrollToTop: () => c.value?.scrollTo({
|
|
105
|
+
top: 0
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
const x = C(0), f = C(0);
|
|
100
109
|
function b(t) {
|
|
101
110
|
x.value = t.x, e.onVirtualScroll?.({
|
|
102
111
|
...t,
|
|
103
|
-
maxX:
|
|
112
|
+
maxX: c.value?.getHorizontalRange() ?? 0
|
|
104
113
|
});
|
|
105
114
|
}
|
|
106
115
|
function V(t, l) {
|
|
107
|
-
return
|
|
116
|
+
return N(t, l, e.rowKey);
|
|
108
117
|
}
|
|
109
|
-
function k(t) {
|
|
110
|
-
|
|
111
|
-
return T(t, l, e.rowKey);
|
|
118
|
+
function k(t, l) {
|
|
119
|
+
return N(t, l ?? e.dataSource.indexOf(t), e.rowKey);
|
|
112
120
|
}
|
|
113
|
-
const q =
|
|
114
|
-
const t = e.
|
|
121
|
+
const q = w(() => {
|
|
122
|
+
const t = e.columnMetrics?.total;
|
|
115
123
|
if (t && t > 0) return t;
|
|
116
|
-
const l =
|
|
124
|
+
const l = ce(e.columns, n.columnWidths), u = fe(e.tableStyle?.width);
|
|
117
125
|
return Math.max(l, u);
|
|
118
|
-
}),
|
|
119
|
-
if (!e.virtualColumn ||
|
|
126
|
+
}), y = w(() => ie(e.columns)), O = w(() => {
|
|
127
|
+
if (!e.virtualColumn || f.value <= 0) return null;
|
|
120
128
|
const t = e.columnMetrics;
|
|
121
129
|
return !t || t.widths.length !== e.columns.length ? null : t.widths;
|
|
122
130
|
}), {
|
|
123
|
-
active:
|
|
124
|
-
start:
|
|
125
|
-
end:
|
|
126
|
-
leftSpacer:
|
|
127
|
-
rightSpacer:
|
|
128
|
-
} =
|
|
129
|
-
widths: () =>
|
|
130
|
-
leftFixedCount: () =>
|
|
131
|
-
rightFixedStart: () =>
|
|
131
|
+
active: H,
|
|
132
|
+
start: _,
|
|
133
|
+
end: I,
|
|
134
|
+
leftSpacer: S,
|
|
135
|
+
rightSpacer: p
|
|
136
|
+
} = se({
|
|
137
|
+
widths: () => O.value,
|
|
138
|
+
leftFixedCount: () => y.value.leftFixedCount,
|
|
139
|
+
rightFixedStart: () => y.value.rightFixedStart,
|
|
132
140
|
offsetX: () => x.value,
|
|
133
|
-
viewportWidth: () =>
|
|
134
|
-
}),
|
|
141
|
+
viewportWidth: () => f.value
|
|
142
|
+
}), K = w(() => {
|
|
135
143
|
const t = e.columns.length;
|
|
136
|
-
if (!
|
|
144
|
+
if (!H.value)
|
|
137
145
|
return Array.from({
|
|
138
146
|
length: t
|
|
139
|
-
}, (
|
|
147
|
+
}, (o, i) => ({
|
|
140
148
|
index: i
|
|
141
149
|
}));
|
|
142
150
|
const {
|
|
143
151
|
leftFixedCount: l,
|
|
144
152
|
rightFixedStart: u
|
|
145
|
-
} =
|
|
146
|
-
for (let
|
|
147
|
-
index:
|
|
153
|
+
} = y.value, a = [];
|
|
154
|
+
for (let o = 0; o < l; o += 1) a.push({
|
|
155
|
+
index: o
|
|
148
156
|
});
|
|
149
|
-
|
|
150
|
-
spacer:
|
|
157
|
+
S.value > 0 && a.push({
|
|
158
|
+
spacer: S.value
|
|
151
159
|
});
|
|
152
|
-
for (let
|
|
153
|
-
index:
|
|
160
|
+
for (let o = _.value; o <= I.value; o += 1) a.push({
|
|
161
|
+
index: o
|
|
154
162
|
});
|
|
155
|
-
|
|
156
|
-
spacer:
|
|
163
|
+
p.value > 0 && a.push({
|
|
164
|
+
spacer: p.value
|
|
157
165
|
});
|
|
158
|
-
for (let
|
|
159
|
-
index:
|
|
166
|
+
for (let o = u; o < t; o += 1) a.push({
|
|
167
|
+
index: o
|
|
160
168
|
});
|
|
161
|
-
return
|
|
169
|
+
return a;
|
|
162
170
|
});
|
|
163
|
-
function
|
|
171
|
+
function ye(t) {
|
|
164
172
|
}
|
|
165
173
|
let s = null, d = null;
|
|
166
|
-
function
|
|
174
|
+
function R(t) {
|
|
167
175
|
const l = t ?? null;
|
|
168
|
-
l !== d && (s && d && s.unobserve(d), d = l, l && (
|
|
169
|
-
d && (
|
|
176
|
+
l !== d && (s && d && s.unobserve(d), d = l, l && (f.value = l.clientWidth, !s && typeof ResizeObserver < "u" && (s = new ResizeObserver(() => {
|
|
177
|
+
d && (f.value = d.clientWidth);
|
|
170
178
|
})), s?.observe(l)));
|
|
171
179
|
}
|
|
172
|
-
return
|
|
180
|
+
return J(() => {
|
|
173
181
|
s?.disconnect(), s = null, d = null;
|
|
174
|
-
}),
|
|
182
|
+
}), Q(() => c.value, (t) => {
|
|
175
183
|
if (t) {
|
|
176
184
|
const l = t.getScrollInfo();
|
|
177
|
-
b(l), t.nativeElement,
|
|
185
|
+
b(l), t.nativeElement, R(t.nativeElement);
|
|
178
186
|
} else
|
|
179
|
-
|
|
187
|
+
R(null);
|
|
180
188
|
}), () => e.dataSource.length === 0 ? r("table", {
|
|
181
|
-
|
|
189
|
+
"data-vtg-table": "",
|
|
190
|
+
class: W(e.tableClass, n.compatClass?.("body")),
|
|
182
191
|
style: e.tableStyle
|
|
183
|
-
}, [r(
|
|
192
|
+
}, [r(ne, {
|
|
184
193
|
columns: e.columns
|
|
185
|
-
}, null), r("tbody", {
|
|
194
|
+
}, null), r(ae, null, null), r("tbody", {
|
|
186
195
|
class: e.tbodyClass
|
|
187
|
-
}, [r(
|
|
196
|
+
}, [r(le, {
|
|
188
197
|
colSpan: e.columns.length || 1,
|
|
189
198
|
emptyClass: e.emptyClass,
|
|
190
199
|
tdClass: e.tdClass
|
|
191
|
-
}, null)])]) : r(
|
|
192
|
-
ref:
|
|
200
|
+
}, null)])]) : r(me, {
|
|
201
|
+
ref: c,
|
|
202
|
+
holderClass: n.compatClass?.("body"),
|
|
193
203
|
data: e.dataSource,
|
|
194
204
|
height: e.height,
|
|
195
205
|
itemHeight: e.itemHeight,
|
|
@@ -208,13 +218,14 @@ const Te = /* @__PURE__ */ $({
|
|
|
208
218
|
index: l
|
|
209
219
|
}) => {
|
|
210
220
|
let u;
|
|
211
|
-
const
|
|
212
|
-
...
|
|
213
|
-
...
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
} : void 0,
|
|
221
|
+
const a = l, o = V(t, a), i = n.expandable?.(), D = n.isExpanded?.(o) ?? !1, P = i?.expandRowByClick ?? !1, j = n.isRowExpandable?.(t) ?? !1, E = n.getRowClassName?.(t, a), B = n.getRowProps?.(t, a), M = n.rowDrag?.enabled.value ? n.rowDrag.getBindings(t, a, B) : void 0, A = {
|
|
222
|
+
...B,
|
|
223
|
+
...M
|
|
224
|
+
}, L = de(n.rowDrag, o, n.subThemeSlots), v = (n.isTreeData?.value ? n.getFlattenRow?.(t) : void 0)?.level ?? 0, X = typeof i?.expandedRowClassName == "function" ? i.expandedRowClassName(t, a, v) : i?.expandedRowClassName, z = P ? () => {
|
|
225
|
+
j && n.toggleExpand?.(t, a);
|
|
226
|
+
} : void 0, T = K.value, $ = e.columnMetrics?.widths;
|
|
217
227
|
return r("table", {
|
|
228
|
+
"data-vtg-table": "",
|
|
218
229
|
class: e.tableClass,
|
|
219
230
|
style: {
|
|
220
231
|
...e.tableStyle,
|
|
@@ -223,43 +234,44 @@ const Te = /* @__PURE__ */ $({
|
|
|
223
234
|
}, [r("tbody", {
|
|
224
235
|
class: e.tbodyClass,
|
|
225
236
|
"data-vtg-preserve-last-border": l < e.dataSource.length - 1 ? "" : void 0
|
|
226
|
-
}, [r(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
237
|
+
}, [r(ee, {
|
|
238
|
+
"data-vtg-virtual-row": "",
|
|
239
|
+
key: o,
|
|
240
|
+
rowClass: W(e.rowClass, E, L, ue(n, t, a, v)) ?? "",
|
|
241
|
+
rowProps: A,
|
|
242
|
+
onClick: z
|
|
243
|
+
}, we(u = T.map((g, G) => {
|
|
232
244
|
if (g.spacer !== void 0)
|
|
233
245
|
return r("td", {
|
|
234
|
-
key: `__vtg_spacer_${
|
|
246
|
+
key: `__vtg_spacer_${G}`,
|
|
235
247
|
style: {
|
|
236
248
|
width: `${g.spacer}px`,
|
|
237
249
|
padding: "0"
|
|
238
250
|
},
|
|
239
251
|
"aria-hidden": "true"
|
|
240
252
|
}, null);
|
|
241
|
-
const
|
|
242
|
-
return r(
|
|
243
|
-
key: h.key ?? String(h.dataIndex ??
|
|
253
|
+
const m = g.index, h = e.columns[m];
|
|
254
|
+
return r(te, {
|
|
255
|
+
key: h.key ?? String(h.dataIndex ?? m),
|
|
244
256
|
record: t,
|
|
245
|
-
rowIndex:
|
|
257
|
+
rowIndex: a,
|
|
246
258
|
column: h,
|
|
247
|
-
colIndex:
|
|
248
|
-
widthOverride:
|
|
259
|
+
colIndex: m,
|
|
260
|
+
widthOverride: $?.[m],
|
|
249
261
|
tdClass: e.tdClass,
|
|
250
262
|
bodyCellEllipsisClass: e.bodyCellEllipsisClass
|
|
251
263
|
}, null);
|
|
252
264
|
})) ? u : {
|
|
253
265
|
default: () => [u]
|
|
254
|
-
}),
|
|
255
|
-
key: `${
|
|
266
|
+
}), D && i?.expandedRowRender ? r(oe, {
|
|
267
|
+
key: `${o}-expanded`,
|
|
256
268
|
record: t,
|
|
257
|
-
rowIndex:
|
|
258
|
-
colspan:
|
|
259
|
-
rowIndent:
|
|
269
|
+
rowIndex: a,
|
|
270
|
+
colspan: T.length,
|
|
271
|
+
rowIndent: v,
|
|
260
272
|
rowClass: e.rowClass,
|
|
261
|
-
rowClassName:
|
|
262
|
-
expandedRowClassName:
|
|
273
|
+
rowClassName: E,
|
|
274
|
+
expandedRowClassName: X,
|
|
263
275
|
tdClass: e.tdClass,
|
|
264
276
|
expandedRowRender: i.expandedRowRender
|
|
265
277
|
}, null) : null])]);
|
|
@@ -268,5 +280,5 @@ const Te = /* @__PURE__ */ $({
|
|
|
268
280
|
}
|
|
269
281
|
});
|
|
270
282
|
export {
|
|
271
|
-
|
|
283
|
+
qe as default
|
|
272
284
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ColumnType, TableLayout } from '../types';
|
|
2
|
+
import { ColumnMetrics } from './useColumnMetrics';
|
|
3
|
+
type Column = ColumnType<Record<string, unknown>>;
|
|
4
|
+
export interface ColumnLayoutOptions {
|
|
5
|
+
columns: () => Column[];
|
|
6
|
+
columnWidths: Record<string, number>;
|
|
7
|
+
layout: () => TableLayout;
|
|
8
|
+
split: () => boolean;
|
|
9
|
+
root: () => HTMLElement | null;
|
|
10
|
+
viewport: () => HTMLElement | null;
|
|
11
|
+
scrollX: () => number | string | undefined;
|
|
12
|
+
onMeasure?: () => void;
|
|
13
|
+
}
|
|
14
|
+
/** Input constraints, allocation and committed browser metrics have separate lifetimes. */
|
|
15
|
+
export declare function useColumnLayout(options: ColumnLayoutOptions): {
|
|
16
|
+
enabled: import('vue').ComputedRef<boolean>;
|
|
17
|
+
minimums: import('vue').ComputedRef<number[]>;
|
|
18
|
+
minimumTotal: import('vue').ComputedRef<number>;
|
|
19
|
+
metrics: import('vue').ComputedRef<ColumnMetrics | null>;
|
|
20
|
+
synchronized: import('vue').ComputedRef<boolean>;
|
|
21
|
+
tableStyle: import('vue').ComputedRef<Record<string, string>>;
|
|
22
|
+
columnStyle: (index: number, span?: number) => Record<string, string>;
|
|
23
|
+
overflow: import('vue').ShallowRef<boolean, boolean>;
|
|
24
|
+
remeasure: () => void;
|
|
25
|
+
};
|
|
26
|
+
export type ColumnLayout = ReturnType<typeof useColumnLayout>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=useColumnLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColumnLayout.d.ts","sourceRoot":"","sources":["../../../../../table/src/composables/useColumnLayout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAQ5E,KAAK,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAMjD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,MAAM,EAAE,CAAA;IACvB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,MAAM,EAAE,MAAM,WAAW,CAAA;IACzB,KAAK,EAAE,MAAM,OAAO,CAAA;IACpB,IAAI,EAAE,MAAM,WAAW,GAAG,IAAI,CAAA;IAC9B,QAAQ,EAAE,MAAM,WAAW,GAAG,IAAI,CAAA;IAClC,OAAO,EAAE,MAAM,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IAC1C,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,OAAO,EAAE,mBAAmB;;;;;;;yBAyD9B,MAAM,oBAAa,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;;EAsYtE;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA"}
|