ik-next-ui 0.0.6 → 0.0.7
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/dist/IkTree/ik-next-ui.css +1 -1
- package/dist/IkTree/ik.index.es.js +91 -63
- package/dist/ik-next-ui.css +1 -1
- package/dist/index.es.js +3965 -3937
- package/dist/index.umd.js +62 -62
- package/dist/src/components/IkTree/IkTree.vue.d.ts +44 -19
- package/dist/src/components/IkTree/index.d.ts +57 -18
- package/dist/src/iking-ui/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.ik-tree-main[data-v-
|
|
1
|
+
.ik-tree-main[data-v-cd738723]{display:flex;flex-direction:column;height:100%;width:100%}.ik-tree-main.auto-flow[data-v-cd738723]{margin:-20px}.ik-tree-main.auto-flow .ik-tree-search[data-v-cd738723]{padding:0 var(--a631d680)}.ik-tree-main.auto-flow .ik-tree.el-tree[data-v-cd738723]{padding:0 var(--a631d680);overflow:auto}.ik-tree-main .ik-tree-search[data-v-cd738723]{margin-bottom:8px}.ik-tree-main .ik-tree-search[data-v-cd738723] .el-input-group__append{padding:0}.ik-tree-main .ik-tree.el-tree[data-v-cd738723]{flex:1;color:var(--ik-color-font-normal)}.ik-tree-main .ik-tree.el-tree.auto-flow[data-v-cd738723]{margin-right:calc(var(--a631d680) * -1);padding-right:var(--a631d680)}.ik-tree-main .ik-tree.el-tree[data-v-cd738723] .el-tree-node.is-current.is-focusable>.el-tree-node__content{color:var(--el-color-primary);background-color:var(--el-color-primary-light-9)}.ik-tree-main .ik-tree.el-tree[data-v-cd738723] .el-tree-node.is-expanded.is-focusable:not(.is-current)>.el-tree-node__content{color:var(--ik-text-color);background-color:transparent}.ik-tree-main .ik-tree.el-tree[data-v-cd738723] .el-tree-node:not(.is-current)>.el-tree-node__content{background-color:transparent!important}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElTree as
|
|
3
|
-
import { Search as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as N, useCssVars as V, useAttrs as B, computed as m, ref as k, watch as F, resolveComponent as I, openBlock as h, createElementBlock as O, Fragment as A, renderSlot as y, createElementVNode as M, normalizeClass as U, createBlock as $, unref as v, createCommentVNode as j, createVNode as E, mergeProps as P, createSlots as R, withCtx as z } from "vue";
|
|
2
|
+
import { ElTree as _ } from "element-plus";
|
|
3
|
+
import { Search as q } from "@element-plus/icons-vue";
|
|
4
|
+
const D = (t, i) => (t.install = (a) => {
|
|
5
5
|
for (const l of [t, ...Object.values({})])
|
|
6
|
-
|
|
7
|
-
}, t),
|
|
6
|
+
a.component(l.name, l);
|
|
7
|
+
}, t), G = /* @__PURE__ */ N({
|
|
8
|
+
name: "IkTree",
|
|
9
|
+
inheritAttrs: !1,
|
|
8
10
|
__name: "IkTree",
|
|
9
11
|
props: {
|
|
12
|
+
// ===== IkTree 自定义属性 =====
|
|
10
13
|
showSearch: {
|
|
11
14
|
type: Boolean,
|
|
12
15
|
default: !0
|
|
@@ -15,10 +18,6 @@ const z = (t, d) => (t.install = (r) => {
|
|
|
15
18
|
type: String,
|
|
16
19
|
default: "请输入名称检索"
|
|
17
20
|
},
|
|
18
|
-
emptyText: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: "暂无数据"
|
|
21
|
-
},
|
|
22
21
|
// 是否自适应滚动
|
|
23
22
|
autoFlow: {
|
|
24
23
|
type: Boolean,
|
|
@@ -34,91 +33,120 @@ const z = (t, d) => (t.install = (r) => {
|
|
|
34
33
|
type: Boolean,
|
|
35
34
|
default: !1
|
|
36
35
|
},
|
|
36
|
+
// ===== el-tree 常用属性(提供更好的类型提示和默认值)=====
|
|
37
37
|
data: {
|
|
38
38
|
type: Array,
|
|
39
39
|
default: () => []
|
|
40
|
+
},
|
|
41
|
+
emptyText: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "暂无数据"
|
|
44
|
+
},
|
|
45
|
+
nodeKey: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "id"
|
|
48
|
+
},
|
|
49
|
+
props: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: () => ({ children: "children", label: "label" })
|
|
40
52
|
}
|
|
41
53
|
},
|
|
42
54
|
emits: ["node-click"],
|
|
43
|
-
setup(t, { expose:
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
setup(t, { expose: i, emit: a }) {
|
|
56
|
+
V((e) => ({
|
|
57
|
+
a631d680: x.value
|
|
46
58
|
}));
|
|
47
|
-
const l = t,
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
const l = t, s = B(), g = [
|
|
60
|
+
"showSearch",
|
|
61
|
+
"placeholder",
|
|
62
|
+
"autoFlow",
|
|
63
|
+
"padding",
|
|
64
|
+
"clickUncheck"
|
|
65
|
+
], w = m(() => {
|
|
66
|
+
const e = {};
|
|
67
|
+
for (const [o, n] of Object.entries(s))
|
|
68
|
+
g.includes(o) || (e[o] = n);
|
|
69
|
+
return e;
|
|
70
|
+
}), d = k(""), c = k();
|
|
71
|
+
F(
|
|
72
|
+
() => d.value,
|
|
50
73
|
(e) => {
|
|
51
|
-
var
|
|
52
|
-
(
|
|
74
|
+
var o;
|
|
75
|
+
(o = c.value) == null || o.filter(e);
|
|
53
76
|
}
|
|
54
77
|
);
|
|
55
|
-
const
|
|
78
|
+
const x = m(
|
|
56
79
|
() => typeof l.padding == "string" ? l.padding : `${l.padding}px`
|
|
57
|
-
),
|
|
58
|
-
|
|
59
|
-
}, p =
|
|
60
|
-
var
|
|
80
|
+
), b = () => {
|
|
81
|
+
d.value = "";
|
|
82
|
+
}, p = a, f = k(null), C = (e) => {
|
|
83
|
+
var n, r, u;
|
|
61
84
|
if (!l.clickUncheck) {
|
|
62
85
|
p("node-click", e);
|
|
63
86
|
return;
|
|
64
87
|
}
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
-
(
|
|
88
|
+
const o = (n = c.value) == null ? void 0 : n.getCurrentKey();
|
|
89
|
+
if (f.value !== null && o === f.value)
|
|
90
|
+
(r = c.value) == null || r.setCurrentKey(), f.value = null, p("node-click", null);
|
|
68
91
|
else {
|
|
69
92
|
p("node-click", e);
|
|
70
|
-
const
|
|
71
|
-
|
|
93
|
+
const K = (u = c.value) == null ? void 0 : u.getCurrentKey();
|
|
94
|
+
f.value = K ?? null;
|
|
72
95
|
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
return
|
|
77
|
-
|
|
96
|
+
}, S = (e, o) => {
|
|
97
|
+
var r, u;
|
|
98
|
+
const n = typeof ((r = l.props) == null ? void 0 : r.label) == "string" ? l.props.label : "label";
|
|
99
|
+
return ((u = o[n]) == null ? void 0 : u.includes(e)) ?? !1;
|
|
100
|
+
}, T = m(() => {
|
|
101
|
+
const e = s.filterNodeMethod || s["filter-node-method"];
|
|
102
|
+
return e || S;
|
|
103
|
+
});
|
|
104
|
+
return i({ tree: c, filterText: d, resetInput: b }), (e, o) => {
|
|
105
|
+
const n = I("el-input");
|
|
106
|
+
return h(), O(
|
|
107
|
+
A,
|
|
78
108
|
null,
|
|
79
109
|
[
|
|
80
110
|
y(e.$slots, "inset", {}, void 0, !0),
|
|
81
|
-
|
|
111
|
+
M(
|
|
82
112
|
"div",
|
|
83
113
|
{
|
|
84
|
-
class:
|
|
114
|
+
class: U(["ik-tree-main", { "auto-flow": t.autoFlow }])
|
|
85
115
|
},
|
|
86
116
|
[
|
|
87
|
-
t.showSearch ? (
|
|
117
|
+
t.showSearch ? (h(), $(n, {
|
|
88
118
|
key: 0,
|
|
89
|
-
modelValue:
|
|
90
|
-
"onUpdate:modelValue":
|
|
119
|
+
modelValue: d.value,
|
|
120
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => d.value = r),
|
|
91
121
|
modelModifiers: { trim: !0 },
|
|
92
122
|
class: "w-full ik-tree-search",
|
|
93
123
|
placeholder: t.placeholder,
|
|
94
124
|
clearable: "",
|
|
95
|
-
"suffix-icon":
|
|
96
|
-
}, null, 8, ["modelValue", "placeholder", "suffix-icon"])) :
|
|
97
|
-
|
|
125
|
+
"suffix-icon": v(q)
|
|
126
|
+
}, null, 8, ["modelValue", "placeholder", "suffix-icon"])) : j("v-if", !0),
|
|
127
|
+
E(v(_), P({
|
|
98
128
|
ref_key: "treeRef",
|
|
99
|
-
ref: c
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"node-key":
|
|
129
|
+
ref: c
|
|
130
|
+
}, w.value, {
|
|
131
|
+
data: t.data,
|
|
132
|
+
"empty-text": t.emptyText,
|
|
133
|
+
"node-key": t.nodeKey,
|
|
134
|
+
props: l,
|
|
135
|
+
"filter-node-method": T.value,
|
|
104
136
|
class: "ik-tree",
|
|
105
|
-
onNodeClick:
|
|
106
|
-
|
|
107
|
-
var f, k;
|
|
108
|
-
return i[((k = (f = e.$attrs) == null ? void 0 : f.props) == null ? void 0 : k.label) || "label"].includes(o);
|
|
109
|
-
}
|
|
110
|
-
}), O({
|
|
137
|
+
onNodeClick: C
|
|
138
|
+
}), R({
|
|
111
139
|
_: 2
|
|
112
140
|
/* DYNAMIC */
|
|
113
141
|
}, [
|
|
114
142
|
e.$slots.default ? {
|
|
115
143
|
name: "default",
|
|
116
|
-
fn:
|
|
117
|
-
y(e.$slots, "default", { data:
|
|
144
|
+
fn: z(({ data: r }) => [
|
|
145
|
+
y(e.$slots, "default", { data: r }, void 0, !0)
|
|
118
146
|
]),
|
|
119
147
|
key: "0"
|
|
120
148
|
} : void 0
|
|
121
|
-
]), 1040, ["
|
|
149
|
+
]), 1040, ["data", "empty-text", "node-key", "props", "filter-node-method"])
|
|
122
150
|
],
|
|
123
151
|
2
|
|
124
152
|
/* CLASS */
|
|
@@ -129,13 +157,13 @@ const z = (t, d) => (t.install = (r) => {
|
|
|
129
157
|
);
|
|
130
158
|
};
|
|
131
159
|
}
|
|
132
|
-
}),
|
|
133
|
-
const
|
|
134
|
-
for (const [l,
|
|
135
|
-
|
|
136
|
-
return
|
|
137
|
-
},
|
|
160
|
+
}), H = (t, i) => {
|
|
161
|
+
const a = t.__vccOpts || t;
|
|
162
|
+
for (const [l, s] of i)
|
|
163
|
+
a[l] = s;
|
|
164
|
+
return a;
|
|
165
|
+
}, J = /* @__PURE__ */ H(G, [["__scopeId", "data-v-cd738723"]]), X = D(J);
|
|
138
166
|
export {
|
|
139
|
-
|
|
140
|
-
|
|
167
|
+
X as IkTree,
|
|
168
|
+
X as default
|
|
141
169
|
};
|