@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.
Files changed (117) hide show
  1. package/README.md +18 -22
  2. package/dist/components/ZlAction/List.vue.mjs +49 -46
  3. package/dist/components/ZlAction/index.vue.d.ts +7 -1
  4. package/dist/components/ZlAction/index.vue.mjs +12 -8
  5. package/dist/components/ZlAction/types.d.ts +5 -2
  6. package/dist/components/ZlAppLayout/HeaderAside.css +1 -0
  7. package/dist/components/ZlAppLayout/HeaderAside.vue.d.ts +25 -0
  8. package/dist/components/ZlAppLayout/HeaderAside.vue.mjs +65 -0
  9. package/dist/components/ZlAppLayout/HeaderAside3.vue.mjs +6 -0
  10. package/dist/components/ZlAppLayout/Horizontal.css +1 -1
  11. package/dist/components/ZlAppLayout/Horizontal.vue.mjs +39 -3
  12. package/dist/components/ZlAppLayout/Horizontal3.vue.mjs +6 -0
  13. package/dist/components/ZlAppLayout/Vertical.css +1 -1
  14. package/dist/components/ZlAppLayout/Vertical.vue.mjs +51 -3
  15. package/dist/components/ZlAppLayout/Vertical3.vue.mjs +6 -0
  16. package/dist/components/ZlAppLayout/index.vue.d.ts +6 -6
  17. package/dist/components/ZlAppLayout/index.vue.mjs +14 -8
  18. package/dist/components/ZlAppSlogan/index.css +1 -1
  19. package/dist/components/ZlAppSlogan/index.vue.d.ts +1 -1
  20. package/dist/components/ZlAppSlogan/index.vue.mjs +19 -12
  21. package/dist/components/ZlBreadcrumb/index.css +1 -0
  22. package/dist/components/ZlBreadcrumb/index.vue.d.ts +32 -0
  23. package/dist/components/ZlBreadcrumb/index.vue.mjs +58 -0
  24. package/dist/components/ZlBreadcrumb/index3.vue.mjs +6 -0
  25. package/dist/components/ZlBreadcrumb/types.d.ts +16 -0
  26. package/dist/components/ZlButton/index.vue.d.ts +81 -0
  27. package/dist/components/ZlButton/index.vue.mjs +60 -0
  28. package/dist/components/ZlButton/index2.vue.mjs +5 -0
  29. package/dist/components/ZlCardPage/index.vue.d.ts +41 -3
  30. package/dist/components/ZlCardPage/index.vue.mjs +68 -68
  31. package/dist/components/ZlCardPage/resolvePagination.d.ts +20 -0
  32. package/dist/components/ZlCardPage/resolvePagination.mjs +24 -0
  33. package/dist/components/ZlCheckboxTag/index.css +1 -1
  34. package/dist/components/ZlCheckboxTag/index.vue.d.ts +4 -4
  35. package/dist/components/ZlCheckboxTag/index.vue.mjs +34 -30
  36. package/dist/components/ZlCopy/copy.mjs +17 -7
  37. package/dist/components/ZlCopy/index.css +1 -1
  38. package/dist/components/ZlCopy/index.vue.mjs +2 -2
  39. package/dist/components/ZlCopy/index2.vue.mjs +34 -36
  40. package/dist/components/ZlDescription/index.css +1 -1
  41. package/dist/components/ZlDescription/index.vue.mjs +28 -24
  42. package/dist/components/ZlDevMenu/index.css +1 -0
  43. package/dist/components/ZlDevMenu/index.vue.d.ts +33 -0
  44. package/dist/components/ZlDevMenu/index.vue.mjs +110 -0
  45. package/dist/components/ZlDevMenu/index3.vue.mjs +6 -0
  46. package/dist/components/ZlDevMenu/types.d.ts +8 -0
  47. package/dist/components/ZlDialog/index.css +1 -1
  48. package/dist/components/ZlDialog/index.vue.d.ts +3 -0
  49. package/dist/components/ZlDialog/index.vue.mjs +39 -35
  50. package/dist/components/ZlDictTag/index.vue.d.ts +12 -3
  51. package/dist/components/ZlDictTag/index.vue.mjs +31 -26
  52. package/dist/components/ZlDrawer/index.css +1 -1
  53. package/dist/components/ZlDrawer/index.vue.d.ts +3 -0
  54. package/dist/components/ZlDrawer/index.vue.mjs +36 -32
  55. package/dist/components/ZlDynamicComponent/index.vue.d.ts +5 -3
  56. package/dist/components/ZlForm/index.css +1 -1
  57. package/dist/components/ZlForm/index.vue.d.ts +7 -0
  58. package/dist/components/ZlForm/index.vue.mjs +50 -47
  59. package/dist/components/ZlLayoutSwitch/index.css +1 -1
  60. package/dist/components/ZlLayoutSwitch/index.vue.d.ts +10 -0
  61. package/dist/components/ZlLayoutSwitch/index.vue.mjs +1 -1
  62. package/dist/components/ZlLayoutSwitch/index2.vue.mjs +27 -19
  63. package/dist/components/ZlLoading/index.css +1 -0
  64. package/dist/components/ZlLoading/index.vue.d.ts +27 -0
  65. package/dist/components/ZlLoading/index.vue.mjs +8 -0
  66. package/dist/components/ZlLoading/index2.vue.mjs +30 -0
  67. package/dist/components/ZlLogin/components/LoginForm.css +1 -1
  68. package/dist/components/ZlLogin/components/LoginForm.vue.mjs +1 -1
  69. package/dist/components/ZlLogin/components/LoginForm2.vue.mjs +26 -25
  70. package/dist/components/ZlMenu/MenuIcon.d.ts +17 -0
  71. package/dist/components/ZlMenu/MenuIcon.mjs +21 -0
  72. package/dist/components/ZlMenu/ZlMenuItem.vue.d.ts +7 -0
  73. package/dist/components/ZlMenu/ZlMenuItem.vue.mjs +53 -0
  74. package/dist/components/ZlMenu/ZlMenuItem2.vue.mjs +5 -0
  75. package/dist/components/ZlMenu/index.css +1 -0
  76. package/dist/components/ZlMenu/index.vue.d.ts +40 -0
  77. package/dist/components/ZlMenu/index.vue.mjs +60 -0
  78. package/dist/components/ZlMenu/index3.vue.mjs +6 -0
  79. package/dist/components/ZlMenu/types.d.ts +20 -0
  80. package/dist/components/ZlPageContainer/index.css +1 -1
  81. package/dist/components/ZlPageContainer/index.vue.mjs +1 -1
  82. package/dist/components/ZlPagination/index.css +1 -1
  83. package/dist/components/ZlPagination/index.vue.d.ts +21 -1
  84. package/dist/components/ZlPagination/index.vue.mjs +1 -1
  85. package/dist/components/ZlPagination/index2.vue.mjs +59 -33
  86. package/dist/components/ZlPagination/usePagination.d.ts +1 -0
  87. package/dist/components/ZlPagination/usePagination.mjs +51 -34
  88. package/dist/components/ZlPopconfirm/index.vue.mjs +25 -24
  89. package/dist/components/ZlSearch/index.vue.d.ts +25 -0
  90. package/dist/components/ZlSearch/index.vue.mjs +202 -205
  91. package/dist/components/ZlSearchTable/index.vue.d.ts +40 -2
  92. package/dist/components/ZlSearchTable/index.vue.mjs +59 -55
  93. package/dist/components/ZlTable/useTablePagination.d.ts +1 -0
  94. package/dist/components/ZlTable/useTablePagination.mjs +37 -23
  95. package/dist/components/ZlTabs/index.vue.d.ts +16 -3
  96. package/dist/components/ZlTag/ZlCornerTag.css +1 -1
  97. package/dist/components/ZlTag/ZlCornerTag.vue.d.ts +14 -1
  98. package/dist/components/ZlTag/ZlCornerTag.vue.mjs +25 -14
  99. package/dist/components/ZlTag/index.vue.mjs +4 -4
  100. package/dist/components/ZlUpload/index.css +1 -1
  101. package/dist/components/ZlUpload/index.vue.d.ts +44 -3
  102. package/dist/components/ZlUpload/index.vue.mjs +3 -3
  103. package/dist/components/ZlUpload/index2.vue.mjs +119 -79
  104. package/dist/index.d.ts +8 -2
  105. package/dist/index.mjs +183 -169
  106. package/dist/locales/en.mjs +2 -2
  107. package/dist/locales/zh-cn.mjs +3 -3
  108. package/package.json +5 -5
  109. package/dist/components/ZlAppLayout/Horizontal2.vue.mjs +0 -42
  110. package/dist/components/ZlAppLayout/Vertical2.vue.mjs +0 -56
  111. package/dist/components/ZlAppMenu/AppMenu.css +0 -1
  112. package/dist/components/ZlAppMenu/AppMenu.vue.d.ts +0 -27
  113. package/dist/components/ZlAppMenu/AppMenu.vue.mjs +0 -37
  114. package/dist/components/ZlAppMenu/AppMenu3.vue.mjs +0 -6
  115. package/dist/components/ZlAppMenu/AppMenuItem.vue.d.ts +0 -11
  116. package/dist/components/ZlAppMenu/AppMenuItem.vue.mjs +0 -58
  117. package/dist/components/ZlAppMenu/AppMenuItem2.vue.mjs +0 -5
@@ -1,26 +1,28 @@
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 z, normalizeStyle as G, createBlock as g, createSlots as H, withCtx as P, renderSlot as v, renderList as k, normalizeProps as J, guardReactiveProps as Q, createCommentVNode as q, createElementVNode as $, Fragment as T, mergeProps as D, unref as h } from "vue";
2
- import { usePageableRequest as U } from "@zl-ui-kit/composables";
3
- import { isArray as b } 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";
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 te } from "../ZlPagination/usePagination.mjs";
9
- const ae = { class: "zl-card-page__content" }, se = { class: "zl-card-page__list" }, N = "search-", de = /* @__PURE__ */ M({
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: R, emit: w }) {
22
- const n = s, B = w, C = V(), E = _(null), p = u(() => {
23
- const e = n.request;
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: r, refreshDepsAction: a, ...c } = e.options ?? {};
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
- ...c,
40
+ ...n,
39
41
  ...t,
40
- ...r ? { refreshDeps: r, refreshDepsAction: a ?? (() => l()) } : {}
42
+ ...d ? { refreshDeps: d, refreshDepsAction: a ?? (() => i()) } : {}
41
43
  }
42
44
  };
43
- }), o = U(p.value.service, p.value.options), I = p.value.instance ?? {
44
- loading: o.loading,
45
- data: o.data,
46
- run: o.run,
47
- params: o.params,
48
- refresh: o.refresh
49
- }, { loading: O, data: i, run: j, params: A, refresh: W } = I, y = u(() => A.value?.[0]), Z = u(() => {
50
- if (b(i.value))
51
- return n.pagination && { total: i.value.length, ...n.pagination };
52
- {
53
- const e = i.value ?? {}, t = y.value ?? {}, r = n.pagination;
54
- return {
55
- ...r,
56
- pageNum: e.pageNum ?? t.pageNum ?? 1,
57
- pageSize: e.pageSize ?? t.pageSize ?? r?.pageSize ?? 30,
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(C).forEach((t) => {
66
- t.startsWith(N) && t !== "search-actions" && e.push(t.slice(N.length));
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 l(e, t = {
66
+ function i(e, t = {
71
67
  pageNum: 1,
72
- pageSize: d.value !== !1 ? d.value.pageSize : 30
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
- () => n.immediate,
80
+ () => c.immediate,
82
81
  (e) => {
83
- e && !n.queryItems.length && l();
82
+ e && !c.queryItems.length && i();
84
83
  },
85
84
  { immediate: !0, once: !0 }
86
- ), R({
85
+ ), C({
87
86
  /** 原地重查:用最近一次入参重新请求,保持当前页码(区别于 `search()` 会回到第 1 页) */
88
- refresh: W,
87
+ refresh: L,
89
88
  /** 最近一次请求的入参(`{ pageNum, pageSize, ...查询表单 }`),未请求过时为 `undefined` */
90
- params: y,
89
+ params: W,
91
90
  /** 重新查询并回到第 1 页;消费方可在 useRequest 的 refreshDepsAction 里调用 */
92
- search: l
91
+ search: i
93
92
  }), (e, t) => {
94
- const r = F("loading");
95
- return L((m(), z("div", {
93
+ const d = F("loading");
94
+ return G((l(), b("div", {
96
95
  class: "zl-card-page",
97
- style: G({ "--card-min-width": s.cardMinWidth })
96
+ style: H({ "--card-min-width": s.cardMinWidth })
98
97
  }, [
99
- s.queryItems.length || e.$slots["search-actions"] ? (m(), g(ee, {
98
+ s.queryItems.length || e.$slots["search-actions"] ? (l(), h(te, {
100
99
  key: 0,
101
100
  ref_key: "searchRef",
102
- ref: E,
101
+ ref: w,
103
102
  items: s.queryItems,
104
103
  immediate: s.immediate,
105
- onSearch: l,
106
- onReset: t[0] || (t[0] = (a) => B("search-reset"))
107
- }, H({ _: 2 }, [
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: P(() => [
111
- v(e.$slots, "search-actions")
110
+ fn: k(() => [
111
+ g(e.$slots, "search-actions")
112
112
  ]),
113
113
  key: "0"
114
114
  } : void 0,
115
- k(K.value, (a) => ({
115
+ z(K.value, (a) => ({
116
116
  name: a,
117
- fn: P((c) => [
118
- v(e.$slots, `search-${a}`, J(Q(c)))
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", ae, [
123
- $("div", se, [
124
- S.value.length ? (m(!0), z(T, { key: 0 }, k(S.value, (a, c) => v(e.$slots, "default", D({
125
- key: a[s.itemKey] || c
126
- }, { ref_for: !0 }, { data: a }))), 128)) : (m(), g(X, { key: 1 }))
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 && h(d) !== !1 ? (m(), g(Y, D({ key: 1 }, h(d), {
130
- onChange: t[1] || (t[1] = (a) => l(void 0, 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
- [r, h(O)]
133
+ [d, v(O)]
134
134
  ]);
135
135
  };
136
136
  }
137
137
  });
138
138
  export {
139
- de as default
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-tag-fill:not(.zl-tag-selected){border-color:transparent;background-color:var(--zl-fill-2)}.zl-checkbox-tag .zl-tag-fill: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)}
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 g, computed as i, ref as h, openBlock as r, createElementBlock as v, Fragment as b, renderList as k, createBlock as m, withCtx as y, renderSlot as B, mergeProps as C, createTextVNode as z, toDisplayString as S, mergeModels as V } from "vue";
2
- import E from "../ZlTag/index.vue.mjs";
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 M = { class: "zl-checkbox-tag" }, T = /* @__PURE__ */ x({
4
+ const N = { class: "zl-checkbox-tag" }, F = /* @__PURE__ */ x({
5
5
  name: "ZlCheckboxTag",
6
6
  __name: "index",
7
- props: /* @__PURE__ */ V({
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 s = o, a = g(o, "modelValue"), c = i(() => s.options.some((e) => e.exclusive)), d = h();
21
- if (c.value && a.value) {
22
- const e = s.options.find((u) => u.value === a.value[0]);
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 t = i(() => new Set(s.single ? [a.value] : a.value ?? []));
26
- function f(e) {
28
+ const r = t(() => new Set(a.single ? [u.value] : u.value ?? []));
29
+ function p(e) {
27
30
  if (e.disabled) return;
28
- const u = s.single ? [a.value] : [...a.value ?? []], l = u.includes(e.value);
29
- if (c.value && !l) {
30
- const n = e;
31
- n.exclusive === !0 || n.exclusive !== d.value ? (a.value = [e.value], d.value = n.exclusive) : a.value = [...u, e.value];
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 n = u.filter((p) => p !== e.value);
36
- a.value = s.single ? n[0] : n;
38
+ const s = n.filter((g) => g !== e.value);
39
+ u.value = a.single ? s[0] : s;
37
40
  } else
38
- s.single ? a.value = e.value : a.value = [...u, e.value];
41
+ a.single ? u.value = e.value : u.value = [...n, e.value];
39
42
  }
40
- return (e, u) => (r(), v("div", M, [
41
- (r(!0), v(b, null, k(o.options, (l) => (r(), m(E, {
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
- fill: o.fill,
44
- rounded: o.rounded,
45
- color: t.value.has(l.value) ? "primary" : void 0,
46
- bordered: t.value.has(l.value) && o.bordered,
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: t.value.has(l.value),
52
+ selected: r.value.has(l.value),
49
53
  disabled: l.disabled,
50
54
  icon: l.icon,
51
55
  size: o.size,
52
- onClick: (n) => f(l)
56
+ onClick: (s) => p(l)
53
57
  }, {
54
- default: y(() => [
55
- B(e.$slots, "default", C({ ref_for: !0 }, { item: l, checked: t.value.has(l.value) }), () => [
56
- z(S(l.label), 1)
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, ["fill", "rounded", "color", "bordered", "selected", "disabled", "icon", "size", "onClick"]))), 128))
64
+ }, 1032, ["class", "style", "rounded", "color", "bordered", "selected", "disabled", "icon", "size", "onClick"]))), 128))
61
65
  ]));
62
66
  }
63
67
  });
64
68
  export {
65
- T as default
69
+ F as default
66
70
  };
67
71
  //# sourceMappingURL=index.vue.mjs.map
@@ -1,12 +1,22 @@
1
- const o = window.navigator, n = o && "clipboard" in o;
2
- function a(e) {
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
- async function c(e) {
7
- e != null && (n ? await o.clipboard.writeText(e) : a(e));
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
- c as default
20
+ a as default
11
21
  };
12
22
  //# sourceMappingURL=copy.mjs.map
@@ -1 +1 @@
1
- .zl-copy[data-v-3a18b7dd]{max-width:100%;display:inline-flex;align-items:center;gap:12px}.zl-copy__text[data-v-3a18b7dd]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3a18b7dd"]]);
4
+ const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1c32b385"]]);
5
5
  export {
6
- m as default
6
+ _ as default
7
7
  };
8
8
  //# sourceMappingURL=index.vue.mjs.map
@@ -1,8 +1,9 @@
1
- import { defineComponent as m, ref as x, resolveComponent as y, openBlock as d, createElementBlock as _, createElementVNode as s, renderSlot as l, toDisplayString as r, unref as p, createVNode as z, withCtx as C, createTextVNode as h } from "vue";
2
- import { useZlT as g } from "@zl-ui-kit/composables";
3
- import { ElMessage as a } from "element-plus";
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 k = { class: "zl-copy" }, T = ["title"], B = /* @__PURE__ */ m({
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 } = g(), n = x(null);
14
- function u() {
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
- const t = c.copyText ?? c.text ?? n.value?.textContent ?? "";
17
- i(t), a.success(o("zl.copy.success", "复制成功"));
18
+ await i(t), p.success(o("zl.copy.success", "复制成功"));
18
19
  } catch {
19
- a.error(o("zl.copy.failed", "复制失败"));
20
+ p.error(o("zl.copy.failed", "复制失败"));
20
21
  }
21
22
  }
22
- return (t, b) => {
23
- const f = y("el-button");
24
- return d(), _("div", k, [
25
- s("span", {
26
- ref_key: "textRef",
27
- ref: n,
28
- class: "zl-copy__text"
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
- B as default
50
+ w as default
53
51
  };
54
52
  //# sourceMappingURL=index2.vue.mjs.map
@@ -1 +1 @@
1
- .zl-description{display:inline-flex;gap:0 16px;font-size:12px;line-height:20px;white-space:nowrap;flex-wrap:wrap}.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}.zl-description-item-icon{color:var(--zl-text-2, #4d5e7d)}.zl-description-item-label{color:var(--zl-text-3, #79879c);margin-right:10px}.zl-description-item-value{color:var(--zl-text-1, #242e43)}.zl-description .zl-tag:not(.zl-tag-fill){padding:0}
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 g, computed as h, defineAsyncComponent as T, resolveComponent as b, openBlock as n, createElementBlock as r, normalizeClass as B, Fragment as m, renderList as D, createBlock as u, createCommentVNode as E, createElementVNode as y, toDisplayString as f, unref as N, mergeProps as V, renderSlot as Z, createTextVNode as F } from "vue";
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 A } from "@zl-ui-kit/utils";
4
- const I = { class: "zl-description-item-label" }, K = { class: "zl-description-item-value" }, q = /* @__PURE__ */ g({
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 && !A(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: k } = S(), t = s, v = h(() => {
16
- const c = [], d = t.emptyText ?? k("zl.description.empty", "暂无");
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: l, getValue: p, dict: a, ...z } = o, i = typeof p == "function" ? p(t.data, o.key, o) : t.data[o.key], x = t.emptyChecker(i, l, t.data) ? d : i;
19
- if (e === !1 || typeof e == "function" && !e(i, l, t.data))
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 C = typeof a == "string" ? { dictKey: a } : a;
22
- c.push({ ...z, key: l, value: i, text: x, dict: C });
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
- }), _ = T(() => import("../ZlDictTag/index2.vue.mjs"));
26
- return (c, d) => {
27
- const o = b("zl-icon");
28
- return n(), r("div", {
29
- class: B(["zl-description", { "zl-description-type-secondary": s.secondary }])
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), r(m, null, D(v.value, (e) => (n(), r("div", {
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(), u(o, {
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
- y("div", I, f(e.label), 1),
41
- y("div", K, [
42
- e.dict ? (n(), u(N(_), V({
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(), r(m, { key: 2 }, [
48
- F(f(e.text), 1)
49
- ], 64))
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
- q as default
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}