@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
@@ -0,0 +1,60 @@
1
+ import { defineComponent as p, useModel as h, resolveComponent as v, openBlock as o, createBlock as c, withCtx as B, createElementBlock as g, Fragment as q, renderList as x, mergeModels as u } from "vue";
2
+ import M from "./ZlMenuItem.vue.mjs";
3
+ const w = /* @__PURE__ */ p({
4
+ name: "ZlMenu",
5
+ __name: "index",
6
+ props: /* @__PURE__ */ u({
7
+ items: { default: () => [] },
8
+ collapsed: { type: Boolean, default: !1 },
9
+ mode: { default: "vertical" },
10
+ uniqueOpened: { type: Boolean, default: !1 },
11
+ defaultOpeneds: { default: () => [] },
12
+ collapseTransition: { type: Boolean, default: !1 },
13
+ collapseWidth: { default: 64 },
14
+ navigate: {}
15
+ }, {
16
+ selected: { default: "" },
17
+ selectedModifiers: {}
18
+ }),
19
+ emits: /* @__PURE__ */ u(["select"], ["update:selected"]),
20
+ setup(e, { emit: f }) {
21
+ const d = e, i = h(e, "selected"), m = f;
22
+ function s(l, t) {
23
+ for (const n of l) {
24
+ if (n.key === t) return n;
25
+ const a = n.children && s(n.children, t);
26
+ if (a) return a;
27
+ }
28
+ }
29
+ function r(l) {
30
+ const t = s(d.items, l);
31
+ !t || t.disabled || (i.value = l, m("select", l, t), d.navigate?.(t));
32
+ }
33
+ return (l, t) => {
34
+ const n = v("el-menu");
35
+ return o(), c(n, {
36
+ class: "zl-menu",
37
+ "default-active": i.value,
38
+ collapse: e.collapsed,
39
+ "collapse-width": e.collapseWidth,
40
+ mode: e.mode,
41
+ "unique-opened": e.uniqueOpened,
42
+ "default-openeds": e.defaultOpeneds,
43
+ "collapse-transition": e.collapseTransition,
44
+ onSelect: r
45
+ }, {
46
+ default: B(() => [
47
+ (o(!0), g(q, null, x(e.items, (a) => (o(), c(M, {
48
+ key: a.key,
49
+ item: a
50
+ }, null, 8, ["item"]))), 128))
51
+ ]),
52
+ _: 1
53
+ }, 8, ["default-active", "collapse", "collapse-width", "mode", "unique-opened", "default-openeds", "collapse-transition"]);
54
+ };
55
+ }
56
+ });
57
+ export {
58
+ w as default
59
+ };
60
+ //# sourceMappingURL=index.vue.mjs.map
@@ -0,0 +1,6 @@
1
+ import o from "./index.vue.mjs";
2
+ import './index.css';/* empty css */
3
+ export {
4
+ o as default
5
+ };
6
+ //# sourceMappingURL=index3.vue.mjs.map
@@ -0,0 +1,20 @@
1
+ import { Component, VNode } from 'vue';
2
+ /** ZlMenu 菜单项配置 */
3
+ export interface MenuOption {
4
+ /** 唯一标识:选中态、select 事件、路由跳转都以它为准 */
5
+ key: string;
6
+ /** 菜单文案 */
7
+ label: string;
8
+ /**
9
+ * 图标:
10
+ * - 字符串:`@zl-ui-kit/icons` 中的 `zl:*` 图标名;
11
+ * - 组件:如 `h(MenuIcon, { name: 'a-home' })` 里的组件本身;
12
+ * - VNode:如 `h(MenuIcon, { name: 'a-home' })` 的结果。
13
+ */
14
+ icon?: string | Component | VNode;
15
+ /** 是否禁用 */
16
+ disabled?: boolean;
17
+ /** 子菜单 */
18
+ children?: MenuOption[];
19
+ }
20
+ //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- .zl-page-container[data-v-4d3cbbba]{display:flex;flex-direction:column;box-sizing:border-box;height:100%;background-color:var(--zl-fill-2, #f0f2f7)}.zl-page-container__header[data-v-4d3cbbba]{display:flex;flex-shrink:0;gap:16px;align-items:center;margin-bottom:16px}.zl-page-container__main[data-v-4d3cbbba]{flex:1;min-width:0}.zl-page-container__title[data-v-4d3cbbba]{font-size:16px;font-weight:600;line-height:24px;color:var(--zl-text-1, #242e43)}.zl-page-container__description[data-v-4d3cbbba]{margin-top:2px;font-size:13px;line-height:20px;color:var(--zl-text-3, #79879c)}.zl-page-container__extra[data-v-4d3cbbba]{display:flex;flex-shrink:0;align-items:center;gap:8px}.zl-page-container__content[data-v-4d3cbbba]{flex:1;min-height:0;overflow:auto}
1
+ .zl-page-container[data-v-b4bd4e1c]{display:flex;flex-direction:column;box-sizing:border-box;height:100%}.zl-page-container__header[data-v-b4bd4e1c]{display:flex;flex-shrink:0;gap:16px;align-items:center;margin-bottom:16px}.zl-page-container__main[data-v-b4bd4e1c]{flex:1;min-width:0}.zl-page-container__title[data-v-b4bd4e1c]{font-size:16px;font-weight:600;line-height:24px;color:var(--zl-text-1, #242e43)}.zl-page-container__description[data-v-b4bd4e1c]{margin-top:2px;font-size:13px;line-height:20px;color:var(--zl-text-3, #79879c)}.zl-page-container__extra[data-v-b4bd4e1c]{display:flex;flex-shrink:0;align-items:center;gap:8px}.zl-page-container__content[data-v-b4bd4e1c]{display:flex;flex:1;flex-direction:column;min-height:0;overflow:auto}.zl-page-container__content[data-v-b4bd4e1c]>*{flex:1 0 auto}
@@ -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 m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4d3cbbba"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b4bd4e1c"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -1 +1 @@
1
- @charset "UTF-8";.zl-pagination[data-v-c7c49843]{padding:6px 16px;background-color:var(--zl-fill-1, #f9fbfd);justify-content:var(--zl-pagination-justify, flex-end)}.zl-pagination--left[data-v-c7c49843]{--zl-pagination-justify: flex-start}.zl-pagination--center[data-v-c7c49843]{--zl-pagination-justify: center}.zl-pagination--right[data-v-c7c49843]{--zl-pagination-justify: flex-end}
1
+ @charset "UTF-8";.zl-pagination[data-v-e29f8a69]{padding:6px 16px;background-color:var(--zl-fill-1, #f9fbfd);justify-content:var(--zl-pagination-justify, flex-end)}.zl-pagination--left[data-v-e29f8a69]{--zl-pagination-justify: flex-start}.zl-pagination--center[data-v-e29f8a69]{--zl-pagination-justify: center}.zl-pagination--right[data-v-e29f8a69]{--zl-pagination-justify: flex-end}.zl-pagination--full[data-v-e29f8a69] .el-pagination__rightwrapper{flex:1;justify-content:flex-end}.zl-pagination--full[data-v-e29f8a69] .el-pager li.is-active{border:1px solid var(--zl-pagination-active-color, var(--el-color-primary));border-radius:var(--el-border-radius-base, 4px)}.zl-pagination__total-num[data-v-e29f8a69]{color:var(--zl-pagination-total-num-color, var(--el-color-primary))}
@@ -1,4 +1,18 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ total?(_: {
5
+ total: number;
6
+ pageRows: number;
7
+ pageNum: number;
8
+ pageSize: number;
9
+ }): any;
10
+ };
11
+ refs: {};
12
+ rootEl: any;
13
+ };
14
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
2
16
  change: (payload: {
3
17
  pageNum: number;
4
18
  pageSize: number;
@@ -13,5 +27,11 @@ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import
13
27
  "onPage-change"?: ((pageNum: number) => any) | undefined;
14
28
  "onPage-size-change"?: ((pageSize: number) => any) | undefined;
15
29
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
30
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
16
31
  export default _default;
32
+ type __VLS_WithTemplateSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
17
37
  //# sourceMappingURL=index.vue.d.ts.map
@@ -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-c7c49843"]]);
4
+ const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e29f8a69"]]);
5
5
  export {
6
6
  i as default
7
7
  };
@@ -1,53 +1,79 @@
1
- import { defineComponent as v, useAttrs as h, computed as r, ref as l, watch as p, resolveComponent as _, openBlock as d, createBlock as S, mergeProps as C, createCommentVNode as N } from "vue";
2
- import { usePagination as P } from "./usePagination.mjs";
3
- const B = /* @__PURE__ */ v({
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(k, { emit: s }) {
9
- const t = s, a = h(), n = P(() => a), c = r(() => a.align ?? "right"), i = l(
10
- a.pageNum ?? (n.value === !1 ? void 0 : n.value.currentPage) ?? 1
11
- ), g = l(
12
- a.pageSize ?? (n.value === !1 ? void 0 : n.value.pageSize) ?? 30
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
- p(
15
- () => a.pageNum ?? a.currentPage,
16
+ N(
17
+ () => n.value.pageNum ?? n.value.currentPage,
16
18
  (e) => {
17
- e != null && (i.value = e);
19
+ e != null && (l.value = e);
18
20
  }
19
- ), p(
20
- () => a.pageSize,
21
+ ), N(
22
+ () => n.value.pageSize,
21
23
  (e) => {
22
- e != null && (g.value = e);
24
+ e != null && (o.value = e);
23
25
  }
24
26
  );
25
- function m(e) {
26
- i.value = e, t("change", { pageNum: e, pageSize: g.value }), t("page-change", e);
27
+ function w(e) {
28
+ l.value = e, s("change", { pageNum: e, pageSize: o.value }), s("page-change", e);
27
29
  }
28
- function f(e) {
29
- g.value = e, i.value = 1, t("change", { pageNum: 1, pageSize: e }), t("page-size-change", e);
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 u = r(() => {
32
- if (n.value === !1) return !1;
33
- const { currentPage: e, pageSize: z, ...o } = n.value;
34
- return delete o.align, o;
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, z) => {
37
- const o = _("el-pagination");
38
- return u.value !== !1 ? (d(), S(o, C({
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--${c.value}`]
41
- }, u.value, {
42
- "current-page": i.value,
43
- "page-size": g.value,
44
- onCurrentChange: m,
45
- onSizeChange: f
46
- }), null, 16, ["class", "current-page", "page-size"])) : N("", !0);
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
- B as default
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 w, toValue as y } from "vue";
2
- function b(i) {
3
- return w(() => {
4
- const o = y(i);
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: s,
10
- pageSizes: n,
11
- pageSize: t = 30,
12
- pageNum: r,
13
- currentPage: l,
14
- layout: p,
15
- size: u,
16
- simple: a = !0,
17
- totalVisible: g,
18
- pageSizeVisible: c,
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: z,
21
- showPageSize: f,
22
- ...m
23
- } = o || {}, S = g ?? z ?? !0, e = (s ?? n ?? [10, 30, 50]).slice();
24
- e.includes(t) || e.push(t);
25
- const h = p ?? [
26
- S ? "total" : "",
27
- c ?? f ?? e.length > 0 ? "sizes" : "",
28
- "prev",
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: u ?? (a ? "small" : "default"),
36
- ...m,
37
- layout: h,
38
- currentPage: r ?? l ?? 1,
39
- pageSize: t,
40
- pageSizes: e.sort((d, P) => d - P)
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
- b as usePagination
61
+ K as normalizePaginationAttrs,
62
+ j as usePagination
46
63
  };
47
64
  //# sourceMappingURL=usePagination.mjs.map
@@ -1,10 +1,11 @@
1
- import { defineComponent as B, computed as d, ref as x, resolveComponent as _, openBlock as u, createBlock as y, mergeProps as $, 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";
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 b = { class: "zl-popconfirm-panel" }, w = { class: "zl-popconfirm-panel__main" }, E = {
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
- }, P = { class: "zl-popconfirm-panel__content" }, R = { class: "zl-popconfirm-panel__actions" }, j = /* @__PURE__ */ B({
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: v }) {
19
- const a = o, { t: p } = V(), z = d(() => a.confirmButtonText ?? p("zl.popconfirm.confirm", "确定")), h = d(() => a.cancelButtonText ?? p("zl.popconfirm.cancel", "取消")), i = x(null), m = v;
20
- function k() {
21
- i.value?.hide?.(), m("confirm");
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 C() {
24
- i.value?.hide?.(), m("cancel");
24
+ function k() {
25
+ i.value?.hide?.(), p("cancel");
25
26
  }
26
- return (e, S) => {
27
- const f = _("el-button"), T = _("el-popover");
28
- return u(), y(T, $({
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", b, [
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", w, [
43
- e.$slots.title || o.title ? (u(), g("div", E, [
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", P, [
49
+ n("div", R, [
49
50
  s(e.$slots, "content", {}, () => [
50
51
  c(l(o.content), 1)
51
52
  ])
52
53
  ]),
53
- n("div", R, [
54
- r(f, {
54
+ n("div", S, [
55
+ r(_, {
55
56
  size: "small",
56
- onClick: C
57
+ onClick: k
57
58
  }, {
58
59
  default: t(() => [
59
- c(l(h.value), 1)
60
+ c(l(z.value), 1)
60
61
  ]),
61
62
  _: 1
62
63
  }),
63
- r(f, {
64
+ r(_, {
64
65
  size: "small",
65
66
  type: "primary",
66
- onClick: k
67
+ onClick: h
67
68
  }, {
68
69
  default: t(() => [
69
- c(l(z.value), 1)
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
- j as default
84
+ q as default
84
85
  };
85
86
  //# sourceMappingURL=index.vue.mjs.map