@vrojs/element-plus 0.0.15 → 0.0.16
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../../vro-el-schema-filter/style/deps.js';
|
|
2
2
|
import '../../vro-el-table-column-group/style/deps.js';
|
|
3
3
|
import 'element-plus/es/components/button/style/css';
|
|
4
|
+
import 'element-plus/es/components/loading/style/css';
|
|
4
5
|
import 'element-plus/es/components/pagination/style/css';
|
|
5
6
|
import 'element-plus/es/components/table/style/css';
|
|
@@ -1,92 +1,89 @@
|
|
|
1
|
-
import { defineComponent as $, useTemplateRef as y, computed as k,
|
|
2
|
-
import { isEmptyObject as
|
|
3
|
-
import { RefreshRight as
|
|
4
|
-
import { ElButton as z, ElTable as B, ElPagination as R } from "element-plus";
|
|
1
|
+
import { defineComponent as $, useTemplateRef as y, computed as k, createElementBlock as i, openBlock as r, createBlock as s, createCommentVNode as a, createElementVNode as d, unref as l, mergeProps as u, withDirectives as P, renderSlot as n, withCtx as p, createTextVNode as T, toDisplayString as V, createVNode as q } from "vue";
|
|
2
|
+
import { isEmptyObject as w } from "@daysnap/utils";
|
|
3
|
+
import { RefreshRight as C } from "@element-plus/icons-vue";
|
|
4
|
+
import { ElLoading as S, ElButton as z, ElTable as B, ElPagination as R } from "element-plus";
|
|
5
5
|
import { useLocale as N } from "../locale/useLocale.js";
|
|
6
|
-
import { VroElSchemaFilter as
|
|
6
|
+
import { VroElSchemaFilter as L } from "../vro-el-schema-filter/index.js";
|
|
7
7
|
import { VroElTableColumnGroup as j } from "../vro-el-table-column-group/index.js";
|
|
8
|
-
import { vroElTableProps as
|
|
9
|
-
const
|
|
8
|
+
import { vroElTableProps as D } from "./types.js";
|
|
9
|
+
const U = { class: "vro-el-table" }, F = { class: "vro-el-table-inner" }, G = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "vro-el-table-header"
|
|
12
|
-
},
|
|
12
|
+
}, H = { class: "vro-el-table-actions" }, O = { class: "vro-el-table-content" }, Y = /* @__PURE__ */ $({
|
|
13
13
|
name: "VroElTable",
|
|
14
14
|
__name: "vro-el-table",
|
|
15
|
-
props:
|
|
15
|
+
props: D,
|
|
16
16
|
emits: ["request", "selection-change"],
|
|
17
17
|
setup(f, { expose: g }) {
|
|
18
|
-
const b = f, { t: v } = N(), c = B, m = y("refElTable"),
|
|
18
|
+
const b = f, { t: v } = N(), c = B, h = S.directive, m = y("refElTable"), E = k(() => {
|
|
19
19
|
const { filterable: e, filterProps: o } = b;
|
|
20
|
-
return !!(e && o?.schema && !
|
|
20
|
+
return !!(e && o?.schema && !w(o.schema));
|
|
21
21
|
});
|
|
22
22
|
return g({
|
|
23
23
|
get elTable() {
|
|
24
24
|
return m.value;
|
|
25
25
|
}
|
|
26
|
-
}), (e, o) =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
onClick: o[1] || (o[1] = (t) => e.$emit("request"))
|
|
44
|
-
}, {
|
|
45
|
-
default: p(() => [
|
|
46
|
-
V(q(r(v)("table.refresh")), 1)
|
|
47
|
-
]),
|
|
48
|
-
_: 1
|
|
49
|
-
}, 8, ["icon", "loading"])) : s("", !0),
|
|
50
|
-
n(e.$slots, "actions")
|
|
51
|
-
])
|
|
52
|
-
])) : s("", !0),
|
|
53
|
-
T((l(), i("div", O, [
|
|
54
|
-
w(r(c), u({
|
|
55
|
-
ref_key: "refElTable",
|
|
56
|
-
ref: m,
|
|
57
|
-
width: "100%",
|
|
58
|
-
"table-layout": "fixed"
|
|
59
|
-
}, e.tableProps, {
|
|
60
|
-
data: e.data,
|
|
61
|
-
onSelectionChange: o[2] || (o[2] = (t) => e.$emit("selection-change", t))
|
|
62
|
-
}), {
|
|
26
|
+
}), (e, o) => (r(), i("div", U, [
|
|
27
|
+
E.value ? (r(), s(l(L), u({ key: 0 }, e.filterProps, {
|
|
28
|
+
loading: e.loading,
|
|
29
|
+
class: "vro-el-table-filter",
|
|
30
|
+
onQuery: o[0] || (o[0] = (t) => e.$emit("request", { query: t, currentPage: 1 }))
|
|
31
|
+
}), null, 16, ["loading"])) : a("", !0),
|
|
32
|
+
d("div", F, [
|
|
33
|
+
e.showHeader && (e.$slots.title || e.$slots.actions || e.showRefresh) ? (r(), i("div", G, [
|
|
34
|
+
n(e.$slots, "title"),
|
|
35
|
+
d("div", H, [
|
|
36
|
+
e.showRefresh ? (r(), s(l(z), {
|
|
37
|
+
key: 0,
|
|
38
|
+
plain: "",
|
|
39
|
+
icon: l(C),
|
|
40
|
+
loading: e.loading,
|
|
41
|
+
onClick: o[1] || (o[1] = (t) => e.$emit("request"))
|
|
42
|
+
}, {
|
|
63
43
|
default: p(() => [
|
|
64
|
-
|
|
65
|
-
e.columns.length ? (l(), a(r(j), {
|
|
66
|
-
key: 0,
|
|
67
|
-
columns: e.columns
|
|
68
|
-
}, null, 8, ["columns"])) : s("", !0),
|
|
69
|
-
n(e.$slots, "default")
|
|
44
|
+
T(V(l(v)("table.refresh")), 1)
|
|
70
45
|
]),
|
|
71
|
-
_:
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
46
|
+
_: 1
|
|
47
|
+
}, 8, ["icon", "loading"])) : a("", !0),
|
|
48
|
+
n(e.$slots, "actions")
|
|
49
|
+
])
|
|
50
|
+
])) : a("", !0),
|
|
51
|
+
P((r(), i("div", O, [
|
|
52
|
+
q(l(c), u({
|
|
53
|
+
ref_key: "refElTable",
|
|
54
|
+
ref: m,
|
|
55
|
+
width: "100%",
|
|
56
|
+
"table-layout": "fixed"
|
|
57
|
+
}, e.tableProps, {
|
|
58
|
+
data: e.data,
|
|
59
|
+
onSelectionChange: o[2] || (o[2] = (t) => e.$emit("selection-change", t))
|
|
60
|
+
}), {
|
|
61
|
+
default: p(() => [
|
|
62
|
+
n(e.$slots, "content-prefix"),
|
|
63
|
+
e.columns.length ? (r(), s(l(j), {
|
|
64
|
+
key: 0,
|
|
65
|
+
columns: e.columns
|
|
66
|
+
}, null, 8, ["columns"])) : a("", !0),
|
|
67
|
+
n(e.$slots, "default")
|
|
68
|
+
]),
|
|
69
|
+
_: 3
|
|
70
|
+
}, 16, ["data"])
|
|
71
|
+
])), [
|
|
72
|
+
[l(h), e.loading]
|
|
73
|
+
]),
|
|
74
|
+
e.pageable ? (r(), s(l(R), u({
|
|
75
|
+
key: 1,
|
|
76
|
+
class: "vro-el-table-pagination",
|
|
77
|
+
layout: "total, prev, pager, next, sizes, jumper",
|
|
78
|
+
background: "",
|
|
79
|
+
size: "small",
|
|
80
|
+
"page-sizes": [10, 20, 50, 100]
|
|
81
|
+
}, e.paginationProps, {
|
|
82
|
+
"onUpdate:currentPage": o[3] || (o[3] = (t) => e.$emit("request", { currentPage: t })),
|
|
83
|
+
"onUpdate:pageSize": o[4] || (o[4] = (t) => e.$emit("request", { pageSize: t, currentPage: 1 }))
|
|
84
|
+
}), null, 16)) : a("", !0)
|
|
85
|
+
])
|
|
86
|
+
]));
|
|
90
87
|
}
|
|
91
88
|
});
|
|
92
89
|
export {
|