@zl-ui-kit/components 0.27.0 → 0.27.2
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 +18 -22
- package/dist/components/ZlAction/List.vue.mjs +49 -46
- package/dist/components/ZlAction/index.vue.d.ts +7 -1
- package/dist/components/ZlAction/index.vue.mjs +12 -8
- package/dist/components/ZlAction/types.d.ts +5 -2
- package/dist/components/ZlAppLayout/HeaderAside.css +1 -0
- package/dist/components/ZlAppLayout/HeaderAside.vue.d.ts +25 -0
- package/dist/components/ZlAppLayout/HeaderAside.vue.mjs +65 -0
- package/dist/components/ZlAppLayout/HeaderAside3.vue.mjs +6 -0
- package/dist/components/ZlAppLayout/Horizontal.css +1 -1
- package/dist/components/ZlAppLayout/Horizontal.vue.mjs +39 -3
- package/dist/components/ZlAppLayout/Horizontal3.vue.mjs +6 -0
- package/dist/components/ZlAppLayout/Vertical.css +1 -1
- package/dist/components/ZlAppLayout/Vertical.vue.mjs +51 -3
- package/dist/components/ZlAppLayout/Vertical3.vue.mjs +6 -0
- package/dist/components/ZlAppLayout/index.vue.d.ts +6 -6
- package/dist/components/ZlAppLayout/index.vue.mjs +14 -8
- 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/ZlBreadcrumb/index.css +1 -0
- package/dist/components/ZlBreadcrumb/index.vue.d.ts +32 -0
- package/dist/components/ZlBreadcrumb/index.vue.mjs +58 -0
- package/dist/components/ZlBreadcrumb/index3.vue.mjs +6 -0
- package/dist/components/ZlBreadcrumb/types.d.ts +16 -0
- package/dist/components/ZlButton/index.vue.d.ts +81 -0
- package/dist/components/ZlButton/index.vue.mjs +60 -0
- package/dist/components/ZlButton/index2.vue.mjs +5 -0
- package/dist/components/ZlCardPage/index.vue.d.ts +41 -3
- package/dist/components/ZlCardPage/index.vue.mjs +68 -68
- package/dist/components/ZlCardPage/resolvePagination.d.ts +20 -0
- package/dist/components/ZlCardPage/resolvePagination.mjs +24 -0
- package/dist/components/ZlCheckboxTag/index.css +1 -1
- package/dist/components/ZlCheckboxTag/index.vue.d.ts +4 -4
- package/dist/components/ZlCheckboxTag/index.vue.mjs +34 -30
- package/dist/components/ZlCopy/copy.mjs +17 -7
- package/dist/components/ZlCopy/index.css +1 -1
- package/dist/components/ZlCopy/index.vue.mjs +2 -2
- package/dist/components/ZlCopy/index2.vue.mjs +34 -36
- package/dist/components/ZlDescription/index.css +1 -1
- package/dist/components/ZlDescription/index.vue.mjs +28 -24
- package/dist/components/ZlDevMenu/index.css +1 -0
- package/dist/components/ZlDevMenu/index.vue.d.ts +33 -0
- package/dist/components/ZlDevMenu/index.vue.mjs +110 -0
- package/dist/components/ZlDevMenu/index3.vue.mjs +6 -0
- package/dist/components/ZlDevMenu/types.d.ts +8 -0
- package/dist/components/ZlDialog/index.css +1 -1
- package/dist/components/ZlDialog/index.vue.d.ts +3 -0
- package/dist/components/ZlDialog/index.vue.mjs +39 -35
- package/dist/components/ZlDictTag/index.vue.d.ts +12 -3
- package/dist/components/ZlDictTag/index.vue.mjs +31 -26
- package/dist/components/ZlDrawer/index.css +1 -1
- package/dist/components/ZlDrawer/index.vue.d.ts +3 -0
- package/dist/components/ZlDrawer/index.vue.mjs +36 -32
- package/dist/components/ZlDynamicComponent/index.vue.d.ts +5 -3
- package/dist/components/ZlForm/index.css +1 -1
- package/dist/components/ZlForm/index.vue.d.ts +7 -0
- package/dist/components/ZlForm/index.vue.mjs +50 -47
- package/dist/components/ZlLayoutSwitch/index.css +1 -1
- package/dist/components/ZlLayoutSwitch/index.vue.d.ts +10 -0
- package/dist/components/ZlLayoutSwitch/index.vue.mjs +1 -1
- package/dist/components/ZlLayoutSwitch/index2.vue.mjs +27 -19
- package/dist/components/ZlLoading/index.css +1 -0
- package/dist/components/ZlLoading/index.vue.d.ts +27 -0
- package/dist/components/ZlLoading/index.vue.mjs +8 -0
- package/dist/components/ZlLoading/index2.vue.mjs +30 -0
- 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/ZlMenu/MenuIcon.d.ts +17 -0
- package/dist/components/ZlMenu/MenuIcon.mjs +21 -0
- package/dist/components/ZlMenu/ZlMenuItem.vue.d.ts +7 -0
- package/dist/components/ZlMenu/ZlMenuItem.vue.mjs +53 -0
- package/dist/components/ZlMenu/ZlMenuItem2.vue.mjs +5 -0
- package/dist/components/ZlMenu/index.css +1 -0
- package/dist/components/ZlMenu/index.vue.d.ts +40 -0
- package/dist/components/ZlMenu/index.vue.mjs +60 -0
- package/dist/components/ZlMenu/index3.vue.mjs +6 -0
- package/dist/components/ZlMenu/types.d.ts +20 -0
- package/dist/components/ZlPageContainer/index.css +1 -1
- package/dist/components/ZlPageContainer/index.vue.mjs +1 -1
- 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.d.ts +25 -0
- package/dist/components/ZlSearch/index.vue.mjs +202 -205
- package/dist/components/ZlSearchTable/index.vue.d.ts +40 -2
- package/dist/components/ZlSearchTable/index.vue.mjs +59 -55
- package/dist/components/ZlTable/useTablePagination.d.ts +1 -0
- package/dist/components/ZlTable/useTablePagination.mjs +37 -23
- package/dist/components/ZlTabs/index.vue.d.ts +16 -3
- package/dist/components/ZlTag/ZlCornerTag.css +1 -1
- package/dist/components/ZlTag/ZlCornerTag.vue.d.ts +14 -1
- package/dist/components/ZlTag/ZlCornerTag.vue.mjs +25 -14
- package/dist/components/ZlTag/index.vue.mjs +4 -4
- package/dist/components/ZlUpload/index.css +1 -1
- package/dist/components/ZlUpload/index.vue.d.ts +44 -3
- package/dist/components/ZlUpload/index.vue.mjs +3 -3
- package/dist/components/ZlUpload/index2.vue.mjs +119 -79
- package/dist/index.d.ts +8 -2
- package/dist/index.mjs +183 -169
- package/dist/locales/en.mjs +2 -2
- package/dist/locales/zh-cn.mjs +3 -3
- package/package.json +5 -5
- package/dist/components/ZlAppLayout/Horizontal2.vue.mjs +0 -42
- package/dist/components/ZlAppLayout/Vertical2.vue.mjs +0 -56
- package/dist/components/ZlAppMenu/AppMenu.css +0 -1
- package/dist/components/ZlAppMenu/AppMenu.vue.d.ts +0 -27
- package/dist/components/ZlAppMenu/AppMenu.vue.mjs +0 -37
- package/dist/components/ZlAppMenu/AppMenu3.vue.mjs +0 -6
- package/dist/components/ZlAppMenu/AppMenuItem.vue.d.ts +0 -11
- package/dist/components/ZlAppMenu/AppMenuItem.vue.mjs +0 -58
- package/dist/components/ZlAppMenu/AppMenuItem2.vue.mjs +0 -5
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { defineComponent as M, useSlots as V, ref 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 P, computed as o, watch as x, resolveDirective as F, withDirectives as G, openBlock as l, createElementBlock as b, normalizeStyle as H, createBlock as h, createSlots as J, withCtx as k, renderSlot as g, renderList as z, normalizeProps as Q, guardReactiveProps as T, createCommentVNode as q, createElementVNode as $, Fragment as U, mergeProps as D, unref as v } from "vue";
|
|
2
|
+
import { usePageableRequest as X } from "@zl-ui-kit/composables";
|
|
3
|
+
import { isArray as Y } from "@zl-ui-kit/utils";
|
|
4
|
+
import _ from "../ZlEmpty/index.vue.mjs";
|
|
5
|
+
import ee from "../ZlPagination/index.vue.mjs";
|
|
6
|
+
import te from "../ZlSearch/index.vue.mjs";
|
|
7
7
|
import '../ZlSearch/index.css';/* empty css */
|
|
8
|
-
import { usePagination as
|
|
9
|
-
|
|
8
|
+
import { usePagination as ae } from "../ZlPagination/usePagination.mjs";
|
|
9
|
+
import { resolveCardPagePagination as se } from "./resolvePagination.mjs";
|
|
10
|
+
const re = { class: "zl-card-page__content" }, ie = { class: "zl-card-page__list" }, B = "search-", he = /* @__PURE__ */ M({
|
|
10
11
|
name: "ZlCardPage",
|
|
11
12
|
__name: "index",
|
|
12
13
|
props: {
|
|
13
14
|
immediate: { type: Boolean, default: !0 },
|
|
14
15
|
request: {},
|
|
15
16
|
queryItems: { default: () => [] },
|
|
17
|
+
hideEmptyLabel: { type: Boolean, default: !1 },
|
|
16
18
|
pagination: { type: [Object, Boolean], default: !0 },
|
|
17
19
|
itemKey: { default: "id" },
|
|
18
20
|
cardMinWidth: {}
|
|
19
21
|
},
|
|
20
22
|
emits: ["search-reset"],
|
|
21
|
-
setup(s, { expose:
|
|
22
|
-
const
|
|
23
|
-
const e =
|
|
23
|
+
setup(s, { expose: C, emit: E }) {
|
|
24
|
+
const c = s, N = E, R = V(), w = P(null), p = o(() => {
|
|
25
|
+
const e = c.request;
|
|
24
26
|
if (e && typeof e == "object" && "run" in e && "data" in e && !("service" in e))
|
|
25
27
|
return {
|
|
26
28
|
instance: e,
|
|
@@ -30,112 +32,110 @@ const ae = { class: "zl-card-page__content" }, se = { class: "zl-card-page__list
|
|
|
30
32
|
const t = { manual: !0, initialData: [] };
|
|
31
33
|
if (typeof e == "function")
|
|
32
34
|
return { instance: null, service: e, options: t };
|
|
33
|
-
const { refreshDeps:
|
|
35
|
+
const { refreshDeps: d, refreshDepsAction: a, ...n } = e.options ?? {};
|
|
34
36
|
return {
|
|
35
37
|
instance: null,
|
|
36
38
|
service: e.service,
|
|
37
39
|
options: {
|
|
38
|
-
...
|
|
40
|
+
...n,
|
|
39
41
|
...t,
|
|
40
|
-
...
|
|
42
|
+
...d ? { refreshDeps: d, refreshDepsAction: a ?? (() => i()) } : {}
|
|
41
43
|
}
|
|
42
44
|
};
|
|
43
|
-
}),
|
|
44
|
-
loading:
|
|
45
|
-
data:
|
|
46
|
-
run:
|
|
47
|
-
params:
|
|
48
|
-
refresh:
|
|
49
|
-
}, { loading: O, data:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
total: e.total ?? 0
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
}), d = te(() => Z.value ?? !1), S = u(
|
|
62
|
-
() => b(i.value) ? i.value : i.value?.rows ?? []
|
|
63
|
-
), K = u(() => {
|
|
45
|
+
}), r = X(p.value.service, p.value.options), I = p.value.instance ?? {
|
|
46
|
+
loading: r.loading,
|
|
47
|
+
data: r.data,
|
|
48
|
+
run: r.run,
|
|
49
|
+
params: r.params,
|
|
50
|
+
refresh: r.refresh
|
|
51
|
+
}, { loading: O, data: m, run: j, params: A, refresh: L } = I, W = o(() => A.value?.[0]), y = P({ pageNum: 1 }), Z = o(
|
|
52
|
+
() => se({
|
|
53
|
+
data: m.value,
|
|
54
|
+
pagination: c.pagination,
|
|
55
|
+
pageState: y.value
|
|
56
|
+
})
|
|
57
|
+
), u = ae(() => Z.value ?? !1), S = o(
|
|
58
|
+
() => Y(m.value) ? m.value : m.value?.rows ?? []
|
|
59
|
+
), K = o(() => {
|
|
64
60
|
const e = [];
|
|
65
|
-
return Object.keys(
|
|
66
|
-
t.startsWith(
|
|
61
|
+
return Object.keys(R).forEach((t) => {
|
|
62
|
+
t.startsWith(B) && t !== "search-actions" && e.push(t.slice(B.length));
|
|
67
63
|
}), e;
|
|
68
64
|
});
|
|
69
65
|
let f;
|
|
70
|
-
function
|
|
66
|
+
function i(e, t = {
|
|
71
67
|
pageNum: 1,
|
|
72
|
-
pageSize:
|
|
68
|
+
pageSize: u.value !== !1 ? u.value.pageSize : 30
|
|
73
69
|
}) {
|
|
74
70
|
f = {
|
|
75
71
|
...f,
|
|
76
72
|
...e,
|
|
77
73
|
...t
|
|
74
|
+
}, y.value = {
|
|
75
|
+
pageNum: t?.pageNum ?? 1,
|
|
76
|
+
pageSize: t?.pageSize
|
|
78
77
|
}, j(f);
|
|
79
78
|
}
|
|
80
79
|
return x(
|
|
81
|
-
() =>
|
|
80
|
+
() => c.immediate,
|
|
82
81
|
(e) => {
|
|
83
|
-
e && !
|
|
82
|
+
e && !c.queryItems.length && i();
|
|
84
83
|
},
|
|
85
84
|
{ immediate: !0, once: !0 }
|
|
86
|
-
),
|
|
85
|
+
), C({
|
|
87
86
|
/** 原地重查:用最近一次入参重新请求,保持当前页码(区别于 `search()` 会回到第 1 页) */
|
|
88
|
-
refresh:
|
|
87
|
+
refresh: L,
|
|
89
88
|
/** 最近一次请求的入参(`{ pageNum, pageSize, ...查询表单 }`),未请求过时为 `undefined` */
|
|
90
|
-
params:
|
|
89
|
+
params: W,
|
|
91
90
|
/** 重新查询并回到第 1 页;消费方可在 useRequest 的 refreshDepsAction 里调用 */
|
|
92
|
-
search:
|
|
91
|
+
search: i
|
|
93
92
|
}), (e, t) => {
|
|
94
|
-
const
|
|
95
|
-
return
|
|
93
|
+
const d = F("loading");
|
|
94
|
+
return G((l(), b("div", {
|
|
96
95
|
class: "zl-card-page",
|
|
97
|
-
style:
|
|
96
|
+
style: H({ "--card-min-width": s.cardMinWidth })
|
|
98
97
|
}, [
|
|
99
|
-
s.queryItems.length || e.$slots["search-actions"] ? (
|
|
98
|
+
s.queryItems.length || e.$slots["search-actions"] ? (l(), h(te, {
|
|
100
99
|
key: 0,
|
|
101
100
|
ref_key: "searchRef",
|
|
102
|
-
ref:
|
|
101
|
+
ref: w,
|
|
103
102
|
items: s.queryItems,
|
|
104
103
|
immediate: s.immediate,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
"hide-empty-label": s.hideEmptyLabel,
|
|
105
|
+
onSearch: i,
|
|
106
|
+
onReset: t[0] || (t[0] = (a) => N("search-reset"))
|
|
107
|
+
}, J({ _: 2 }, [
|
|
108
108
|
e.$slots["search-actions"] ? {
|
|
109
109
|
name: "actions",
|
|
110
|
-
fn:
|
|
111
|
-
|
|
110
|
+
fn: k(() => [
|
|
111
|
+
g(e.$slots, "search-actions")
|
|
112
112
|
]),
|
|
113
113
|
key: "0"
|
|
114
114
|
} : void 0,
|
|
115
|
-
|
|
115
|
+
z(K.value, (a) => ({
|
|
116
116
|
name: a,
|
|
117
|
-
fn:
|
|
118
|
-
|
|
117
|
+
fn: k((n) => [
|
|
118
|
+
g(e.$slots, `search-${a}`, Q(T(n)))
|
|
119
119
|
])
|
|
120
120
|
}))
|
|
121
|
-
]), 1032, ["items", "immediate"])) : q("", !0),
|
|
122
|
-
$("div",
|
|
123
|
-
$("div",
|
|
124
|
-
S.value.length ? (
|
|
125
|
-
key: a[s.itemKey] ||
|
|
126
|
-
}, { ref_for: !0 }, { data: a }))), 128)) : (
|
|
121
|
+
]), 1032, ["items", "immediate", "hide-empty-label"])) : q("", !0),
|
|
122
|
+
$("div", re, [
|
|
123
|
+
$("div", ie, [
|
|
124
|
+
S.value.length ? (l(!0), b(U, { key: 0 }, z(S.value, (a, n) => g(e.$slots, "default", D({
|
|
125
|
+
key: a[s.itemKey] || n
|
|
126
|
+
}, { ref_for: !0 }, { data: a }))), 128)) : (l(), h(_, { key: 1 }))
|
|
127
127
|
])
|
|
128
128
|
]),
|
|
129
|
-
s.pagination &&
|
|
130
|
-
onChange: t[1] || (t[1] = (a) =>
|
|
129
|
+
s.pagination && v(u) !== !1 ? (l(), h(ee, D({ key: 1 }, v(u), {
|
|
130
|
+
onChange: t[1] || (t[1] = (a) => i(void 0, a))
|
|
131
131
|
}), null, 16)) : q("", !0)
|
|
132
132
|
], 4)), [
|
|
133
|
-
[
|
|
133
|
+
[d, v(O)]
|
|
134
134
|
]);
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
export {
|
|
139
|
-
|
|
139
|
+
he as default
|
|
140
140
|
};
|
|
141
141
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZlCardPage 的分页数据源解析(纯函数,便于回归测试)。
|
|
3
|
+
*
|
|
4
|
+
* 无论接口返回行数组还是分页对象,结果里都必须带上「本次请求的目标页码」:
|
|
5
|
+
* 下发的 `currentPage` 只有会随查询 / 重置变化,ZlPagination 的监听才会触发。
|
|
6
|
+
* 否则数组响应(或接口不回传 pageNum)时 currentPage 恒为 1,在第 N 页点重置
|
|
7
|
+
* 就会出现「数据已回第 1 页、分页器仍停在第 N 页」。
|
|
8
|
+
*/
|
|
9
|
+
export interface CardPageState {
|
|
10
|
+
/** 本次请求的目标页码,由 `search()` 写入;`refresh()` 不改(原地重查保持页码) */
|
|
11
|
+
pageNum: number;
|
|
12
|
+
/** 本次请求的目标页容量 */
|
|
13
|
+
pageSize?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function resolveCardPagePagination(options: {
|
|
16
|
+
data: any;
|
|
17
|
+
pagination: Record<string, any> | boolean | undefined;
|
|
18
|
+
pageState: CardPageState;
|
|
19
|
+
}): Record<string, any> | false;
|
|
20
|
+
//# sourceMappingURL=resolvePagination.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isArray as p } from "@zl-ui-kit/utils";
|
|
2
|
+
function f(o) {
|
|
3
|
+
const { data: a, pagination: t, pageState: g } = o;
|
|
4
|
+
if (t === !1) return !1;
|
|
5
|
+
const e = (t === !0 ? {} : t) ?? {}, { pageNum: i, pageSize: r } = g;
|
|
6
|
+
if (p(a))
|
|
7
|
+
return {
|
|
8
|
+
...e,
|
|
9
|
+
pageNum: i,
|
|
10
|
+
pageSize: r ?? e.pageSize ?? 30,
|
|
11
|
+
total: a.length
|
|
12
|
+
};
|
|
13
|
+
const n = a ?? {};
|
|
14
|
+
return {
|
|
15
|
+
...e,
|
|
16
|
+
pageNum: i,
|
|
17
|
+
pageSize: r ?? n.pageSize ?? e.pageSize ?? 30,
|
|
18
|
+
total: n.total ?? 0
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
f as resolveCardPagePagination
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=resolvePagination.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.zl-checkbox-tag{display:inline-flex;flex-wrap:wrap;gap:8px}.zl-checkbox-tag .zl-
|
|
1
|
+
.zl-checkbox-tag{display:inline-flex;flex-wrap:wrap;gap:8px}.zl-checkbox-tag .zl-checkbox-tag__plain:not(.zl-tag-selected){background-color:var(--zl-fill-2)}.zl-checkbox-tag .zl-checkbox-tag__plain:not(.zl-tag-selected):hover:not(.zl-tag-disabled){background-color:var(--zl-fill-3)}.zl-checkbox-tag .zl-tag.zl-tag-selected:not(.zl-tag-disabled):hover{background-color:var(--tag-color-fill)}.zl-checkbox-tag .zl-tag-disabled{color:var(--zl-text-4)}.zl-checkbox-tag .zl-tag-disabled.zl-tag-selected{background-color:var(--zl-primary-1);color:var(--zl-primary-3);border-color:var(--zl-primary-3)}
|
|
@@ -12,9 +12,9 @@ type __VLS_Props = {
|
|
|
12
12
|
options?: CheckboxTagOption[];
|
|
13
13
|
/** 单选模式(值为单值) */
|
|
14
14
|
single?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
rounded?: boolean;
|
|
17
|
-
/**
|
|
15
|
+
/** 是否圆角显示,默认开启;也可为具体圆角值(数字 px 或 CSS 长度),false 关闭(直角/small) */
|
|
16
|
+
rounded?: boolean | number | string;
|
|
17
|
+
/** 是否显示边框,默认开启 */
|
|
18
18
|
bordered?: boolean;
|
|
19
19
|
/** 是否填充背景色,默认开启 */
|
|
20
20
|
fill?: boolean;
|
|
@@ -44,7 +44,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
44
44
|
fill: boolean;
|
|
45
45
|
size: "mini" | "small" | "medium";
|
|
46
46
|
bordered: boolean;
|
|
47
|
-
rounded: boolean;
|
|
47
|
+
rounded: boolean | number | string;
|
|
48
48
|
options: CheckboxTagOption[];
|
|
49
49
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
50
50
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as x, useModel as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as x, useModel as b, computed as t, ref as h, openBlock as c, createElementBlock as v, Fragment as k, renderList as m, createBlock as y, normalizeStyle as z, normalizeClass as B, withCtx as C, renderSlot as S, mergeProps as V, createTextVNode as $, toDisplayString as E, mergeModels as M } from "vue";
|
|
2
|
+
import w from "../ZlTag/index.vue.mjs";
|
|
3
3
|
import '../ZlTag/index.css';/* empty css */
|
|
4
|
-
const
|
|
4
|
+
const N = { class: "zl-checkbox-tag" }, F = /* @__PURE__ */ x({
|
|
5
5
|
name: "ZlCheckboxTag",
|
|
6
6
|
__name: "index",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ M({
|
|
8
8
|
options: { default: () => [] },
|
|
9
9
|
single: { type: Boolean },
|
|
10
|
-
rounded: { type: Boolean, default: !0 },
|
|
10
|
+
rounded: { type: [Boolean, Number, String], default: !0 },
|
|
11
11
|
bordered: { type: Boolean, default: !0 },
|
|
12
12
|
fill: { type: Boolean, default: !0 },
|
|
13
13
|
size: { default: "small" }
|
|
@@ -17,51 +17,55 @@ const M = { class: "zl-checkbox-tag" }, T = /* @__PURE__ */ x({
|
|
|
17
17
|
}),
|
|
18
18
|
emits: ["update:modelValue"],
|
|
19
19
|
setup(o) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const a = o, u = b(o, "modelValue"), f = t(() => {
|
|
21
|
+
if (typeof a.rounded == "number") return { "--zl-radius-round": `${a.rounded}px` };
|
|
22
|
+
if (typeof a.rounded == "string") return { "--zl-radius-round": a.rounded };
|
|
23
|
+
}), i = t(() => a.options.some((e) => e.exclusive)), d = h();
|
|
24
|
+
if (i.value && u.value) {
|
|
25
|
+
const e = a.options.find((n) => n.value === u.value[0]);
|
|
23
26
|
d.value = e?.exclusive;
|
|
24
27
|
}
|
|
25
|
-
const
|
|
26
|
-
function
|
|
28
|
+
const r = t(() => new Set(a.single ? [u.value] : u.value ?? []));
|
|
29
|
+
function p(e) {
|
|
27
30
|
if (e.disabled) return;
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
31
|
-
|
|
31
|
+
const n = a.single ? [u.value] : [...u.value ?? []], l = n.includes(e.value);
|
|
32
|
+
if (i.value && !l) {
|
|
33
|
+
const s = e;
|
|
34
|
+
s.exclusive === !0 || s.exclusive !== d.value ? (u.value = [e.value], d.value = s.exclusive) : u.value = [...n, e.value];
|
|
32
35
|
return;
|
|
33
36
|
}
|
|
34
37
|
if (l) {
|
|
35
|
-
const
|
|
36
|
-
|
|
38
|
+
const s = n.filter((g) => g !== e.value);
|
|
39
|
+
u.value = a.single ? s[0] : s;
|
|
37
40
|
} else
|
|
38
|
-
|
|
41
|
+
a.single ? u.value = e.value : u.value = [...n, e.value];
|
|
39
42
|
}
|
|
40
|
-
return (e,
|
|
41
|
-
(
|
|
43
|
+
return (e, n) => (c(), v("div", N, [
|
|
44
|
+
(c(!0), v(k, null, m(o.options, (l) => (c(), y(w, {
|
|
42
45
|
key: l.value,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
class: B({ "zl-checkbox-tag__plain": !r.value.has(l.value) && o.fill }),
|
|
47
|
+
style: z(f.value),
|
|
48
|
+
rounded: o.rounded !== !1,
|
|
49
|
+
color: r.value.has(l.value) ? "primary" : void 0,
|
|
50
|
+
bordered: o.bordered,
|
|
47
51
|
selectable: "",
|
|
48
|
-
selected:
|
|
52
|
+
selected: r.value.has(l.value),
|
|
49
53
|
disabled: l.disabled,
|
|
50
54
|
icon: l.icon,
|
|
51
55
|
size: o.size,
|
|
52
|
-
onClick: (
|
|
56
|
+
onClick: (s) => p(l)
|
|
53
57
|
}, {
|
|
54
|
-
default:
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
default: C(() => [
|
|
59
|
+
S(e.$slots, "default", V({ ref_for: !0 }, { item: l, checked: r.value.has(l.value) }), () => [
|
|
60
|
+
$(E(l.label), 1)
|
|
57
61
|
])
|
|
58
62
|
]),
|
|
59
63
|
_: 2
|
|
60
|
-
}, 1032, ["
|
|
64
|
+
}, 1032, ["class", "style", "rounded", "color", "bordered", "selected", "disabled", "icon", "size", "onClick"]))), 128))
|
|
61
65
|
]));
|
|
62
66
|
}
|
|
63
67
|
});
|
|
64
68
|
export {
|
|
65
|
-
|
|
69
|
+
F as default
|
|
66
70
|
};
|
|
67
71
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const t = document.createElement("textarea");
|
|
4
|
-
t.value = e ?? "", t.style.position = "absolute", t.style.opacity = "0", document.body.appendChild(t), t.select(), document.execCommand("copy"), t.remove();
|
|
1
|
+
function t() {
|
|
2
|
+
return typeof navigator < "u" && !!navigator.clipboard;
|
|
5
3
|
}
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
function n(o) {
|
|
5
|
+
if (typeof document > "u")
|
|
6
|
+
throw new Error("[ZlCopy] document is not available");
|
|
7
|
+
const e = document.createElement("textarea");
|
|
8
|
+
e.value = o ?? "", e.style.position = "fixed", e.style.top = "-9999px", e.style.opacity = "0", document.body.appendChild(e), e.select();
|
|
9
|
+
try {
|
|
10
|
+
if (!document.execCommand("copy"))
|
|
11
|
+
throw new Error('[ZlCopy] execCommand("copy") failed');
|
|
12
|
+
} finally {
|
|
13
|
+
e.remove();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function a(o) {
|
|
17
|
+
o != null && (t() ? await navigator.clipboard.writeText(o) : n(o));
|
|
8
18
|
}
|
|
9
19
|
export {
|
|
10
|
-
|
|
20
|
+
a as default
|
|
11
21
|
};
|
|
12
22
|
//# sourceMappingURL=copy.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.zl-copy[data-v-
|
|
1
|
+
.zl-copy[data-v-1c32b385]{max-width:100%;display:inline-flex;align-items:center;gap:12px}.zl-copy__text[data-v-1c32b385]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
4
|
+
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1c32b385"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_ as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as m, ref as
|
|
2
|
-
import { useZlT as
|
|
3
|
-
import { ElMessage as
|
|
1
|
+
import { defineComponent as m, ref as u, openBlock as y, createElementBlock as x, createElementVNode as r, renderSlot as n, toDisplayString as l, unref as a, createVNode as d, withCtx as _, createTextVNode as z } from "vue";
|
|
2
|
+
import { useZlT as h } from "@zl-ui-kit/composables";
|
|
3
|
+
import { ElMessage as p } from "element-plus";
|
|
4
|
+
import C from "../ZlButton/index.vue.mjs";
|
|
4
5
|
import i from "./copy.mjs";
|
|
5
|
-
const
|
|
6
|
+
const g = { class: "zl-copy" }, k = ["title"], w = /* @__PURE__ */ m({
|
|
6
7
|
name: "ZlCopy",
|
|
7
8
|
__name: "index",
|
|
8
9
|
props: {
|
|
@@ -10,45 +11,42 @@ const k = { class: "zl-copy" }, T = ["title"], B = /* @__PURE__ */ m({
|
|
|
10
11
|
copyText: {}
|
|
11
12
|
},
|
|
12
13
|
setup(e) {
|
|
13
|
-
const c = e, { t: o } =
|
|
14
|
-
function
|
|
14
|
+
const c = e, { t: o } = h(), s = u(null);
|
|
15
|
+
async function f() {
|
|
16
|
+
const t = c.copyText ?? c.text ?? s.value?.textContent ?? "";
|
|
15
17
|
try {
|
|
16
|
-
|
|
17
|
-
i(t), a.success(o("zl.copy.success", "复制成功"));
|
|
18
|
+
await i(t), p.success(o("zl.copy.success", "复制成功"));
|
|
18
19
|
} catch {
|
|
19
|
-
|
|
20
|
+
p.error(o("zl.copy.failed", "复制失败"));
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
return (t,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
s
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
l(t.$slots, "default", {}, () => [
|
|
31
|
-
s("span", { title: e.text }, r(e.text), 9, T)
|
|
32
|
-
], !0)
|
|
33
|
-
], 512),
|
|
34
|
-
l(t.$slots, "trigger", { copy: p(i) }, () => [
|
|
35
|
-
z(f, {
|
|
36
|
-
size: "small",
|
|
37
|
-
text: "",
|
|
38
|
-
class: "zl-copy__button",
|
|
39
|
-
onClick: u
|
|
40
|
-
}, {
|
|
41
|
-
default: C(() => [
|
|
42
|
-
h(r(p(o)("zl.copy.copy", "复制")), 1)
|
|
43
|
-
]),
|
|
44
|
-
_: 1
|
|
45
|
-
})
|
|
23
|
+
return (t, T) => (y(), x("div", g, [
|
|
24
|
+
r("span", {
|
|
25
|
+
ref_key: "textRef",
|
|
26
|
+
ref: s,
|
|
27
|
+
class: "zl-copy__text"
|
|
28
|
+
}, [
|
|
29
|
+
n(t.$slots, "default", {}, () => [
|
|
30
|
+
r("span", { title: e.text }, l(e.text), 9, k)
|
|
46
31
|
], !0)
|
|
47
|
-
])
|
|
48
|
-
|
|
32
|
+
], 512),
|
|
33
|
+
n(t.$slots, "trigger", { copy: a(i) }, () => [
|
|
34
|
+
d(C, {
|
|
35
|
+
size: "small",
|
|
36
|
+
text: "",
|
|
37
|
+
class: "zl-copy__button",
|
|
38
|
+
onClick: f
|
|
39
|
+
}, {
|
|
40
|
+
default: _(() => [
|
|
41
|
+
z(l(a(o)("zl.copy.copy", "复制")), 1)
|
|
42
|
+
]),
|
|
43
|
+
_: 1
|
|
44
|
+
})
|
|
45
|
+
], !0)
|
|
46
|
+
]));
|
|
49
47
|
}
|
|
50
48
|
});
|
|
51
49
|
export {
|
|
52
|
-
|
|
50
|
+
w as default
|
|
53
51
|
};
|
|
54
52
|
//# sourceMappingURL=index2.vue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
@charset "UTF-8";.zl-description{display:inline-flex;gap:0 16px;font-size:12px;line-height:20px;white-space:nowrap;flex-wrap:wrap;max-width:100%}.zl-description-type-secondary{padding:0 8px;background-color:var(--zl-fill-2, #eff4f9);border-radius:var(--zl-radius-small, 2px)}.zl-description-type-secondary .zl-description-item:not(:last-child):after{content:"";display:inline-block;height:12px;width:1px;background-color:var(--zl-border-2, #e3e9ef);position:absolute;top:4px;right:-8px}.zl-description-item{position:relative;display:inline-flex;align-items:center;gap:2px;min-width:0;max-width:100%}.zl-description-item-icon{color:var(--zl-text-2, #4d5e7d)}.zl-description-item-label{color:var(--zl-text-3, #79879c);margin-right:10px;flex-shrink:0}.zl-description-item-value{color:var(--zl-text-1, #242e43);flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zl-description .zl-tag:not(.zl-tag-fill){padding:0}
|
|
@@ -1,52 +1,56 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as C, computed as h, defineAsyncComponent as T, resolveComponent as g, openBlock as n, createElementBlock as a, normalizeClass as b, Fragment as B, renderList as D, createBlock as d, createCommentVNode as E, createElementVNode as u, toDisplayString as y, unref as N, mergeProps as V, renderSlot as Z, withCtx as A, createTextVNode as F } from "vue";
|
|
2
2
|
import { useZlT as S } from "@zl-ui-kit/composables";
|
|
3
|
-
import { isNumber as
|
|
4
|
-
|
|
3
|
+
import { isNumber as w } from "@zl-ui-kit/utils";
|
|
4
|
+
import I from "../ZlAutoTooltip/index.vue.mjs";
|
|
5
|
+
const K = { class: "zl-description-item-label" }, L = { class: "zl-description-item-value" }, H = /* @__PURE__ */ C({
|
|
5
6
|
name: "ZlDescription",
|
|
6
7
|
__name: "index",
|
|
7
8
|
props: {
|
|
8
9
|
items: {},
|
|
9
10
|
data: { default: () => ({}) },
|
|
10
|
-
emptyChecker: { type: Function, default: (s) => !s && !
|
|
11
|
+
emptyChecker: { type: Function, default: (s) => !s && !w(s) },
|
|
11
12
|
emptyText: {},
|
|
12
13
|
secondary: { type: Boolean }
|
|
13
14
|
},
|
|
14
15
|
setup(s) {
|
|
15
|
-
const { t:
|
|
16
|
-
const c = [],
|
|
16
|
+
const { t: f } = S(), t = s, k = h(() => {
|
|
17
|
+
const c = [], p = t.emptyText ?? f("zl.description.empty", "暂无");
|
|
17
18
|
for (const o of t.items) {
|
|
18
|
-
const { visible: e, key:
|
|
19
|
-
if (e === !1 || typeof e == "function" && !e(i,
|
|
19
|
+
const { visible: e, key: r, getValue: m, dict: l, ..._ } = o, i = typeof m == "function" ? m(t.data, o.key, o) : t.data[o.key], x = t.emptyChecker(i, r, t.data) ? p : i;
|
|
20
|
+
if (e === !1 || typeof e == "function" && !e(i, r, t.data))
|
|
20
21
|
continue;
|
|
21
|
-
const
|
|
22
|
-
c.push({ ...
|
|
22
|
+
const z = typeof l == "string" ? { dictKey: l } : l;
|
|
23
|
+
c.push({ ..._, key: r, value: i, text: x, dict: z });
|
|
23
24
|
}
|
|
24
25
|
return c;
|
|
25
|
-
}),
|
|
26
|
-
return (c,
|
|
27
|
-
const o =
|
|
28
|
-
return n(),
|
|
29
|
-
class:
|
|
26
|
+
}), v = T(() => import("../ZlDictTag/index2.vue.mjs"));
|
|
27
|
+
return (c, p) => {
|
|
28
|
+
const o = g("zl-icon");
|
|
29
|
+
return n(), a("div", {
|
|
30
|
+
class: b(["zl-description", { "zl-description-type-secondary": s.secondary }])
|
|
30
31
|
}, [
|
|
31
|
-
(n(!0),
|
|
32
|
+
(n(!0), a(B, null, D(k.value, (e) => (n(), a("div", {
|
|
32
33
|
key: e.key,
|
|
33
34
|
class: "zl-description-item"
|
|
34
35
|
}, [
|
|
35
|
-
e.icon ? (n(),
|
|
36
|
+
e.icon ? (n(), d(o, {
|
|
36
37
|
key: 0,
|
|
37
38
|
class: "zl-description-item-icon",
|
|
38
39
|
icon: e.icon
|
|
39
40
|
}, null, 8, ["icon"])) : E("", !0),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
e.dict ? (n(),
|
|
41
|
+
u("div", K, y(e.label), 1),
|
|
42
|
+
u("div", L, [
|
|
43
|
+
e.dict ? (n(), d(N(v), V({
|
|
43
44
|
key: 0,
|
|
44
45
|
ref_for: !0
|
|
45
46
|
}, e.dict, {
|
|
46
47
|
value: e.text
|
|
47
|
-
}), null, 16, ["value"])) : e.slot ? Z(c.$slots, e.key, {}, void 0, void 0, 1) : (n(),
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
}), null, 16, ["value"])) : e.slot ? Z(c.$slots, e.key, {}, void 0, void 0, 1) : (n(), d(I, { key: 2 }, {
|
|
49
|
+
default: A(() => [
|
|
50
|
+
F(y(e.text), 1)
|
|
51
|
+
]),
|
|
52
|
+
_: 2
|
|
53
|
+
}, 1024))
|
|
50
54
|
])
|
|
51
55
|
]))), 128))
|
|
52
56
|
], 2);
|
|
@@ -54,6 +58,6 @@ const I = { class: "zl-description-item-label" }, K = { class: "zl-description-i
|
|
|
54
58
|
}
|
|
55
59
|
});
|
|
56
60
|
export {
|
|
57
|
-
|
|
61
|
+
H as default
|
|
58
62
|
};
|
|
59
63
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.zl-dev-menu{position:fixed;z-index:3000;user-select:none}.zl-dev-menu__button{width:48px;height:48px;font-size:20px;box-shadow:0 4px 10px var(--zl-shadow-1, rgba(36, 46, 67, .1))}.zl-dev-menu__panel{display:flex;flex-direction:column;gap:10px}.zl-dev-menu__title{font-size:12px;font-weight:600;color:var(--zl-text-1, #242e43)}.zl-dev-menu__list{display:flex;flex-direction:column;gap:2px;max-height:320px;overflow:auto}.zl-dev-menu__item{display:flex;gap:8px;align-items:center;justify-content:space-between;padding:6px 8px;font-size:12px;color:var(--zl-text-2, #4d5e7d);cursor:pointer;border-radius:4px}.zl-dev-menu__item:hover{background:var(--zl-fill-2, #f5f7fa)}.zl-dev-menu__item.is-active{font-weight:600;color:var(--zl-primary-6, var(--el-color-primary))}.zl-dev-menu__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zl-dev-menu__path{flex:none;max-width:50%;overflow:hidden;font-size:11px;color:var(--zl-text-3, #8a9bb5);text-overflow:ellipsis;white-space:nowrap}.zl-dev-menu__empty{padding:12px 8px;font-size:12px;color:var(--zl-text-3, #8a9bb5);text-align:center}
|