@vtable-guild/vtable-guild 2.7.1 → 2.8.0
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 +3 -0
- package/dist/core/src/components/VirtualList/VirtualList.d.ts.map +1 -1
- package/dist/core/src/components/VirtualList/VirtualList.mjs +28 -27
- package/dist/core/src/components/VirtualList/VirtualScrollBar.d.ts +1 -1
- 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 +2 -0
- package/dist/index.full.mjs +5229 -3895
- 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 +497 -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/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 +106 -93
- 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 +44 -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 +210 -171
- 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 +3 -1
- package/dist/table/src/index.d.ts.map +1 -1
- 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/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Re, inject as Pe, computed as a, ref as f, watch as
|
|
1
|
+
import { defineComponent as Re, inject as Pe, computed as a, ref as f, watch as me, nextTick as He, onBeforeUnmount as Ve, createVNode as i, mergeProps as $, Teleport as Ke, isVNode as Be } from "vue";
|
|
2
2
|
import "../../../core/src/utils/tv.mjs";
|
|
3
3
|
import We from "../../../core/src/components/Tooltip.mjs";
|
|
4
4
|
import je from "../../../icons/src/DownOutlinedIcon.mjs";
|
|
@@ -24,7 +24,7 @@ function il(t) {
|
|
|
24
24
|
if (t === "ascend") return "ascending";
|
|
25
25
|
if (t === "descend") return "descending";
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const Al = /* @__PURE__ */ Re({
|
|
28
28
|
name: "TableHeaderCell",
|
|
29
29
|
props: {
|
|
30
30
|
cell: {
|
|
@@ -45,16 +45,16 @@ const Il = /* @__PURE__ */ Re({
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
setup(t) {
|
|
48
|
-
const e = Pe(Ge, {}), o = a(() => t.cell.isLeaf ? t.cell.column : null),
|
|
48
|
+
const e = Pe(Ge, {}), o = a(() => t.cell.isLeaf ? t.cell.column : null), N = a(() => t.cell.leafIndex >= 0 ? String(t.cell.leafIndex) : void 0), d = a(() => t.cell.column.customHeaderCell?.(t.cell.column, t.index, o.value ?? void 0)), L = a(() => Ye(d.value, "colSpan") ?? t.cell.colSpan), R = a(() => t.cell.rowSpan), _ = a(() => {
|
|
49
49
|
const {
|
|
50
50
|
onClick: l,
|
|
51
51
|
...r
|
|
52
52
|
} = $e(d.value);
|
|
53
53
|
return r;
|
|
54
|
-
}), y = a(() => o.value?.sorter ? e.getSortOrder?.(o.value) ?? null : null),
|
|
54
|
+
}), y = a(() => o.value?.sorter ? e.getSortOrder?.(o.value) ?? null : null), E = a(() => !!o.value?.sorter), M = a(() => !o.value || !E.value ? !1 : o.value.showSorterTooltip ?? e.showSorterTooltip?.value ?? !0), k = a(() => {
|
|
55
55
|
const l = o.value;
|
|
56
56
|
return l ? (l.filters?.length ?? 0) > 0 || !!l.customFilterDropdown || !!l.filterDropdown : !1;
|
|
57
|
-
}), P = a(() => !o.value || !
|
|
57
|
+
}), P = a(() => !o.value || !k.value ? [] : e.getFilteredValue?.(o.value) ?? []), h = a(() => {
|
|
58
58
|
const l = o.value;
|
|
59
59
|
return l ? l.filtered !== void 0 ? l.filtered : P.value.length > 0 : !1;
|
|
60
60
|
}), Z = a(() => o.value?.filterDropdownOpen !== void 0), ee = f(!1), T = a(() => Z.value ? o.value?.filterDropdownOpen ?? !1 : ee.value);
|
|
@@ -68,12 +68,12 @@ const Il = /* @__PURE__ */ Re({
|
|
|
68
68
|
function K(l) {
|
|
69
69
|
H.value && !H.value.contains(l.target) && !m.value?.contains(l.target) && v(!1);
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const pe = a(() => {
|
|
72
72
|
const l = o.value;
|
|
73
73
|
return l ? !!l.filterDropdown || !!l.customFilterDropdown && !!e.customFilterDropdown : !1;
|
|
74
74
|
});
|
|
75
|
-
|
|
76
|
-
l &&
|
|
75
|
+
me(T, (l) => {
|
|
76
|
+
l && pe.value ? He(() => {
|
|
77
77
|
document.addEventListener("mousedown", K);
|
|
78
78
|
}) : document.removeEventListener("mousedown", K);
|
|
79
79
|
}), Ve(() => {
|
|
@@ -88,7 +88,7 @@ const Il = /* @__PURE__ */ Re({
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
const x = f([]), te = f(null);
|
|
91
|
-
|
|
91
|
+
me(() => P.value, (l) => {
|
|
92
92
|
x.value = [...l];
|
|
93
93
|
}, {
|
|
94
94
|
immediate: !0
|
|
@@ -96,35 +96,35 @@ const Il = /* @__PURE__ */ Re({
|
|
|
96
96
|
function B(l) {
|
|
97
97
|
o.value && (e.confirmFilter?.(o.value, l), v(!1));
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Ce() {
|
|
100
100
|
o.value && (e.resetFilter?.(o.value), v(!1));
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function ge() {
|
|
103
103
|
v(!1);
|
|
104
104
|
}
|
|
105
|
-
const
|
|
105
|
+
const he = a(() => {
|
|
106
106
|
const l = t.cell.leafColumns;
|
|
107
107
|
if (!l.length) return null;
|
|
108
|
-
const r = l[0], u = l[l.length - 1], g = J(r) ?? t.cell.colStart, s = J(u) ?? t.cell.colEnd,
|
|
109
|
-
return l.every((p) => p.fixed === "left") &&
|
|
110
|
-
left:
|
|
108
|
+
const r = l[0], u = l[l.length - 1], g = J(r) ?? t.cell.colStart, s = J(u) ?? t.cell.colEnd, I = e.fixedOffsets?.value?.get(g), A = e.fixedOffsets?.value?.get(s);
|
|
109
|
+
return l.every((p) => p.fixed === "left") && I?.left !== void 0 ? {
|
|
110
|
+
left: I.left,
|
|
111
111
|
isLastLeft: A?.isLastLeft
|
|
112
112
|
} : l.every((p) => p.fixed === "right") && A?.right !== void 0 ? {
|
|
113
113
|
right: A.right,
|
|
114
|
-
isFirstRight:
|
|
114
|
+
isFirstRight: I?.isFirstRight
|
|
115
115
|
} : null;
|
|
116
116
|
}), {
|
|
117
|
-
fixedStyle:
|
|
117
|
+
fixedStyle: Se,
|
|
118
118
|
fixedClass: oe
|
|
119
119
|
} = Xe({
|
|
120
|
-
fixedInfo: () =>
|
|
121
|
-
}),
|
|
120
|
+
fixedInfo: () => he.value
|
|
121
|
+
}), be = a(() => {
|
|
122
122
|
const l = e.themePreset?.value === "antdv", r = e.bordered?.value ?? !1;
|
|
123
123
|
return !l || r || t.cell.isLeaf ? "" : e.vtgClass?.("before:hidden border-b-0") ?? "";
|
|
124
|
-
}),
|
|
124
|
+
}), we = a(() => {
|
|
125
125
|
const l = e.leafColumnCount?.value ?? 0;
|
|
126
126
|
return l > 0 && t.cell.colEnd < l - 1 ? e.bordered?.value ?? !1 ? e.vtgClass?.("last:border-r last:border-[color:var(--vtg-table-border-color)]") ?? "" : e.vtgClass?.("last:before:bg-[color:var(--vtg-table-header-split-color)]") ?? "" : "";
|
|
127
|
-
}), ne = a(() => e.getColumnTitle?.(t.cell.column) ?? t.cell.column.title ?? ""),
|
|
127
|
+
}), ne = a(() => e.getColumnTitle?.(t.cell.column) ?? t.cell.column.title ?? ""), re = a(() => {
|
|
128
128
|
if (!t.cell.isLeaf) return !1;
|
|
129
129
|
const l = o.value;
|
|
130
130
|
return !l || !Je(l).enabled ? !1 : e.headerEllipsis?.value === !0;
|
|
@@ -140,23 +140,24 @@ const Il = /* @__PURE__ */ Re({
|
|
|
140
140
|
}
|
|
141
141
|
return ne.value;
|
|
142
142
|
}), ye = a(() => {
|
|
143
|
-
const l = t.cell.column.align ? e.vtgClass?.(sl[t.cell.column.align]) ?? "" : "", r =
|
|
144
|
-
return C(t.thClass, l, r, u,
|
|
145
|
-
}),
|
|
143
|
+
const l = t.cell.column.align ? e.vtgClass?.(sl[t.cell.column.align]) ?? "" : "", r = E.value ? e.subThemeSlots?.thSortable() : "", u = y.value ? e.subThemeSlots?.thSorted() : "", g = o.value?.key === "__vtg_expand__";
|
|
144
|
+
return C(t.thClass, l, r, u, be.value, t.cell.column.className, g ? e.vtgClass?.("before:hidden") : "", d.value?.class, d.value?.className, oe.value, we.value, g ? e.compatClass?.("row-expand-icon-cell") : "", re.value ? e.compatClass?.("cell-ellipsis") : "");
|
|
145
|
+
}), se = a(() => {
|
|
146
146
|
const l = {};
|
|
147
147
|
if (o.value) {
|
|
148
|
-
const s = e.columnWidths?.[String(J(o.value) ?? t.cell.
|
|
148
|
+
const s = e.columnWidths?.[String(J(o.value) ?? t.cell.leafIndex)] ?? o.value.width;
|
|
149
149
|
s && (l.width = typeof s == "number" ? `${s}px` : s);
|
|
150
150
|
}
|
|
151
|
-
const r = d.value?.style, u =
|
|
151
|
+
const r = d.value?.style, u = Se.value;
|
|
152
152
|
return {
|
|
153
153
|
...l,
|
|
154
154
|
...u ?? {},
|
|
155
|
-
...r ?? {}
|
|
155
|
+
...r ?? {},
|
|
156
|
+
...o.value ? e.columnLayout?.columnStyle(t.cell.leafIndex, L.value) : {}
|
|
156
157
|
};
|
|
157
|
-
}),
|
|
158
|
+
}), O = f(!1), D = f(null);
|
|
158
159
|
function Te() {
|
|
159
|
-
return
|
|
160
|
+
return D.value ? D.value.getBoundingClientRect() : {
|
|
160
161
|
top: 0,
|
|
161
162
|
left: 0,
|
|
162
163
|
right: 0,
|
|
@@ -165,27 +166,27 @@ const Il = /* @__PURE__ */ Re({
|
|
|
165
166
|
}
|
|
166
167
|
let c = null;
|
|
167
168
|
function xe() {
|
|
168
|
-
c && clearTimeout(c),
|
|
169
|
+
c && clearTimeout(c), O.value = !0;
|
|
169
170
|
}
|
|
170
|
-
function
|
|
171
|
+
function ae() {
|
|
171
172
|
c && clearTimeout(c), c = setTimeout(() => {
|
|
172
|
-
|
|
173
|
+
O.value = !1;
|
|
173
174
|
}, 100);
|
|
174
175
|
}
|
|
175
176
|
function De() {
|
|
176
177
|
c && clearTimeout(c);
|
|
177
178
|
}
|
|
178
|
-
function
|
|
179
|
-
c && clearTimeout(c),
|
|
179
|
+
function Ie() {
|
|
180
|
+
c && clearTimeout(c), O.value = !1;
|
|
180
181
|
}
|
|
181
|
-
const W = f(!1), j = f(!1),
|
|
182
|
+
const W = f(!1), j = f(!1), Ae = a(() => M.value && W.value && !j.value);
|
|
182
183
|
function Fe(l) {
|
|
183
184
|
const r = _.value.onMouseenter;
|
|
184
|
-
typeof r == "function" && r(l),
|
|
185
|
+
typeof r == "function" && r(l), M.value && (W.value = !0);
|
|
185
186
|
}
|
|
186
187
|
function Le(l) {
|
|
187
188
|
const r = _.value.onMouseleave;
|
|
188
|
-
typeof r == "function" && r(l),
|
|
189
|
+
typeof r == "function" && r(l), M.value && (W.value = !1);
|
|
189
190
|
}
|
|
190
191
|
function q() {
|
|
191
192
|
j.value = !0;
|
|
@@ -195,19 +196,19 @@ const Il = /* @__PURE__ */ Re({
|
|
|
195
196
|
}
|
|
196
197
|
function U(l) {
|
|
197
198
|
const r = d.value?.onClick;
|
|
198
|
-
typeof r == "function" && r(l), o.value &&
|
|
199
|
+
typeof r == "function" && r(l), o.value && E.value && e.toggleSortOrder?.(o.value);
|
|
199
200
|
}
|
|
200
201
|
return () => {
|
|
201
|
-
if (
|
|
202
|
+
if (L.value === 0 || R.value === 0)
|
|
202
203
|
return null;
|
|
203
|
-
const l =
|
|
204
|
+
const l = L.value !== 1 ? L.value : void 0, r = R.value !== 1 ? R.value : void 0;
|
|
204
205
|
if (o.value?.key === "__vtg_selection__") {
|
|
205
|
-
const n = e.rowSelection?.(), S = n?.type === "radio",
|
|
206
|
+
const n = e.rowSelection?.(), S = n?.type === "radio", ce = n?.hideSelectAll === !0, X = n?.selections !== void 0 && n.selections !== !1, b = e.locale?.value, F = n?.columnTitle, Oe = F !== void 0, fe = C(t.thClass, e.vtgClass?.(Oe ? "text-center before:hidden" : "text-center before:hidden leading-[0]"), o.value.className, d.value?.class, d.value?.className, oe.value, e.compatClass?.("selection-column")), de = se.value;
|
|
206
207
|
let Y = [];
|
|
207
208
|
if (X && (n?.selections === !0 ? Y = [{
|
|
208
209
|
key: "__vtg_select_all__",
|
|
209
|
-
text: b?.selection?.selectAll ?? "
|
|
210
|
-
onSelect: () => e.toggleAll?.(!0)
|
|
210
|
+
text: b?.selection?.selectAll ?? "全选所有",
|
|
211
|
+
onSelect: () => e.toggleAll?.(!0, !0)
|
|
211
212
|
}, {
|
|
212
213
|
key: "__vtg_select_invert__",
|
|
213
214
|
text: b?.selection?.selectInvert ?? "反选当页",
|
|
@@ -218,8 +219,8 @@ const Il = /* @__PURE__ */ Re({
|
|
|
218
219
|
onSelect: () => e.clearSelection?.()
|
|
219
220
|
}] : Array.isArray(n?.selections) && (Y = n.selections.map((w) => w === qe ? {
|
|
220
221
|
key: "__vtg_select_all__",
|
|
221
|
-
text: b?.selection?.selectAll ?? "
|
|
222
|
-
onSelect: () => e.toggleAll?.(!0)
|
|
222
|
+
text: b?.selection?.selectAll ?? "全选所有",
|
|
223
|
+
onSelect: () => e.toggleAll?.(!0, !0)
|
|
223
224
|
} : w === ze ? {
|
|
224
225
|
key: "__vtg_select_invert__",
|
|
225
226
|
text: b?.selection?.selectInvert ?? "反选当页",
|
|
@@ -230,64 +231,65 @@ const Il = /* @__PURE__ */ Re({
|
|
|
230
231
|
onSelect: () => e.clearSelection?.()
|
|
231
232
|
} : w))), S)
|
|
232
233
|
return i("th", $(_.value, {
|
|
233
|
-
class:
|
|
234
|
-
style:
|
|
234
|
+
class: fe,
|
|
235
|
+
style: de,
|
|
235
236
|
colspan: l,
|
|
236
237
|
rowspan: r,
|
|
237
|
-
"data-vtg-leaf-col":
|
|
238
|
+
"data-vtg-leaf-col": N.value,
|
|
238
239
|
onClick: U
|
|
239
|
-
}), [
|
|
240
|
-
const
|
|
240
|
+
}), [F]);
|
|
241
|
+
const ve = e.allCheckedState?.() ?? "none", Ne = F ? i("span", {
|
|
241
242
|
class: e.vtgClass?.("ml-2")
|
|
242
|
-
}, [
|
|
243
|
+
}, [F]) : null;
|
|
243
244
|
return i("th", $(_.value, {
|
|
244
|
-
class:
|
|
245
|
-
style:
|
|
245
|
+
class: fe,
|
|
246
|
+
style: de,
|
|
246
247
|
colspan: l,
|
|
247
248
|
rowspan: r,
|
|
248
|
-
"data-vtg-leaf-col":
|
|
249
|
+
"data-vtg-leaf-col": N.value,
|
|
249
250
|
onClick: U
|
|
250
|
-
}), [
|
|
251
|
+
}), [ce ? F : i("span", {
|
|
251
252
|
class: C(e.vtgClass?.("inline-flex items-center justify-center relative"), e.compatClass?.("selection"))
|
|
252
253
|
}, [i(ol, {
|
|
253
|
-
checked:
|
|
254
|
-
indeterminate:
|
|
254
|
+
checked: ve === "all",
|
|
255
|
+
indeterminate: ve === "partial",
|
|
255
256
|
onChange: (w) => e.toggleAll?.(w)
|
|
256
257
|
}, null), Ne, X && i("span", {
|
|
257
|
-
ref:
|
|
258
|
+
ref: D,
|
|
258
259
|
class: C(e.subThemeSlots?.selectionExtra(), e.vtgClass?.("absolute left-full top-1/2 -translate-y-1/2")),
|
|
259
260
|
onMouseenter: xe,
|
|
260
|
-
onMouseleave:
|
|
261
|
+
onMouseleave: ae,
|
|
261
262
|
role: "button",
|
|
262
263
|
"aria-label": "Selection options"
|
|
263
|
-
}, [i(je, null, null)])]), !
|
|
264
|
+
}, [i(je, null, null)])]), !ce && X && i(nl, {
|
|
264
265
|
items: Y,
|
|
266
|
+
anchorElement: D.value,
|
|
265
267
|
anchorRect: Te(),
|
|
266
|
-
popupContainer: Q(e,
|
|
267
|
-
visible:
|
|
268
|
-
onClose:
|
|
268
|
+
popupContainer: Q(e, D.value),
|
|
269
|
+
visible: O.value,
|
|
270
|
+
onClose: Ie,
|
|
269
271
|
onMouseenter: De,
|
|
270
|
-
onMouseleave:
|
|
272
|
+
onMouseleave: ae
|
|
271
273
|
}, null)]);
|
|
272
274
|
}
|
|
273
|
-
const u = e.locale?.value, g = y.value === null ? u?.header.sortTriggerAsc ?? "点击升序" : y.value === "ascend" ? u?.header.sortTriggerDesc ?? "点击降序" : u?.header.cancelSort ?? "取消排序", s = o.value,
|
|
274
|
-
class:
|
|
275
|
+
const u = e.locale?.value, g = y.value === null ? u?.header.sortTriggerAsc ?? "点击升序" : y.value === "ascend" ? u?.header.sortTriggerDesc ?? "点击降序" : u?.header.cancelSort ?? "取消排序", s = o.value, I = e.subThemeSlots?.sortAreaWrapper(), A = e.subThemeSlots?.sortAreaTitle(), p = i("span", {
|
|
276
|
+
class: I
|
|
275
277
|
}, [i("span", {
|
|
276
|
-
class: C(A,
|
|
277
|
-
}, [_e.value]),
|
|
278
|
+
class: C(A, re.value && e.vtgClass?.("block min-w-0 overflow-hidden text-ellipsis whitespace-nowrap"))
|
|
279
|
+
}, [_e.value]), E.value && i(el, {
|
|
278
280
|
sortOrder: y.value
|
|
279
|
-
}, null)]),
|
|
280
|
-
class:
|
|
281
|
+
}, null)]), ie = e.subThemeSlots?.sortAreaOuter(), Ee = M.value ? i("span", {
|
|
282
|
+
class: ie
|
|
281
283
|
}, [i(We, {
|
|
282
284
|
block: !0,
|
|
283
285
|
title: g,
|
|
284
286
|
placement: "top",
|
|
285
|
-
open:
|
|
287
|
+
open: Ae.value
|
|
286
288
|
}, al(p) ? p : {
|
|
287
289
|
default: () => [p]
|
|
288
290
|
})]) : i("span", {
|
|
289
|
-
class:
|
|
290
|
-
}, [p]),
|
|
291
|
+
class: ie
|
|
292
|
+
}, [p]), Me = s && (s.filterIcon ? i("span", {
|
|
291
293
|
class: C(e.subThemeSlots?.filterIconWrapper(), e.subThemeSlots?.filterIcon(), h.value && e.compatClass && "active"),
|
|
292
294
|
ref: m,
|
|
293
295
|
onMouseenter: q,
|
|
@@ -338,8 +340,8 @@ const Il = /* @__PURE__ */ Re({
|
|
|
338
340
|
filters: s.filters ?? [],
|
|
339
341
|
visible: T.value,
|
|
340
342
|
close: () => v(!1)
|
|
341
|
-
},
|
|
342
|
-
const n = typeof s.filterDropdown == "function" ? s.filterDropdown(G) : s.filterDropdown ?? (
|
|
343
|
+
}, ue = s?.customFilterDropdown ? e.customFilterDropdown : void 0, ke = s && G && (() => {
|
|
344
|
+
const n = typeof s.filterDropdown == "function" ? s.filterDropdown(G) : s.filterDropdown ?? (ue ? ue(G) : null);
|
|
343
345
|
if (n) {
|
|
344
346
|
const S = Q(e, m.value);
|
|
345
347
|
return i(Ke, {
|
|
@@ -363,8 +365,8 @@ const Il = /* @__PURE__ */ Re({
|
|
|
363
365
|
expandedKeys: te.value,
|
|
364
366
|
visible: T.value,
|
|
365
367
|
onConfirm: B,
|
|
366
|
-
onReset:
|
|
367
|
-
onClose:
|
|
368
|
+
onReset: Ce,
|
|
369
|
+
onClose: ge,
|
|
368
370
|
"onUpdate:expandedKeys": (S) => {
|
|
369
371
|
te.value = S;
|
|
370
372
|
}
|
|
@@ -372,23 +374,23 @@ const Il = /* @__PURE__ */ Re({
|
|
|
372
374
|
})();
|
|
373
375
|
return i("th", $(_.value, {
|
|
374
376
|
class: ye.value,
|
|
375
|
-
style:
|
|
377
|
+
style: se.value,
|
|
376
378
|
colspan: l,
|
|
377
379
|
rowspan: r,
|
|
378
|
-
"data-vtg-leaf-col":
|
|
380
|
+
"data-vtg-leaf-col": N.value,
|
|
379
381
|
onClick: U,
|
|
380
382
|
onMouseenter: Fe,
|
|
381
383
|
onMouseleave: Le,
|
|
382
384
|
"aria-sort": o.value ? il(y.value) : void 0
|
|
383
385
|
}), [i("span", {
|
|
384
|
-
class: C(e.vtgClass?.("flex items-center"), t.headerCellInnerClass,
|
|
385
|
-
}, [
|
|
386
|
+
class: C(e.vtgClass?.("flex items-center"), t.headerCellInnerClass, k.value && e.compatClass?.("filter-column"))
|
|
387
|
+
}, [Ee, k.value && Me]), k.value && ke, o.value?.resizable && i(rl, {
|
|
386
388
|
column: o.value,
|
|
387
|
-
colIndex: t.cell.
|
|
389
|
+
colIndex: t.cell.leafIndex
|
|
388
390
|
}, null)]);
|
|
389
391
|
};
|
|
390
392
|
}
|
|
391
393
|
});
|
|
392
394
|
export {
|
|
393
|
-
|
|
395
|
+
Al as default
|
|
394
396
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { PropType, SlotsType, VNodeChild } from 'vue';
|
|
2
|
+
import { VTableGuildPaginationLocale } from '../../../core/src/index.ts';
|
|
3
|
+
import { PaginationItemType, TablePaginationConfig, TablePaginationSlotProps, TablePaginationState } from '../types/pagination';
|
|
4
|
+
/** Bounded page window, even for millions of pages. */
|
|
5
|
+
export declare function paginationItems(current: number, pages: number, less: boolean): Array<{
|
|
6
|
+
page: number;
|
|
7
|
+
type: PaginationItemType;
|
|
8
|
+
}>;
|
|
9
|
+
/** Element Plus keeps pagerCount numeric pages at the edges, and pagerCount - 2 in the middle. */
|
|
10
|
+
export declare function elementPlusPaginationItems(current: number, pages: number, count?: number): {
|
|
11
|
+
page: number;
|
|
12
|
+
type: PaginationItemType;
|
|
13
|
+
}[];
|
|
14
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
15
|
+
config: {
|
|
16
|
+
type: PropType<TablePaginationConfig>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
state: {
|
|
20
|
+
type: PropType<TablePaginationState>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
locale: {
|
|
24
|
+
type: PropType<VTableGuildPaginationLocale>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
align: {
|
|
28
|
+
type: PropType<"left" | "center" | "right">;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
position: {
|
|
32
|
+
type: PropType<TablePaginationSlotProps["position"]>;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
tableSize: PropType<"large" | "middle" | "small">;
|
|
36
|
+
narrow: BooleanConstructor;
|
|
37
|
+
getPopupContainer: PropType<(trigger: HTMLElement) => HTMLElement>;
|
|
38
|
+
}>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
39
|
+
change: (_page: number, _pageSize?: number) => true;
|
|
40
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
41
|
+
config: {
|
|
42
|
+
type: PropType<TablePaginationConfig>;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
state: {
|
|
46
|
+
type: PropType<TablePaginationState>;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
locale: {
|
|
50
|
+
type: PropType<VTableGuildPaginationLocale>;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
53
|
+
align: {
|
|
54
|
+
type: PropType<"left" | "center" | "right">;
|
|
55
|
+
default: string;
|
|
56
|
+
};
|
|
57
|
+
position: {
|
|
58
|
+
type: PropType<TablePaginationSlotProps["position"]>;
|
|
59
|
+
default: string;
|
|
60
|
+
};
|
|
61
|
+
tableSize: PropType<"large" | "middle" | "small">;
|
|
62
|
+
narrow: BooleanConstructor;
|
|
63
|
+
getPopupContainer: PropType<(trigger: HTMLElement) => HTMLElement>;
|
|
64
|
+
}>> & Readonly<{
|
|
65
|
+
onChange?: ((_page: number, _pageSize?: number | undefined) => any) | undefined;
|
|
66
|
+
}>, {
|
|
67
|
+
position: "topLeft" | "topCenter" | "topRight" | "bottomLeft" | "bottomCenter" | "bottomRight";
|
|
68
|
+
align: "left" | "right" | "center";
|
|
69
|
+
narrow: boolean;
|
|
70
|
+
}, SlotsType<{
|
|
71
|
+
paginationItem?: (props: TablePaginationSlotProps) => VNodeChild;
|
|
72
|
+
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
73
|
+
export default _default;
|
|
74
|
+
//# sourceMappingURL=TablePagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TablePagination.d.ts","sourceRoot":"","sources":["../../../../../table/src/components/TablePagination.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,QAAQ,EACb,KAAK,SAAS,EAEd,KAAK,UAAU,EAChB,MAAM,KAAK,CAAA;AACZ,OAAO,EAKL,KAAK,2BAA2B,EACjC,MAAM,oBAAoB,CAAA;AAO3B,OAAO,KAAK,EACV,kBAAkB,EAElB,qBAAqB,EAErB,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,qBAAqB,CAAA;AAa5B,uDAAuD;AACvD,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,OAAO,GACZ,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAC,CAenD;AAED,kGAAkG;AAClG,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,SAAI;UAMtD,MAAM;UAAQ,kBAAkB;IAM7D;;;cAK6B,QAAQ,CAAC,qBAAqB,CAAC;;;;cAChC,QAAQ,CAAC,oBAAoB,CAAC;;;;cAC7B,QAAQ,CAAC,2BAA2B,CAAC;;;;cACtC,QAAQ,CAAC,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;;;;cAE5C,QAAQ,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;;;eAG3C,QAAQ,CAAC,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;;uBAE5B,QAAQ,CAAC,CAAC,OAAO,EAAE,WAAW,KAAK,WAAW,CAAC;;oBAEvD,MAAM,cAAc,MAAM;;;cAZvB,QAAQ,CAAC,qBAAqB,CAAC;;;;cAChC,QAAQ,CAAC,oBAAoB,CAAC;;;;cAC7B,QAAQ,CAAC,2BAA2B,CAAC;;;;cACtC,QAAQ,CAAC,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;;;;cAE5C,QAAQ,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;;;eAG3C,QAAQ,CAAC,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;;uBAE5B,QAAQ,CAAC,CAAC,OAAO,EAAE,WAAW,KAAK,WAAW,CAAC;;;;;;;;qBAI7D,CAAC,KAAK,EAAE,wBAAwB,KAAK,UAAU;;AAjBpE,wBA0eE"}
|