@zl-ui-kit/components 0.7.2 → 0.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/README.md +102 -63
- package/dist/components/ZlAction/List.vue.mjs +16 -15
- package/dist/components/ZlAction/types.d.ts +5 -2
- package/dist/components/ZlCardPage/index.vue.d.ts +37 -5
- package/dist/components/ZlCardPage/index.vue.mjs +87 -93
- package/dist/components/ZlDictTag/index.vue.d.ts +5 -0
- package/dist/components/ZlDictTag/index.vue.mjs +20 -19
- package/dist/components/ZlPagination/index.css +1 -1
- package/dist/components/ZlPagination/index.vue.mjs +1 -1
- package/dist/components/ZlPagination/usePagination.d.ts +6 -0
- package/dist/components/ZlPagination/usePagination.mjs +22 -19
- package/dist/components/ZlSearch/index.vue.d.ts +3 -0
- package/dist/components/ZlSearch/index.vue.mjs +81 -78
- package/dist/components/ZlSearchTable/index.vue.d.ts +12 -2
- package/dist/components/ZlUpload/index.css +1 -1
- package/dist/components/ZlUpload/index.vue.d.ts +8 -0
- package/dist/components/ZlUpload/index.vue.mjs +2 -2
- package/dist/components/ZlUpload/index2.vue.mjs +76 -72
- package/package.json +7 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { usePageableRequest as
|
|
3
|
-
import { isArray as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent as M, useSlots as V, ref as _, computed as u, watch as x, resolveDirective as F, withDirectives as L, openBlock as m, createElementBlock as P, normalizeStyle as G, createBlock as v, createSlots as H, withCtx as S, renderSlot as h, renderList as k, normalizeProps as J, guardReactiveProps as Q, createCommentVNode as q, createElementVNode as z, Fragment as T, mergeProps as $, unref as g } from "vue";
|
|
2
|
+
import { usePageableRequest as U } from "@zl-ui-kit/composables";
|
|
3
|
+
import { isArray as D } from "@zl-ui-kit/utils";
|
|
4
|
+
import X from "../ZlEmpty/index.vue.mjs";
|
|
5
|
+
import Y from "../ZlPagination/index.vue.mjs";
|
|
6
|
+
import ee from "../ZlSearch/index.vue.mjs";
|
|
7
7
|
import '../ZlSearch/index.css';/* empty css */
|
|
8
|
-
import { usePagination as
|
|
9
|
-
const
|
|
8
|
+
import { usePagination as te } from "../ZlPagination/usePagination.mjs";
|
|
9
|
+
const ae = { class: "zl-card-page__content" }, re = { class: "zl-card-page__list" }, b = "search-", de = /* @__PURE__ */ M({
|
|
10
10
|
name: "ZlCardPage",
|
|
11
11
|
__name: "index",
|
|
12
12
|
props: {
|
|
@@ -18,123 +18,117 @@ const ee = { class: "zl-card-page__content" }, te = { class: "zl-card-page__list
|
|
|
18
18
|
cardMinWidth: {}
|
|
19
19
|
},
|
|
20
20
|
emits: ["search-reset"],
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
21
|
+
setup(r, { expose: R, emit: w }) {
|
|
22
|
+
const i = r, B = w, C = V(), E = _(null), f = u(() => {
|
|
23
|
+
const e = i.request;
|
|
24
|
+
if (e && typeof e == "object" && "run" in e && "data" in e && !("service" in e))
|
|
25
|
+
return {
|
|
26
|
+
instance: e,
|
|
27
|
+
service: () => Promise.resolve([]),
|
|
28
|
+
options: { manual: !0, initialData: [] }
|
|
29
|
+
};
|
|
23
30
|
const t = { manual: !0, initialData: [] };
|
|
24
|
-
if (typeof
|
|
25
|
-
return { service:
|
|
26
|
-
const {
|
|
27
|
-
refreshDeps: e,
|
|
28
|
-
refreshDepsAction: o,
|
|
29
|
-
...a
|
|
30
|
-
} = r.request.options ?? {};
|
|
31
|
+
if (typeof e == "function")
|
|
32
|
+
return { instance: null, service: e, options: t };
|
|
33
|
+
const { refreshDeps: n, refreshDepsAction: a, ...c } = e.options ?? {};
|
|
31
34
|
return {
|
|
32
|
-
|
|
35
|
+
instance: null,
|
|
36
|
+
service: e.service,
|
|
33
37
|
options: {
|
|
38
|
+
...c,
|
|
34
39
|
...t,
|
|
35
|
-
...a
|
|
36
|
-
manual: !0,
|
|
37
|
-
...e ? { refreshDeps: e, refreshDepsAction: o ?? (() => i()) } : {}
|
|
40
|
+
...n ? { refreshDeps: n, refreshDepsAction: a ?? (() => l()) } : {}
|
|
38
41
|
}
|
|
39
42
|
};
|
|
40
|
-
}), {
|
|
41
|
-
loading:
|
|
42
|
-
data:
|
|
43
|
-
run:
|
|
44
|
-
params:
|
|
45
|
-
refresh:
|
|
46
|
-
}
|
|
47
|
-
if (
|
|
48
|
-
return
|
|
43
|
+
}), o = U(f.value.service, f.value.options), I = f.value.instance ?? {
|
|
44
|
+
loading: o.loading,
|
|
45
|
+
data: o.data,
|
|
46
|
+
run: o.run,
|
|
47
|
+
params: o.params,
|
|
48
|
+
refresh: o.refresh
|
|
49
|
+
}, { loading: N, data: s, run: O, params: j, refresh: A } = I, W = u(() => j.value?.[0]), Z = u(() => {
|
|
50
|
+
if (D(s.value))
|
|
51
|
+
return i.pagination && { total: s.value.length, ...i.pagination };
|
|
49
52
|
{
|
|
50
|
-
const { pageNum:
|
|
51
|
-
return { pageNum:
|
|
53
|
+
const { pageNum: e, pageSize: t, total: n = 0 } = s.value;
|
|
54
|
+
return { pageNum: e, pageSize: t, total: n };
|
|
52
55
|
}
|
|
53
|
-
}),
|
|
54
|
-
() =>
|
|
55
|
-
),
|
|
56
|
-
const
|
|
57
|
-
return Object.keys(
|
|
58
|
-
|
|
59
|
-
}),
|
|
56
|
+
}), d = te(() => Z.value ?? !1), y = u(
|
|
57
|
+
() => D(s.value) ? s.value : s.value?.rows ?? []
|
|
58
|
+
), K = u(() => {
|
|
59
|
+
const e = [];
|
|
60
|
+
return Object.keys(C).forEach((t) => {
|
|
61
|
+
t.startsWith(b) && t !== "search-actions" && e.push(t.slice(b.length));
|
|
62
|
+
}), e;
|
|
60
63
|
});
|
|
61
|
-
let
|
|
62
|
-
function
|
|
64
|
+
let p;
|
|
65
|
+
function l(e, t = {
|
|
63
66
|
pageNum: 1,
|
|
64
|
-
pageSize:
|
|
67
|
+
pageSize: d.value !== !1 ? d.value.pageSize : 30
|
|
65
68
|
}) {
|
|
66
|
-
|
|
67
|
-
...
|
|
68
|
-
...
|
|
69
|
-
...
|
|
70
|
-
},
|
|
69
|
+
p = {
|
|
70
|
+
...p,
|
|
71
|
+
...e,
|
|
72
|
+
...t
|
|
73
|
+
}, O(p);
|
|
71
74
|
}
|
|
72
|
-
return
|
|
73
|
-
() =>
|
|
74
|
-
(
|
|
75
|
-
|
|
75
|
+
return x(
|
|
76
|
+
() => i.immediate,
|
|
77
|
+
(e) => {
|
|
78
|
+
e && !i.queryItems.length && l();
|
|
76
79
|
},
|
|
77
80
|
{ immediate: !0, once: !0 }
|
|
78
|
-
),
|
|
79
|
-
refresh:
|
|
80
|
-
params:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
has(t, e) {
|
|
88
|
-
return e in (c.value ?? {});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
)
|
|
92
|
-
}), (t, e) => {
|
|
93
|
-
const o = M("loading");
|
|
94
|
-
return V((u(), q("div", {
|
|
81
|
+
), R({
|
|
82
|
+
refresh: A,
|
|
83
|
+
params: W,
|
|
84
|
+
/** 重新查询并回到第 1 页;消费方可在 useRequest 的 refreshDepsAction 里调用 */
|
|
85
|
+
search: l
|
|
86
|
+
}), (e, t) => {
|
|
87
|
+
const n = F("loading");
|
|
88
|
+
return L((m(), P("div", {
|
|
95
89
|
class: "zl-card-page",
|
|
96
|
-
style:
|
|
90
|
+
style: G({ "--card-min-width": r.cardMinWidth })
|
|
97
91
|
}, [
|
|
98
|
-
|
|
92
|
+
r.queryItems.length || e.$slots["search-actions"] ? (m(), v(ee, {
|
|
99
93
|
key: 0,
|
|
100
94
|
ref_key: "searchRef",
|
|
101
|
-
ref:
|
|
102
|
-
items:
|
|
103
|
-
immediate:
|
|
104
|
-
onSearch:
|
|
105
|
-
onReset:
|
|
106
|
-
},
|
|
107
|
-
|
|
95
|
+
ref: E,
|
|
96
|
+
items: r.queryItems,
|
|
97
|
+
immediate: r.immediate,
|
|
98
|
+
onSearch: l,
|
|
99
|
+
onReset: t[0] || (t[0] = (a) => B("search-reset"))
|
|
100
|
+
}, H({ _: 2 }, [
|
|
101
|
+
e.$slots["search-actions"] ? {
|
|
108
102
|
name: "actions",
|
|
109
|
-
fn:
|
|
110
|
-
h(
|
|
103
|
+
fn: S(() => [
|
|
104
|
+
h(e.$slots, "search-actions")
|
|
111
105
|
]),
|
|
112
106
|
key: "0"
|
|
113
107
|
} : void 0,
|
|
114
|
-
|
|
108
|
+
k(K.value, (a) => ({
|
|
115
109
|
name: a,
|
|
116
|
-
fn:
|
|
117
|
-
h(
|
|
110
|
+
fn: S((c) => [
|
|
111
|
+
h(e.$slots, `search-${a}`, J(Q(c)))
|
|
118
112
|
])
|
|
119
113
|
}))
|
|
120
|
-
]), 1032, ["items", "immediate"])) :
|
|
121
|
-
z("div",
|
|
122
|
-
z("div",
|
|
123
|
-
y.value.length ? (
|
|
124
|
-
key: a[
|
|
125
|
-
}, { ref_for: !0 }, { data: a }))), 128)) : (
|
|
114
|
+
]), 1032, ["items", "immediate"])) : q("", !0),
|
|
115
|
+
z("div", ae, [
|
|
116
|
+
z("div", re, [
|
|
117
|
+
y.value.length ? (m(!0), P(T, { key: 0 }, k(y.value, (a, c) => h(e.$slots, "default", $({
|
|
118
|
+
key: a[r.itemKey] || c
|
|
119
|
+
}, { ref_for: !0 }, { data: a }))), 128)) : (m(), v(X, { key: 1 }))
|
|
126
120
|
])
|
|
127
121
|
]),
|
|
128
|
-
|
|
129
|
-
onChange:
|
|
130
|
-
}), null, 16)) :
|
|
122
|
+
r.pagination && g(d) !== !1 ? (m(), v(Y, $({ key: 1 }, g(d), {
|
|
123
|
+
onChange: t[1] || (t[1] = (a) => l(void 0, a))
|
|
124
|
+
}), null, 16)) : q("", !0)
|
|
131
125
|
], 4)), [
|
|
132
|
-
[
|
|
126
|
+
[n, g(N)]
|
|
133
127
|
]);
|
|
134
128
|
};
|
|
135
129
|
}
|
|
136
130
|
});
|
|
137
131
|
export {
|
|
138
|
-
|
|
132
|
+
de as default
|
|
139
133
|
};
|
|
140
134
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -7,10 +7,15 @@ type __VLS_Props = {
|
|
|
7
7
|
corner?: boolean | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
8
8
|
value?: string;
|
|
9
9
|
simple?: boolean;
|
|
10
|
+
/** 是否展示字典项图标(默认 true) */
|
|
11
|
+
iconVisible?: boolean;
|
|
12
|
+
/** @deprecated 用 `iconVisible`:全库显隐统一用 visible 语义,且不要用反向命名 */
|
|
10
13
|
hideIcon?: boolean;
|
|
11
14
|
};
|
|
12
15
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
13
16
|
corner: boolean | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
17
|
+
iconVisible: boolean;
|
|
18
|
+
hideIcon: boolean;
|
|
14
19
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
20
|
export default _default;
|
|
16
21
|
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as f, watch as y, computed as
|
|
1
|
+
import { defineComponent as f, watch as y, computed as l, openBlock as n, createBlock as s, mergeProps as u, withCtx as d, createTextVNode as p, toDisplayString as m } from "vue";
|
|
2
2
|
import { useDict as g, useDictStore as h } from "@zl-ui-kit/composables";
|
|
3
|
-
import
|
|
3
|
+
import B from "../ZlTag/ZlCornerTag.vue.mjs";
|
|
4
4
|
import '../ZlTag/index.css';import '../ZlTag/ZlCornerTag.css';/* empty css */
|
|
5
|
-
import
|
|
5
|
+
import _ from "../ZlTag/index.vue.mjs";
|
|
6
6
|
/* empty css */
|
|
7
|
-
const
|
|
7
|
+
const K = /* @__PURE__ */ f({
|
|
8
8
|
name: "ZlDictTag",
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|
|
@@ -13,44 +13,45 @@ const b = /* @__PURE__ */ f({
|
|
|
13
13
|
corner: { type: [Boolean, String], default: !1 },
|
|
14
14
|
value: {},
|
|
15
15
|
simple: { type: Boolean },
|
|
16
|
-
|
|
16
|
+
iconVisible: { type: Boolean, default: void 0 },
|
|
17
|
+
hideIcon: { type: Boolean, default: void 0 }
|
|
17
18
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const e =
|
|
19
|
+
setup(i) {
|
|
20
|
+
const e = i, v = g(e.dictKey, { data: e.dict });
|
|
20
21
|
y(
|
|
21
22
|
() => e.dict,
|
|
22
23
|
(t) => {
|
|
23
24
|
if (t?.length) {
|
|
24
|
-
const { dictStore:
|
|
25
|
-
|
|
25
|
+
const { dictStore: a } = h();
|
|
26
|
+
a.value = { ...a.value, [e.dictKey]: t };
|
|
26
27
|
}
|
|
27
28
|
},
|
|
28
29
|
{ deep: !1 }
|
|
29
30
|
);
|
|
30
|
-
const o =
|
|
31
|
+
const o = l(() => v.value.find((t) => t.value === e.value)), r = l(() => o.value ? {
|
|
31
32
|
color: e.simple ? void 0 : o.value.color,
|
|
32
|
-
icon: e.hideIcon ?
|
|
33
|
-
} : {}),
|
|
34
|
-
return (t,
|
|
33
|
+
icon: e.iconVisible ?? !e.hideIcon ? o.value.icon : void 0
|
|
34
|
+
} : {}), c = l(() => e.corner === !0 ? "top-right" : e.corner);
|
|
35
|
+
return (t, a) => c.value ? (n(), s(B, u({
|
|
35
36
|
key: 0,
|
|
36
37
|
class: "zl-dict-corner-tag"
|
|
37
|
-
}, { ...
|
|
38
|
+
}, { ...r.value, ...t.$attrs }, { position: c.value }), {
|
|
38
39
|
default: d(() => [
|
|
39
|
-
p(m(o.value?.label ||
|
|
40
|
+
p(m(o.value?.label || i.value), 1)
|
|
40
41
|
]),
|
|
41
42
|
_: 1
|
|
42
|
-
}, 16, ["position"])) : (n(), s(
|
|
43
|
+
}, 16, ["position"])) : (n(), s(_, u({
|
|
43
44
|
key: 1,
|
|
44
45
|
class: "zl-dict-tag"
|
|
45
|
-
}, { ...
|
|
46
|
+
}, { ...r.value, ...t.$attrs }), {
|
|
46
47
|
default: d(() => [
|
|
47
|
-
p(m(o.value?.label ||
|
|
48
|
+
p(m(o.value?.label || i.value), 1)
|
|
48
49
|
]),
|
|
49
50
|
_: 1
|
|
50
51
|
}, 16));
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
+
K as default
|
|
55
56
|
};
|
|
56
57
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.zl-pagination[data-v-
|
|
1
|
+
@charset "UTF-8";.zl-pagination[data-v-fd07517c]{padding:6px 16px;background-color:var(--zl-fill-1, #f9fbfd);justify-content:var(--zl-pagination-justify, flex-end)}.zl-pagination--left[data-v-fd07517c]{--zl-pagination-justify: flex-start}.zl-pagination--center[data-v-fd07517c]{--zl-pagination-justify: center}.zl-pagination--right[data-v-fd07517c]{--zl-pagination-justify: flex-end}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index2.vue.mjs";
|
|
2
2
|
import './index.css';/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fd07517c"]]);
|
|
5
5
|
export {
|
|
6
6
|
i as default
|
|
7
7
|
};
|
|
@@ -4,7 +4,13 @@ export interface PaginationProps {
|
|
|
4
4
|
pageNum?: number;
|
|
5
5
|
pageSize?: number;
|
|
6
6
|
pageSizeOptions?: number[];
|
|
7
|
+
/** 是否展示总数(默认 true) */
|
|
8
|
+
totalVisible?: boolean;
|
|
9
|
+
/** 是否展示每页条数选择器(默认 true) */
|
|
10
|
+
pageSizeVisible?: boolean;
|
|
11
|
+
/** @deprecated 用 `totalVisible`(全库显隐统一用 visible 语义) */
|
|
7
12
|
showTotal?: boolean;
|
|
13
|
+
/** @deprecated 用 `pageSizeVisible`(全库显隐统一用 visible 语义) */
|
|
8
14
|
showPageSize?: boolean;
|
|
9
15
|
simple?: boolean;
|
|
10
16
|
[key: string]: any;
|
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
const o =
|
|
1
|
+
import { computed as S, toValue as h } from "vue";
|
|
2
|
+
function P(s) {
|
|
3
|
+
return S(() => {
|
|
4
|
+
const o = h(s);
|
|
5
5
|
if (o === !1)
|
|
6
6
|
return !1;
|
|
7
7
|
const {
|
|
8
|
-
pageSizeOptions:
|
|
8
|
+
pageSizeOptions: a = [10, 30, 50],
|
|
9
9
|
pageSize: t = 30,
|
|
10
10
|
pageNum: n = 1,
|
|
11
|
-
simple:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
simple: i = !0,
|
|
12
|
+
totalVisible: r,
|
|
13
|
+
pageSizeVisible: l,
|
|
14
|
+
// 旧名回落:新名优先,两者都没给才用默认值
|
|
15
|
+
showTotal: p,
|
|
16
|
+
showPageSize: u,
|
|
17
|
+
...g
|
|
18
|
+
} = o || {}, c = r ?? p ?? !0, e = a.slice();
|
|
16
19
|
e.includes(t) || e.push(t);
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
const f = [
|
|
21
|
+
c ? "total" : "",
|
|
22
|
+
l ?? u ?? e.length > 0 ? "sizes" : "",
|
|
20
23
|
"prev",
|
|
21
24
|
"pager",
|
|
22
25
|
"next",
|
|
23
|
-
|
|
26
|
+
i ? "" : "jumper"
|
|
24
27
|
].filter(Boolean).join(", ");
|
|
25
28
|
return {
|
|
26
29
|
// EP 2.7+ 官方推荐 size(原 arco simple/mini 语义映射为小尺寸)
|
|
27
|
-
size:
|
|
28
|
-
...
|
|
29
|
-
layout:
|
|
30
|
+
size: i ? "small" : "default",
|
|
31
|
+
...g,
|
|
32
|
+
layout: f,
|
|
30
33
|
currentPage: n,
|
|
31
34
|
pageSize: t,
|
|
32
|
-
pageSizes: e.sort((
|
|
35
|
+
pageSizes: e.sort((z, m) => z - m)
|
|
33
36
|
};
|
|
34
37
|
});
|
|
35
38
|
}
|
|
36
39
|
export {
|
|
37
|
-
|
|
40
|
+
P as usePagination
|
|
38
41
|
};
|
|
39
42
|
//# sourceMappingURL=usePagination.mjs.map
|
|
@@ -13,6 +13,8 @@ type __VLS_Props = {
|
|
|
13
13
|
/** 禁用全部查询项 */
|
|
14
14
|
disabled?: boolean;
|
|
15
15
|
/** 是否展示「筛选条件」标签行;不传时按「是否发生溢出」自动判定 */
|
|
16
|
+
labelsVisible?: boolean;
|
|
17
|
+
/** @deprecated 用 `labelsVisible`(全库显隐统一用 visible 语义) */
|
|
16
18
|
showLabels?: boolean;
|
|
17
19
|
};
|
|
18
20
|
declare function search(): Promise<void>;
|
|
@@ -239,6 +241,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
|
|
|
239
241
|
immediate: boolean;
|
|
240
242
|
disabled: boolean;
|
|
241
243
|
items: SearchItem[];
|
|
244
|
+
labelsVisible: boolean;
|
|
242
245
|
showLabels: boolean;
|
|
243
246
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
244
247
|
formRef: ({
|