@zl-ui-kit/components 0.8.3 → 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.
- package/README.md +444 -179
- package/dist/components/ZlAddSub/index.css +1 -1
- package/dist/components/ZlAddSub/index.vue.mjs +2 -2
- package/dist/components/ZlAppMenu/AppMenu.vue.d.ts +1 -1
- package/dist/components/ZlCardPage/index.vue.d.ts +94 -36
- package/dist/components/ZlCardPage/index.vue.mjs +2 -0
- package/dist/components/ZlChart/index.vue.d.ts +1 -0
- package/dist/components/ZlChart/index.vue.mjs +1 -0
- package/dist/components/ZlCheckAll/index.css +1 -1
- package/dist/components/ZlCheckAll/index.vue.mjs +1 -1
- package/dist/components/ZlDynamicComponent/index.vue.d.ts +8 -3
- package/dist/components/ZlDynamicComponent/index.vue.mjs +24 -19
- package/dist/components/ZlEditor/ZlSqlEditor.vue.d.ts +28 -2
- package/dist/components/ZlEditor/ZlSqlEditor.vue.mjs +27 -18
- package/dist/components/ZlEditor/index.vue.d.ts +22 -1
- package/dist/components/ZlEditor/index.vue.mjs +47 -24
- package/dist/components/ZlForm/index.vue.d.ts +26 -2
- package/dist/components/ZlForm/index.vue.mjs +96 -90
- package/dist/components/ZlGrid/index.vue.d.ts +1 -1
- package/dist/components/ZlIcon/index.css +1 -1
- package/dist/components/ZlIcon/index.vue.d.ts +6 -2
- package/dist/components/ZlIcon/index.vue.mjs +2 -2
- package/dist/components/ZlIcon/index2.vue.mjs +30 -23
- package/dist/components/ZlPagination/index.css +1 -1
- package/dist/components/ZlPagination/index.vue.mjs +1 -1
- package/dist/components/ZlSearch/index.vue.d.ts +82 -23
- package/dist/components/ZlSearch/index.vue.mjs +8 -1
- package/dist/components/ZlSearchTable/index.vue.d.ts +180 -40
- package/dist/components/ZlSearchTable/index.vue.mjs +4 -0
- package/dist/components/ZlSorter/ZlSorterList.css +1 -1
- package/dist/components/ZlSorter/ZlSorterList.vue.d.ts +1 -1
- package/dist/components/ZlSorter/ZlSorterList.vue.mjs +2 -2
- package/dist/components/ZlSorter/index.css +1 -1
- package/dist/components/ZlSorter/index.vue.mjs +2 -2
- package/dist/components/ZlSwitch/index.vue.d.ts +6 -2
- package/dist/components/ZlSwitch/index.vue.mjs +26 -24
- package/dist/components/ZlTable/index.vue.d.ts +36 -1
- package/dist/components/ZlTable/index.vue.mjs +98 -75
- package/dist/components/ZlTabs/index.vue.d.ts +20 -3
- package/dist/components/ZlTabs/index.vue.mjs +30 -20
- package/dist/components/ZlTag/index.vue.d.ts +2 -2
- package/dist/components/ZlTree/index.vue.d.ts +83 -2
- package/dist/components/ZlTree/index.vue.mjs +218 -71
- package/package.json +6 -6
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/** 节点键值类型(即 `node-key` 指向字段的值) */
|
|
2
|
+
type ZlTreeKey = string | number;
|
|
3
|
+
/** 节点原始数据 */
|
|
4
|
+
type ZlTreeData = Record<string, any>;
|
|
1
5
|
type __VLS_Props = {
|
|
2
|
-
/** 字段映射(arco fieldNames 兼容:title→label、children
|
|
6
|
+
/** 字段映射(arco fieldNames 兼容:title→label、children;disabled/isLeaf 填数据里的布尔字段名) */
|
|
3
7
|
fieldNames?: {
|
|
4
8
|
key?: string;
|
|
5
9
|
title?: string;
|
|
6
10
|
children?: string;
|
|
11
|
+
disabled?: string;
|
|
12
|
+
isLeaf?: string;
|
|
7
13
|
};
|
|
8
14
|
/** 搜索框透传(el-input 属性) */
|
|
9
15
|
inputSearchProps?: Record<string, any>;
|
|
@@ -13,15 +19,33 @@ type __VLS_Props = {
|
|
|
13
19
|
disableFilter?: boolean;
|
|
14
20
|
/** 是否显示树区域加载状态 */
|
|
15
21
|
loading?: boolean;
|
|
22
|
+
/** 显示复选框(多选),取值可用 `v-model:checked-keys` 或 `getCheckedKeys()` */
|
|
23
|
+
showCheckbox?: boolean;
|
|
24
|
+
/** 勾选时父子不关联(每个节点独立勾选) */
|
|
25
|
+
checkStrictly?: boolean;
|
|
26
|
+
/** 勾选父节点时联动勾选全部子孙(懒加载未展开的层级需要展开后才纳入) */
|
|
27
|
+
checkDescendants?: boolean;
|
|
16
28
|
};
|
|
29
|
+
type __VLS_PublicProps = {
|
|
30
|
+
'checkedKeys'?: ZlTreeKey[];
|
|
31
|
+
'halfCheckedKeys'?: ZlTreeKey[];
|
|
32
|
+
} & __VLS_Props;
|
|
17
33
|
declare function __VLS_template(): {
|
|
18
34
|
attrs: Partial<{}>;
|
|
19
35
|
slots: Partial<Record<string, (_: any) => any>> & {
|
|
20
36
|
'search-extra'?(_: {}): any;
|
|
37
|
+
default?(_: {
|
|
38
|
+
node: any;
|
|
39
|
+
data: any;
|
|
40
|
+
}): any;
|
|
21
41
|
title?(_: {
|
|
22
42
|
node: any;
|
|
23
43
|
data: any;
|
|
24
44
|
}): any;
|
|
45
|
+
icon?(_: {
|
|
46
|
+
node: any;
|
|
47
|
+
data: any;
|
|
48
|
+
}): any;
|
|
25
49
|
};
|
|
26
50
|
refs: {
|
|
27
51
|
treeRef: unknown;
|
|
@@ -29,12 +53,69 @@ declare function __VLS_template(): {
|
|
|
29
53
|
rootEl: any;
|
|
30
54
|
};
|
|
31
55
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
32
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
56
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
57
|
+
elTree: any;
|
|
58
|
+
/** 勾选节点的 key 数组;`getCheckedKeys(true)` 只取叶子节点 */
|
|
59
|
+
getCheckedKeys: (leafOnly?: boolean) => ZlTreeKey[];
|
|
60
|
+
/** 勾选节点的数据数组;`leafOnly` 只要叶子,`includeHalfChecked` 连半选节点一起返回 */
|
|
61
|
+
getCheckedNodes: (leafOnly?: boolean, includeHalfChecked?: boolean) => ZlTreeData[];
|
|
62
|
+
/** 半选节点的 key 数组(父子联动下部分勾选的父节点) */
|
|
63
|
+
getHalfCheckedKeys: () => ZlTreeKey[];
|
|
64
|
+
/** 半选节点的数据数组 */
|
|
65
|
+
getHalfCheckedNodes: () => ZlTreeData[];
|
|
66
|
+
/** 按 key 数组设置勾选;`leafOnly` 表示这些 key 只对应叶子节点(父节点由联动推导) */
|
|
67
|
+
setCheckedKeys: (keys: ZlTreeKey[], leafOnly?: boolean) => void;
|
|
68
|
+
/** 设置单个节点勾选态:`data` 传 key 或节点数据,`deep=false` 表示不联动父子 */
|
|
69
|
+
setChecked: (data: ZlTreeKey | ZlTreeData, checked: boolean, deep?: boolean) => void;
|
|
70
|
+
/** 全选 / 取消全选(跳过 `props.disabled` 命中的节点;懒加载未展开层级需先 `expandAll()`) */
|
|
71
|
+
setAllChecked: (checked?: boolean) => void;
|
|
72
|
+
/** 清空所有勾选与半选 */
|
|
73
|
+
clearChecked: () => void;
|
|
74
|
+
/** 当前高亮(选中)节点的 key,无选中返回 `null` */
|
|
75
|
+
getCurrentKey: () => ZlTreeKey | null;
|
|
76
|
+
/** 当前高亮节点的数据,无选中返回 `null` */
|
|
77
|
+
getCurrentNode: () => ZlTreeData | null;
|
|
78
|
+
/** 设置高亮节点:传 `null` 取消高亮,`expandParent` 是否自动展开父级 */
|
|
79
|
+
setCurrentKey: (key?: ZlTreeKey | null, expandParent?: boolean) => void;
|
|
80
|
+
/** 按节点实例设置高亮 */
|
|
81
|
+
setCurrentNode: (node: any, expandParent?: boolean) => void;
|
|
82
|
+
/** 按值过滤节点(配合 `filterTreeNode`;传空串恢复全量显示) */
|
|
83
|
+
filter: (value: string) => void;
|
|
84
|
+
/** 展开全部已加载节点 */
|
|
85
|
+
expandAll: () => void;
|
|
86
|
+
/** 收起全部节点 */
|
|
87
|
+
collapseAll: () => void;
|
|
88
|
+
/** 取节点实例(可读 `node.checked` / `node.expanded` / `node.level` 等内部状态) */
|
|
89
|
+
getNode: (data: ZlTreeKey | ZlTreeData) => any;
|
|
90
|
+
/** 取从根到该节点的完整路径数据(面包屑、级联回显用) */
|
|
91
|
+
getNodePath: (data: ZlTreeKey | ZlTreeData) => ZlTreeData[];
|
|
92
|
+
/** 按 key 替换子节点数据(懒加载接口回来后刷新某一支) */
|
|
93
|
+
updateKeyChildren: (key: ZlTreeKey, data: ZlTreeData[]) => void;
|
|
94
|
+
/** 在父节点下追加子节点:`parentData` 传 key / 数据 / 节点实例,缺省追加到根 */
|
|
95
|
+
append: (data: ZlTreeData, parentData?: ZlTreeKey | ZlTreeData | any) => void;
|
|
96
|
+
/** 在参考节点之前插入兄弟节点 */
|
|
97
|
+
insertBefore: (data: ZlTreeData, refData: ZlTreeKey | ZlTreeData | any) => void;
|
|
98
|
+
/** 在参考节点之后插入兄弟节点 */
|
|
99
|
+
insertAfter: (data: ZlTreeData, refData: ZlTreeKey | ZlTreeData | any) => void;
|
|
100
|
+
/** 删除节点(传 key 或节点数据) */
|
|
101
|
+
remove: (data: ZlTreeKey | ZlTreeData | any) => void;
|
|
102
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
103
|
+
"update:checkedKeys": (value: ZlTreeKey[]) => any;
|
|
104
|
+
"update:halfCheckedKeys": (value: ZlTreeKey[]) => any;
|
|
105
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
106
|
+
"onUpdate:checkedKeys"?: ((value: ZlTreeKey[]) => any) | undefined;
|
|
107
|
+
"onUpdate:halfCheckedKeys"?: ((value: ZlTreeKey[]) => any) | undefined;
|
|
108
|
+
}>, {
|
|
33
109
|
fieldNames: {
|
|
34
110
|
key?: string;
|
|
35
111
|
title?: string;
|
|
36
112
|
children?: string;
|
|
113
|
+
disabled?: string;
|
|
114
|
+
isLeaf?: string;
|
|
37
115
|
};
|
|
116
|
+
showCheckbox: boolean;
|
|
117
|
+
checkStrictly: boolean;
|
|
118
|
+
checkDescendants: boolean;
|
|
38
119
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
39
120
|
treeRef: unknown;
|
|
40
121
|
}, any>;
|
|
@@ -1,109 +1,256 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as J, useModel as x, useAttrs as Q, useSlots as X, ref as w, computed as c, watch as K, nextTick as v, onMounted as Y, resolveComponent as z, resolveDirective as ee, withDirectives as B, openBlock as N, createElementBlock as M, createVNode as i, mergeProps as P, withCtx as p, renderSlot as u, createCommentVNode as T, createElementVNode as V, createSlots as te, normalizeProps as A, guardReactiveProps as b, createTextVNode as le, toDisplayString as oe, renderList as se, vShow as re, createBlock as ne, mergeModels as ce } from "vue";
|
|
2
|
+
import ae from "../ZlAutoTooltip/index.vue.mjs";
|
|
3
|
+
import de from "../ZlEmpty/index.vue.mjs";
|
|
4
|
+
import _ from "../ZlIcon/index.vue.mjs";
|
|
5
|
+
const ie = { class: "zl-tree" }, ue = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "zl-tree-search"
|
|
8
|
-
},
|
|
8
|
+
}, fe = { class: "zl-tree-body" }, he = { class: "zl-tree-node" }, Ce = /* @__PURE__ */ J({
|
|
9
9
|
name: "ZlTree",
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "index",
|
|
12
|
-
props: {
|
|
12
|
+
props: /* @__PURE__ */ ce({
|
|
13
13
|
fieldNames: { default: () => ({ key: "key", title: "title", children: "children" }) },
|
|
14
14
|
inputSearchProps: {},
|
|
15
15
|
filterTreeNode: {},
|
|
16
16
|
disableFilter: { type: Boolean },
|
|
17
|
-
loading: { type: Boolean }
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
loading: { type: Boolean },
|
|
18
|
+
showCheckbox: { type: Boolean, default: !1 },
|
|
19
|
+
checkStrictly: { type: Boolean, default: !1 },
|
|
20
|
+
checkDescendants: { type: Boolean, default: !1 }
|
|
21
|
+
}, {
|
|
22
|
+
checkedKeys: {},
|
|
23
|
+
checkedKeysModifiers: {},
|
|
24
|
+
halfCheckedKeys: {},
|
|
25
|
+
halfCheckedKeysModifiers: {}
|
|
26
|
+
}),
|
|
27
|
+
emits: ["update:checkedKeys", "update:halfCheckedKeys"],
|
|
28
|
+
setup(n, { expose: $ }) {
|
|
29
|
+
const f = n, C = x(n, "checkedKeys"), E = x(n, "halfCheckedKeys"), s = Q(), L = X(), l = w(null), h = w(""), D = ["default", "title", "icon"], H = c(() => Object.keys(L).filter((e) => !D.includes(e))), Z = c(() => {
|
|
30
|
+
const e = f.fieldNames, t = {
|
|
31
|
+
label: e.title ?? "title",
|
|
32
|
+
children: e.children ?? "children"
|
|
33
|
+
};
|
|
34
|
+
e.disabled && (t.disabled = e.disabled), e.isLeaf && (t.isLeaf = e.isLeaf);
|
|
35
|
+
const o = s.props ?? {};
|
|
36
|
+
return { ...t, ...o };
|
|
37
|
+
}), F = c(
|
|
38
|
+
() => s["node-key"] ?? s.nodeKey ?? f.fieldNames.key ?? "key"
|
|
39
|
+
), R = [
|
|
40
|
+
"props",
|
|
41
|
+
"node-key",
|
|
42
|
+
"nodeKey",
|
|
43
|
+
"filter-node-method",
|
|
44
|
+
"filterNodeMethod",
|
|
45
|
+
"onCheck",
|
|
46
|
+
"on-check"
|
|
47
|
+
], j = c(() => {
|
|
48
|
+
const e = {};
|
|
49
|
+
for (const [t, o] of Object.entries(s))
|
|
50
|
+
R.includes(t) || (e[t] = o);
|
|
51
|
+
return e;
|
|
52
|
+
}), S = c(() => !(s.data ?? []).length);
|
|
53
|
+
K(h, (e) => {
|
|
54
|
+
l.value?.filter(e);
|
|
26
55
|
});
|
|
27
|
-
function
|
|
28
|
-
return e ? String(t[
|
|
56
|
+
function I(e, t) {
|
|
57
|
+
return e ? String(t[f.fieldNames.title ?? "title"] ?? "").includes(e) : !0;
|
|
29
58
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
const O = c(() => {
|
|
60
|
+
const e = s["filter-node-method"] ?? s.filterNodeMethod;
|
|
61
|
+
return typeof e == "function" ? e : f.filterTreeNode ?? I;
|
|
62
|
+
});
|
|
63
|
+
let m = !1;
|
|
64
|
+
function W(e) {
|
|
65
|
+
m = !0, e(), v(() => m = !1);
|
|
66
|
+
}
|
|
67
|
+
function y() {
|
|
68
|
+
const e = C.value;
|
|
69
|
+
!Array.isArray(e) || !l.value || l.value.setCheckedKeys(e);
|
|
70
|
+
}
|
|
71
|
+
function a() {
|
|
72
|
+
W(() => {
|
|
73
|
+
C.value = l.value?.getCheckedKeys?.() ?? [], E.value = l.value?.getHalfCheckedKeys?.() ?? [];
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function U(e, t) {
|
|
77
|
+
a(), q("onCheck", [e, t]);
|
|
78
|
+
}
|
|
79
|
+
function q(e, t) {
|
|
80
|
+
const o = s[e] ?? s[e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()], g = Array.isArray(o) ? o : [o];
|
|
81
|
+
for (const k of g)
|
|
82
|
+
typeof k == "function" && k(...t);
|
|
83
|
+
}
|
|
84
|
+
K(
|
|
85
|
+
() => C.value,
|
|
86
|
+
() => {
|
|
87
|
+
m || v(y);
|
|
88
|
+
},
|
|
89
|
+
{ deep: !0 }
|
|
90
|
+
), K(
|
|
91
|
+
() => s.data,
|
|
92
|
+
() => {
|
|
93
|
+
v(y);
|
|
94
|
+
}
|
|
95
|
+
), Y(() => {
|
|
96
|
+
y();
|
|
97
|
+
});
|
|
98
|
+
function G(e = !0) {
|
|
99
|
+
return (l.value?.store?._getAllNodes?.() ?? []).filter((o) => !e || !o.disabled).map((o) => o.key).filter((o) => o != null);
|
|
100
|
+
}
|
|
101
|
+
return $({
|
|
102
|
+
/** 内部 `el-tree` 实例:下面未列出的原生能力(`store` 等)从这里取 */
|
|
103
|
+
get elTree() {
|
|
104
|
+
return l.value;
|
|
105
|
+
},
|
|
106
|
+
/** 勾选节点的 key 数组;`getCheckedKeys(true)` 只取叶子节点 */
|
|
107
|
+
getCheckedKeys: (e) => l.value?.getCheckedKeys(e) ?? [],
|
|
108
|
+
/** 勾选节点的数据数组;`leafOnly` 只要叶子,`includeHalfChecked` 连半选节点一起返回 */
|
|
109
|
+
getCheckedNodes: (e, t) => l.value?.getCheckedNodes(e, t) ?? [],
|
|
110
|
+
/** 半选节点的 key 数组(父子联动下部分勾选的父节点) */
|
|
111
|
+
getHalfCheckedKeys: () => l.value?.getHalfCheckedKeys() ?? [],
|
|
112
|
+
/** 半选节点的数据数组 */
|
|
113
|
+
getHalfCheckedNodes: () => l.value?.getHalfCheckedNodes() ?? [],
|
|
114
|
+
/** 按 key 数组设置勾选;`leafOnly` 表示这些 key 只对应叶子节点(父节点由联动推导) */
|
|
115
|
+
setCheckedKeys: (e, t) => {
|
|
116
|
+
l.value?.setCheckedKeys(e, t), a();
|
|
117
|
+
},
|
|
118
|
+
/** 设置单个节点勾选态:`data` 传 key 或节点数据,`deep=false` 表示不联动父子 */
|
|
119
|
+
setChecked: (e, t, o = !0) => {
|
|
120
|
+
l.value?.setChecked(e, t, o), a();
|
|
121
|
+
},
|
|
122
|
+
/** 全选 / 取消全选(跳过 `props.disabled` 命中的节点;懒加载未展开层级需先 `expandAll()`) */
|
|
123
|
+
setAllChecked: (e = !0) => {
|
|
124
|
+
const t = e ? G() : [];
|
|
125
|
+
l.value?.setCheckedKeys(t), a();
|
|
126
|
+
},
|
|
127
|
+
/** 清空所有勾选与半选 */
|
|
128
|
+
clearChecked: () => {
|
|
129
|
+
l.value?.setCheckedKeys([]), a();
|
|
130
|
+
},
|
|
131
|
+
/** 当前高亮(选中)节点的 key,无选中返回 `null` */
|
|
132
|
+
getCurrentKey: () => l.value?.getCurrentKey() ?? null,
|
|
133
|
+
/** 当前高亮节点的数据,无选中返回 `null` */
|
|
134
|
+
getCurrentNode: () => l.value?.getCurrentNode() ?? null,
|
|
135
|
+
/** 设置高亮节点:传 `null` 取消高亮,`expandParent` 是否自动展开父级 */
|
|
136
|
+
setCurrentKey: (e, t = !0) => {
|
|
137
|
+
l.value?.setCurrentKey(e, t);
|
|
138
|
+
},
|
|
139
|
+
/** 按节点实例设置高亮 */
|
|
140
|
+
setCurrentNode: (e, t = !0) => {
|
|
141
|
+
l.value?.setCurrentNode(e, t);
|
|
142
|
+
},
|
|
143
|
+
/** 按值过滤节点(配合 `filterTreeNode`;传空串恢复全量显示) */
|
|
144
|
+
filter: (e) => {
|
|
145
|
+
h.value = e, l.value?.filter(e);
|
|
146
|
+
},
|
|
147
|
+
/** 展开全部已加载节点 */
|
|
148
|
+
expandAll: () => {
|
|
149
|
+
(l.value?.store?._getAllNodes?.() ?? []).forEach((t) => t.expand());
|
|
150
|
+
},
|
|
151
|
+
/** 收起全部节点 */
|
|
152
|
+
collapseAll: () => {
|
|
153
|
+
(l.value?.store?._getAllNodes?.() ?? []).forEach((t) => t.collapse());
|
|
154
|
+
},
|
|
155
|
+
/** 取节点实例(可读 `node.checked` / `node.expanded` / `node.level` 等内部状态) */
|
|
156
|
+
getNode: (e) => l.value?.getNode(e),
|
|
157
|
+
/** 取从根到该节点的完整路径数据(面包屑、级联回显用) */
|
|
158
|
+
getNodePath: (e) => l.value?.getNodePath(e) ?? [],
|
|
159
|
+
/** 按 key 替换子节点数据(懒加载接口回来后刷新某一支) */
|
|
160
|
+
updateKeyChildren: (e, t) => {
|
|
161
|
+
l.value?.updateKeyChildren(e, t), v(y);
|
|
162
|
+
},
|
|
163
|
+
/** 在父节点下追加子节点:`parentData` 传 key / 数据 / 节点实例,缺省追加到根 */
|
|
164
|
+
append: (e, t) => {
|
|
165
|
+
l.value?.append(e, t);
|
|
166
|
+
},
|
|
167
|
+
/** 在参考节点之前插入兄弟节点 */
|
|
168
|
+
insertBefore: (e, t) => {
|
|
169
|
+
l.value?.insertBefore(e, t);
|
|
170
|
+
},
|
|
171
|
+
/** 在参考节点之后插入兄弟节点 */
|
|
172
|
+
insertAfter: (e, t) => {
|
|
173
|
+
l.value?.insertAfter(e, t);
|
|
174
|
+
},
|
|
175
|
+
/** 删除节点(传 key 或节点数据) */
|
|
176
|
+
remove: (e) => {
|
|
177
|
+
l.value?.remove(e);
|
|
178
|
+
}
|
|
179
|
+
}), (e, t) => {
|
|
180
|
+
const o = z("el-input"), g = z("el-tree"), k = ee("loading");
|
|
181
|
+
return B((N(), M("div", ie, [
|
|
182
|
+
n.disableFilter ? T("", !0) : (N(), M("div", ue, [
|
|
183
|
+
i(o, P({
|
|
184
|
+
modelValue: h.value,
|
|
185
|
+
"onUpdate:modelValue": t[0] || (t[0] = (r) => h.value = r),
|
|
50
186
|
clearable: ""
|
|
51
|
-
},
|
|
52
|
-
suffix:
|
|
53
|
-
|
|
187
|
+
}, n.inputSearchProps, { "suffix-icon": null }), {
|
|
188
|
+
suffix: p(() => [
|
|
189
|
+
i(_, {
|
|
54
190
|
icon: "zl:search",
|
|
55
191
|
style: { cursor: "pointer" }
|
|
56
192
|
})
|
|
57
193
|
]),
|
|
58
194
|
_: 1
|
|
59
195
|
}, 16, ["modelValue"]),
|
|
60
|
-
|
|
196
|
+
u(e.$slots, "search-extra")
|
|
61
197
|
])),
|
|
62
|
-
|
|
63
|
-
|
|
198
|
+
V("div", fe, [
|
|
199
|
+
B(i(g, P({
|
|
64
200
|
ref_key: "treeRef",
|
|
65
|
-
ref:
|
|
66
|
-
},
|
|
67
|
-
props:
|
|
68
|
-
"node-key":
|
|
69
|
-
"filter-node-method":
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
201
|
+
ref: l
|
|
202
|
+
}, j.value, {
|
|
203
|
+
props: Z.value,
|
|
204
|
+
"node-key": F.value,
|
|
205
|
+
"filter-node-method": O.value,
|
|
206
|
+
"show-checkbox": n.showCheckbox,
|
|
207
|
+
"check-strictly": n.checkStrictly,
|
|
208
|
+
"check-descendants": n.checkDescendants,
|
|
209
|
+
onCheck: U
|
|
210
|
+
}), te({
|
|
211
|
+
default: p(({ node: r, data: d }) => [
|
|
212
|
+
u(e.$slots, "default", {
|
|
213
|
+
node: r,
|
|
214
|
+
data: d
|
|
215
|
+
}, () => [
|
|
216
|
+
u(e.$slots, "title", A(b({ node: r, data: d })), () => [
|
|
217
|
+
V("span", he, [
|
|
218
|
+
u(e.$slots, "icon", A(b({ node: r, data: d })), () => [
|
|
219
|
+
i(_, {
|
|
220
|
+
icon: r.isLeaf ? "zl:document-color" : "zl:folder-color",
|
|
221
|
+
class: "zl-tree-node__icon"
|
|
222
|
+
}, null, 8, ["icon"])
|
|
81
223
|
]),
|
|
82
|
-
|
|
83
|
-
|
|
224
|
+
i(ae, null, {
|
|
225
|
+
default: p(() => [
|
|
226
|
+
le(oe(r.label), 1)
|
|
227
|
+
]),
|
|
228
|
+
_: 2
|
|
229
|
+
}, 1024)
|
|
230
|
+
])
|
|
84
231
|
])
|
|
85
232
|
])
|
|
86
233
|
]),
|
|
87
234
|
_: 2
|
|
88
235
|
}, [
|
|
89
|
-
|
|
90
|
-
name:
|
|
91
|
-
fn:
|
|
92
|
-
|
|
236
|
+
se(H.value, (r) => ({
|
|
237
|
+
name: r,
|
|
238
|
+
fn: p((d) => [
|
|
239
|
+
u(e.$slots, r, A(b(d)))
|
|
93
240
|
])
|
|
94
241
|
}))
|
|
95
|
-
]), 1040, ["props", "node-key", "filter-node-method"]), [
|
|
96
|
-
[
|
|
242
|
+
]), 1040, ["props", "node-key", "filter-node-method", "show-checkbox", "check-strictly", "check-descendants"]), [
|
|
243
|
+
[re, !S.value]
|
|
97
244
|
]),
|
|
98
|
-
|
|
245
|
+
S.value ? (N(), ne(de, { key: 0 })) : T("", !0)
|
|
99
246
|
])
|
|
100
247
|
])), [
|
|
101
|
-
[
|
|
248
|
+
[k, n.loading]
|
|
102
249
|
]);
|
|
103
250
|
};
|
|
104
251
|
}
|
|
105
252
|
});
|
|
106
253
|
export {
|
|
107
|
-
|
|
254
|
+
Ce as default
|
|
108
255
|
};
|
|
109
256
|
//# sourceMappingURL=index.vue.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zl-ui-kit/components",
|
|
3
|
-
"version": "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/composables": "0.
|
|
43
|
-
"@zl-ui-kit/
|
|
44
|
-
"@zl-ui-kit/
|
|
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",
|
|
@@ -98,10 +98,10 @@
|
|
|
98
98
|
"@vue-office/pdf": "^2.0.10",
|
|
99
99
|
"@vue-office/pptx": "1.0.1",
|
|
100
100
|
"echarts": "^5.6.0",
|
|
101
|
-
"@jichuang/vite-config": "1.0.0",
|
|
102
101
|
"@jichuang/eslint-config": "1.0.0",
|
|
102
|
+
"@jichuang/vite-config": "1.0.0",
|
|
103
103
|
"@jichuang/tsconfig": "1.0.0",
|
|
104
|
-
"@zl-ui-kit/theme": "0.
|
|
104
|
+
"@zl-ui-kit/theme": "0.10.0"
|
|
105
105
|
},
|
|
106
106
|
"repository": {
|
|
107
107
|
"type": "git",
|