@zl-ui-kit/components 0.22.1 → 0.24.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/README.md +108 -60
- package/dist/components/ZlAppLayout/Vertical2.vue.mjs +39 -41
- package/dist/components/ZlAppSlogan/index.css +1 -1
- package/dist/components/ZlAppSlogan/index.vue.d.ts +1 -1
- package/dist/components/ZlAppSlogan/index.vue.mjs +19 -12
- package/dist/components/ZlButton/index.vue.d.ts +19 -2
- package/dist/components/ZlButton/index.vue.mjs +30 -14
- package/dist/components/ZlCopy/index.css +1 -1
- package/dist/components/ZlCopy/index.vue.mjs +2 -2
- package/dist/components/ZlCopy/index2.vue.mjs +30 -32
- package/dist/components/ZlDevMenu/index.vue.mjs +34 -33
- package/dist/components/ZlDialog/index.vue.mjs +26 -25
- package/dist/components/ZlDrawer/index.vue.mjs +23 -22
- package/dist/components/ZlLogin/components/LoginForm.css +1 -1
- package/dist/components/ZlLogin/components/LoginForm.vue.mjs +1 -1
- package/dist/components/ZlLogin/components/LoginForm2.vue.mjs +26 -25
- package/dist/components/ZlPagination/index.css +1 -1
- package/dist/components/ZlPagination/index.vue.d.ts +21 -1
- package/dist/components/ZlPagination/index.vue.mjs +1 -1
- package/dist/components/ZlPagination/index2.vue.mjs +59 -33
- package/dist/components/ZlPagination/usePagination.d.ts +1 -0
- package/dist/components/ZlPagination/usePagination.mjs +51 -34
- package/dist/components/ZlPopconfirm/index.vue.mjs +25 -24
- package/dist/components/ZlSearch/index.vue.mjs +196 -202
- package/dist/locales/zh-cn.mjs +1 -1
- package/package.json +6 -6
|
@@ -1,53 +1,79 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { usePagination as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as A, useAttrs as U, computed as t, ref as S, watch as N, resolveComponent as B, openBlock as T, createBlock as V, mergeProps as b, createSlots as j, withCtx as M, createElementVNode as r, renderSlot as R, createTextVNode as c, toDisplayString as v, createCommentVNode as $ } from "vue";
|
|
2
|
+
import { normalizePaginationAttrs as D, usePagination as E } from "./usePagination.mjs";
|
|
3
|
+
const Z = { class: "el-pagination__total zl-pagination__total" }, q = { class: "zl-pagination__total-num" }, F = { class: "zl-pagination__total-num" }, J = /* @__PURE__ */ A({
|
|
4
4
|
name: "ZlPagination",
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "index",
|
|
7
7
|
emits: ["change", "page-change", "page-size-change"],
|
|
8
|
-
setup(
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
), g = l(
|
|
12
|
-
|
|
8
|
+
setup(G, { emit: y }) {
|
|
9
|
+
const s = y, C = U(), n = t(() => D(C)), a = E(() => n.value), P = t(() => n.value.align ?? "right"), m = t(
|
|
10
|
+
() => a.value === !1 ? [] : String(a.value.layout ?? "").split(",").map((e) => e.trim()).filter(Boolean)
|
|
11
|
+
), f = t(() => !m.value.includes("jumper")), z = t(() => m.value.includes("total") && !f.value), k = t(() => n.value.totalUnit ?? "资源"), g = t(() => a.value === !1 ? 0 : Number(a.value.total ?? 0)), l = S(
|
|
12
|
+
n.value.pageNum ?? (a.value === !1 ? void 0 : a.value.currentPage) ?? 1
|
|
13
|
+
), o = S(
|
|
14
|
+
n.value.pageSize ?? (a.value === !1 ? void 0 : a.value.pageSize) ?? 30
|
|
13
15
|
);
|
|
14
|
-
|
|
15
|
-
() =>
|
|
16
|
+
N(
|
|
17
|
+
() => n.value.pageNum ?? n.value.currentPage,
|
|
16
18
|
(e) => {
|
|
17
|
-
e != null && (
|
|
19
|
+
e != null && (l.value = e);
|
|
18
20
|
}
|
|
19
|
-
),
|
|
20
|
-
() =>
|
|
21
|
+
), N(
|
|
22
|
+
() => n.value.pageSize,
|
|
21
23
|
(e) => {
|
|
22
|
-
e != null && (
|
|
24
|
+
e != null && (o.value = e);
|
|
23
25
|
}
|
|
24
26
|
);
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
+
function w(e) {
|
|
28
|
+
l.value = e, s("change", { pageNum: e, pageSize: o.value }), s("page-change", e);
|
|
27
29
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
+
function x(e) {
|
|
31
|
+
o.value = e, l.value = 1, s("change", { pageNum: 1, pageSize: e }), s("page-size-change", e);
|
|
30
32
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const _ = t(() => {
|
|
34
|
+
const e = o.value || 1;
|
|
35
|
+
return Math.min(e, Math.max(g.value - (l.value - 1) * e, 0));
|
|
36
|
+
}), d = t(() => {
|
|
37
|
+
if (a.value === !1) return !1;
|
|
38
|
+
const { currentPage: e, pageSize: i, totalUnit: h, ...u } = a.value;
|
|
39
|
+
return delete u.align, z.value && typeof u.layout == "string" && (u.layout = u.layout.split(",").map((p) => p.trim()).map((p) => p === "total" ? "slot" : p).join(", ")), u;
|
|
35
40
|
});
|
|
36
|
-
return (e,
|
|
37
|
-
const
|
|
38
|
-
return
|
|
41
|
+
return (e, i) => {
|
|
42
|
+
const h = B("el-pagination");
|
|
43
|
+
return d.value !== !1 ? (T(), V(h, b({
|
|
39
44
|
key: 0,
|
|
40
|
-
class: ["zl-pagination", `zl-pagination--${
|
|
41
|
-
},
|
|
42
|
-
"current-page":
|
|
43
|
-
"page-size":
|
|
44
|
-
onCurrentChange:
|
|
45
|
-
onSizeChange:
|
|
46
|
-
}),
|
|
45
|
+
class: ["zl-pagination", [`zl-pagination--${P.value}`, f.value ? "zl-pagination--simple" : "zl-pagination--full"]]
|
|
46
|
+
}, d.value, {
|
|
47
|
+
"current-page": l.value,
|
|
48
|
+
"page-size": o.value,
|
|
49
|
+
onCurrentChange: w,
|
|
50
|
+
onSizeChange: x
|
|
51
|
+
}), j({ _: 2 }, [
|
|
52
|
+
z.value ? {
|
|
53
|
+
name: "default",
|
|
54
|
+
fn: M(() => [
|
|
55
|
+
r("span", Z, [
|
|
56
|
+
R(e.$slots, "total", {
|
|
57
|
+
total: g.value,
|
|
58
|
+
pageRows: _.value,
|
|
59
|
+
pageNum: l.value,
|
|
60
|
+
pageSize: o.value
|
|
61
|
+
}, () => [
|
|
62
|
+
i[0] || (i[0] = c(" 共 ", -1)),
|
|
63
|
+
r("span", q, v(g.value), 1),
|
|
64
|
+
c(" 条" + v(k.value) + ",当前筛选命中 ", 1),
|
|
65
|
+
r("span", F, v(_.value), 1),
|
|
66
|
+
i[1] || (i[1] = c(" 条,每页 ", -1))
|
|
67
|
+
], !0)
|
|
68
|
+
])
|
|
69
|
+
]),
|
|
70
|
+
key: "0"
|
|
71
|
+
} : void 0
|
|
72
|
+
]), 1040, ["class", "current-page", "page-size"])) : $("", !0);
|
|
47
73
|
};
|
|
48
74
|
}
|
|
49
75
|
});
|
|
50
76
|
export {
|
|
51
|
-
|
|
77
|
+
J as default
|
|
52
78
|
};
|
|
53
79
|
//# sourceMappingURL=index2.vue.mjs.map
|
|
@@ -23,6 +23,7 @@ export interface PaginationProps {
|
|
|
23
23
|
simple?: boolean;
|
|
24
24
|
[key: string]: any;
|
|
25
25
|
}
|
|
26
|
+
export declare function normalizePaginationAttrs(attrs: Record<string, any>): Record<string, any>;
|
|
26
27
|
export declare function usePagination(props: Ref<PaginationProps | false> | (() => PaginationProps | false)): import('vue').ComputedRef<false | {
|
|
27
28
|
layout: string;
|
|
28
29
|
currentPage: number;
|
|
@@ -1,47 +1,64 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { computed as V, toValue as k } from "vue";
|
|
2
|
+
const _ = [
|
|
3
|
+
"pageNum",
|
|
4
|
+
"pageSize",
|
|
5
|
+
"pageSizeOptions",
|
|
6
|
+
"totalVisible",
|
|
7
|
+
"pageSizeVisible",
|
|
8
|
+
"showTotal",
|
|
9
|
+
"showPageSize",
|
|
10
|
+
"currentPage",
|
|
11
|
+
"pageSizes",
|
|
12
|
+
"totalUnit"
|
|
13
|
+
], v = (e) => e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
|
|
14
|
+
function K(e) {
|
|
15
|
+
const t = { ...e };
|
|
16
|
+
for (const o of _) {
|
|
17
|
+
const i = v(o);
|
|
18
|
+
i !== o && (t[o] === void 0 && e[i] !== void 0 && (t[o] = e[i]), delete t[i]);
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
}
|
|
22
|
+
function j(e) {
|
|
23
|
+
return V(() => {
|
|
24
|
+
const o = k(e);
|
|
5
25
|
if (o === !1)
|
|
6
26
|
return !1;
|
|
7
27
|
const {
|
|
8
28
|
// 对外名优先,EP 名回落:上层已归一化时只会有 EP 名
|
|
9
|
-
pageSizeOptions:
|
|
10
|
-
pageSizes:
|
|
11
|
-
pageSize:
|
|
12
|
-
pageNum:
|
|
13
|
-
currentPage:
|
|
14
|
-
layout:
|
|
15
|
-
size:
|
|
16
|
-
simple:
|
|
17
|
-
totalVisible:
|
|
18
|
-
pageSizeVisible:
|
|
29
|
+
pageSizeOptions: i,
|
|
30
|
+
pageSizes: r,
|
|
31
|
+
pageSize: s = 30,
|
|
32
|
+
pageNum: p,
|
|
33
|
+
currentPage: g,
|
|
34
|
+
layout: u,
|
|
35
|
+
size: c,
|
|
36
|
+
simple: l = !1,
|
|
37
|
+
totalVisible: f,
|
|
38
|
+
pageSizeVisible: z,
|
|
19
39
|
// 旧名回落:新名优先,两者都没给才用默认值
|
|
20
|
-
showTotal:
|
|
21
|
-
showPageSize:
|
|
22
|
-
...
|
|
23
|
-
} = o || {},
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"pager",
|
|
30
|
-
"next",
|
|
31
|
-
a ? "" : "jumper"
|
|
32
|
-
].filter(Boolean).join(", ");
|
|
40
|
+
showTotal: S,
|
|
41
|
+
showPageSize: m,
|
|
42
|
+
...b
|
|
43
|
+
} = o || {}, h = f ?? S ?? !0, n = l === !0 || l === "", a = (i ?? r ?? [10, 30, 50]).slice();
|
|
44
|
+
a.includes(s) || a.push(s);
|
|
45
|
+
const d = [
|
|
46
|
+
h ? "total" : "",
|
|
47
|
+
z ?? m ?? a.length > 0 ? "sizes" : ""
|
|
48
|
+
].filter(Boolean), P = ["prev", "pager", "next", n ? "" : "jumper"].filter(Boolean), w = u ?? [...d, ...n ? [] : ["->"], ...P].join(", ");
|
|
33
49
|
return {
|
|
34
50
|
// EP 2.7+ 官方推荐 size(原 arco simple/mini 语义映射为小尺寸)
|
|
35
|
-
size:
|
|
36
|
-
...
|
|
37
|
-
layout:
|
|
38
|
-
currentPage:
|
|
39
|
-
pageSize:
|
|
40
|
-
pageSizes:
|
|
51
|
+
size: c ?? (n ? "small" : "default"),
|
|
52
|
+
...b,
|
|
53
|
+
layout: w,
|
|
54
|
+
currentPage: p ?? g ?? 1,
|
|
55
|
+
pageSize: s,
|
|
56
|
+
pageSizes: a.sort((y, T) => y - T)
|
|
41
57
|
};
|
|
42
58
|
});
|
|
43
59
|
}
|
|
44
60
|
export {
|
|
45
|
-
|
|
61
|
+
K as normalizePaginationAttrs,
|
|
62
|
+
j as usePagination
|
|
46
63
|
};
|
|
47
64
|
//# sourceMappingURL=usePagination.mjs.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as T, computed as f, ref as B, resolveComponent as x, openBlock as d, createBlock as $, mergeProps as y, withCtx as t, createElementVNode as n, createVNode as r, createElementBlock as g, renderSlot as s, createTextVNode as c, toDisplayString as l, createCommentVNode as N } from "vue";
|
|
2
2
|
import { useZlT as V } from "@zl-ui-kit/composables";
|
|
3
|
+
import _ from "../ZlButton/index.vue.mjs";
|
|
3
4
|
import Z from "../ZlIcon/index.vue.mjs";
|
|
4
|
-
const
|
|
5
|
+
const w = { class: "zl-popconfirm-panel" }, E = { class: "zl-popconfirm-panel__main" }, P = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "zl-popconfirm-panel__title"
|
|
7
|
-
},
|
|
8
|
+
}, R = { class: "zl-popconfirm-panel__content" }, S = { class: "zl-popconfirm-panel__actions" }, q = /* @__PURE__ */ T({
|
|
8
9
|
name: "ZlPopconfirm",
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "index",
|
|
@@ -15,17 +16,17 @@ const b = { class: "zl-popconfirm-panel" }, w = { class: "zl-popconfirm-panel__m
|
|
|
15
16
|
cancelButtonText: {}
|
|
16
17
|
},
|
|
17
18
|
emits: ["confirm", "cancel"],
|
|
18
|
-
setup(o, { emit:
|
|
19
|
-
const a = o, { t:
|
|
20
|
-
function
|
|
21
|
-
i.value?.hide?.(),
|
|
19
|
+
setup(o, { emit: u }) {
|
|
20
|
+
const a = o, { t: m } = V(), v = f(() => a.confirmButtonText ?? m("zl.popconfirm.confirm", "确定")), z = f(() => a.cancelButtonText ?? m("zl.popconfirm.cancel", "取消")), i = B(null), p = u;
|
|
21
|
+
function h() {
|
|
22
|
+
i.value?.hide?.(), p("confirm");
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
i.value?.hide?.(),
|
|
24
|
+
function k() {
|
|
25
|
+
i.value?.hide?.(), p("cancel");
|
|
25
26
|
}
|
|
26
|
-
return (e,
|
|
27
|
-
const
|
|
28
|
-
return
|
|
27
|
+
return (e, A) => {
|
|
28
|
+
const C = x("el-popover");
|
|
29
|
+
return d(), $(C, y({
|
|
29
30
|
ref_key: "popoverRef",
|
|
30
31
|
ref: i,
|
|
31
32
|
class: "zl-popconfirm"
|
|
@@ -34,39 +35,39 @@ const b = { class: "zl-popconfirm-panel" }, w = { class: "zl-popconfirm-panel__m
|
|
|
34
35
|
s(e.$slots, "default")
|
|
35
36
|
]),
|
|
36
37
|
default: t(() => [
|
|
37
|
-
n("div",
|
|
38
|
+
n("div", w, [
|
|
38
39
|
r(Z, {
|
|
39
40
|
class: "zl-popconfirm-panel__icon",
|
|
40
41
|
icon: "zl:information-color"
|
|
41
42
|
}),
|
|
42
|
-
n("div",
|
|
43
|
-
e.$slots.title || o.title ? (
|
|
43
|
+
n("div", E, [
|
|
44
|
+
e.$slots.title || o.title ? (d(), g("div", P, [
|
|
44
45
|
s(e.$slots, "title", {}, () => [
|
|
45
46
|
c(l(o.title), 1)
|
|
46
47
|
])
|
|
47
48
|
])) : N("", !0),
|
|
48
|
-
n("div",
|
|
49
|
+
n("div", R, [
|
|
49
50
|
s(e.$slots, "content", {}, () => [
|
|
50
51
|
c(l(o.content), 1)
|
|
51
52
|
])
|
|
52
53
|
]),
|
|
53
|
-
n("div",
|
|
54
|
-
r(
|
|
54
|
+
n("div", S, [
|
|
55
|
+
r(_, {
|
|
55
56
|
size: "small",
|
|
56
|
-
onClick:
|
|
57
|
+
onClick: k
|
|
57
58
|
}, {
|
|
58
59
|
default: t(() => [
|
|
59
|
-
c(l(
|
|
60
|
+
c(l(z.value), 1)
|
|
60
61
|
]),
|
|
61
62
|
_: 1
|
|
62
63
|
}),
|
|
63
|
-
r(
|
|
64
|
+
r(_, {
|
|
64
65
|
size: "small",
|
|
65
66
|
type: "primary",
|
|
66
|
-
onClick:
|
|
67
|
+
onClick: h
|
|
67
68
|
}, {
|
|
68
69
|
default: t(() => [
|
|
69
|
-
c(l(
|
|
70
|
+
c(l(v.value), 1)
|
|
70
71
|
]),
|
|
71
72
|
_: 1
|
|
72
73
|
})
|
|
@@ -80,6 +81,6 @@ const b = { class: "zl-popconfirm-panel" }, w = { class: "zl-popconfirm-panel__m
|
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
+
q as default
|
|
84
85
|
};
|
|
85
86
|
//# sourceMappingURL=index.vue.mjs.map
|