vft 0.0.500 → 0.0.501
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/index.css +1 -1
- package/es/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/es/components/autocomplete/index.d.ts +6 -6
- package/es/components/button/index.d.ts +9 -9
- package/es/components/image-viewer/image-viewer.vue.d.ts +2 -0
- package/es/components/image-viewer/image-viewer.vue2.js +89 -85
- package/es/components/image-viewer/index.d.ts +18 -0
- package/es/components/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/select/index.d.ts +4 -4
- package/es/components/select/select.vue.d.ts +4 -4
- package/es/components/select/useSelect.d.ts +4 -4
- package/es/components/super-form/super-form-item.vue2.js +313 -294
- package/es/components/table/field.js +32 -33
- package/es/components/tree-select/select.js +24 -24
- package/es/components/tree-select/tree-select-option.js +18 -7
- package/es/components/tree-select/tree-select.vue2.js +28 -26
- package/es/components/tree-select/tree.js +27 -26
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/lib/components/autocomplete/index.d.ts +6 -6
- package/lib/components/button/index.d.ts +9 -9
- package/lib/components/image-viewer/image-viewer.vue.d.ts +2 -0
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/image-viewer/index.d.ts +18 -0
- package/lib/components/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/select/index.d.ts +4 -4
- package/lib/components/select/select.vue.d.ts +4 -4
- package/lib/components/select/useSelect.d.ts +4 -4
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/table/field.cjs +1 -1
- package/lib/components/tree-select/select.cjs +1 -1
- package/lib/components/tree-select/tree-select-option.cjs +1 -1
- package/lib/components/tree-select/tree-select.vue2.cjs +1 -1
- package/lib/components/tree-select/tree.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/theme-style/index.css +1 -1
- package/theme-style/src/tree-select.scss +8 -0
- package/theme-style/vft-tree-select.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createVNode as r, Fragment as _, isVNode as g } from "vue";
|
|
2
|
-
import { useLoadingDelay as
|
|
2
|
+
import { useLoadingDelay as L } from "@vft/use";
|
|
3
3
|
import { formatToDateTime as d } from "@vft/utils/date";
|
|
4
|
-
import { isNullOrUndefined as
|
|
4
|
+
import { isNullOrUndefined as M } from "@vft/utils";
|
|
5
5
|
import { VftButton as u } from "../button/index.js";
|
|
6
|
-
import { VftPopconfirm as
|
|
6
|
+
import { VftPopconfirm as h } from "../popconfirm/index.js";
|
|
7
7
|
import { VftTag as c } from "../tag/index.js";
|
|
8
8
|
function m(t) {
|
|
9
9
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !g(t);
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const V = {
|
|
12
12
|
type: "seq",
|
|
13
13
|
title: "序号",
|
|
14
14
|
fixed: "left",
|
|
15
15
|
width: 53
|
|
16
|
-
},
|
|
16
|
+
}, W = {
|
|
17
17
|
type: "checkbox",
|
|
18
18
|
title: "",
|
|
19
19
|
minWidth: 60,
|
|
@@ -29,46 +29,46 @@ const N = {
|
|
|
29
29
|
}, O = ({
|
|
30
30
|
format: t = "YYYY-MM-DD",
|
|
31
31
|
field: e = "date",
|
|
32
|
-
title:
|
|
32
|
+
title: o = "时间"
|
|
33
33
|
} = {}) => ({
|
|
34
34
|
minWidth: 100,
|
|
35
35
|
field: e,
|
|
36
|
-
title:
|
|
36
|
+
title: o,
|
|
37
37
|
formatter: ({
|
|
38
|
-
row:
|
|
39
|
-
}) =>
|
|
38
|
+
row: i
|
|
39
|
+
}) => i[e] ? d(i[e], t) : "-"
|
|
40
40
|
}), D = ({
|
|
41
41
|
format: t = "YYYY-MM-DD HH:mm:ss",
|
|
42
42
|
field: e = "date",
|
|
43
|
-
title:
|
|
43
|
+
title: o = "时间"
|
|
44
44
|
} = {}) => ({
|
|
45
45
|
minWidth: 190,
|
|
46
46
|
field: e,
|
|
47
|
-
title:
|
|
47
|
+
title: o,
|
|
48
48
|
formatter: ({
|
|
49
|
-
row:
|
|
50
|
-
}) =>
|
|
49
|
+
row: i
|
|
50
|
+
}) => i[e] ? d(i[e], t) : "-"
|
|
51
51
|
}), P = ({
|
|
52
52
|
format: t = "YYYY-MM-DD HH:mm:ss",
|
|
53
53
|
field: e = "createTime",
|
|
54
|
-
title:
|
|
54
|
+
title: o = "创建时间"
|
|
55
55
|
} = {}) => D({
|
|
56
56
|
format: t,
|
|
57
57
|
field: e,
|
|
58
|
-
title:
|
|
58
|
+
title: o
|
|
59
59
|
}), b = ({
|
|
60
60
|
format: t = "YYYY-MM-DD HH:mm:ss",
|
|
61
61
|
field: e = "updateTime",
|
|
62
|
-
title:
|
|
62
|
+
title: o = "更新时间"
|
|
63
63
|
} = {}) => D({
|
|
64
64
|
format: t,
|
|
65
65
|
field: e,
|
|
66
|
-
title:
|
|
66
|
+
title: o
|
|
67
67
|
}), j = ({
|
|
68
68
|
field: t = "status",
|
|
69
69
|
title: e = "状态",
|
|
70
|
-
normalText:
|
|
71
|
-
disabledText:
|
|
70
|
+
normalText: o = "正常",
|
|
71
|
+
disabledText: i = "禁用",
|
|
72
72
|
strToNumber: l = !0
|
|
73
73
|
} = {}) => ({
|
|
74
74
|
field: t,
|
|
@@ -79,26 +79,25 @@ const N = {
|
|
|
79
79
|
row: a
|
|
80
80
|
}) => {
|
|
81
81
|
let n = a?.[t];
|
|
82
|
-
return
|
|
83
|
-
default: () => [
|
|
82
|
+
return M(n) ? "-" : (l && Number(n) === 0 && (n = !1), n ? r(c, null, m(o) ? o : {
|
|
83
|
+
default: () => [o]
|
|
84
84
|
}) : r(c, {
|
|
85
85
|
type: "danger"
|
|
86
|
-
}, m(
|
|
87
|
-
default: () => [
|
|
86
|
+
}, m(i) ? i : {
|
|
87
|
+
default: () => [i]
|
|
88
88
|
}));
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}), U = ({
|
|
92
92
|
confirmText: t = "确认删除?",
|
|
93
93
|
leftCallback: e,
|
|
94
|
-
rightCallback:
|
|
95
|
-
leftText:
|
|
94
|
+
rightCallback: o,
|
|
95
|
+
leftText: i = "编辑",
|
|
96
96
|
rightText: l = "删除",
|
|
97
97
|
showLeft: a = !0,
|
|
98
98
|
showRight: n = !0
|
|
99
99
|
} = {}) => ({
|
|
100
100
|
title: "操作栏",
|
|
101
|
-
minWidth: 180,
|
|
102
101
|
field: "custom-action",
|
|
103
102
|
fixed: "right",
|
|
104
103
|
slots: {
|
|
@@ -109,8 +108,8 @@ const N = {
|
|
|
109
108
|
loading: p,
|
|
110
109
|
start: E,
|
|
111
110
|
cancel: I
|
|
112
|
-
} =
|
|
113
|
-
E(),
|
|
111
|
+
} = L(), Y = () => {
|
|
112
|
+
E(), o?.(f)?.finally(() => {
|
|
114
113
|
I();
|
|
115
114
|
});
|
|
116
115
|
};
|
|
@@ -120,9 +119,9 @@ const N = {
|
|
|
120
119
|
onClick: (s) => {
|
|
121
120
|
s.stopPropagation(), e?.(f);
|
|
122
121
|
}
|
|
123
|
-
}, m(
|
|
124
|
-
default: () => [
|
|
125
|
-
}) : null, n ? r(
|
|
122
|
+
}, m(i) ? i : {
|
|
123
|
+
default: () => [i]
|
|
124
|
+
}) : null, n ? r(h, {
|
|
126
125
|
width: "150",
|
|
127
126
|
onConfirm: Y,
|
|
128
127
|
title: t
|
|
@@ -143,13 +142,13 @@ const N = {
|
|
|
143
142
|
});
|
|
144
143
|
export {
|
|
145
144
|
U as ACTION_FIELD,
|
|
146
|
-
|
|
145
|
+
W as CHECKED_FIELD,
|
|
147
146
|
P as CREATE_TIME_FIELD,
|
|
148
147
|
O as DATE_FIELD,
|
|
149
148
|
D as DATE_TIME_FIELD,
|
|
150
149
|
S as ID_FIELD,
|
|
151
150
|
k as NAME_FIELD,
|
|
152
|
-
|
|
151
|
+
V as SEQ_FIELD,
|
|
153
152
|
j as STATUS_FIELD,
|
|
154
153
|
b as UPDATE_TIME_FIELD
|
|
155
154
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { watch as
|
|
2
|
-
import { useEventListener as
|
|
1
|
+
import { watch as b, nextTick as h, computed as c, onMounted as A, toRefs as L } from "vue";
|
|
2
|
+
import { useEventListener as T } from "@vueuse/core";
|
|
3
3
|
import { pick as k, get as d } from "lodash-es";
|
|
4
4
|
import "../select/index.js";
|
|
5
5
|
import { selectV2Props as C } from "../select/defaults.js";
|
|
6
6
|
import "@vft/utils";
|
|
7
7
|
import "../config-provider/hooks/use-global-config.js";
|
|
8
|
-
import { EVENT_CODE as
|
|
8
|
+
import { EVENT_CODE as y } from "../../constants/aria.js";
|
|
9
9
|
import { UPDATE_MODEL_EVENT as O } from "../../constants/event.js";
|
|
10
10
|
import "../form/index.js";
|
|
11
11
|
import { useNamespace as w } from "../../hooks/use-namespace/index.js";
|
|
@@ -33,21 +33,21 @@ const Z = (e, { attrs: s, emit: f }, {
|
|
|
33
33
|
tree: r,
|
|
34
34
|
key: n
|
|
35
35
|
}) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const g = w("tree-select");
|
|
37
|
+
b(
|
|
38
38
|
() => e.data,
|
|
39
39
|
() => {
|
|
40
|
-
e.filterable &&
|
|
40
|
+
e.filterable && h(() => {
|
|
41
41
|
const t = l.value?.states?.inputValue || "";
|
|
42
42
|
r.value?.filter(t);
|
|
43
43
|
});
|
|
44
44
|
},
|
|
45
45
|
{ flush: "post" }
|
|
46
46
|
);
|
|
47
|
-
const
|
|
47
|
+
const x = (t) => {
|
|
48
48
|
const o = t.at(-1);
|
|
49
49
|
if (o.expanded && o.childNodes.at(-1))
|
|
50
|
-
|
|
50
|
+
x([o.childNodes.at(-1)]);
|
|
51
51
|
else {
|
|
52
52
|
r.value?.el$?.querySelector(
|
|
53
53
|
`[data-key="${t.at(-1).key}"]`
|
|
@@ -59,32 +59,32 @@ const Z = (e, { attrs: s, emit: f }, {
|
|
|
59
59
|
label: "label",
|
|
60
60
|
children: "children",
|
|
61
61
|
...e.props
|
|
62
|
-
})),
|
|
63
|
-
|
|
62
|
+
})), p = () => {
|
|
63
|
+
h(() => {
|
|
64
64
|
const t = l.value;
|
|
65
65
|
if (!t?.states) return;
|
|
66
|
-
const o = e.data || [], i = m.value.value,
|
|
66
|
+
const o = e.data || [], i = m.value.value, v = m.value.label, u = m.value.children, S = D(o, i, v, u), a = e.modelValue;
|
|
67
67
|
if (a == null || Array.isArray(a) && a.length === 0) {
|
|
68
68
|
t.states.selectedLabel = "";
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
const E =
|
|
73
|
-
return E ? d(E,
|
|
71
|
+
const M = (Array.isArray(a) ? a : [a]).map((N) => {
|
|
72
|
+
const E = S.find((V) => d(V, i) === N);
|
|
73
|
+
return E ? d(E, v) : "";
|
|
74
74
|
});
|
|
75
|
-
t.states.selectedLabel =
|
|
75
|
+
t.states.selectedLabel = M.filter(Boolean).join(", ");
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
|
-
return A(() => {
|
|
79
|
-
|
|
78
|
+
return l.syncSelectedLabel = p, A(() => {
|
|
79
|
+
p(), T(
|
|
80
80
|
() => l.value?.selectRef,
|
|
81
81
|
"keydown",
|
|
82
82
|
async (t) => {
|
|
83
83
|
const o = j(t), i = l.value?.expanded;
|
|
84
|
-
[
|
|
85
|
-
if (
|
|
84
|
+
[y.down, y.up].includes(o) && i && (await h(), setTimeout(() => {
|
|
85
|
+
if (y.up === o) {
|
|
86
86
|
const u = r.value?.store?.root?.childNodes;
|
|
87
|
-
u &&
|
|
87
|
+
u && x(u);
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
(l.value?.states?.hoveringIndex ?? -1) >= 0 && l.value?.filteredOptions && r.value?.el$?.querySelector("[data-key]")?.focus({ preventScroll: !0 });
|
|
@@ -94,12 +94,12 @@ const Z = (e, { attrs: s, emit: f }, {
|
|
|
94
94
|
capture: !0
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
|
-
}),
|
|
97
|
+
}), b(
|
|
98
98
|
() => [e.data, e.modelValue],
|
|
99
|
-
|
|
99
|
+
p,
|
|
100
100
|
{ immediate: !0, deep: !0 }
|
|
101
101
|
), {
|
|
102
|
-
...k(
|
|
102
|
+
...k(L(e), Object.keys(C)),
|
|
103
103
|
...s,
|
|
104
104
|
class: c(() => s.class),
|
|
105
105
|
style: c(() => s.style),
|
|
@@ -109,7 +109,7 @@ const Z = (e, { attrs: s, emit: f }, {
|
|
|
109
109
|
"onUpdate:modelValue": (t) => f(O, t),
|
|
110
110
|
valueKey: n,
|
|
111
111
|
popperClass: c(() => {
|
|
112
|
-
const t = [
|
|
112
|
+
const t = [g.e("popper")];
|
|
113
113
|
return e.popperClass && t.push(e.popperClass), t.join(" ");
|
|
114
114
|
}),
|
|
115
115
|
popperStyle: c(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as n, inject as r, computed as i, h as o } from "vue";
|
|
2
|
+
const c = n({
|
|
3
3
|
name: "TreeSelectOption",
|
|
4
4
|
props: {
|
|
5
5
|
value: {
|
|
@@ -19,17 +19,28 @@ const u = l({
|
|
|
19
19
|
default: !0
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
setup(e, { slots:
|
|
23
|
-
|
|
22
|
+
setup(e, { slots: a }) {
|
|
23
|
+
const l = r("treeSelectModelValue", null), u = i(() => {
|
|
24
|
+
if (!l || l.value === void 0 || l.value === null)
|
|
25
|
+
return !1;
|
|
26
|
+
const t = l.value;
|
|
27
|
+
return Array.isArray(t) ? t.includes(e.value) : t === e.value;
|
|
28
|
+
});
|
|
29
|
+
return () => e.visible ? o(
|
|
24
30
|
"span",
|
|
25
31
|
{
|
|
26
|
-
class:
|
|
32
|
+
class: [
|
|
33
|
+
"vft-tree-select-option",
|
|
34
|
+
{
|
|
35
|
+
"is-selected": u.value
|
|
36
|
+
}
|
|
37
|
+
],
|
|
27
38
|
"data-value": e.value
|
|
28
39
|
},
|
|
29
|
-
|
|
40
|
+
a.default ? a.default() : e.label
|
|
30
41
|
) : null;
|
|
31
42
|
}
|
|
32
43
|
});
|
|
33
44
|
export {
|
|
34
|
-
|
|
45
|
+
c as default
|
|
35
46
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as h, ref as s, computed as m, reactive as
|
|
1
|
+
import { defineComponent as h, ref as s, computed as m, provide as g, toRef as C, reactive as n, onMounted as k, h as a } from "vue";
|
|
2
2
|
import { pick as u } from "lodash-es";
|
|
3
|
-
import { VftSelect as
|
|
4
|
-
import { selectV2Props as
|
|
5
|
-
import { VftTree as
|
|
6
|
-
import { useSelect as
|
|
7
|
-
import { useTree as
|
|
8
|
-
const
|
|
3
|
+
import { VftSelect as b } from "../select/index.js";
|
|
4
|
+
import { selectV2Props as v } from "../select/defaults.js";
|
|
5
|
+
import { VftTree as B } from "../tree/index.js";
|
|
6
|
+
import { useSelect as N } from "./select.js";
|
|
7
|
+
import { useTree as K } from "./tree.js";
|
|
8
|
+
const S = {
|
|
9
9
|
data: Array,
|
|
10
10
|
emptyText: String,
|
|
11
11
|
renderAfterExpand: {
|
|
@@ -51,13 +51,13 @@ const v = {
|
|
|
51
51
|
default: 18
|
|
52
52
|
},
|
|
53
53
|
icon: [String, Object]
|
|
54
|
-
},
|
|
54
|
+
}, E = h({
|
|
55
55
|
name: "VftTreeSelect",
|
|
56
56
|
// disable `VftSelect` inherit current attrs
|
|
57
57
|
inheritAttrs: !1,
|
|
58
58
|
props: {
|
|
59
|
-
...k,
|
|
60
59
|
...v,
|
|
60
|
+
...S,
|
|
61
61
|
/**
|
|
62
62
|
* @description The cached data of the lazy node, the structure is the same as the data, used to get the label of the unloaded data
|
|
63
63
|
*/
|
|
@@ -81,16 +81,18 @@ const v = {
|
|
|
81
81
|
default: 274
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
|
-
setup(
|
|
85
|
-
const { expose: i } = r, e = s(),
|
|
84
|
+
setup(t, r) {
|
|
85
|
+
const { expose: i } = r, e = s(), o = s(), d = m(() => t.nodeKey || t.valueKey || "value");
|
|
86
|
+
g("treeSelectModelValue", C(t, "modelValue"));
|
|
87
|
+
const f = N(t, r, { select: e, tree: o, key: d }), p = K(t, r, {
|
|
86
88
|
select: e,
|
|
87
|
-
tree:
|
|
89
|
+
tree: o,
|
|
88
90
|
key: d
|
|
89
|
-
}), { cacheOptions:
|
|
90
|
-
return i(c),
|
|
91
|
+
}), { cacheOptions: A, ...y } = p, c = n({});
|
|
92
|
+
return i(c), k(() => {
|
|
91
93
|
Object.assign(c, {
|
|
92
94
|
//TODO: let only tree and select in 3.0
|
|
93
|
-
...u(
|
|
95
|
+
...u(o.value, [
|
|
94
96
|
"filter",
|
|
95
97
|
"updateKeyChildren",
|
|
96
98
|
"getCheckedNodes",
|
|
@@ -112,11 +114,11 @@ const v = {
|
|
|
112
114
|
]),
|
|
113
115
|
...u(e.value, ["focus", "blur"]),
|
|
114
116
|
selectedLabel: e.value?.selectedLabel ?? "",
|
|
115
|
-
treeRef:
|
|
117
|
+
treeRef: o.value,
|
|
116
118
|
selectRef: e.value
|
|
117
119
|
});
|
|
118
|
-
}), () =>
|
|
119
|
-
|
|
120
|
+
}), () => a(
|
|
121
|
+
b,
|
|
120
122
|
/**
|
|
121
123
|
* 1. The `props` is processed into `Refs`, but `v-bind` and
|
|
122
124
|
* render function props cannot read `Refs`, so use `reactive`
|
|
@@ -126,24 +128,24 @@ const v = {
|
|
|
126
128
|
* 3. VftSelect requires `options` prop, but we use custom slots
|
|
127
129
|
* so we pass an empty array.
|
|
128
130
|
*/
|
|
129
|
-
|
|
131
|
+
n({
|
|
130
132
|
...f,
|
|
131
133
|
// Pass a dummy option to prevent "No data" from showing
|
|
132
134
|
// Since we use custom slots (Tree in footer), this won't be rendered
|
|
133
|
-
ref: (
|
|
135
|
+
ref: (l) => e.value = l
|
|
134
136
|
}),
|
|
135
137
|
{
|
|
136
138
|
default: () => null,
|
|
137
139
|
// Custom rendering in footer
|
|
138
|
-
empty: () =>
|
|
140
|
+
empty: () => a("div", {
|
|
139
141
|
style: { display: "none" }
|
|
140
142
|
}),
|
|
141
143
|
// Hide "No data" container completely
|
|
142
|
-
footer: () =>
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
footer: () => a(
|
|
145
|
+
B,
|
|
146
|
+
n({
|
|
145
147
|
...y,
|
|
146
|
-
ref: (
|
|
148
|
+
ref: (l) => o.value = l
|
|
147
149
|
})
|
|
148
150
|
)
|
|
149
151
|
}
|
|
@@ -151,5 +153,5 @@ const v = {
|
|
|
151
153
|
}
|
|
152
154
|
});
|
|
153
155
|
export {
|
|
154
|
-
|
|
156
|
+
E as default
|
|
155
157
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { watch as
|
|
1
|
+
import { watch as D, nextTick as x, computed as C, toRefs as A } from "vue";
|
|
2
2
|
import { isEqual as P, pick as T, isNil as z } from "lodash-es";
|
|
3
3
|
import { UPDATE_MODEL_EVENT as v } from "../../constants/event.js";
|
|
4
4
|
import "@vueuse/core";
|
|
@@ -8,13 +8,13 @@ import { escapeStringRegexp as H } from "../../utils/vue/data-helper.js";
|
|
|
8
8
|
import "../form/index.js";
|
|
9
9
|
import "../tree/index.js";
|
|
10
10
|
import I from "./tree-select-option.js";
|
|
11
|
-
import { toValidArray as r, treeFind as K, isValidValue as
|
|
11
|
+
import { toValidArray as r, treeFind as K, isValidValue as S, treeEach as b, isValidArray as _ } from "./utils.js";
|
|
12
12
|
const $ = (e, { attrs: f, slots: N, emit: k }, {
|
|
13
|
-
select:
|
|
13
|
+
select: u,
|
|
14
14
|
tree: t,
|
|
15
15
|
key: m
|
|
16
16
|
}) => {
|
|
17
|
-
|
|
17
|
+
D(
|
|
18
18
|
[() => e.modelValue, t],
|
|
19
19
|
() => {
|
|
20
20
|
e.showCheckbox && x(() => {
|
|
@@ -30,7 +30,7 @@ const $ = (e, { attrs: f, slots: N, emit: k }, {
|
|
|
30
30
|
deep: !0
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
const
|
|
33
|
+
const M = C(() => ({
|
|
34
34
|
value: m.value,
|
|
35
35
|
label: "label",
|
|
36
36
|
children: "children",
|
|
@@ -38,7 +38,7 @@ const $ = (e, { attrs: f, slots: N, emit: k }, {
|
|
|
38
38
|
isLeaf: "isLeaf",
|
|
39
39
|
...e.props
|
|
40
40
|
})), d = (l, c) => {
|
|
41
|
-
const n =
|
|
41
|
+
const n = M.value[l];
|
|
42
42
|
return F(n) ? n(
|
|
43
43
|
c,
|
|
44
44
|
t.value?.getNode(d("value", c))
|
|
@@ -48,7 +48,7 @@ const $ = (e, { attrs: f, slots: N, emit: k }, {
|
|
|
48
48
|
(c) => d("value", c) === l,
|
|
49
49
|
(c) => d("children", c),
|
|
50
50
|
(c, n, i, o) => o && d("value", o)
|
|
51
|
-
)).filter((l) =>
|
|
51
|
+
)).filter((l) => S(l)), O = C(() => {
|
|
52
52
|
if (!e.renderAfterExpand && !e.lazy) return [];
|
|
53
53
|
const l = [];
|
|
54
54
|
return b(
|
|
@@ -66,7 +66,7 @@ const $ = (e, { attrs: f, slots: N, emit: k }, {
|
|
|
66
66
|
}), V = () => t.value?.getCheckedKeys().filter((l) => {
|
|
67
67
|
const c = t.value?.getNode(l);
|
|
68
68
|
return !z(c) && R(c.childNodes);
|
|
69
|
-
}),
|
|
69
|
+
}), w = [
|
|
70
70
|
"data",
|
|
71
71
|
"emptyText",
|
|
72
72
|
"renderAfterExpand",
|
|
@@ -95,7 +95,7 @@ const $ = (e, { attrs: f, slots: N, emit: k }, {
|
|
|
95
95
|
"icon"
|
|
96
96
|
];
|
|
97
97
|
return {
|
|
98
|
-
...T(A(e),
|
|
98
|
+
...T(A(e), w),
|
|
99
99
|
...f,
|
|
100
100
|
nodeKey: m,
|
|
101
101
|
// only expand on click node when the `check-strictly` is false
|
|
@@ -123,11 +123,12 @@ const $ = (e, { attrs: f, slots: N, emit: k }, {
|
|
|
123
123
|
label: d("label", l),
|
|
124
124
|
disabled: d("disabled", l)
|
|
125
125
|
};
|
|
126
|
-
if (
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
if (u.value?.allOptionsValueMap) {
|
|
127
|
+
const s = u.value.allOptionsValueMap.get(i);
|
|
128
|
+
s ? u.value?.onSelect(s.option) : u.value?.onSelect(o);
|
|
129
129
|
} else
|
|
130
|
-
|
|
130
|
+
u.value?.onSelect(o);
|
|
131
|
+
u.syncSelectedLabel && u.syncSelectedLabel();
|
|
131
132
|
}
|
|
132
133
|
} else e.expandOnClickNode && n.proxy.handleExpandIconClick();
|
|
133
134
|
},
|
|
@@ -139,9 +140,9 @@ const $ = (e, { attrs: f, slots: N, emit: k }, {
|
|
|
139
140
|
(a) => i[a.key] = a,
|
|
140
141
|
(a) => a.childNodes
|
|
141
142
|
);
|
|
142
|
-
const o = c.checkedKeys,
|
|
143
|
+
const o = c.checkedKeys, s = e.multiple ? r(e.modelValue).filter(
|
|
143
144
|
(a) => !(a in i) && !o.includes(a)
|
|
144
|
-
) : [], y =
|
|
145
|
+
) : [], y = s.concat(o);
|
|
145
146
|
if (e.checkStrictly)
|
|
146
147
|
k(
|
|
147
148
|
v,
|
|
@@ -150,20 +151,20 @@ const $ = (e, { attrs: f, slots: N, emit: k }, {
|
|
|
150
151
|
);
|
|
151
152
|
else if (e.multiple) {
|
|
152
153
|
const a = V();
|
|
153
|
-
k(v,
|
|
154
|
+
k(v, s.concat(a));
|
|
154
155
|
} else {
|
|
155
156
|
const a = K(
|
|
156
157
|
[l],
|
|
157
|
-
(
|
|
158
|
-
(
|
|
159
|
-
), E = a ? d("value", a) : void 0,
|
|
158
|
+
(h) => !_(d("children", h)) && !d("disabled", h),
|
|
159
|
+
(h) => d("children", h)
|
|
160
|
+
), E = a ? d("value", a) : void 0, L = S(e.modelValue) && !!K(
|
|
160
161
|
[l],
|
|
161
|
-
(
|
|
162
|
-
(
|
|
162
|
+
(h) => d("value", h) === e.modelValue,
|
|
163
|
+
(h) => d("children", h)
|
|
163
164
|
);
|
|
164
165
|
k(
|
|
165
166
|
v,
|
|
166
|
-
E === e.modelValue ||
|
|
167
|
+
E === e.modelValue || L ? void 0 : E
|
|
167
168
|
);
|
|
168
169
|
}
|
|
169
170
|
x(() => {
|
|
@@ -174,7 +175,7 @@ const $ = (e, { attrs: f, slots: N, emit: k }, {
|
|
|
174
175
|
halfCheckedKeys: t.value.getHalfCheckedKeys(),
|
|
175
176
|
halfCheckedNodes: t.value.getHalfCheckedNodes()
|
|
176
177
|
});
|
|
177
|
-
}),
|
|
178
|
+
}), u.value?.focus();
|
|
178
179
|
},
|
|
179
180
|
onNodeExpand: (l, c, n) => {
|
|
180
181
|
f.onNodeExpand?.(l, c, n), x(() => {
|
|
@@ -185,15 +186,15 @@ const $ = (e, { attrs: f, slots: N, emit: k }, {
|
|
|
185
186
|
(a) => i[a.key] = a,
|
|
186
187
|
(a) => a.childNodes
|
|
187
188
|
);
|
|
188
|
-
const
|
|
189
|
+
const s = r(e.modelValue).filter(
|
|
189
190
|
(a) => !(a in i) && !o.includes(a)
|
|
190
191
|
), y = V();
|
|
191
|
-
k(v,
|
|
192
|
+
k(v, s.concat(y));
|
|
192
193
|
}
|
|
193
194
|
});
|
|
194
195
|
},
|
|
195
196
|
// else
|
|
196
|
-
cacheOptions:
|
|
197
|
+
cacheOptions: O
|
|
197
198
|
};
|
|
198
199
|
};
|
|
199
200
|
export {
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
|
@@ -62,9 +62,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
62
62
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
63
63
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
64
64
|
readonly effect?: "light" | "dark" | undefined;
|
|
65
|
+
readonly visible?: boolean | null | undefined;
|
|
65
66
|
readonly teleported?: boolean | undefined;
|
|
66
67
|
readonly open?: boolean | undefined;
|
|
67
|
-
readonly visible?: boolean | null | undefined;
|
|
68
68
|
readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
|
|
69
69
|
readonly arrowOffset?: number | undefined;
|
|
70
70
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -480,9 +480,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
480
480
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
481
481
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
482
482
|
readonly effect?: "light" | "dark" | undefined;
|
|
483
|
+
readonly visible?: boolean | null | undefined;
|
|
483
484
|
readonly teleported?: boolean | undefined;
|
|
484
485
|
readonly open?: boolean | undefined;
|
|
485
|
-
readonly visible?: boolean | null | undefined;
|
|
486
486
|
readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
|
|
487
487
|
readonly arrowOffset?: number | undefined;
|
|
488
488
|
readonly gpuAcceleration?: boolean | undefined;
|