vft 0.0.123 → 0.0.125
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/es/components/table/field.js +76 -75
- package/es/components/table/table.vue2.js +67 -67
- package/es/package.json.js +1 -1
- package/lib/components/table/field.cjs +1 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/package.json +5 -5
- package/web-types.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createVNode as e, Fragment as
|
|
2
|
-
import { formatToDateTime as
|
|
1
|
+
import { createVNode as e, Fragment as c, isVNode as D } from "vue";
|
|
2
|
+
import { formatToDateTime as f } from "@vft/utils";
|
|
3
3
|
import "../divider/index.js";
|
|
4
4
|
import "../icon/index.js";
|
|
5
5
|
import "../avatar/index.js";
|
|
@@ -28,7 +28,7 @@ import "../image/index.js";
|
|
|
28
28
|
import "../input/index.js";
|
|
29
29
|
import "../link/index.js";
|
|
30
30
|
import "../pagination/index.js";
|
|
31
|
-
import { VftTag as
|
|
31
|
+
import { VftTag as s } from "../tag/index.js";
|
|
32
32
|
import "../side-menu/index.js";
|
|
33
33
|
import "../qrcode/index.js";
|
|
34
34
|
import "../overlay/index.js";
|
|
@@ -38,7 +38,7 @@ import "../page-wrapper/index.js";
|
|
|
38
38
|
import "../exception/index.js";
|
|
39
39
|
import "../search/index.js";
|
|
40
40
|
import "../form/index.js";
|
|
41
|
-
import { VftButton as
|
|
41
|
+
import { VftButton as u } from "../button/index.js";
|
|
42
42
|
import "../checkbox/index.js";
|
|
43
43
|
import "../radio/index.js";
|
|
44
44
|
import "../switch/index.js";
|
|
@@ -67,7 +67,7 @@ import "../tree/index.js";
|
|
|
67
67
|
import "../skeleton/index.js";
|
|
68
68
|
import "../space/index.js";
|
|
69
69
|
import "../card/index.js";
|
|
70
|
-
import { VftPopconfirm as
|
|
70
|
+
import { VftPopconfirm as d } from "../popconfirm/index.js";
|
|
71
71
|
import "../alert/index.js";
|
|
72
72
|
import "../drawer/index.js";
|
|
73
73
|
import "../input-number/index.js";
|
|
@@ -90,88 +90,89 @@ import "lodash";
|
|
|
90
90
|
import "../../hooks/use-z-index/index.js";
|
|
91
91
|
import "@vueuse/core";
|
|
92
92
|
import "../../utils/ns-cover.js";
|
|
93
|
-
function
|
|
94
|
-
return typeof
|
|
93
|
+
function l(t) {
|
|
94
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !D(t);
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const to = {
|
|
97
97
|
type: "seq",
|
|
98
98
|
title: "序号",
|
|
99
99
|
minWidth: 70,
|
|
100
100
|
fixed: "left"
|
|
101
|
-
},
|
|
101
|
+
}, oo = {
|
|
102
102
|
field: "id",
|
|
103
103
|
title: "Id",
|
|
104
104
|
minWidth: 100
|
|
105
|
-
},
|
|
105
|
+
}, io = {
|
|
106
106
|
field: "name",
|
|
107
107
|
title: "名称",
|
|
108
108
|
minWidth: 100
|
|
109
|
-
},
|
|
110
|
-
format:
|
|
111
|
-
field:
|
|
112
|
-
title:
|
|
109
|
+
}, ro = ({
|
|
110
|
+
format: t = "YYYY-MM-DD",
|
|
111
|
+
field: o = "date",
|
|
112
|
+
title: r = "时间"
|
|
113
113
|
} = {}) => ({
|
|
114
114
|
minWidth: 100,
|
|
115
|
-
field:
|
|
116
|
-
title:
|
|
115
|
+
field: o,
|
|
116
|
+
title: r,
|
|
117
117
|
formatter: ({
|
|
118
|
-
row:
|
|
119
|
-
}) =>
|
|
120
|
-
}),
|
|
121
|
-
format:
|
|
122
|
-
field:
|
|
123
|
-
title:
|
|
118
|
+
row: i
|
|
119
|
+
}) => i[o] ? f(i[o], t) : "-"
|
|
120
|
+
}), a = ({
|
|
121
|
+
format: t = "YYYY-MM-DD HH:mm:ss",
|
|
122
|
+
field: o = "date",
|
|
123
|
+
title: r = "时间"
|
|
124
124
|
} = {}) => ({
|
|
125
125
|
minWidth: 170,
|
|
126
|
-
field:
|
|
127
|
-
title:
|
|
126
|
+
field: o,
|
|
127
|
+
title: r,
|
|
128
128
|
formatter: ({
|
|
129
|
-
row:
|
|
130
|
-
}) =>
|
|
131
|
-
}), ro = ({
|
|
132
|
-
format: o = "YYYY-MM-DD HH:mm:ss",
|
|
133
|
-
field: t = "createTime",
|
|
134
|
-
title: i = "创建时间"
|
|
135
|
-
} = {}) => f({
|
|
136
|
-
format: o,
|
|
137
|
-
field: t,
|
|
138
|
-
title: i
|
|
129
|
+
row: i
|
|
130
|
+
}) => i[o] ? f(i[o], t) : "-"
|
|
139
131
|
}), mo = ({
|
|
140
|
-
format:
|
|
141
|
-
field:
|
|
142
|
-
title:
|
|
143
|
-
} = {}) =>
|
|
144
|
-
format:
|
|
145
|
-
field:
|
|
146
|
-
title:
|
|
132
|
+
format: t = "YYYY-MM-DD HH:mm:ss",
|
|
133
|
+
field: o = "createTime",
|
|
134
|
+
title: r = "创建时间"
|
|
135
|
+
} = {}) => a({
|
|
136
|
+
format: t,
|
|
137
|
+
field: o,
|
|
138
|
+
title: r
|
|
147
139
|
}), po = ({
|
|
148
|
-
|
|
149
|
-
|
|
140
|
+
format: t = "YYYY-MM-DD HH:mm:ss",
|
|
141
|
+
field: o = "updateTime",
|
|
142
|
+
title: r = "更新时间"
|
|
143
|
+
} = {}) => a({
|
|
144
|
+
format: t,
|
|
145
|
+
field: o,
|
|
146
|
+
title: r
|
|
147
|
+
}), eo = ({
|
|
148
|
+
field: t = "status",
|
|
149
|
+
title: o = "状态",
|
|
150
|
+
normalText: r = "正常",
|
|
150
151
|
disabledText: i = "禁用",
|
|
151
|
-
strToNumber:
|
|
152
|
+
strToNumber: p = !0
|
|
152
153
|
} = {}) => ({
|
|
153
|
-
field:
|
|
154
|
-
title:
|
|
154
|
+
field: t,
|
|
155
|
+
title: o,
|
|
155
156
|
width: 100,
|
|
156
157
|
slots: {
|
|
157
158
|
default: ({
|
|
158
|
-
row:
|
|
159
|
+
row: m
|
|
159
160
|
}) => {
|
|
160
|
-
let
|
|
161
|
-
return
|
|
162
|
-
default: () => [
|
|
163
|
-
}) : e(
|
|
161
|
+
let n = m == null ? void 0 : m[t];
|
|
162
|
+
return n ? (p && Number(n) === 0 && (n = !1), n ? e(s, null, l(r) ? r : {
|
|
163
|
+
default: () => [r]
|
|
164
|
+
}) : e(s, {
|
|
164
165
|
type: "danger"
|
|
165
|
-
},
|
|
166
|
+
}, l(i) ? i : {
|
|
166
167
|
default: () => [i]
|
|
167
168
|
})) : "-";
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
|
-
}),
|
|
171
|
-
confirmText:
|
|
172
|
-
leftCallback:
|
|
173
|
-
rightCallback:
|
|
174
|
-
leftText:
|
|
171
|
+
}), no = ({
|
|
172
|
+
confirmText: t = "确认删除?",
|
|
173
|
+
leftCallback: o = (m) => console.log(m),
|
|
174
|
+
rightCallback: r = (m) => console.log(m),
|
|
175
|
+
leftText: i = "编辑",
|
|
175
176
|
rightText: p = "删除"
|
|
176
177
|
} = {}) => ({
|
|
177
178
|
title: "操作栏",
|
|
@@ -180,34 +181,34 @@ const xt = {
|
|
|
180
181
|
slots: {
|
|
181
182
|
default: ({
|
|
182
183
|
row: m
|
|
183
|
-
}) => e(
|
|
184
|
+
}) => e(c, null, [i ? e(u, {
|
|
184
185
|
size: "small",
|
|
185
186
|
type: "primary",
|
|
186
|
-
onClick: () =>
|
|
187
|
-
},
|
|
188
|
-
default: () => [
|
|
189
|
-
}) : null, p ? e(
|
|
187
|
+
onClick: () => o(m)
|
|
188
|
+
}, l(i) ? i : {
|
|
189
|
+
default: () => [i]
|
|
190
|
+
}) : null, p ? e(d, {
|
|
190
191
|
width: "150",
|
|
191
|
-
onConfirm: () =>
|
|
192
|
-
title:
|
|
192
|
+
onConfirm: () => r(m),
|
|
193
|
+
title: t
|
|
193
194
|
}, {
|
|
194
|
-
reference: () => e(
|
|
195
|
+
reference: () => e(u, {
|
|
195
196
|
size: "small",
|
|
196
197
|
type: "danger"
|
|
197
|
-
},
|
|
198
|
+
}, l(p) ? p : {
|
|
198
199
|
default: () => [p]
|
|
199
200
|
})
|
|
200
201
|
}) : null])
|
|
201
202
|
}
|
|
202
203
|
});
|
|
203
204
|
export {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
205
|
+
no as ACTION_FIELD,
|
|
206
|
+
mo as CREATE_TIME_FIELD,
|
|
207
|
+
ro as DATE_FIELD,
|
|
208
|
+
a as DATE_TIME_FIELD,
|
|
209
|
+
oo as ID_FIELD,
|
|
210
|
+
io as NAME_FIELD,
|
|
211
|
+
to as SEQ_FIELD,
|
|
212
|
+
eo as STATUS_FIELD,
|
|
213
|
+
po as UPDATE_TIME_FIELD
|
|
213
214
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VftEmpty as
|
|
3
|
-
import { VftPagination as
|
|
4
|
-
import { useNamespace as
|
|
1
|
+
import { defineComponent as $, useAttrs as K, ref as i, computed as f, watch as v, reactive as Q, onMounted as Z, resolveComponent as _, openBlock as y, createElementBlock as ee, normalizeClass as C, unref as l, createBlock as R, mergeProps as b, createCommentVNode as O, createVNode as W, createSlots as te, withCtx as S, withDirectives as I, createElementVNode as w, vShow as ae } from "vue";
|
|
2
|
+
import { VftEmpty as ne } from "../empty/index.js";
|
|
3
|
+
import { VftPagination as q } from "../pagination/index.js";
|
|
4
|
+
import { useNamespace as le } from "../../hooks/use-namespace/index.js";
|
|
5
5
|
import "@popperjs/core";
|
|
6
6
|
import "lodash";
|
|
7
7
|
import "../../hooks/use-z-index/index.js";
|
|
8
|
-
import { useDebounceFn as
|
|
9
|
-
import { isNullOrUndefined as
|
|
8
|
+
import { useDebounceFn as oe, useResizeObserver as re } from "@vueuse/core";
|
|
9
|
+
import { isNullOrUndefined as ie } from "@vft/utils";
|
|
10
10
|
import "../../utils/ns-cover.js";
|
|
11
11
|
import "../icon/index.js";
|
|
12
|
-
import { vLoading as
|
|
13
|
-
import { EmptyEnum as
|
|
14
|
-
const
|
|
12
|
+
import { vLoading as se } from "../loading/directive.js";
|
|
13
|
+
import { EmptyEnum as ue } from "../empty/constants.js";
|
|
14
|
+
const ce = {
|
|
15
15
|
style: {
|
|
16
16
|
"min-height": "500px"
|
|
17
17
|
}
|
|
18
18
|
}, s = (
|
|
19
19
|
/* hoist-static*/
|
|
20
|
-
|
|
21
|
-
),
|
|
20
|
+
le("table")
|
|
21
|
+
), ge = $({
|
|
22
22
|
name: "vft-table"
|
|
23
|
-
}),
|
|
24
|
-
...
|
|
23
|
+
}), Ne = /* @__PURE__ */ $({
|
|
24
|
+
...ge,
|
|
25
25
|
props: {
|
|
26
26
|
maxHeight: {},
|
|
27
27
|
columns: {},
|
|
@@ -60,30 +60,30 @@ const ue = {
|
|
|
60
60
|
},
|
|
61
61
|
emits: ["page-change", "size-change", "sort-change", "update:page-num", "update:page-size"],
|
|
62
62
|
setup(a, {
|
|
63
|
-
expose:
|
|
63
|
+
expose: A,
|
|
64
64
|
emit: u
|
|
65
65
|
}) {
|
|
66
|
-
const
|
|
66
|
+
const V = K(), D = i(0), r = i(), T = oe(() => G(), 120), k = f(() => a.pagePlacement.startsWith("bottom")), z = f(() => a.pageSize >= a.total), j = f(() => a.columns.map((e) => (e.align || (e.align = "center"), !e.formatter && !e.slots && !e.cellRender && (e.formatter = ({
|
|
67
67
|
cellValue: t
|
|
68
|
-
}) =>
|
|
68
|
+
}) => ie(t) || t === "" ? "-" : t), e)));
|
|
69
69
|
v([() => a.loading, () => a.data, () => a.columns], () => {
|
|
70
|
-
|
|
70
|
+
T();
|
|
71
71
|
}, {
|
|
72
72
|
immediate: !0
|
|
73
73
|
});
|
|
74
|
-
function
|
|
75
|
-
d.data = a.data,
|
|
74
|
+
function G() {
|
|
75
|
+
d.data = a.data, N(a.pageNum);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function F(e) {
|
|
78
78
|
u("page-change", e), u("update:page-num", e);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function M(e) {
|
|
81
81
|
u("size-change", e), u("update:page-size", e);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const U = () => ({
|
|
84
84
|
maxHeight: "88px",
|
|
85
85
|
height: "44px"
|
|
86
|
-
}),
|
|
86
|
+
}), X = (e) => {
|
|
87
87
|
var n;
|
|
88
88
|
const {
|
|
89
89
|
column: t
|
|
@@ -91,7 +91,7 @@ const ue = {
|
|
|
91
91
|
return {
|
|
92
92
|
maxHeight: ((n = t == null ? void 0 : t.cellRender) == null ? void 0 : n.name) === "Clamp" ? "max-content" : "44px"
|
|
93
93
|
};
|
|
94
|
-
}, d =
|
|
94
|
+
}, d = Q({
|
|
95
95
|
autoResize: !0,
|
|
96
96
|
sortConfig: {
|
|
97
97
|
trigger: "cell",
|
|
@@ -104,12 +104,12 @@ const ue = {
|
|
|
104
104
|
orders: ["desc", "asc", null]
|
|
105
105
|
},
|
|
106
106
|
seqConfig: {
|
|
107
|
-
startIndex:
|
|
107
|
+
startIndex: D.value
|
|
108
108
|
},
|
|
109
109
|
cellClassName: "cellClass",
|
|
110
110
|
rowClassName: "rowClass",
|
|
111
|
-
cellStyle:
|
|
112
|
-
rowStyle:
|
|
111
|
+
cellStyle: X,
|
|
112
|
+
rowStyle: U,
|
|
113
113
|
headerRowClassName: "headerRowClass",
|
|
114
114
|
headerAlign: "center",
|
|
115
115
|
columnConfig: {
|
|
@@ -126,47 +126,47 @@ const ue = {
|
|
|
126
126
|
enabled: !1
|
|
127
127
|
},
|
|
128
128
|
...a.tableConfig,
|
|
129
|
-
...
|
|
130
|
-
}),
|
|
129
|
+
...V
|
|
130
|
+
}), Y = (e) => {
|
|
131
131
|
u("sort-change", e);
|
|
132
132
|
};
|
|
133
133
|
v(() => a.pageNum, (e) => {
|
|
134
|
-
|
|
134
|
+
N(e);
|
|
135
135
|
});
|
|
136
|
-
const
|
|
136
|
+
const N = (e) => {
|
|
137
137
|
d.seqConfig && (d.seqConfig.startIndex = (e - 1) * a.pageSize);
|
|
138
|
-
}, c = i(),
|
|
138
|
+
}, c = i(), B = i();
|
|
139
139
|
let p = i(!1), o = i(null), m = i(null);
|
|
140
|
-
const g =
|
|
140
|
+
const g = f(() => {
|
|
141
141
|
var e;
|
|
142
142
|
return ((e = a.sticky) == null ? void 0 : e.getContainer) || document.documentElement || document.body;
|
|
143
143
|
});
|
|
144
144
|
v(() => [r, a.sticky], () => {
|
|
145
145
|
var e, t, n;
|
|
146
|
-
(e = r.value) != null && e.$el && a.sticky && ((t = g.value) == null || t.removeEventListener("scroll",
|
|
147
|
-
|
|
146
|
+
(e = r.value) != null && e.$el && a.sticky && ((t = g.value) == null || t.removeEventListener("scroll", h), (n = g.value) == null || n.addEventListener("scroll", h), setTimeout(() => {
|
|
147
|
+
P();
|
|
148
148
|
}, 50));
|
|
149
149
|
}, {
|
|
150
150
|
immediate: !0,
|
|
151
151
|
deep: !0
|
|
152
152
|
});
|
|
153
|
-
function
|
|
154
|
-
if (!o.value || !m.value || (
|
|
153
|
+
function P() {
|
|
154
|
+
if (!o.value || !m.value || (h(), !p.value))
|
|
155
155
|
return;
|
|
156
156
|
const e = o.value.clientWidth, t = m.value.offsetWidth;
|
|
157
|
-
c.value.style.width = e - 1 + "px",
|
|
157
|
+
c.value.style.width = e - 1 + "px", B.value.style.width = t + "px";
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
var
|
|
161
|
-
if (!((
|
|
159
|
+
function h() {
|
|
160
|
+
var L, x, H;
|
|
161
|
+
if (!((L = r.value) != null && L.$el) || !o.value || !g.value)
|
|
162
162
|
return;
|
|
163
|
-
const e = ((
|
|
163
|
+
const e = ((x = g.value) == null ? void 0 : x.clientHeight) || window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, {
|
|
164
164
|
top: t,
|
|
165
165
|
bottom: n
|
|
166
|
-
} = o.value.getBoundingClientRect(),
|
|
167
|
-
p.value = t < e && n > e && n -
|
|
166
|
+
} = o.value.getBoundingClientRect(), E = ((H = g.value) == null ? void 0 : H.getBoundingClientRect().top) || document.body.getBoundingClientRect().top;
|
|
167
|
+
p.value = t < e && n > e && n - E > e, c.value.scrollLeft = o.value.scrollLeft;
|
|
168
168
|
}
|
|
169
|
-
const
|
|
169
|
+
const J = () => {
|
|
170
170
|
var t;
|
|
171
171
|
const e = (t = r.value) == null ? void 0 : t.$el;
|
|
172
172
|
e && (o.value = e.querySelector(".vxe-table--body-wrapper"), m.value = e.querySelector(".vxe-table--body"), !(!o.value && !m.value) && (o.value.addEventListener("scroll", function(n) {
|
|
@@ -175,67 +175,67 @@ const ue = {
|
|
|
175
175
|
o.value.scrollLeft = n.target.scrollLeft;
|
|
176
176
|
})));
|
|
177
177
|
};
|
|
178
|
-
return
|
|
179
|
-
a.sticky && (
|
|
180
|
-
}),
|
|
178
|
+
return Z(() => {
|
|
179
|
+
a.sticky && (J(), re(r, () => P()));
|
|
180
|
+
}), A({
|
|
181
181
|
table: r
|
|
182
182
|
}), (e, t) => {
|
|
183
|
-
const n =
|
|
184
|
-
return y(),
|
|
183
|
+
const n = _("vxe-grid");
|
|
184
|
+
return y(), ee("div", {
|
|
185
185
|
class: C(l(s).b())
|
|
186
|
-
}, [e.showPager && !k.value ? (y(),
|
|
186
|
+
}, [e.showPager && !z.value && !k.value ? (y(), R(l(q), b({
|
|
187
187
|
key: 0,
|
|
188
188
|
class: [l(s).e("pager"), l(s).m("pager-" + e.pagePlacement)],
|
|
189
189
|
layout: "prev, pager, next"
|
|
190
190
|
}, e.pageOptions, {
|
|
191
191
|
total: e.total,
|
|
192
192
|
"page-size": e.pageSize,
|
|
193
|
-
onCurrentChange: t[0] || (t[0] = (
|
|
193
|
+
onCurrentChange: t[0] || (t[0] = (E) => u("page-change", e.pageNum)),
|
|
194
194
|
"current-page": e.pageNum
|
|
195
|
-
}), null, 16, ["class", "total", "page-size", "current-page"])) :
|
|
195
|
+
}), null, 16, ["class", "total", "page-size", "current-page"])) : O("", !0), W(n, b({
|
|
196
196
|
ref_key: "xGrid",
|
|
197
197
|
ref: r
|
|
198
198
|
}, d, {
|
|
199
199
|
height: e.height,
|
|
200
200
|
"max-height": e.maxHeight,
|
|
201
|
-
columns:
|
|
201
|
+
columns: j.value,
|
|
202
202
|
data: e.data,
|
|
203
203
|
"auto-resize": "",
|
|
204
204
|
loading: e.loading,
|
|
205
205
|
resizable: "",
|
|
206
|
-
onSortChange:
|
|
207
|
-
}),
|
|
208
|
-
empty: S(() => [
|
|
209
|
-
type: l(
|
|
206
|
+
onSortChange: Y
|
|
207
|
+
}), te({
|
|
208
|
+
empty: S(() => [W(l(ne), {
|
|
209
|
+
type: l(ue).NO_DATA
|
|
210
210
|
}, null, 8, ["type"])]),
|
|
211
|
-
loading: S(() => [
|
|
211
|
+
loading: S(() => [I(w("div", ce, null, 512), [[l(se), e.loading]])]),
|
|
212
212
|
_: 2
|
|
213
213
|
}, [e.sticky ? {
|
|
214
214
|
name: "bottom",
|
|
215
|
-
fn: S(() => [
|
|
215
|
+
fn: S(() => [I(w("div", {
|
|
216
216
|
ref_key: "stickyScroll",
|
|
217
217
|
ref: c,
|
|
218
218
|
class: C(l(s).e("sticky-scroll-warpper"))
|
|
219
219
|
}, [w("div", {
|
|
220
220
|
ref_key: "stickyScrollBar",
|
|
221
|
-
ref:
|
|
221
|
+
ref: B,
|
|
222
222
|
class: C(l(s).e("sticky-scroll-bar"))
|
|
223
|
-
}, null, 2)], 2), [[
|
|
223
|
+
}, null, 2)], 2), [[ae, l(p)]])]),
|
|
224
224
|
key: "0"
|
|
225
|
-
} : void 0]), 1040, ["height", "max-height", "columns", "data", "loading"]), e.showPager && k.value ? (y(),
|
|
225
|
+
} : void 0]), 1040, ["height", "max-height", "columns", "data", "loading"]), e.showPager && !z.value && k.value ? (y(), R(l(q), b({
|
|
226
226
|
key: 1,
|
|
227
227
|
class: [l(s).e("pager"), l(s).m("pager-" + e.pagePlacement)],
|
|
228
228
|
layout: "prev, pager, next, jumper"
|
|
229
229
|
}, e.pageOptions, {
|
|
230
230
|
total: e.total,
|
|
231
231
|
"page-size": e.pageSize,
|
|
232
|
-
onCurrentChange:
|
|
233
|
-
onSizeChange:
|
|
232
|
+
onCurrentChange: F,
|
|
233
|
+
onSizeChange: M,
|
|
234
234
|
"current-page": e.pageNum
|
|
235
|
-
}), null, 16, ["class", "total", "page-size", "current-page"])) :
|
|
235
|
+
}), null, 16, ["class", "total", "page-size", "current-page"])) : O("", !0)], 2);
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
239
|
export {
|
|
240
|
-
|
|
240
|
+
Ne as default
|
|
241
241
|
};
|
package/es/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),a=require("@vft/utils");require("../divider/index.cjs");require("../icon/index.cjs");require("../avatar/index.cjs");require("../empty/index.cjs");require("../result/index.cjs");require("../tabs/index.cjs");require("../popper/index.cjs");require("../collapse-transition/index.cjs");require("../tooltip/index.cjs");require("../popover/index.cjs");require("../menu/index.cjs");require("../context-menu/context-menu.vue2.cjs");require("../multiple-tabs/index.cjs");require("../header-layout/index.cjs");require("../footer-layout/index.cjs");require("../iframe-layout/index.cjs");require("../router-view-content/index.cjs");require("../logo/index.cjs");require("../backtop/index.cjs");require("../container/index.cjs");require("../config-provider/index.cjs");require("../descriptions/index.cjs");require("../full-screen/index.cjs");require("../icon-text/index.cjs");require("../image/index.cjs");require("../input/index.cjs");require("../link/index.cjs");require("../pagination/index.cjs");const D=require("../tag/index.cjs");require("../side-menu/index.cjs");require("../qrcode/index.cjs");require("../overlay/index.cjs");require("../clamp/index.cjs");require("../clamp-toggle/index.cjs");require("../page-wrapper/index.cjs");require("../exception/index.cjs");require("../search/index.cjs");require("../form/index.cjs");const c=require("../button/index.cjs");require("../checkbox/index.cjs");require("../radio/index.cjs");require("../switch/index.cjs");require("../color-picker/index.cjs");require("../scrollbar/index.cjs");require("../dropdown/index.cjs");require("../virtual-list/components/fixed-size-list.cjs");require("../virtual-list/components/dynamic-size-list.cjs");require("../virtual-list/components/fixed-size-grid.cjs");require("../virtual-list/components/dynamic-size-grid.cjs");require("../virtual-list/props.cjs");require("../select/index.cjs");require("../verify-code/index.cjs");require("./index.cjs");require("../image-viewer/index.cjs");require("../list-cell/index.cjs");require("../dialog/index.cjs");require("../date-time-select/index.cjs");require("../col/index.cjs");require("../row/index.cjs");require("../horizontal-menu/index.cjs");require("../time-picker/index.cjs");require("../date-picker/index.cjs");require("../check-tag/index.cjs");require("../tree/index.cjs");require("../skeleton/index.cjs");require("../space/index.cjs");require("../card/index.cjs");const l=require("../popconfirm/index.cjs");require("../alert/index.cjs");require("../drawer/index.cjs");require("../input-number/index.cjs");require("../slider/index.cjs");require("../autocomplete/index.cjs");require("../super-form/index.cjs");require("../progress/index.cjs");require("../upload/index.cjs");require("../modal/index.cjs");require("../md-container/index.cjs");require("../md-comment/index.cjs");require("../md-tabs/index.cjs");require("../md-vue-playground/index.cjs");require("../md-code-demo/index.cjs");require("../md-code-tabs/index.cjs");require("../message/index.cjs");require("../config-provider/hooks/use-global-config.cjs");require("@popperjs/core");require("lodash");require("../../hooks/use-z-index/index.cjs");require("@vueuse/core");require("../../utils/ns-cover.cjs");function E(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!t.isVNode(e)}const d={type:"seq",title:"序号",minWidth:70,fixed:"left"},I={field:"id",title:"Id",minWidth:100},m={field:"name",title:"名称",minWidth:100},_=({format:e="YYYY-MM-DD",field:r="date",title:u="时间"}={})=>({minWidth:100,field:r,title:u,formatter:({row:i})=>i[r]?a.formatToDateTime(i[r],e):"-"}),s=({format:e="YYYY-MM-DD HH:mm:ss",field:r="date",title:u="时间"}={})=>({minWidth:170,field:r,title:u,formatter:({row:i})=>i[r]?a.formatToDateTime(i[r],e):"-"}),f=({format:e="YYYY-MM-DD HH:mm:ss",field:r="createTime",title:u="创建时间"}={})=>s({format:e,field:r,title:u}),F=({format:e="YYYY-MM-DD HH:mm:ss",field:r="updateTime",title:u="更新时间"}={})=>s({format:e,field:r,title:u}),T=({field:e="status",title:r="状态",normalText:u="正常",disabledText:i="禁用",strToNumber:n=!0}={})=>({field:e,title:r,width:100,slots:{default:({row:q})=>{let o=q==null?void 0:q[e];return o?(n&&Number(o)===0&&(o=!1),o?t.createVNode(D.VftTag,null,E(u)?u:{default:()=>[u]}):t.createVNode(D.VftTag,{type:"danger"},E(i)?i:{default:()=>[i]})):"-"}}}),L=({confirmText:e="确认删除?",leftCallback:r=q=>console.log(q),rightCallback:u=q=>console.log(q),leftText:i="编辑",rightText:n="删除"}={})=>({title:"操作栏",minWidth:150,fixed:"right",slots:{default:({row:q})=>t.createVNode(t.Fragment,null,[i?t.createVNode(c.VftButton,{size:"small",type:"primary",onClick:()=>r(q)},E(i)?i:{default:()=>[i]}):null,n?t.createVNode(l.VftPopconfirm,{width:"150",onConfirm:()=>u(q),title:e},{reference:()=>t.createVNode(c.VftButton,{size:"small",type:"danger"},E(n)?n:{default:()=>[n]})}):null])}});exports.ACTION_FIELD=L;exports.CREATE_TIME_FIELD=f;exports.DATE_FIELD=_;exports.DATE_TIME_FIELD=s;exports.ID_FIELD=I;exports.NAME_FIELD=m;exports.SEQ_FIELD=d;exports.STATUS_FIELD=T;exports.UPDATE_TIME_FIELD=F;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),I=require("../empty/index.cjs"),z=require("../pagination/index.cjs"),A=require("../../hooks/use-namespace/index.cjs");require("@popperjs/core");require("lodash");require("../../hooks/use-z-index/index.cjs");const N=require("@vueuse/core"),D=require("@vft/utils");require("../../utils/ns-cover.cjs");require("../icon/index.cjs");const T=require("../loading/directive.cjs"),j=require("../empty/constants.cjs"),M={style:{"min-height":"500px"}},i=A.useNamespace("table"),G=e.defineComponent({name:"vft-table"}),F=e.defineComponent({...G,props:{maxHeight:{},columns:{},data:{default:[]},loading:{type:Boolean,default:!1},height:{},pageSize:{default:50},pageNum:{default:1},total:{},defaultSort:{default:{}},tableConfig:{default:{}},sticky:{type:[Boolean,Object]},showPager:{type:Boolean,default:!0},pagePlacement:{default:"bottom-right"},pageOptions:{}},emits:["page-change","size-change","sort-change","update:page-num","update:page-size"],setup(a,{expose:q,emit:u}){const B=e.useAttrs(),P=e.ref(0),o=e.ref(),x=N.useDebounceFn(()=>L(),120),p=e.computed(()=>a.pagePlacement.startsWith("bottom")),h=e.computed(()=>a.pageSize>=a.total),E=e.computed(()=>a.columns.map(t=>(t.align||(t.align="center"),!t.formatter&&!t.slots&&!t.cellRender&&(t.formatter=({cellValue:n})=>D.isNullOrUndefined(n)||n===""?"-":n),t)));e.watch([()=>a.loading,()=>a.data,()=>a.columns],()=>{x()},{immediate:!0});function L(){d.data=a.data,v(a.pageNum)}function H(t){u("page-change",t),u("update:page-num",t)}function O(t){u("size-change",t),u("update:page-size",t)}const R=()=>({maxHeight:"88px",height:"44px"}),V=t=>{var l;const{column:n}=t;return{maxHeight:((l=n==null?void 0:n.cellRender)==null?void 0:l.name)==="Clamp"?"max-content":"44px"}},d=e.reactive({autoResize:!0,sortConfig:{trigger:"cell",remote:!0,defaultSort:{field:"",order:"desc",...a.defaultSort},orders:["desc","asc",null]},seqConfig:{startIndex:P.value},cellClassName:"cellClass",rowClassName:"rowClass",cellStyle:V,rowStyle:R,headerRowClassName:"headerRowClass",headerAlign:"center",columnConfig:{resizable:!0},rowConfig:{isHover:!0},scrollY:{mode:"wheel"},scrollX:{enabled:!1},...a.tableConfig,...B}),W=t=>{u("sort-change",t)};e.watch(()=>a.pageNum,t=>{v(t)});const v=t=>{d.seqConfig&&(d.seqConfig.startIndex=(t-1)*a.pageSize)},s=e.ref(),y=e.ref();let f=e.ref(!1),r=e.ref(null),g=e.ref(null);const c=e.computed(()=>{var t;return((t=a.sticky)==null?void 0:t.getContainer)||document.documentElement||document.body});e.watch(()=>[o,a.sticky],()=>{var t,n,l;(t=o.value)!=null&&t.$el&&a.sticky&&((n=c.value)==null||n.removeEventListener("scroll",m),(l=c.value)==null||l.addEventListener("scroll",m),setTimeout(()=>{C()},50))},{immediate:!0,deep:!0});function C(){if(!r.value||!g.value||(m(),!f.value))return;const t=r.value.clientWidth,n=g.value.offsetWidth;s.value.style.width=t-1+"px",y.value.style.width=n+"px"}function m(){var S,w,k;if(!((S=o.value)!=null&&S.$el)||!r.value||!c.value)return;const t=((w=c.value)==null?void 0:w.clientHeight)||window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,{top:n,bottom:l}=r.value.getBoundingClientRect(),b=((k=c.value)==null?void 0:k.getBoundingClientRect().top)||document.body.getBoundingClientRect().top;f.value=n<t&&l>t&&l-b>t,s.value.scrollLeft=r.value.scrollLeft}const $=()=>{var n;const t=(n=o.value)==null?void 0:n.$el;t&&(r.value=t.querySelector(".vxe-table--body-wrapper"),g.value=t.querySelector(".vxe-table--body"),!(!r.value&&!g.value)&&(r.value.addEventListener("scroll",function(l){s.value.scrollLeft=l.target.scrollLeft}),s.value.addEventListener("scroll",function(l){r.value.scrollLeft=l.target.scrollLeft})))};return e.onMounted(()=>{a.sticky&&($(),N.useResizeObserver(o,()=>C()))}),q({table:o}),(t,n)=>{const l=e.resolveComponent("vxe-grid");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(i).b())},[t.showPager&&!h.value&&!p.value?(e.openBlock(),e.createBlock(e.unref(z.VftPagination),e.mergeProps({key:0,class:[e.unref(i).e("pager"),e.unref(i).m("pager-"+t.pagePlacement)],layout:"prev, pager, next"},t.pageOptions,{total:t.total,"page-size":t.pageSize,onCurrentChange:n[0]||(n[0]=b=>u("page-change",t.pageNum)),"current-page":t.pageNum}),null,16,["class","total","page-size","current-page"])):e.createCommentVNode("",!0),e.createVNode(l,e.mergeProps({ref_key:"xGrid",ref:o},d,{height:t.height,"max-height":t.maxHeight,columns:E.value,data:t.data,"auto-resize":"",loading:t.loading,resizable:"",onSortChange:W}),e.createSlots({empty:e.withCtx(()=>[e.createVNode(e.unref(I.VftEmpty),{type:e.unref(j.EmptyEnum).NO_DATA},null,8,["type"])]),loading:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",M,null,512),[[e.unref(T.vLoading),t.loading]])]),_:2},[t.sticky?{name:"bottom",fn:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"stickyScroll",ref:s,class:e.normalizeClass(e.unref(i).e("sticky-scroll-warpper"))},[e.createElementVNode("div",{ref_key:"stickyScrollBar",ref:y,class:e.normalizeClass(e.unref(i).e("sticky-scroll-bar"))},null,2)],2),[[e.vShow,e.unref(f)]])]),key:"0"}:void 0]),1040,["height","max-height","columns","data","loading"]),t.showPager&&!h.value&&p.value?(e.openBlock(),e.createBlock(e.unref(z.VftPagination),e.mergeProps({key:1,class:[e.unref(i).e("pager"),e.unref(i).m("pager-"+t.pagePlacement)],layout:"prev, pager, next, jumper"},t.pageOptions,{total:t.total,"page-size":t.pageSize,onCurrentChange:H,onSizeChange:O,"current-page":t.pageNum}),null,16,["class","total","page-size","current-page"])):e.createCommentVNode("",!0)],2)}}});exports.default=F;
|
package/lib/package.json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.125";exports.version=e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.125",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"qrcode": "1.5.3",
|
|
54
54
|
"resize-detector": "0.3.0",
|
|
55
55
|
"sortablejs": "^1.15.0",
|
|
56
|
-
"@vft/constants": "0.0.58",
|
|
57
|
-
"@vft/router": "0.0.27",
|
|
58
|
-
"@vft/utils": "0.0.42",
|
|
59
56
|
"@vft/store": "0.0.27",
|
|
57
|
+
"@vft/router": "0.0.27",
|
|
58
|
+
"@vft/constants": "0.0.58",
|
|
60
59
|
"@vft/directives": "0.0.23",
|
|
61
|
-
"@vft/use": "0.0.30"
|
|
60
|
+
"@vft/use": "0.0.30",
|
|
61
|
+
"@vft/utils": "0.0.42"
|
|
62
62
|
},
|
|
63
63
|
"vetur": {
|
|
64
64
|
"tags": "tags.json",
|