vft 0.0.120 → 0.0.122
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/super-form/super-form.vue2.js +11 -11
- package/es/components/table/field.js +76 -67
- package/es/components/table/table.vue2.js +73 -68
- package/es/package.json.js +1 -1
- package/lib/components/super-form/super-form.vue2.cjs +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 +3 -3
- package/web-types.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as W, useAttrs as nt, reactive as st, ref as n, computed as c, unref as o, watch as d, nextTick as pt, onMounted as lt, openBlock as l, createBlock as B, mergeProps as R, withKeys as ut, withCtx as h, normalizeProps as
|
|
1
|
+
import { defineComponent as W, useAttrs as nt, reactive as st, ref as n, computed as c, unref as o, watch as d, nextTick as pt, onMounted as lt, openBlock as l, createBlock as B, mergeProps as R, withKeys as ut, withCtx as h, normalizeProps as y, renderSlot as g, createElementBlock as ft, Fragment as ct, renderList as V, createSlots as j, guardReactiveProps as x, createCommentVNode as E } from "vue";
|
|
2
2
|
import { useNamespace as dt } from "../../hooks/use-namespace/index.js";
|
|
3
3
|
import "@popperjs/core";
|
|
4
4
|
import "lodash";
|
|
5
5
|
import "../../hooks/use-z-index/index.js";
|
|
6
6
|
import { useTimeoutFn as Bt, useDebounceFn as ht } from "@vueuse/core";
|
|
7
|
-
import { cloneDeep as J, pick as
|
|
7
|
+
import { cloneDeep as J, pick as yt, deepMerge as gt } from "@vft/utils";
|
|
8
8
|
import "../../utils/ns-cover.js";
|
|
9
9
|
import { FormCompEnum as bt } from "./component-map.js";
|
|
10
10
|
import vt from "./super-form-action.vue2.js";
|
|
@@ -227,7 +227,7 @@ const Ot = (
|
|
|
227
227
|
{ deep: !0 }
|
|
228
228
|
);
|
|
229
229
|
async function K(t) {
|
|
230
|
-
v.value =
|
|
230
|
+
v.value = gt(o(v) || {}, t);
|
|
231
231
|
}
|
|
232
232
|
function rt(t, i, r) {
|
|
233
233
|
a[t] = i, r && r.itemProps && !r.itemProps.autoLink && S(t).catch((O) => {
|
|
@@ -257,9 +257,9 @@ const Ot = (
|
|
|
257
257
|
scrollToField: et
|
|
258
258
|
};
|
|
259
259
|
lt(() => {
|
|
260
|
-
T(), D("register", z)
|
|
260
|
+
T(), D("register", z);
|
|
261
261
|
});
|
|
262
|
-
const mt = c(() =>
|
|
262
|
+
const mt = c(() => yt(
|
|
263
263
|
e.value,
|
|
264
264
|
[
|
|
265
265
|
"showResetButton",
|
|
@@ -299,9 +299,9 @@ const Ot = (
|
|
|
299
299
|
default: h(() => {
|
|
300
300
|
var O, G, U;
|
|
301
301
|
return [
|
|
302
|
-
(O = m.value) != null && O.length ? (l(), B(o(kt),
|
|
302
|
+
(O = m.value) != null && O.length ? (l(), B(o(kt), y(R({ key: 0 }, (G = e.value) == null ? void 0 : G.rowProps)), {
|
|
303
303
|
default: h(() => [
|
|
304
|
-
|
|
304
|
+
g(t.$slots, "formHeader"),
|
|
305
305
|
(l(!0), ft(ct, null, V(m.value, (p) => (l(), B(Ft, {
|
|
306
306
|
key: p.field,
|
|
307
307
|
tableAction: t.tableAction,
|
|
@@ -316,22 +316,22 @@ const Ot = (
|
|
|
316
316
|
V(Object.keys(t.$slots), (f) => ({
|
|
317
317
|
name: f,
|
|
318
318
|
fn: h((at) => [
|
|
319
|
-
|
|
319
|
+
g(t.$slots, f, y(x(at || {})))
|
|
320
320
|
])
|
|
321
321
|
}))
|
|
322
322
|
]), 1032, ["tableAction", "schema", "formProps", "allDefaultValues", "formModel", "updateSchema"]))), 128))
|
|
323
323
|
]),
|
|
324
324
|
_: 3
|
|
325
325
|
}, 16)) : E("", !0),
|
|
326
|
-
(U = e.value) != null && U.showActionButtonGroup ? (l(), B(vt,
|
|
326
|
+
(U = e.value) != null && U.showActionButtonGroup ? (l(), B(vt, y(R({ key: 1 }, mt.value)), j({ _: 2 }, [
|
|
327
327
|
V(["resetBefore", "submitBefore", "submitAfter"], (p) => ({
|
|
328
328
|
name: p,
|
|
329
329
|
fn: h((f) => [
|
|
330
|
-
|
|
330
|
+
g(t.$slots, p, y(x(f || {})))
|
|
331
331
|
])
|
|
332
332
|
}))
|
|
333
333
|
]), 1040)) : E("", !0),
|
|
334
|
-
|
|
334
|
+
g(t.$slots, "formFooter")
|
|
335
335
|
];
|
|
336
336
|
}),
|
|
337
337
|
_: 3
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createVNode as
|
|
2
|
-
import { formatToDateTime as
|
|
1
|
+
import { createVNode as e, Fragment as a, isVNode as c } from "vue";
|
|
2
|
+
import { formatToDateTime as u } 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 l } 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 s } 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,115 +90,124 @@ 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 n(o) {
|
|
94
|
+
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !c(o);
|
|
95
95
|
}
|
|
96
96
|
const xt = {
|
|
97
97
|
type: "seq",
|
|
98
98
|
title: "序号",
|
|
99
99
|
minWidth: 70,
|
|
100
100
|
fixed: "left"
|
|
101
|
-
},
|
|
101
|
+
}, to = {
|
|
102
102
|
field: "id",
|
|
103
103
|
title: "Id",
|
|
104
104
|
minWidth: 100
|
|
105
|
-
},
|
|
105
|
+
}, oo = {
|
|
106
106
|
field: "name",
|
|
107
107
|
title: "名称",
|
|
108
108
|
minWidth: 100
|
|
109
|
-
},
|
|
110
|
-
format:
|
|
109
|
+
}, io = ({
|
|
110
|
+
format: o = "YYYY-MM-DD",
|
|
111
111
|
field: t = "date",
|
|
112
|
-
title:
|
|
112
|
+
title: i = "时间"
|
|
113
113
|
} = {}) => ({
|
|
114
114
|
minWidth: 100,
|
|
115
115
|
field: t,
|
|
116
|
-
title:
|
|
116
|
+
title: i,
|
|
117
117
|
formatter: ({
|
|
118
|
-
row:
|
|
119
|
-
}) =>
|
|
120
|
-
}),
|
|
121
|
-
format:
|
|
118
|
+
row: r
|
|
119
|
+
}) => r[t] ? u(r[t], o) : "-"
|
|
120
|
+
}), f = ({
|
|
121
|
+
format: o = "YYYY-MM-DD HH:mm:ss",
|
|
122
122
|
field: t = "date",
|
|
123
|
-
title:
|
|
123
|
+
title: i = "时间"
|
|
124
124
|
} = {}) => ({
|
|
125
125
|
minWidth: 170,
|
|
126
126
|
field: t,
|
|
127
|
-
title:
|
|
127
|
+
title: i,
|
|
128
128
|
formatter: ({
|
|
129
|
-
row:
|
|
130
|
-
}) =>
|
|
131
|
-
}),
|
|
132
|
-
format:
|
|
129
|
+
row: r
|
|
130
|
+
}) => r[t] ? u(r[t], o) : "-"
|
|
131
|
+
}), ro = ({
|
|
132
|
+
format: o = "YYYY-MM-DD HH:mm:ss",
|
|
133
133
|
field: t = "createTime",
|
|
134
|
-
title:
|
|
135
|
-
} = {}) =>
|
|
136
|
-
format:
|
|
134
|
+
title: i = "创建时间"
|
|
135
|
+
} = {}) => f({
|
|
136
|
+
format: o,
|
|
137
137
|
field: t,
|
|
138
|
-
title:
|
|
139
|
-
}),
|
|
140
|
-
format:
|
|
138
|
+
title: i
|
|
139
|
+
}), mo = ({
|
|
140
|
+
format: o = "YYYY-MM-DD HH:mm:ss",
|
|
141
141
|
field: t = "updateTime",
|
|
142
|
-
title:
|
|
143
|
-
} = {}) =>
|
|
144
|
-
format:
|
|
142
|
+
title: i = "更新时间"
|
|
143
|
+
} = {}) => f({
|
|
144
|
+
format: o,
|
|
145
145
|
field: t,
|
|
146
|
-
title:
|
|
147
|
-
}),
|
|
148
|
-
field:
|
|
146
|
+
title: i
|
|
147
|
+
}), po = ({
|
|
148
|
+
field: o = "status",
|
|
149
|
+
normalText: t = "正常",
|
|
150
|
+
disabledText: i = "禁用",
|
|
151
|
+
strToNumber: r = !0
|
|
152
|
+
} = {}) => ({
|
|
153
|
+
field: o,
|
|
149
154
|
title: "状态",
|
|
150
155
|
width: 100,
|
|
151
156
|
slots: {
|
|
152
157
|
default: ({
|
|
153
|
-
row:
|
|
154
|
-
}) =>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
row: p
|
|
159
|
+
}) => {
|
|
160
|
+
let m = p == null ? void 0 : p[o];
|
|
161
|
+
return m ? (r && Number(m) === 0 && (m = !1), m ? e(l, {
|
|
162
|
+
type: "danger"
|
|
163
|
+
}, n(i) ? i : {
|
|
164
|
+
default: () => [i]
|
|
165
|
+
}) : e(l, null, n(t) ? t : {
|
|
166
|
+
default: () => [t]
|
|
167
|
+
})) : "-";
|
|
168
|
+
}
|
|
161
169
|
}
|
|
162
|
-
}),
|
|
163
|
-
confirmText:
|
|
164
|
-
leftCallback: t,
|
|
165
|
-
rightCallback:
|
|
166
|
-
leftText:
|
|
170
|
+
}), eo = ({
|
|
171
|
+
confirmText: o = "确认删除?",
|
|
172
|
+
leftCallback: t = (m) => console.log(m),
|
|
173
|
+
rightCallback: i = (m) => console.log(m),
|
|
174
|
+
leftText: r = "编辑",
|
|
167
175
|
rightText: p = "删除"
|
|
168
|
-
}) => ({
|
|
176
|
+
} = {}) => ({
|
|
169
177
|
title: "操作栏",
|
|
170
178
|
minWidth: 150,
|
|
179
|
+
fixed: "right",
|
|
171
180
|
slots: {
|
|
172
181
|
default: ({
|
|
173
|
-
row:
|
|
174
|
-
}) =>
|
|
182
|
+
row: m
|
|
183
|
+
}) => e(a, null, [r ? e(s, {
|
|
175
184
|
size: "small",
|
|
176
185
|
type: "primary",
|
|
177
|
-
onClick: () => t(
|
|
178
|
-
},
|
|
179
|
-
default: () => [
|
|
180
|
-
}) : null, p ?
|
|
186
|
+
onClick: () => t(m)
|
|
187
|
+
}, n(r) ? r : {
|
|
188
|
+
default: () => [r]
|
|
189
|
+
}) : null, p ? e(D, {
|
|
181
190
|
width: "150",
|
|
182
|
-
onConfirm: () =>
|
|
183
|
-
title:
|
|
191
|
+
onConfirm: () => i(m),
|
|
192
|
+
title: o
|
|
184
193
|
}, {
|
|
185
|
-
reference: () =>
|
|
194
|
+
reference: () => e(s, {
|
|
186
195
|
size: "small",
|
|
187
196
|
type: "danger"
|
|
188
|
-
},
|
|
197
|
+
}, n(p) ? p : {
|
|
189
198
|
default: () => [p]
|
|
190
199
|
})
|
|
191
200
|
}) : null])
|
|
192
201
|
}
|
|
193
202
|
});
|
|
194
203
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
204
|
+
eo as ACTION_FIELD,
|
|
205
|
+
ro as CREATE_TIME_FIELD,
|
|
206
|
+
io as DATE_FIELD,
|
|
207
|
+
f as DATE_TIME_FIELD,
|
|
208
|
+
to as ID_FIELD,
|
|
209
|
+
oo as NAME_FIELD,
|
|
201
210
|
xt as SEQ_FIELD,
|
|
202
|
-
|
|
203
|
-
|
|
211
|
+
po as STATUS_FIELD,
|
|
212
|
+
mo as UPDATE_TIME_FIELD
|
|
204
213
|
};
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VftEmpty as
|
|
3
|
-
import { VftPagination as
|
|
4
|
-
import { useNamespace as
|
|
1
|
+
import { defineComponent as q, useAttrs as J, ref as i, computed as y, watch as C, reactive as K, onMounted as Q, resolveComponent as Z, resolveDirective as _, openBlock as b, createElementBlock as ee, normalizeClass as S, unref as l, createBlock as L, mergeProps as w, createCommentVNode as R, createVNode as O, createSlots as te, withCtx as k, withDirectives as W, createElementVNode as z, vShow as ae } from "vue";
|
|
2
|
+
import { VftEmpty as ne } from "../empty/index.js";
|
|
3
|
+
import { VftPagination as I } 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
|
-
import { EmptyEnum as
|
|
12
|
-
const
|
|
11
|
+
import { EmptyEnum as se } from "../empty/constants.js";
|
|
12
|
+
const ue = {
|
|
13
|
+
style: {
|
|
14
|
+
"min-height": "100px"
|
|
15
|
+
}
|
|
16
|
+
}, s = (
|
|
13
17
|
/* hoist-static*/
|
|
14
|
-
|
|
15
|
-
),
|
|
18
|
+
le("table")
|
|
19
|
+
), ce = q({
|
|
16
20
|
name: "vft-table"
|
|
17
|
-
}),
|
|
18
|
-
...
|
|
21
|
+
}), we = /* @__PURE__ */ q({
|
|
22
|
+
...ce,
|
|
19
23
|
props: {
|
|
20
24
|
maxHeight: {},
|
|
21
25
|
columns: {},
|
|
@@ -54,30 +58,30 @@ const s = (
|
|
|
54
58
|
},
|
|
55
59
|
emits: ["page-change", "size-change", "sort-change", "update:page-num", "update:page-size"],
|
|
56
60
|
setup(a, {
|
|
57
|
-
expose:
|
|
61
|
+
expose: $,
|
|
58
62
|
emit: u
|
|
59
63
|
}) {
|
|
60
|
-
const
|
|
64
|
+
const A = J(), D = i(0), r = i(), V = oe(() => j(), 120), N = y(() => a.pagePlacement.startsWith("bottom")), T = y(() => a.columns.map((e) => (e.align || (e.align = "center"), !e.formatter && !e.slots && !e.cellRender && (e.formatter = ({
|
|
61
65
|
cellValue: t
|
|
62
|
-
}) =>
|
|
63
|
-
|
|
66
|
+
}) => ie(t) || t === "" ? "-" : t), e)));
|
|
67
|
+
C([() => a.loading, () => a.data, () => a.columns], () => {
|
|
64
68
|
V();
|
|
65
69
|
}, {
|
|
66
70
|
immediate: !0
|
|
67
71
|
});
|
|
68
|
-
function
|
|
69
|
-
d.data = a.data,
|
|
72
|
+
function j() {
|
|
73
|
+
d.data = a.data, B(a.pageNum);
|
|
70
74
|
}
|
|
71
|
-
function
|
|
75
|
+
function G(e) {
|
|
72
76
|
u("page-change", e), u("update:page-num", e);
|
|
73
77
|
}
|
|
74
|
-
function
|
|
78
|
+
function F(e) {
|
|
75
79
|
u("size-change", e), u("update:page-size", e);
|
|
76
80
|
}
|
|
77
|
-
const
|
|
81
|
+
const M = () => ({
|
|
78
82
|
maxHeight: "88px",
|
|
79
83
|
height: "44px"
|
|
80
|
-
}),
|
|
84
|
+
}), U = (e) => {
|
|
81
85
|
var n;
|
|
82
86
|
const {
|
|
83
87
|
column: t
|
|
@@ -85,7 +89,7 @@ const s = (
|
|
|
85
89
|
return {
|
|
86
90
|
maxHeight: ((n = t == null ? void 0 : t.cellRender) == null ? void 0 : n.name) === "Clamp" ? "max-content" : "44px"
|
|
87
91
|
};
|
|
88
|
-
}, d =
|
|
92
|
+
}, d = K({
|
|
89
93
|
autoResize: !0,
|
|
90
94
|
sortConfig: {
|
|
91
95
|
trigger: "cell",
|
|
@@ -98,12 +102,12 @@ const s = (
|
|
|
98
102
|
orders: ["desc", "asc", null]
|
|
99
103
|
},
|
|
100
104
|
seqConfig: {
|
|
101
|
-
startIndex:
|
|
105
|
+
startIndex: D.value
|
|
102
106
|
},
|
|
103
107
|
cellClassName: "cellClass",
|
|
104
108
|
rowClassName: "rowClass",
|
|
105
|
-
cellStyle:
|
|
106
|
-
rowStyle:
|
|
109
|
+
cellStyle: U,
|
|
110
|
+
rowStyle: M,
|
|
107
111
|
headerRowClassName: "headerRowClass",
|
|
108
112
|
headerAlign: "center",
|
|
109
113
|
columnConfig: {
|
|
@@ -120,47 +124,47 @@ const s = (
|
|
|
120
124
|
enabled: !1
|
|
121
125
|
},
|
|
122
126
|
...a.tableConfig,
|
|
123
|
-
|
|
124
|
-
}),
|
|
127
|
+
...A
|
|
128
|
+
}), X = (e) => {
|
|
125
129
|
u("sort-change", e);
|
|
126
130
|
};
|
|
127
|
-
|
|
128
|
-
|
|
131
|
+
C(() => a.pageNum, (e) => {
|
|
132
|
+
B(e);
|
|
129
133
|
});
|
|
130
|
-
const
|
|
134
|
+
const B = (e) => {
|
|
131
135
|
d.seqConfig && (d.seqConfig.startIndex = (e - 1) * a.pageSize);
|
|
132
|
-
}, c = i(),
|
|
136
|
+
}, c = i(), P = i();
|
|
133
137
|
let f = i(!1), o = i(null), m = i(null);
|
|
134
|
-
const g =
|
|
138
|
+
const g = y(() => {
|
|
135
139
|
var e;
|
|
136
140
|
return ((e = a.sticky) == null ? void 0 : e.getContainer) || document.documentElement || document.body;
|
|
137
141
|
});
|
|
138
|
-
|
|
142
|
+
C(() => [r, a.sticky], () => {
|
|
139
143
|
var e, t, n;
|
|
140
144
|
(e = r.value) != null && e.$el && a.sticky && ((t = g.value) == null || t.removeEventListener("scroll", p), (n = g.value) == null || n.addEventListener("scroll", p), setTimeout(() => {
|
|
141
|
-
|
|
145
|
+
E();
|
|
142
146
|
}, 50));
|
|
143
147
|
}, {
|
|
144
148
|
immediate: !0,
|
|
145
149
|
deep: !0
|
|
146
150
|
});
|
|
147
|
-
function
|
|
151
|
+
function E() {
|
|
148
152
|
if (!o.value || !m.value || (p(), !f.value))
|
|
149
153
|
return;
|
|
150
154
|
const e = o.value.clientWidth, t = m.value.offsetWidth;
|
|
151
|
-
c.value.style.width = e - 1 + "px",
|
|
155
|
+
c.value.style.width = e - 1 + "px", P.value.style.width = t + "px";
|
|
152
156
|
}
|
|
153
157
|
function p() {
|
|
154
|
-
var
|
|
155
|
-
if (!((
|
|
158
|
+
var v, x, H;
|
|
159
|
+
if (!((v = r.value) != null && v.$el) || !o.value || !g.value)
|
|
156
160
|
return;
|
|
157
|
-
const e = ((
|
|
161
|
+
const e = ((x = g.value) == null ? void 0 : x.clientHeight) || window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, {
|
|
158
162
|
top: t,
|
|
159
163
|
bottom: n
|
|
160
|
-
} = o.value.getBoundingClientRect(),
|
|
161
|
-
f.value = t < e && n > e && n -
|
|
164
|
+
} = o.value.getBoundingClientRect(), h = ((H = g.value) == null ? void 0 : H.getBoundingClientRect().top) || document.body.getBoundingClientRect().top;
|
|
165
|
+
f.value = t < e && n > e && n - h > e, c.value.scrollLeft = o.value.scrollLeft;
|
|
162
166
|
}
|
|
163
|
-
const
|
|
167
|
+
const Y = () => {
|
|
164
168
|
var t;
|
|
165
169
|
const e = (t = r.value) == null ? void 0 : t.$el;
|
|
166
170
|
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) {
|
|
@@ -169,66 +173,67 @@ const s = (
|
|
|
169
173
|
o.value.scrollLeft = n.target.scrollLeft;
|
|
170
174
|
})));
|
|
171
175
|
};
|
|
172
|
-
return
|
|
173
|
-
a.sticky && (
|
|
174
|
-
}),
|
|
176
|
+
return Q(() => {
|
|
177
|
+
a.sticky && (Y(), re(r, () => E()));
|
|
178
|
+
}), $({
|
|
175
179
|
table: r
|
|
176
180
|
}), (e, t) => {
|
|
177
|
-
const n =
|
|
178
|
-
return
|
|
179
|
-
class:
|
|
180
|
-
}, [e.showPager && !
|
|
181
|
+
const n = Z("vxe-grid"), h = _("loading");
|
|
182
|
+
return b(), ee("div", {
|
|
183
|
+
class: S(l(s).b())
|
|
184
|
+
}, [e.showPager && !N.value ? (b(), L(l(I), w({
|
|
181
185
|
key: 0,
|
|
182
186
|
class: [l(s).e("pager"), l(s).m("pager-" + e.pagePlacement)],
|
|
183
187
|
layout: "prev, pager, next"
|
|
184
188
|
}, e.pageOptions, {
|
|
185
189
|
total: e.total,
|
|
186
190
|
"page-size": e.pageSize,
|
|
187
|
-
onCurrentChange: t[0] || (t[0] = (
|
|
191
|
+
onCurrentChange: t[0] || (t[0] = (v) => u("page-change", e.pageNum)),
|
|
188
192
|
"current-page": e.pageNum
|
|
189
|
-
}), null, 16, ["class", "total", "page-size", "current-page"])) :
|
|
193
|
+
}), null, 16, ["class", "total", "page-size", "current-page"])) : R("", !0), O(n, w({
|
|
190
194
|
ref_key: "xGrid",
|
|
191
195
|
ref: r
|
|
192
196
|
}, d, {
|
|
193
197
|
height: e.height,
|
|
194
198
|
"max-height": e.maxHeight,
|
|
195
|
-
columns:
|
|
199
|
+
columns: T.value,
|
|
196
200
|
data: e.data,
|
|
197
201
|
"auto-resize": "",
|
|
198
202
|
loading: e.loading,
|
|
199
203
|
resizable: "",
|
|
200
|
-
onSortChange:
|
|
201
|
-
}),
|
|
202
|
-
empty:
|
|
203
|
-
type: l(
|
|
204
|
+
onSortChange: X
|
|
205
|
+
}), te({
|
|
206
|
+
empty: k(() => [O(l(ne), {
|
|
207
|
+
type: l(se).NO_DATA
|
|
204
208
|
}, null, 8, ["type"])]),
|
|
209
|
+
loading: k(() => [W(z("div", ue, null, 512), [[h, e.loading]])]),
|
|
205
210
|
_: 2
|
|
206
211
|
}, [e.sticky ? {
|
|
207
212
|
name: "bottom",
|
|
208
|
-
fn:
|
|
213
|
+
fn: k(() => [W(z("div", {
|
|
209
214
|
ref_key: "stickyScroll",
|
|
210
215
|
ref: c,
|
|
211
|
-
class:
|
|
212
|
-
}, [
|
|
216
|
+
class: S(l(s).e("sticky-scroll-warpper"))
|
|
217
|
+
}, [z("div", {
|
|
213
218
|
ref_key: "stickyScrollBar",
|
|
214
|
-
ref:
|
|
215
|
-
class:
|
|
216
|
-
}, null, 2)], 2), [[
|
|
219
|
+
ref: P,
|
|
220
|
+
class: S(l(s).e("sticky-scroll-bar"))
|
|
221
|
+
}, null, 2)], 2), [[ae, l(f)]])]),
|
|
217
222
|
key: "0"
|
|
218
|
-
} : void 0]), 1040, ["height", "max-height", "columns", "data", "loading"]), e.showPager &&
|
|
223
|
+
} : void 0]), 1040, ["height", "max-height", "columns", "data", "loading"]), e.showPager && N.value ? (b(), L(l(I), w({
|
|
219
224
|
key: 1,
|
|
220
225
|
class: [l(s).e("pager"), l(s).m("pager-" + e.pagePlacement)],
|
|
221
226
|
layout: "prev, pager, next, jumper"
|
|
222
227
|
}, e.pageOptions, {
|
|
223
228
|
total: e.total,
|
|
224
229
|
"page-size": e.pageSize,
|
|
225
|
-
onCurrentChange:
|
|
226
|
-
onSizeChange:
|
|
230
|
+
onCurrentChange: G,
|
|
231
|
+
onSizeChange: F,
|
|
227
232
|
"current-page": e.pageNum
|
|
228
|
-
}), null, 16, ["class", "total", "page-size", "current-page"])) :
|
|
233
|
+
}), null, 16, ["class", "total", "page-size", "current-page"])) : R("", !0)], 2);
|
|
229
234
|
};
|
|
230
235
|
}
|
|
231
236
|
});
|
|
232
237
|
export {
|
|
233
|
-
|
|
238
|
+
we as default
|
|
234
239
|
};
|
package/es/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),J=require("../../hooks/use-namespace/index.cjs");require("@popperjs/core");require("lodash");require("../../hooks/use-z-index/index.cjs");const I=require("@vueuse/core"),f=require("@vft/utils");require("../../utils/ns-cover.cjs");const W=require("./component-map.cjs"),Q=require("./super-form-action.vue2.cjs"),X=require("./super-form-item.vue2.cjs"),Y=require("./use/use-auto-focus.cjs"),Z=require("./use/use-form-context.cjs"),ee=require("./use/use-form-events.cjs"),re=require("./use/use-form-values.cjs");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");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");const te=require("../form/index.cjs");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("../table/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");const ue=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");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("./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");const oe=J.useNamespace("super-form"),ne=e.defineComponent({name:"vft-super-form"}),ie=e.defineComponent({...ne,props:{rowProps:{default:{gutter:20}},baseColProps:{},quickColSpan:{default:3},autoSetPlaceHolder:{type:Boolean,default:!0},schemas:{},autoFocusFirstItem:{type:Boolean,default:!1},submitOnReset:{type:Boolean},mergeDynamicData:{},fieldMapToTime:{},autoSubmitOnEnter:{type:Boolean,default:!0},rulesMessageJoinLabel:{type:Boolean,default:!0},autoAdvancedLine:{},alwaysShowLines:{},tableAction:{default:""},submitOnChange:{type:Boolean},showActionButtonGroup:{type:Boolean,default:!0},autoCleanErrorMessage:{type:Boolean},beforeSubmitFunc:{},submitFunc:{},watchDataIsChange:{type:Boolean},size:{default:"default"},disabled:{type:Boolean},model:{},rules:{},labelPosition:{default:"right"},requireAsteriskPosition:{default:"left"},labelWidth:{default:"auto"},labelSuffix:{},inline:{type:Boolean},inlineMessage:{type:Boolean},statusIcon:{type:Boolean},showMessage:{type:Boolean,default:!0},validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:{type:Boolean,default:!1},scrollToError:{type:Boolean},showResetButton:{type:Boolean,default:!1},showSubmitButton:{type:Boolean,default:!0},showCommonButton:{type:Boolean,default:!1},resetButtonOptions:{},submitButtonOptions:{},commonButtonOptions:{},actionRowOptions:{}},emits:["register","reset","submit","field-value-change"],setup(T,{expose:L,emit:F}){const w=T,x=e.useAttrs(),i=e.reactive({}),m=e.ref({}),l=e.ref(!1),p=e.ref({}),S=e.ref(null),q=e.ref(null),P=e.ref(),t=e.computed(()=>({...w,...e.unref(p)})),N=e.computed(()=>({...x,...w,...e.unref(t)})),n=e.computed(()=>{const r=e.unref(S);return e.unref(t).showAdvancedButton?f.cloneDeep(r.filter(o=>o.component!==W.FormCompEnum.DIVIDER)):f.cloneDeep(r)}),{handleFormValues:$,initDefault:C}=re.useFormValues({getProps:t,defaultValueRef:m,getSchema:n,formModel:i});Y.useAutoFocus({getSchema:n,getProps:t,isInitedDefault:l,formElRef:q});const{handleSubmit:s,setFieldsValue:d,clearValidate:_,validate:k,validateField:B,getFieldsValue:h,updateSchema:g,resetSchema:y,appendSchemaByField:A,removeSchemaByField:V,resetFields:v,scrollToField:z,getFieldValue:O,setFormItemError:H}=ee.useFormEvents({emit:F,getProps:t,formModel:i,getSchema:n,defaultValueRef:m,formElRef:q,schemaRef:S,handleFormValues:$,initValues:P});Z.createFormContext({resetAction:v,submitAction:s}),e.watch(()=>e.unref(t).model,()=>{const{model:r}=e.unref(t);r&&d(r)},{immediate:!0}),e.watch(()=>e.unref(t).schemas,r=>{y(r??[])}),e.watch(()=>n.value,r=>{var o;e.nextTick(()=>{}),!e.unref(l)&&r!=null&&r.length&&(C(),l.value=!0,(o=t.value)!=null&&o.watchDataIsChange&&I.useTimeoutFn(()=>{P.value=h()},40))}),e.watch(()=>i,I.useDebounceFn(()=>{e.unref(t).submitOnChange&&s()},300),{deep:!0});async function R(r){p.value=f.deepMerge(e.unref(p)||{},r)}function K(r,o,u){i[r]=o,u&&u.itemProps&&!u.itemProps.autoLink&&B(r).catch(b=>{})}function j(r){const{autoSubmitOnEnter:o}=e.unref(t);if(o&&r.key==="Enter"&&r.target&&r.target instanceof HTMLElement){const u=r.target;u&&u.tagName&&u.tagName.toUpperCase()==="INPUT"&&s()}}const E={getFieldsValue:h,getFieldValue:O,setFieldsValue:d,resetFields:v,updateSchema:g,resetSchema:y,setProps:R,removeSchemaByField:V,appendSchemaByField:A,clearValidate:_,validateField:B,validate:k,submit:s,scrollToField:z};e.onMounted(()=>{C(),F("register",E)
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),J=require("../../hooks/use-namespace/index.cjs");require("@popperjs/core");require("lodash");require("../../hooks/use-z-index/index.cjs");const I=require("@vueuse/core"),f=require("@vft/utils");require("../../utils/ns-cover.cjs");const W=require("./component-map.cjs"),Q=require("./super-form-action.vue2.cjs"),X=require("./super-form-item.vue2.cjs"),Y=require("./use/use-auto-focus.cjs"),Z=require("./use/use-form-context.cjs"),ee=require("./use/use-form-events.cjs"),re=require("./use/use-form-values.cjs");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");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");const te=require("../form/index.cjs");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("../table/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");const ue=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");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("./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");const oe=J.useNamespace("super-form"),ne=e.defineComponent({name:"vft-super-form"}),ie=e.defineComponent({...ne,props:{rowProps:{default:{gutter:20}},baseColProps:{},quickColSpan:{default:3},autoSetPlaceHolder:{type:Boolean,default:!0},schemas:{},autoFocusFirstItem:{type:Boolean,default:!1},submitOnReset:{type:Boolean},mergeDynamicData:{},fieldMapToTime:{},autoSubmitOnEnter:{type:Boolean,default:!0},rulesMessageJoinLabel:{type:Boolean,default:!0},autoAdvancedLine:{},alwaysShowLines:{},tableAction:{default:""},submitOnChange:{type:Boolean},showActionButtonGroup:{type:Boolean,default:!0},autoCleanErrorMessage:{type:Boolean},beforeSubmitFunc:{},submitFunc:{},watchDataIsChange:{type:Boolean},size:{default:"default"},disabled:{type:Boolean},model:{},rules:{},labelPosition:{default:"right"},requireAsteriskPosition:{default:"left"},labelWidth:{default:"auto"},labelSuffix:{},inline:{type:Boolean},inlineMessage:{type:Boolean},statusIcon:{type:Boolean},showMessage:{type:Boolean,default:!0},validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:{type:Boolean,default:!1},scrollToError:{type:Boolean},showResetButton:{type:Boolean,default:!1},showSubmitButton:{type:Boolean,default:!0},showCommonButton:{type:Boolean,default:!1},resetButtonOptions:{},submitButtonOptions:{},commonButtonOptions:{},actionRowOptions:{}},emits:["register","reset","submit","field-value-change"],setup(T,{expose:L,emit:F}){const w=T,x=e.useAttrs(),i=e.reactive({}),m=e.ref({}),l=e.ref(!1),p=e.ref({}),S=e.ref(null),q=e.ref(null),P=e.ref(),t=e.computed(()=>({...w,...e.unref(p)})),N=e.computed(()=>({...x,...w,...e.unref(t)})),n=e.computed(()=>{const r=e.unref(S);return e.unref(t).showAdvancedButton?f.cloneDeep(r.filter(o=>o.component!==W.FormCompEnum.DIVIDER)):f.cloneDeep(r)}),{handleFormValues:$,initDefault:C}=re.useFormValues({getProps:t,defaultValueRef:m,getSchema:n,formModel:i});Y.useAutoFocus({getSchema:n,getProps:t,isInitedDefault:l,formElRef:q});const{handleSubmit:s,setFieldsValue:d,clearValidate:_,validate:k,validateField:B,getFieldsValue:h,updateSchema:g,resetSchema:y,appendSchemaByField:A,removeSchemaByField:V,resetFields:v,scrollToField:z,getFieldValue:O,setFormItemError:H}=ee.useFormEvents({emit:F,getProps:t,formModel:i,getSchema:n,defaultValueRef:m,formElRef:q,schemaRef:S,handleFormValues:$,initValues:P});Z.createFormContext({resetAction:v,submitAction:s}),e.watch(()=>e.unref(t).model,()=>{const{model:r}=e.unref(t);r&&d(r)},{immediate:!0}),e.watch(()=>e.unref(t).schemas,r=>{y(r??[])}),e.watch(()=>n.value,r=>{var o;e.nextTick(()=>{}),!e.unref(l)&&r!=null&&r.length&&(C(),l.value=!0,(o=t.value)!=null&&o.watchDataIsChange&&I.useTimeoutFn(()=>{P.value=h()},40))}),e.watch(()=>i,I.useDebounceFn(()=>{e.unref(t).submitOnChange&&s()},300),{deep:!0});async function R(r){p.value=f.deepMerge(e.unref(p)||{},r)}function K(r,o,u){i[r]=o,u&&u.itemProps&&!u.itemProps.autoLink&&B(r).catch(b=>{})}function j(r){const{autoSubmitOnEnter:o}=e.unref(t);if(o&&r.key==="Enter"&&r.target&&r.target instanceof HTMLElement){const u=r.target;u&&u.tagName&&u.tagName.toUpperCase()==="INPUT"&&s()}}const E={getFieldsValue:h,getFieldValue:O,setFieldsValue:d,resetFields:v,updateSchema:g,resetSchema:y,setProps:R,removeSchemaByField:V,appendSchemaByField:A,clearValidate:_,validateField:B,validate:k,submit:s,scrollToField:z};e.onMounted(()=>{C(),F("register",E)});const G=e.computed(()=>f.pick(t.value,["showResetButton","showCommonButton","showSubmitButton","resetButtonOptions","submitButtonOptions","commonButtonOptions","actionColOptions","actionSpan"]));return L({getFieldsValue:h,getFieldValue:O,setFieldsValue:d,resetFields:v,updateSchema:g,resetSchema:y,setProps:R,removeSchemaByField:V,appendSchemaByField:A,clearValidate:_,validateField:B,validate:k,submit:s,setFormItemError:H}),(r,o)=>{var u;return l.value&&((u=n.value)!=null&&u.length)?(e.openBlock(),e.createBlock(e.unref(te.VftForm),e.mergeProps({key:0},N.value,{ref_key:"formElRef",ref:q,class:e.unref(oe).b(),model:i,onKeypress:e.withKeys(j,["enter"])}),{default:e.withCtx(()=>{var b,D,M;return[(b=n.value)!=null&&b.length?(e.openBlock(),e.createBlock(e.unref(ue.VftRow),e.normalizeProps(e.mergeProps({key:0},(D=t.value)==null?void 0:D.rowProps)),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"formHeader"),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,a=>(e.openBlock(),e.createBlock(X.default,{key:a.field,tableAction:r.tableAction,formActionType:E,schema:a,formProps:t.value,allDefaultValues:m.value,formModel:i,setFormModel:K,updateSchema:e.unref(g)},e.createSlots({_:2},[e.renderList(Object.keys(r.$slots),c=>({name:c,fn:e.withCtx(U=>[e.renderSlot(r.$slots,c,e.normalizeProps(e.guardReactiveProps(U||{})))])}))]),1032,["tableAction","schema","formProps","allDefaultValues","formModel","updateSchema"]))),128))]),_:3},16)):e.createCommentVNode("",!0),(M=t.value)!=null&&M.showActionButtonGroup?(e.openBlock(),e.createBlock(Q.default,e.normalizeProps(e.mergeProps({key:1},G.value)),e.createSlots({_:2},[e.renderList(["resetBefore","submitBefore","submitAfter"],a=>({name:a,fn:e.withCtx(c=>[e.renderSlot(r.$slots,a,e.normalizeProps(e.guardReactiveProps(c||{})))])}))]),1040)):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"formFooter")]}),_:3},16,["class","model","onKeypress"])):e.createCommentVNode("",!0)}}});exports.default=ie;
|