@zl-ui-kit/components 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +309 -162
  2. package/dist/components/ZlAddSub/index.css +1 -1
  3. package/dist/components/ZlAddSub/index.vue.mjs +2 -2
  4. package/dist/components/ZlAppMenu/AppMenu.vue.d.ts +1 -1
  5. package/dist/components/ZlCardPage/index.vue.d.ts +94 -36
  6. package/dist/components/ZlCardPage/index.vue.mjs +2 -0
  7. package/dist/components/ZlChart/index.vue.d.ts +1 -0
  8. package/dist/components/ZlChart/index.vue.mjs +1 -0
  9. package/dist/components/ZlCheckAll/index.css +1 -1
  10. package/dist/components/ZlCheckAll/index.vue.mjs +1 -1
  11. package/dist/components/ZlDynamicComponent/index.vue.d.ts +8 -3
  12. package/dist/components/ZlDynamicComponent/index.vue.mjs +24 -19
  13. package/dist/components/ZlEditor/ZlSqlEditor.vue.d.ts +28 -2
  14. package/dist/components/ZlEditor/ZlSqlEditor.vue.mjs +27 -18
  15. package/dist/components/ZlEditor/index.vue.d.ts +22 -1
  16. package/dist/components/ZlEditor/index.vue.mjs +47 -24
  17. package/dist/components/ZlForm/index.vue.d.ts +26 -2
  18. package/dist/components/ZlForm/index.vue.mjs +96 -90
  19. package/dist/components/ZlGrid/index.vue.d.ts +1 -1
  20. package/dist/components/ZlIcon/index.css +1 -1
  21. package/dist/components/ZlIcon/index.vue.d.ts +6 -2
  22. package/dist/components/ZlIcon/index.vue.mjs +2 -2
  23. package/dist/components/ZlIcon/index2.vue.mjs +30 -23
  24. package/dist/components/ZlPagination/index.css +1 -1
  25. package/dist/components/ZlPagination/index.vue.mjs +1 -1
  26. package/dist/components/ZlSearch/index.vue.d.ts +82 -23
  27. package/dist/components/ZlSearch/index.vue.mjs +8 -1
  28. package/dist/components/ZlSearchTable/index.vue.d.ts +180 -40
  29. package/dist/components/ZlSearchTable/index.vue.mjs +4 -0
  30. package/dist/components/ZlSorter/ZlSorterList.css +1 -1
  31. package/dist/components/ZlSorter/ZlSorterList.vue.d.ts +1 -1
  32. package/dist/components/ZlSorter/ZlSorterList.vue.mjs +2 -2
  33. package/dist/components/ZlSorter/index.css +1 -1
  34. package/dist/components/ZlSorter/index.vue.mjs +2 -2
  35. package/dist/components/ZlSwitch/index.vue.d.ts +6 -2
  36. package/dist/components/ZlSwitch/index.vue.mjs +26 -24
  37. package/dist/components/ZlTable/index.vue.d.ts +36 -1
  38. package/dist/components/ZlTable/index.vue.mjs +98 -75
  39. package/dist/components/ZlTabs/index.vue.d.ts +20 -3
  40. package/dist/components/ZlTabs/index.vue.mjs +30 -20
  41. package/dist/components/ZlTag/index.vue.d.ts +2 -2
  42. package/package.json +6 -6
@@ -1,8 +1,8 @@
1
1
  import o from "./ZlSorterList2.vue.mjs";
2
2
  import './ZlSorterList.css';/* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-189806da"]]);
4
+ const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-32694666"]]);
5
5
  export {
6
- p as default
6
+ s as default
7
7
  };
8
8
  //# sourceMappingURL=ZlSorterList.vue.mjs.map
@@ -1 +1 @@
1
- .zl-sorter[data-v-b80cc7d3]{display:inline-flex;align-items:center;cursor:pointer;gap:4px;font-size:12px;padding:1px 4px}.zl-sorter__label[data-v-b80cc7d3]{color:var(--zl-text-2, #4d5e7d)}.zl-sorter__label.active[data-v-b80cc7d3]{color:var(--zl-link-6, var(--el-color-primary, #3261ce))}.zl-sorter__icon[data-v-b80cc7d3]{display:inline-flex;flex-direction:column;font-size:8px;color:var(--zl-text-4, #b3c0cc)}.zl-sorter__icon .active[data-v-b80cc7d3]{color:var(--zl-link-6, var(--el-color-primary, #3261ce))}
1
+ .zl-sorter[data-v-af336d25]{display:inline-flex;align-items:center;cursor:pointer;gap:4px;font-size:12px;padding:1px 4px}.zl-sorter__label[data-v-af336d25]{color:var(--zl-text-2, #4d5e7d)}.zl-sorter__label.active[data-v-af336d25]{color:var(--zl-link-6, var(--el-color-primary, #3261ce))}.zl-sorter__icon[data-v-af336d25]{display:inline-flex;flex-direction:column;font-size:8px;color:var(--zl-text-4, #b3c0cc)}.zl-sorter__icon .active[data-v-af336d25]{color:var(--zl-link-6, var(--el-color-primary, #3261ce))}
@@ -1,8 +1,8 @@
1
1
  import o from "./index2.vue.mjs";
2
2
  import './index.css';/* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-b80cc7d3"]]);
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-af336d25"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
8
8
  //# sourceMappingURL=index.vue.mjs.map
@@ -7,6 +7,10 @@ type __VLS_Props = {
7
7
  checkedValue?: boolean | string | number;
8
8
  /** 未选中状态对应的提交值 */
9
9
  uncheckedValue?: boolean | string | number;
10
+ /** `checked-value` 的别名(对齐 `el-switch` 的 `active-value`),两者同传时 `checked-value` 优先 */
11
+ activeValue?: boolean | string | number;
12
+ /** `unchecked-value` 的别名(对齐 `el-switch` 的 `inactive-value`),两者同传时 `unchecked-value` 优先 */
13
+ inactiveValue?: boolean | string | number;
10
14
  /** 选中时显示的文案 */
11
15
  checkedText?: string;
12
16
  /** 未选中时显示的文案 */
@@ -23,13 +27,13 @@ declare function __VLS_template(): {
23
27
  };
24
28
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
25
29
  declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
30
+ change: (value: string | number | boolean) => any;
26
31
  "update:modelValue": (value: string | number | boolean) => any;
27
32
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
33
+ onChange?: ((value: string | number | boolean) => any) | undefined;
28
34
  "onUpdate:modelValue"?: ((value: string | number | boolean) => any) | undefined;
29
35
  }>, {
30
36
  defaultChecked: boolean;
31
- checkedValue: boolean | string | number;
32
- uncheckedValue: boolean | string | number;
33
37
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
34
38
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
35
39
  export default _default;
@@ -1,47 +1,49 @@
1
- import { defineComponent as V, ref as f, computed as d, resolveComponent as x, openBlock as n, createElementBlock as u, createVNode as C, mergeProps as T, normalizeClass as g, renderSlot as s, createTextVNode as h, toDisplayString as m, createCommentVNode as w } from "vue";
2
- const y = { class: "zl-switch" }, N = /* @__PURE__ */ V({
1
+ import { defineComponent as g, computed as c, ref as y, resolveComponent as B, openBlock as i, createElementBlock as r, createVNode as N, mergeProps as S, normalizeClass as x, renderSlot as m, createTextVNode as h, toDisplayString as v, createCommentVNode as C } from "vue";
2
+ const T = { class: "zl-switch" }, b = /* @__PURE__ */ g({
3
3
  name: "ZlSwitch",
4
4
  inheritAttrs: !1,
5
5
  __name: "index",
6
6
  props: {
7
7
  modelValue: { type: [Boolean, String, Number] },
8
8
  defaultChecked: { type: Boolean, default: !1 },
9
- checkedValue: { type: [Boolean, String, Number], default: !0 },
10
- uncheckedValue: { type: [Boolean, String, Number], default: !1 },
9
+ checkedValue: { type: [Boolean, String, Number] },
10
+ uncheckedValue: { type: [Boolean, String, Number] },
11
+ activeValue: { type: [Boolean, String, Number] },
12
+ inactiveValue: { type: [Boolean, String, Number] },
11
13
  checkedText: {},
12
14
  uncheckedText: {}
13
15
  },
14
- emits: ["update:modelValue"],
15
- setup(l, { emit: r }) {
16
- const e = l, i = r, o = f(e.defaultChecked ? e.checkedValue : e.uncheckedValue), k = d(() => e.modelValue ?? o.value), c = d(() => k.value === e.checkedValue);
17
- function p(t) {
18
- const a = t ? e.checkedValue : e.uncheckedValue;
19
- o.value = a, i("update:modelValue", a);
16
+ emits: ["update:modelValue", "change"],
17
+ setup(l, { emit: k }) {
18
+ const t = l, u = k, o = c(() => t.checkedValue ?? t.activeValue ?? !0), d = c(() => t.uncheckedValue ?? t.inactiveValue ?? !1), s = y(t.defaultChecked ? o.value : d.value), p = c(() => t.modelValue ?? s.value), n = c(() => p.value === o.value);
19
+ function V(e) {
20
+ const a = e ? o.value : d.value;
21
+ s.value = a, u("update:modelValue", a), u("change", a);
20
22
  }
21
- return (t, a) => {
22
- const v = x("el-switch");
23
- return n(), u("span", y, [
24
- C(v, T(t.$attrs, {
25
- "model-value": c.value,
23
+ return (e, a) => {
24
+ const f = B("el-switch");
25
+ return i(), r("span", T, [
26
+ N(f, S(e.$attrs, {
27
+ "model-value": n.value,
26
28
  "active-value": !0,
27
29
  "inactive-value": !1,
28
- "onUpdate:modelValue": p
30
+ "onUpdate:modelValue": V
29
31
  }), null, 16, ["model-value"]),
30
- t.$slots.checked || l.checkedText || t.$slots.unchecked || l.uncheckedText ? (n(), u("span", {
32
+ e.$slots.checked || l.checkedText || e.$slots.unchecked || l.uncheckedText ? (i(), r("span", {
31
33
  key: 0,
32
- class: g(["zl-switch__text", { "zl-switch__text--checked": c.value }])
34
+ class: x(["zl-switch__text", { "zl-switch__text--checked": n.value }])
33
35
  }, [
34
- c.value ? s(t.$slots, "checked", {}, () => [
35
- h(m(l.checkedText), 1)
36
- ], void 0, 0) : s(t.$slots, "unchecked", {}, () => [
37
- h(m(l.uncheckedText), 1)
36
+ n.value ? m(e.$slots, "checked", {}, () => [
37
+ h(v(l.checkedText), 1)
38
+ ], void 0, 0) : m(e.$slots, "unchecked", {}, () => [
39
+ h(v(l.uncheckedText), 1)
38
40
  ], void 0, 1)
39
- ], 2)) : w("", !0)
41
+ ], 2)) : C("", !0)
40
42
  ]);
41
43
  };
42
44
  }
43
45
  });
44
46
  export {
45
- N as default
47
+ b as default
46
48
  };
47
49
  //# sourceMappingURL=index.vue.mjs.map
@@ -12,7 +12,42 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
12
12
  pagination?: Record<string, any> | boolean;
13
13
  /** 表格 loading(作用于表格区) */
14
14
  loading?: boolean;
15
- }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
15
+ }, {
16
+ /** 单选表格下将指定行设为选中;不传参则清除当前行选中 */
17
+ setCurrentRow: (row?: any) => any;
18
+ /** 多选表格下切换某行选中状态;第二个参数可直接指定是否选中 */
19
+ toggleRowSelection: (row: any, selected?: boolean) => any;
20
+ /** 清空用户的多选状态 */
21
+ clearSelection: () => any;
22
+ /** 多选表格全选 / 取消全选 */
23
+ toggleAllSelection: () => any;
24
+ /** 取当前被选中的行 */
25
+ getSelectionRows: () => any;
26
+ /** 取当前半选(父子联动)的行 */
27
+ getHalfSelectionRows: () => any;
28
+ /** 展开/收起某行的展开内容或子节点;第二个参数可直接指定是否展开 */
29
+ toggleRowExpansion: (row: any, expanded?: boolean) => any;
30
+ /** 清除排序,恢复原始顺序 */
31
+ clearSort: () => any;
32
+ /** 清除列筛选;不传 columnKey 则清除全部 */
33
+ clearFilter: (columnKeys?: string | string[]) => any;
34
+ /** 手动排序:`prop` 指定列字段,`order` 指定升/降序 */
35
+ sort: (prop: string, order: "ascending" | "descending" | null) => any;
36
+ /** 重新计算表格布局(容器由隐藏变可见时常用) */
37
+ doLayout: () => any;
38
+ /** 懒加载树形表格下更新某行的子节点(需配合 `row-key`) */
39
+ updateKeyChildren: (key: string | number, children: any[]) => any;
40
+ /** 滚动到指定坐标 */
41
+ scrollTo: (options?: {
42
+ left?: number;
43
+ top?: number;
44
+ } | number, top?: number) => any;
45
+ /** 设置横向滚动位置 */
46
+ setScrollLeft: (left: number) => any;
47
+ /** 设置纵向滚动位置 */
48
+ setScrollTop: (top: number) => any;
49
+ elTable: any;
50
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
16
51
  "page-change": (pageNum: number) => any;
17
52
  "page-size-change": (pageSize: number) => any;
18
53
  "pagination-change": (payload: {
@@ -1,9 +1,9 @@
1
- import { defineComponent as T, ref as j, toRef as y, computed as P, resolveComponent as w, resolveDirective as D, openBlock as o, createElementBlock as k, withDirectives as K, createBlock as f, mergeProps as i, unref as l, withCtx as c, renderSlot as h, normalizeProps as O, guardReactiveProps as V, createCommentVNode as v, Fragment as Z, renderList as E, createSlots as F, createTextVNode as I, toDisplayString as L } from "vue";
2
- import q from "../ZlAction/List.vue.mjs";
1
+ import { defineComponent as B, ref as K, toRef as b, computed as m, resolveComponent as w, resolveDirective as L, openBlock as r, createElementBlock as C, withDirectives as j, createBlock as c, mergeProps as i, unref as s, withCtx as u, renderSlot as h, normalizeProps as D, guardReactiveProps as E, createCommentVNode as y, Fragment as F, renderList as H, createSlots as O, createTextVNode as V, toDisplayString as Z } from "vue";
2
+ import I from "../ZlAction/List.vue.mjs";
3
3
  import '../ZlAction/List.css';/* empty css */
4
- import G from "../ZlPagination/index.vue.mjs";
5
- import { useTablePagination as H } from "./useTablePagination.mjs";
6
- const J = { class: "zl-table" }, M = { inheritAttrs: !1 }, ee = /* @__PURE__ */ T({
4
+ import q from "../ZlPagination/index.vue.mjs";
5
+ import { useTablePagination as G } from "./useTablePagination.mjs";
6
+ const J = { class: "zl-table" }, M = { inheritAttrs: !1 }, ee = /* @__PURE__ */ B({
7
7
  ...M,
8
8
  name: "ZlTable",
9
9
  __name: "index",
@@ -16,90 +16,113 @@ const J = { class: "zl-table" }, M = { inheritAttrs: !1 }, ee = /* @__PURE__ */
16
16
  loading: { type: Boolean, default: !1 }
17
17
  },
18
18
  emits: ["pagination-change", "page-change", "page-size-change"],
19
- setup(u, { expose: C, emit: S }) {
20
- const g = u, N = S, _ = j(null), { data: m, pagination: s, onPageChange: x, onPageSizeChange: z } = H({
21
- data: y(g, "data"),
22
- pagination: y(g, "pagination"),
23
- dataKey: g.dataKey,
24
- emit: N
25
- }), A = P(() => {
26
- const a = typeof s.value == "object" ? s.value.total : void 0;
27
- return typeof a == "number" ? a : m.value?.length ?? 0;
28
- }), $ = P(() => g.columns.map((a) => {
29
- const { label: r, prop: n, slot: d, actions: p, title: e, dataIndex: t, columnSlot: B, ellipsis: b, ...R } = a;
19
+ setup(v, { expose: P, emit: R }) {
20
+ const f = v, k = R, a = K(null), { data: S, pagination: d, onPageChange: x, onPageSizeChange: A } = G({
21
+ data: b(f, "data"),
22
+ pagination: b(f, "pagination"),
23
+ dataKey: f.dataKey,
24
+ emit: k
25
+ }), N = m(() => {
26
+ const e = typeof d.value == "object" ? d.value.total : void 0;
27
+ return typeof e == "number" ? e : S.value?.length ?? 0;
28
+ }), T = m(() => f.columns.map((e) => {
29
+ const { label: o, prop: n, slot: p, actions: g, title: t, dataIndex: l, columnSlot: z, ellipsis: _, ...$ } = e;
30
30
  return {
31
- label: r || e,
32
- prop: n || t,
33
- slotName: (typeof d == "string" ? d : void 0) || (d || Array.isArray(p) ? n || t : void 0),
34
- headerSlotName: B ? `header-${t || n}` : void 0,
35
- actions: Array.isArray(p) ? p : void 0,
36
- actionProps: a.actionProps,
31
+ label: o || t,
32
+ prop: n || l,
33
+ slotName: (typeof p == "string" ? p : void 0) || (p || Array.isArray(g) ? n || l : void 0),
34
+ headerSlotName: z ? `header-${l || n}` : void 0,
35
+ actions: Array.isArray(g) ? g : void 0,
36
+ actionProps: e.actionProps,
37
37
  // arco 列属性兼容映射:ellipsis → EP showOverflowTooltip
38
38
  rest: {
39
- ...b !== void 0 ? { showOverflowTooltip: b !== !1 } : {},
40
- ...R
39
+ ..._ !== void 0 ? { showOverflowTooltip: _ !== !1 } : {},
40
+ ...$
41
41
  }
42
42
  };
43
43
  }));
44
- return C(
45
- new Proxy(
46
- {},
47
- {
48
- get(a, r) {
49
- return _.value?.[r];
50
- },
51
- has(a, r) {
52
- return r in (_.value ?? {});
53
- }
54
- }
55
- )
56
- ), (a, r) => {
57
- const n = w("el-table-column"), d = w("el-table"), p = D("loading");
58
- return o(), k("div", J, [
59
- K((o(), f(d, i({
44
+ return P({
45
+ /** 单选表格下将指定行设为选中;不传参则清除当前行选中 */
46
+ setCurrentRow: (e) => a.value?.setCurrentRow(e),
47
+ /** 多选表格下切换某行选中状态;第二个参数可直接指定是否选中 */
48
+ toggleRowSelection: (e, o) => a.value?.toggleRowSelection(e, o),
49
+ /** 清空用户的多选状态 */
50
+ clearSelection: () => a.value?.clearSelection(),
51
+ /** 多选表格全选 / 取消全选 */
52
+ toggleAllSelection: () => a.value?.toggleAllSelection(),
53
+ /** 取当前被选中的行 */
54
+ getSelectionRows: () => a.value?.getSelectionRows(),
55
+ /** 取当前半选(父子联动)的行 */
56
+ getHalfSelectionRows: () => a.value?.getHalfSelectionRows(),
57
+ /** 展开/收起某行的展开内容或子节点;第二个参数可直接指定是否展开 */
58
+ toggleRowExpansion: (e, o) => a.value?.toggleRowExpansion(e, o),
59
+ /** 清除排序,恢复原始顺序 */
60
+ clearSort: () => a.value?.clearSort(),
61
+ /** 清除列筛选;不传 columnKey 则清除全部 */
62
+ clearFilter: (e) => a.value?.clearFilter(e),
63
+ /** 手动排序:`prop` 指定列字段,`order` 指定升/降序 */
64
+ sort: (e, o) => a.value?.sort(e, o),
65
+ /** 重新计算表格布局(容器由隐藏变可见时常用) */
66
+ doLayout: () => a.value?.doLayout(),
67
+ /** 懒加载树形表格下更新某行的子节点(需配合 `row-key`) */
68
+ updateKeyChildren: (e, o) => a.value?.updateKeyChildren(e, o),
69
+ /** 滚动到指定坐标 */
70
+ scrollTo: (e, o) => a.value?.scrollTo(e, o),
71
+ /** 设置横向滚动位置 */
72
+ setScrollLeft: (e) => a.value?.setScrollLeft(e),
73
+ /** 设置纵向滚动位置 */
74
+ setScrollTop: (e) => a.value?.setScrollTop(e),
75
+ /** 内部 ElTable 实例,未列出的能力(`store`/`columns` 等)兜底用 */
76
+ get elTable() {
77
+ return a.value;
78
+ }
79
+ }), (e, o) => {
80
+ const n = w("el-table-column"), p = w("el-table"), g = L("loading");
81
+ return r(), C("div", J, [
82
+ j((r(), c(p, i({
60
83
  ref_key: "tableRef",
61
- ref: _,
84
+ ref: a,
62
85
  class: "zl-table__inner"
63
- }, { border: !1, ...a.$attrs }, { data: l(m) }), {
64
- default: c(() => [
65
- a.$slots.expand ? (o(), f(n, {
86
+ }, { border: !1, ...e.$attrs }, { data: s(S) }), {
87
+ default: u(() => [
88
+ e.$slots.expand ? (r(), c(n, {
66
89
  key: 0,
67
90
  type: "expand"
68
91
  }, {
69
- default: c((e) => [
70
- h(a.$slots, "expand", O(V(e)))
92
+ default: u((t) => [
93
+ h(e.$slots, "expand", D(E(t)))
71
94
  ]),
72
95
  _: 3
73
- })) : v("", !0),
74
- (o(!0), k(Z, null, E($.value, (e) => (o(), f(n, i({
75
- key: e.prop ?? e.label,
76
- label: e.label,
77
- prop: e.prop
78
- }, { ref_for: !0 }, e.rest, {
79
- width: e.actions ? e.rest.width ?? (u.expandAction ? 120 : 80) : e.rest.width,
80
- align: e.actions ? e.rest.align ?? "center" : e.rest.align
81
- }), F({ _: 2 }, [
82
- e.headerSlotName ? {
96
+ })) : y("", !0),
97
+ (r(!0), C(F, null, H(T.value, (t) => (r(), c(n, i({
98
+ key: t.prop ?? t.label,
99
+ label: t.label,
100
+ prop: t.prop
101
+ }, { ref_for: !0 }, t.rest, {
102
+ width: t.actions ? t.rest.width ?? (v.expandAction ? 120 : 80) : t.rest.width,
103
+ align: t.actions ? t.rest.align ?? "center" : t.rest.align
104
+ }), O({ _: 2 }, [
105
+ t.headerSlotName ? {
83
106
  name: "header",
84
- fn: c((t) => [
85
- h(a.$slots, e.headerSlotName, i({ ref_for: !0 }, t))
107
+ fn: u((l) => [
108
+ h(e.$slots, t.headerSlotName, i({ ref_for: !0 }, l))
86
109
  ]),
87
110
  key: "0"
88
111
  } : void 0,
89
- e.slotName || e.actions ? {
112
+ t.slotName || t.actions ? {
90
113
  name: "default",
91
- fn: c((t) => [
92
- e.actions ? (o(), f(q, i({
114
+ fn: u((l) => [
115
+ t.actions ? (r(), c(I, i({
93
116
  key: 0,
94
117
  ref_for: !0
95
- }, e.actionProps, {
96
- actions: e.actions,
97
- "visible-args": [t.row, t],
98
- "action-args": [t.row, t],
118
+ }, t.actionProps, {
119
+ actions: t.actions,
120
+ "visible-args": [l.row, l],
121
+ "action-args": [l.row, l],
99
122
  "icon-more": { darkSurface: !0 }
100
- }), null, 16, ["actions", "visible-args", "action-args"])) : e.slotName ? h(a.$slots, e.slotName, i({ ref_for: !0 }, t), () => [
101
- I(L(e.prop ? t.row[e.prop] : ""), 1)
102
- ], void 0, 1) : v("", !0)
123
+ }), null, 16, ["actions", "visible-args", "action-args"])) : t.slotName ? h(e.$slots, t.slotName, i({ ref_for: !0 }, l), () => [
124
+ V(Z(t.prop ? l.row[t.prop] : ""), 1)
125
+ ], void 0, 1) : y("", !0)
103
126
  ]),
104
127
  key: "1"
105
128
  } : void 0
@@ -107,16 +130,16 @@ const J = { class: "zl-table" }, M = { inheritAttrs: !1 }, ee = /* @__PURE__ */
107
130
  ]),
108
131
  _: 3
109
132
  }, 16, ["data"])), [
110
- [p, u.loading]
133
+ [g, v.loading]
111
134
  ]),
112
- l(s) !== !1 ? (o(), f(G, i({
135
+ s(d) !== !1 ? (r(), c(q, i({
113
136
  key: 0,
114
137
  class: "zl-table__pagination"
115
- }, typeof l(s) == "object" ? l(s) : {}, {
116
- total: A.value,
117
- onPageChange: l(x),
118
- onPageSizeChange: l(z)
119
- }), null, 16, ["total", "onPageChange", "onPageSizeChange"])) : v("", !0)
138
+ }, typeof s(d) == "object" ? s(d) : {}, {
139
+ total: N.value,
140
+ onPageChange: s(x),
141
+ onPageSizeChange: s(A)
142
+ }), null, 16, ["total", "onPageChange", "onPageSizeChange"])) : y("", !0)
120
143
  ]);
121
144
  };
122
145
  }
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * 标签页(el-tabs 封装):tabs schema 驱动,每 tab 内容经具名插槽(#tab.key)渲染
3
- * EP 映射:tab.key→el-tab-pane name、tab.title→label、lazyLoad→lazy
3
+ * EP 映射:tab.key→el-tab-pane name、tab.title→label、tab.lazyLoad|tab.lazy→lazy
4
+ * 受控当前页签用 v-model(modelValue);`type`/`tab-click` 等未声明入参与事件透传 ElTabs
4
5
  *
5
6
  * 注意 1:这里必须 import 组件本体,不能写 `h('el-tabs')` ——h() 收到字符串只会当成
6
7
  * 原生标签(shapeFlag=ELEMENT),既不解析组件、也不会渲染出页签,且没有任何告警。
@@ -18,6 +19,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
18
19
  type: ArrayConstructor;
19
20
  default: () => never[];
20
21
  };
22
+ /** 当前激活页签的 key,可用 v-model 双向绑定 */
23
+ modelValue: {
24
+ type: (StringConstructor | NumberConstructor)[];
25
+ default: undefined;
26
+ };
21
27
  /** 是否显示页签导航分隔线,默认显示 */
22
28
  border: {
23
29
  type: BooleanConstructor;
@@ -32,12 +38,20 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
32
38
  };
33
39
  }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
34
40
  [key: string]: any;
35
- }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
41
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
42
+ /** 点击页签切换后触发,参数为新激活页签的 key(v-model 更新) */
43
+ 'update:modelValue': (key: string | number | undefined) => boolean;
44
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
36
45
  /** 页签配置列表,以 key 关联内容插槽 */
37
46
  tabs: {
38
47
  type: ArrayConstructor;
39
48
  default: () => never[];
40
49
  };
50
+ /** 当前激活页签的 key,可用 v-model 双向绑定 */
51
+ modelValue: {
52
+ type: (StringConstructor | NumberConstructor)[];
53
+ default: undefined;
54
+ };
41
55
  /** 是否显示页签导航分隔线,默认显示 */
42
56
  border: {
43
57
  type: BooleanConstructor;
@@ -50,8 +64,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
50
64
  type: BooleanConstructor;
51
65
  default: boolean;
52
66
  };
53
- }>> & Readonly<{}>, {
67
+ }>> & Readonly<{
68
+ "onUpdate:modelValue"?: ((key: string | number | undefined) => any) | undefined;
69
+ }>, {
54
70
  border: boolean;
71
+ modelValue: string | number;
55
72
  fit: boolean;
56
73
  tabs: unknown[];
57
74
  darkNav: boolean;
@@ -1,11 +1,13 @@
1
- import { ElTabs as b, ElTabPane as i } from "element-plus";
2
- import { defineComponent as m, getCurrentInstance as c, h as r, withCtx as o, renderSlot as l } from "vue";
3
- const z = m({
1
+ import { ElTabs as b, ElTabPane as p } from "element-plus";
2
+ import { defineComponent as c, getCurrentInstance as y, h as r, withCtx as o, renderSlot as d } from "vue";
3
+ const V = c({
4
4
  name: "ZlTabs",
5
5
  inheritAttrs: !1,
6
6
  props: {
7
7
  /** 页签配置列表,以 key 关联内容插槽 */
8
8
  tabs: { type: Array, default: () => [] },
9
+ /** 当前激活页签的 key,可用 v-model 双向绑定 */
10
+ modelValue: { type: [String, Number], default: void 0 },
9
11
  /** 是否显示页签导航分隔线,默认显示 */
10
12
  border: { type: Boolean, default: !0 },
11
13
  /** 是否撑满容器并让内容区滚动 */
@@ -13,8 +15,12 @@ const z = m({
13
15
  /** 是否启用导航背景色,默认启用 */
14
16
  darkNav: { type: Boolean, default: !0 }
15
17
  },
16
- setup(t, { slots: e, attrs: d }) {
17
- const n = c();
18
+ emits: {
19
+ /** 点击页签切换后触发,参数为新激活页签的 key(v-model 更新) */
20
+ "update:modelValue": (e) => typeof e == "string" || typeof e == "number" || e === void 0
21
+ },
22
+ setup(e, { slots: a, attrs: u, emit: s }) {
23
+ const n = y();
18
24
  return () => r("div", { class: "zl-tabs-wrap" }, [
19
25
  r(
20
26
  b,
@@ -22,47 +28,51 @@ const z = m({
22
28
  class: [
23
29
  "zl-tabs",
24
30
  {
25
- "zl-tabs-no-border": !t.border,
26
- "zl-tabs-fit": t.fit,
27
- "zl-tabs-dark-nav": t.darkNav
31
+ "zl-tabs-no-border": !e.border,
32
+ "zl-tabs-fit": e.fit,
33
+ "zl-tabs-dark-nav": e.darkNav
28
34
  }
29
35
  ],
30
- ...d
36
+ ...u,
37
+ // 受控页签走显式契约(modelValue 已声明为 prop,不会落在 attrs 里)
38
+ modelValue: e.modelValue,
39
+ "onUpdate:modelValue": (t) => s("update:modelValue", t)
31
40
  },
32
41
  {
33
42
  default: o(
34
43
  () => [
35
- ...t.tabs.map((s) => {
36
- const { key: a, title: f, ...u } = s;
44
+ ...e.tabs.map((t) => {
45
+ const { key: l, title: f, lazyLoad: i, ...m } = t;
37
46
  return r(
38
- i,
47
+ p,
39
48
  {
40
- key: a,
41
- name: a,
49
+ key: l,
50
+ name: l,
42
51
  label: f,
43
- lazy: !0,
44
- ...u
52
+ // 默认懒挂载;可用 tab 里的 `lazy: false` 或 arco 风 `lazyLoad: false` 覆盖
53
+ lazy: i ?? !0,
54
+ ...m
45
55
  },
46
56
  {
47
57
  // 必须返回数组:ElTabPane 用 renderSlot 渲染内容,内部 ensureValidVNode
48
58
  // 会对返回值调用 .some(),拿到单个 vnode 会直接抛 TypeError。
49
- default: o(() => [l(e, a, { tab: s })], n)
59
+ default: o(() => [d(a, l, { tab: t })], n)
50
60
  }
51
61
  );
52
62
  }),
53
63
  // 追加在页签列表之后的内容(不在任何 ElTabPane 内)
54
- l(e, "default")
64
+ d(a, "default")
55
65
  ],
56
66
  n
57
67
  )
58
68
  }
59
69
  ),
60
70
  // 页签栏右侧的附加操作区
61
- l(e, "extra")
71
+ d(a, "extra")
62
72
  ]);
63
73
  }
64
74
  });
65
75
  export {
66
- z as default
76
+ V as default
67
77
  };
68
78
  //# sourceMappingURL=index.vue.mjs.map
@@ -173,10 +173,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
173
173
  }>, {
174
174
  fill: boolean;
175
175
  icon: string;
176
+ size: "small" | "medium" | "mini";
176
177
  color: string;
177
- disabled: boolean;
178
178
  visible: boolean | undefined;
179
- size: "small" | "mini" | "medium";
179
+ disabled: boolean;
180
180
  bordered: boolean;
181
181
  dotIcon: boolean;
182
182
  iconColor: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zl-ui-kit/components",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "description": "ZL UI 业务组件库(Element Plus 体系,Zl 前缀)——首批:Icon/AutoTooltip/Tag/CornerTag/Text/Title/Copy/Empty/Pagination/DictTag",
6
6
  "license": "MIT",
@@ -39,9 +39,9 @@
39
39
  "file-type": "^20.4.1",
40
40
  "dt-sql-parser": "^4.3.1",
41
41
  "sql-formatter": "^15.4.2",
42
- "@zl-ui-kit/utils": "0.9.0",
43
- "@zl-ui-kit/composables": "0.9.0",
44
- "@zl-ui-kit/icons": "0.9.0"
42
+ "@zl-ui-kit/composables": "0.10.0",
43
+ "@zl-ui-kit/icons": "0.10.0",
44
+ "@zl-ui-kit/utils": "0.10.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@vueuse/core": "^12.3.0",
@@ -99,9 +99,9 @@
99
99
  "@vue-office/pptx": "1.0.1",
100
100
  "echarts": "^5.6.0",
101
101
  "@jichuang/eslint-config": "1.0.0",
102
- "@zl-ui-kit/theme": "0.9.0",
102
+ "@jichuang/vite-config": "1.0.0",
103
103
  "@jichuang/tsconfig": "1.0.0",
104
- "@jichuang/vite-config": "1.0.0"
104
+ "@zl-ui-kit/theme": "0.10.0"
105
105
  },
106
106
  "repository": {
107
107
  "type": "git",