vft 0.0.511 → 0.0.513
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/cascader/cascader.vue2.js +202 -203
- package/es/components/cascader-panel/menu.vue2.js +49 -50
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +18 -19
- package/es/components/color-picker/color-picker.vue2.js +133 -134
- package/es/components/config-provider/config-provider.vue.d.ts +0 -2
- package/es/components/config-provider/config-provider.vue2.js +4 -5
- package/es/components/config-provider/constants.d.ts +0 -1
- package/es/components/config-provider/constants.js +2 -3
- package/es/components/config-provider/hooks/use-global-config.js +30 -33
- package/es/components/config-provider/index.d.ts +0 -9
- package/es/components/config-provider/index.js +5 -6
- package/es/components/date-picker/composables/use-basic-date-table.js +82 -83
- package/es/components/date-picker/composables/use-month-range-header.js +14 -15
- package/es/components/date-picker/composables/use-panel-date-range.js +23 -24
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +183 -184
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +224 -225
- package/es/components/date-time-select/date-time-select.vue2.js +36 -39
- package/es/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue2.js +67 -68
- package/es/components/dropdown/index.d.ts +33 -33
- package/es/components/empty/empty.vue2.js +38 -39
- package/es/components/full-screen/full-screen.vue2.js +17 -18
- package/es/components/image/image.vue2.js +59 -60
- package/es/components/image-viewer/image-viewer.vue2.js +44 -45
- package/es/components/index.js +97 -98
- package/es/components/md-container/md-container.vue2.js +74 -75
- package/es/components/md-container/toc.js +36 -37
- package/es/components/message-box/message-box.vue2.js +3 -3
- package/es/components/message-box/method.js +47 -48
- package/es/components/modal/modal-footer-action.vue2.js +24 -25
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -16
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +53 -54
- package/es/components/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/popconfirm/popconfirm.vue2.js +39 -40
- package/es/components/search/search.vue2.js +50 -51
- 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/select/useSelect.js +231 -232
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +65 -66
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +133 -134
- package/es/components/transfer/transfer-panel.vue2.js +56 -57
- package/es/components/transfer/transfer.vue2.js +69 -70
- package/es/components/tree/tree.vue2.js +59 -60
- package/es/components/upload/upload-content.vue2.js +49 -50
- package/es/components/upload/upload-list.vue2.js +45 -46
- package/es/components/upload/upload.vue2.js +99 -100
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -5
- 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/cascader/cascader.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue.d.ts +0 -2
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/config-provider/constants.cjs +1 -1
- package/lib/components/config-provider/constants.d.ts +0 -1
- package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
- package/lib/components/config-provider/index.cjs +1 -1
- package/lib/components/config-provider/index.d.ts +0 -9
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
- package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
- package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/dropdown/index.d.ts +33 -33
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/toc.cjs +1 -1
- package/lib/components/message-box/message-box.vue2.cjs +1 -1
- package/lib/components/message-box/method.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +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.cjs +1 -1
- package/lib/components/select/useSelect.d.ts +4 -4
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
- package/lib/components/transfer/transfer.vue2.cjs +1 -1
- package/lib/components/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +2 -2
- package/theme-style/index.css +1 -1
- package/theme-style/src/message-box.scss +2 -2
- package/theme-style/src/table.scss +2 -0
- package/theme-style/vft-message-box.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
- package/es/locale/index.d.js +0 -1
- package/es/locale/index.d.ts +0 -26
- package/es/locale/index.js +0 -10
- package/es/locale/lang/en.d.ts +0 -183
- package/es/locale/lang/en.js +0 -241
- package/es/locale/lang/zh-cn.d.ts +0 -183
- package/es/locale/lang/zh-cn.js +0 -241
- package/es/locale/lang/zh-tw.d.ts +0 -183
- package/es/locale/lang/zh-tw.js +0 -241
- package/es/locale/use-locale.d.ts +0 -17
- package/es/locale/use-locale.js +0 -56
- package/lib/locale/index.cjs +0 -1
- package/lib/locale/index.d.cjs +0 -1
- package/lib/locale/index.d.ts +0 -26
- package/lib/locale/lang/en.cjs +0 -1
- package/lib/locale/lang/en.d.ts +0 -183
- package/lib/locale/lang/zh-cn.cjs +0 -1
- package/lib/locale/lang/zh-cn.d.ts +0 -183
- package/lib/locale/lang/zh-tw.cjs +0 -1
- package/lib/locale/lang/zh-tw.d.ts +0 -183
- package/lib/locale/use-locale.cjs +0 -1
- package/lib/locale/use-locale.d.ts +0 -17
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as A, useSlots as
|
|
1
|
+
import { defineComponent as A, useSlots as M, reactive as O, computed as N, toRefs as j, openBlock as r, createElementBlock as v, normalizeClass as o, unref as e, createElementVNode as d, createVNode as h, isRef as b, withCtx as k, createTextVNode as S, toDisplayString as V, createBlock as P, createCommentVNode as w, withDirectives as B, Fragment as H, renderList as J, vShow as E, renderSlot as U } from "vue";
|
|
2
2
|
import { isEmpty as n } from "@vft/utils";
|
|
3
3
|
import "@vueuse/core";
|
|
4
4
|
import "../config-provider/hooks/use-global-config.js";
|
|
@@ -8,87 +8,86 @@ import { useNamespace as K } from "../../hooks/use-namespace/index.js";
|
|
|
8
8
|
import "../../hooks/use-model-toggle/index.js";
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import "../../hooks/use-z-index/index.js";
|
|
11
|
-
import Q from "
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { useCheck as _ } from "./composables/use-check.js";
|
|
11
|
+
import { VftCheckbox as q, VftCheckboxGroup as Q } from "../checkbox/index.js";
|
|
12
|
+
import { VftInput as W } from "../input/index.js";
|
|
13
|
+
import { transferPanelEmits as X, transferPanelProps as Y } from "./transfer-panel.js";
|
|
14
|
+
import { useCheck as Z } from "./composables/use-check.js";
|
|
16
15
|
import "./transfer.js";
|
|
17
|
-
import { usePropsAlias as
|
|
18
|
-
const
|
|
16
|
+
import { usePropsAlias as x } from "./composables/use-props-alias.js";
|
|
17
|
+
const _ = A({
|
|
19
18
|
name: "VftTransferPanel"
|
|
20
|
-
}),
|
|
21
|
-
...
|
|
22
|
-
props:
|
|
23
|
-
emits:
|
|
24
|
-
setup(
|
|
25
|
-
const y =
|
|
19
|
+
}), he = /* @__PURE__ */ A({
|
|
20
|
+
..._,
|
|
21
|
+
props: Y,
|
|
22
|
+
emits: X,
|
|
23
|
+
setup(D, { expose: R, emit: z }) {
|
|
24
|
+
const y = D, F = z, I = M(), T = ({ option: l }) => l, a = K("transfer"), p = O({
|
|
26
25
|
checked: [],
|
|
27
26
|
allChecked: !1,
|
|
28
27
|
query: "",
|
|
29
28
|
checkChangeByUser: !0
|
|
30
|
-
}),
|
|
31
|
-
filteredData:
|
|
32
|
-
checkedSummary:
|
|
33
|
-
isIndeterminate:
|
|
34
|
-
handleAllCheckedChange:
|
|
35
|
-
} =
|
|
36
|
-
() => !n(p.query) && n(
|
|
37
|
-
),
|
|
38
|
-
return
|
|
29
|
+
}), u = x(y), {
|
|
30
|
+
filteredData: C,
|
|
31
|
+
checkedSummary: $,
|
|
32
|
+
isIndeterminate: G,
|
|
33
|
+
handleAllCheckedChange: L
|
|
34
|
+
} = Z(y, p, F), m = N(
|
|
35
|
+
() => !n(p.query) && n(C.value)
|
|
36
|
+
), g = N(() => !n(I.default()[0].children)), { checked: c, allChecked: f, query: i } = j(p);
|
|
37
|
+
return R({
|
|
39
38
|
/** @description filter keyword */
|
|
40
39
|
query: i
|
|
41
|
-
}), (
|
|
42
|
-
class: o(e(
|
|
40
|
+
}), (l, s) => (r(), v("div", {
|
|
41
|
+
class: o(e(a).b("panel"))
|
|
43
42
|
}, [
|
|
44
43
|
d("p", {
|
|
45
|
-
class: o(e(
|
|
44
|
+
class: o(e(a).be("panel", "header"))
|
|
46
45
|
}, [
|
|
47
46
|
h(e(q), {
|
|
48
|
-
modelValue: e(
|
|
49
|
-
"onUpdate:modelValue":
|
|
50
|
-
indeterminate: e(
|
|
47
|
+
modelValue: e(f),
|
|
48
|
+
"onUpdate:modelValue": s[0] || (s[0] = (t) => b(f) ? f.value = t : null),
|
|
49
|
+
indeterminate: e(G),
|
|
51
50
|
"validate-event": !1,
|
|
52
|
-
onChange: e(
|
|
51
|
+
onChange: e(L)
|
|
53
52
|
}, {
|
|
54
53
|
default: k(() => [
|
|
55
|
-
S(V(
|
|
56
|
-
d("span", null, V(e(
|
|
54
|
+
S(V(l.title) + " ", 1),
|
|
55
|
+
d("span", null, V(e($)), 1)
|
|
57
56
|
]),
|
|
58
57
|
_: 1
|
|
59
58
|
}, 8, ["modelValue", "indeterminate", "onChange"])
|
|
60
59
|
], 2),
|
|
61
60
|
d("div", {
|
|
62
|
-
class: o([e(
|
|
61
|
+
class: o([e(a).be("panel", "body"), e(a).is("with-footer", g.value)])
|
|
63
62
|
}, [
|
|
64
|
-
|
|
63
|
+
l.filterable ? (r(), P(e(W), {
|
|
65
64
|
key: 0,
|
|
66
65
|
modelValue: e(i),
|
|
67
|
-
"onUpdate:modelValue":
|
|
68
|
-
class: o(e(
|
|
66
|
+
"onUpdate:modelValue": s[1] || (s[1] = (t) => b(i) ? i.value = t : null),
|
|
67
|
+
class: o(e(a).be("panel", "filter")),
|
|
69
68
|
size: "default",
|
|
70
|
-
placeholder:
|
|
69
|
+
placeholder: l.placeholder,
|
|
71
70
|
"prefix-icon": "ico-ep:search",
|
|
72
71
|
clearable: "",
|
|
73
72
|
"validate-event": !1
|
|
74
73
|
}, null, 8, ["modelValue", "class", "placeholder"])) : w("", !0),
|
|
75
|
-
B(h(e(
|
|
76
|
-
modelValue: e(
|
|
77
|
-
"onUpdate:modelValue":
|
|
74
|
+
B(h(e(Q), {
|
|
75
|
+
modelValue: e(c),
|
|
76
|
+
"onUpdate:modelValue": s[2] || (s[2] = (t) => b(c) ? c.value = t : null),
|
|
78
77
|
"validate-event": !1,
|
|
79
|
-
class: o([e(
|
|
78
|
+
class: o([e(a).is("filterable", l.filterable), e(a).be("panel", "list")])
|
|
80
79
|
}, {
|
|
81
80
|
default: k(() => [
|
|
82
|
-
(
|
|
83
|
-
key:
|
|
84
|
-
class: o(e(
|
|
85
|
-
value:
|
|
86
|
-
disabled:
|
|
81
|
+
(r(!0), v(H, null, J(e(C), (t) => (r(), P(e(q), {
|
|
82
|
+
key: t[e(u).key],
|
|
83
|
+
class: o(e(a).be("panel", "item")),
|
|
84
|
+
value: t[e(u).key],
|
|
85
|
+
disabled: t[e(u).disabled],
|
|
87
86
|
"validate-event": !1
|
|
88
87
|
}, {
|
|
89
88
|
default: k(() => [
|
|
90
|
-
h(
|
|
91
|
-
option:
|
|
89
|
+
h(T, {
|
|
90
|
+
option: l.optionRender?.(t)
|
|
92
91
|
}, null, 8, ["option"])
|
|
93
92
|
]),
|
|
94
93
|
_: 2
|
|
@@ -96,27 +95,27 @@ const te = A({
|
|
|
96
95
|
]),
|
|
97
96
|
_: 1
|
|
98
97
|
}, 8, ["modelValue", "class"]), [
|
|
99
|
-
[
|
|
98
|
+
[E, !m.value && !e(n)(l.data)]
|
|
100
99
|
]),
|
|
101
100
|
B(d("div", {
|
|
102
|
-
class: o(e(
|
|
101
|
+
class: o(e(a).be("panel", "empty"))
|
|
103
102
|
}, [
|
|
104
|
-
U(
|
|
105
|
-
S(V(
|
|
103
|
+
U(l.$slots, "empty", {}, () => [
|
|
104
|
+
S(V(m.value ? "无匹配数据" : "无数据"), 1)
|
|
106
105
|
])
|
|
107
106
|
], 2), [
|
|
108
|
-
[
|
|
107
|
+
[E, m.value || e(n)(l.data)]
|
|
109
108
|
])
|
|
110
109
|
], 2),
|
|
111
|
-
|
|
110
|
+
g.value ? (r(), v("p", {
|
|
112
111
|
key: 0,
|
|
113
|
-
class: o(e(
|
|
112
|
+
class: o(e(a).be("panel", "footer"))
|
|
114
113
|
}, [
|
|
115
|
-
U(
|
|
114
|
+
U(l.$slots, "default")
|
|
116
115
|
], 2)) : w("", !0)
|
|
117
116
|
], 2));
|
|
118
117
|
}
|
|
119
118
|
});
|
|
120
119
|
export {
|
|
121
|
-
|
|
120
|
+
he as default
|
|
122
121
|
};
|
|
@@ -1,145 +1,144 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as N, useSlots as G, reactive as H, ref as v, computed as s, watch as J, h as y, Comment as K, openBlock as p, createElementBlock as h, normalizeClass as i, unref as t, createVNode as a, withCtx as l, renderSlot as d, createElementVNode as O, toDisplayString as T, createCommentVNode as P } from "vue";
|
|
2
2
|
import "@vueuse/core";
|
|
3
|
-
import { isEmpty as
|
|
4
|
-
import { debugWarn as
|
|
3
|
+
import { isEmpty as V, isUndefined as w } from "@vft/utils";
|
|
4
|
+
import { debugWarn as X } from "../../utils/error.js";
|
|
5
5
|
import "../config-provider/hooks/use-global-config.js";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "../form/index.js";
|
|
8
|
-
import { useNamespace as
|
|
8
|
+
import { useNamespace as Y } from "../../hooks/use-namespace/index.js";
|
|
9
9
|
import "../../hooks/use-model-toggle/index.js";
|
|
10
10
|
import "@popperjs/core";
|
|
11
11
|
import "../../hooks/use-z-index/index.js";
|
|
12
|
-
import x from "../../locale/use-locale.js";
|
|
13
12
|
import { VftButton as D } from "../button/index.js";
|
|
14
13
|
import { VftIcon as S } from "../icon/index.js";
|
|
15
|
-
import { transferEmits as
|
|
14
|
+
import { transferEmits as Z, transferProps as x } from "./transfer.js";
|
|
16
15
|
import "./transfer-panel.js";
|
|
17
|
-
import { usePropsAlias as
|
|
18
|
-
import { useCheckedChange as
|
|
19
|
-
import { useComputedData as
|
|
20
|
-
import { useMove as
|
|
21
|
-
import
|
|
22
|
-
import { useFormItem as
|
|
23
|
-
const
|
|
16
|
+
import { usePropsAlias as ee } from "./composables/use-props-alias.js";
|
|
17
|
+
import { useCheckedChange as te } from "./composables/use-checked-change.js";
|
|
18
|
+
import { useComputedData as oe } from "./composables/use-computed-data.js";
|
|
19
|
+
import { useMove as re } from "./composables/use-move.js";
|
|
20
|
+
import E from "./transfer-panel.vue2.js";
|
|
21
|
+
import { useFormItem as ae } from "../form/hooks/use-form-item.js";
|
|
22
|
+
const le = { key: 0 }, se = { key: 0 }, ne = N({
|
|
24
23
|
name: "VftTransfer"
|
|
25
|
-
}),
|
|
26
|
-
...
|
|
27
|
-
props:
|
|
28
|
-
emits:
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
24
|
+
}), Ne = /* @__PURE__ */ N({
|
|
25
|
+
...ne,
|
|
26
|
+
props: x,
|
|
27
|
+
emits: Z,
|
|
28
|
+
setup($, { expose: B, emit: _ }) {
|
|
29
|
+
const o = $, u = _, I = G(), r = Y("transfer"), { formItem: M } = ae(), n = H({
|
|
31
30
|
leftChecked: [],
|
|
32
31
|
rightChecked: []
|
|
33
|
-
}),
|
|
32
|
+
}), C = ee(o), { sourceData: q, targetData: A } = oe(o), { onSourceCheckedChange: F, onTargetCheckedChange: R } = te(
|
|
34
33
|
n,
|
|
35
|
-
|
|
36
|
-
), { addToLeft: z, addToRight:
|
|
34
|
+
u
|
|
35
|
+
), { addToLeft: z, addToRight: L } = re(o, n, u), f = v(), c = v(), Q = (e) => {
|
|
37
36
|
switch (e) {
|
|
38
37
|
case "left":
|
|
39
|
-
|
|
38
|
+
f.value.query = "";
|
|
40
39
|
break;
|
|
41
40
|
case "right":
|
|
42
|
-
|
|
41
|
+
c.value.query = "";
|
|
43
42
|
break;
|
|
44
43
|
}
|
|
45
|
-
},
|
|
46
|
-
() =>
|
|
44
|
+
}, k = s(() => o.buttonTexts.length === 2), U = s(() => o.titles[0] || "列表 1"), W = s(() => o.titles[1] || "列表 2"), g = s(
|
|
45
|
+
() => o.filterPlaceholder || "请输入搜索内容"
|
|
47
46
|
);
|
|
48
|
-
|
|
49
|
-
() =>
|
|
47
|
+
J(
|
|
48
|
+
() => o.modelValue,
|
|
50
49
|
() => {
|
|
51
|
-
|
|
50
|
+
o.validateEvent && M?.validate?.("change").catch((e) => X(e));
|
|
52
51
|
}
|
|
53
52
|
);
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
(
|
|
53
|
+
const b = s(() => (e) => {
|
|
54
|
+
if (o.renderContent) return o.renderContent(y, e);
|
|
55
|
+
const m = (I.default?.({ option: e }) || []).filter(
|
|
56
|
+
(j) => j.type !== K
|
|
58
57
|
);
|
|
59
|
-
return
|
|
58
|
+
return m.length ? m : y(
|
|
60
59
|
"span",
|
|
61
|
-
e[
|
|
60
|
+
e[C.value.label] || e[C.value.key]
|
|
62
61
|
);
|
|
63
62
|
});
|
|
64
|
-
return
|
|
63
|
+
return B({
|
|
65
64
|
/** @description clear the filter keyword of a certain panel */
|
|
66
|
-
clearQuery:
|
|
65
|
+
clearQuery: Q,
|
|
67
66
|
/** @description left panel ref */
|
|
68
|
-
leftPanel:
|
|
67
|
+
leftPanel: f,
|
|
69
68
|
/** @description right panel ref */
|
|
70
|
-
rightPanel:
|
|
71
|
-
}), (e,
|
|
72
|
-
class: i(t(
|
|
69
|
+
rightPanel: c
|
|
70
|
+
}), (e, m) => (p(), h("div", {
|
|
71
|
+
class: i(t(r).b())
|
|
73
72
|
}, [
|
|
74
|
-
a(
|
|
73
|
+
a(E, {
|
|
75
74
|
ref_key: "leftPanel",
|
|
76
|
-
ref:
|
|
77
|
-
data: t(
|
|
78
|
-
"option-render":
|
|
79
|
-
placeholder:
|
|
80
|
-
title:
|
|
75
|
+
ref: f,
|
|
76
|
+
data: t(q),
|
|
77
|
+
"option-render": b.value,
|
|
78
|
+
placeholder: g.value,
|
|
79
|
+
title: U.value,
|
|
81
80
|
filterable: e.filterable,
|
|
82
81
|
format: e.format,
|
|
83
82
|
"filter-method": e.filterMethod,
|
|
84
83
|
"default-checked": e.leftDefaultChecked,
|
|
85
|
-
props:
|
|
86
|
-
onCheckedChange: t(
|
|
84
|
+
props: o.props,
|
|
85
|
+
onCheckedChange: t(F)
|
|
87
86
|
}, {
|
|
88
87
|
empty: l(() => [
|
|
89
|
-
|
|
88
|
+
d(e.$slots, "left-empty")
|
|
90
89
|
]),
|
|
91
90
|
default: l(() => [
|
|
92
|
-
|
|
91
|
+
d(e.$slots, "left-footer")
|
|
93
92
|
]),
|
|
94
93
|
_: 3
|
|
95
94
|
}, 8, ["data", "option-render", "placeholder", "title", "filterable", "format", "filter-method", "default-checked", "props", "onCheckedChange"]),
|
|
96
|
-
|
|
97
|
-
class: i(t(
|
|
95
|
+
O("div", {
|
|
96
|
+
class: i(t(r).e("buttons"))
|
|
98
97
|
}, [
|
|
99
98
|
a(t(D), {
|
|
100
99
|
type: "primary",
|
|
101
|
-
class: i([t(
|
|
102
|
-
disabled: t(
|
|
100
|
+
class: i([t(r).e("button"), t(r).is("with-texts", k.value)]),
|
|
101
|
+
disabled: t(V)(n.rightChecked),
|
|
103
102
|
onClick: t(z)
|
|
104
103
|
}, {
|
|
105
104
|
default: l(() => [
|
|
106
105
|
a(t(S), { icon: "icon-arrow-left" }),
|
|
107
|
-
t(
|
|
106
|
+
t(w)(e.buttonTexts[0]) ? P("", !0) : (p(), h("span", le, T(e.buttonTexts[0]), 1))
|
|
108
107
|
]),
|
|
109
108
|
_: 1
|
|
110
109
|
}, 8, ["class", "disabled", "onClick"]),
|
|
111
110
|
a(t(D), {
|
|
112
111
|
type: "primary",
|
|
113
|
-
class: i([t(
|
|
114
|
-
disabled: t(
|
|
115
|
-
onClick: t(
|
|
112
|
+
class: i([t(r).e("button"), t(r).is("with-texts", k.value)]),
|
|
113
|
+
disabled: t(V)(n.leftChecked),
|
|
114
|
+
onClick: t(L)
|
|
116
115
|
}, {
|
|
117
116
|
default: l(() => [
|
|
118
|
-
t(
|
|
117
|
+
t(w)(e.buttonTexts[1]) ? P("", !0) : (p(), h("span", se, T(e.buttonTexts[1]), 1)),
|
|
119
118
|
a(t(S), { icon: "icon-arrow-right" })
|
|
120
119
|
]),
|
|
121
120
|
_: 1
|
|
122
121
|
}, 8, ["class", "disabled", "onClick"])
|
|
123
122
|
], 2),
|
|
124
|
-
a(
|
|
123
|
+
a(E, {
|
|
125
124
|
ref_key: "rightPanel",
|
|
126
|
-
ref:
|
|
127
|
-
data: t(
|
|
128
|
-
"option-render":
|
|
129
|
-
placeholder:
|
|
125
|
+
ref: c,
|
|
126
|
+
data: t(A),
|
|
127
|
+
"option-render": b.value,
|
|
128
|
+
placeholder: g.value,
|
|
130
129
|
filterable: e.filterable,
|
|
131
130
|
format: e.format,
|
|
132
131
|
"filter-method": e.filterMethod,
|
|
133
|
-
title:
|
|
132
|
+
title: W.value,
|
|
134
133
|
"default-checked": e.rightDefaultChecked,
|
|
135
|
-
props:
|
|
134
|
+
props: o.props,
|
|
136
135
|
onCheckedChange: t(R)
|
|
137
136
|
}, {
|
|
138
137
|
empty: l(() => [
|
|
139
|
-
|
|
138
|
+
d(e.$slots, "right-empty")
|
|
140
139
|
]),
|
|
141
140
|
default: l(() => [
|
|
142
|
-
|
|
141
|
+
d(e.$slots, "right-footer")
|
|
143
142
|
]),
|
|
144
143
|
_: 3
|
|
145
144
|
}, 8, ["data", "option-render", "placeholder", "filterable", "format", "filter-method", "title", "default-checked", "props", "onCheckedChange"])
|
|
@@ -147,5 +146,5 @@ const ne = { key: 0 }, ie = { key: 0 }, fe = $({
|
|
|
147
146
|
}
|
|
148
147
|
});
|
|
149
148
|
export {
|
|
150
|
-
|
|
149
|
+
Ne as default
|
|
151
150
|
};
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Y, getCurrentInstance as x, ref as s, computed as Z, watch as i, provide as w, openBlock as y, createElementBlock as m, normalizeClass as h, unref as n, Fragment as _, renderList as ee, createBlock as te, renderSlot as re, createElementVNode as E, toDisplayString as oe, createCommentVNode as ne, withDirectives as de, vShow as ae } from "vue";
|
|
2
2
|
import "../form/index.js";
|
|
3
3
|
import "../icon/index.js";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import "@vft/utils";
|
|
6
6
|
import "../config-provider/hooks/use-global-config.js";
|
|
7
7
|
import "lodash-es";
|
|
8
|
-
import { useNamespace as
|
|
8
|
+
import { useNamespace as le } from "../../hooks/use-namespace/index.js";
|
|
9
9
|
import "../../hooks/use-model-toggle/index.js";
|
|
10
10
|
import "@popperjs/core";
|
|
11
11
|
import "../../hooks/use-z-index/index.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
const Ie = /* @__PURE__ */ Z({
|
|
12
|
+
import ce from "./model/tree-store.js";
|
|
13
|
+
import { useDragNodeHandler as se } from "./model/useDragNode.js";
|
|
14
|
+
import { useKeydown as ie } from "./model/useKeydown.js";
|
|
15
|
+
import { useNodeExpandEventBroadcast as ue } from "./model/useNodeExpandEventBroadcast.js";
|
|
16
|
+
import { getNodeKey as pe, handleCurrentChange as B } from "./model/util.js";
|
|
17
|
+
import ye from "./tree-node.vue.js";
|
|
18
|
+
import { formItemContextKey as he } from "../form/constants.js";
|
|
19
|
+
const $e = /* @__PURE__ */ Y({
|
|
21
20
|
__name: "tree",
|
|
22
21
|
props: {
|
|
23
22
|
data: { default: [] },
|
|
@@ -53,8 +52,8 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
53
52
|
},
|
|
54
53
|
emits: ["check-change", "current-change", "node-click", "node-contextmenu", "node-collapse", "node-expand", "check", "node-drag-start", "node-drag-end", "node-drop", "node-drag-leave", "node-drag-enter", "node-drag-over"],
|
|
55
54
|
setup(l, { expose: T, emit: D }) {
|
|
56
|
-
const t = l, f = D, C = x(), a =
|
|
57
|
-
new
|
|
55
|
+
const t = l, f = D, C = x(), a = le("tree"), r = s(
|
|
56
|
+
new ce({
|
|
58
57
|
key: t.nodeKey,
|
|
59
58
|
data: t.data,
|
|
60
59
|
lazy: t.lazy,
|
|
@@ -71,15 +70,15 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
71
70
|
})
|
|
72
71
|
);
|
|
73
72
|
r.value.initialize();
|
|
74
|
-
const u = s(r.value.root),
|
|
73
|
+
const u = s(r.value.root), b = s(null), K = s(null), g = s(null), { broadcastExpanded: S } = ue(t), { dragState: p } = se({
|
|
75
74
|
props: t,
|
|
76
75
|
ctx: C,
|
|
77
|
-
el$:
|
|
76
|
+
el$: K,
|
|
78
77
|
dropIndicator$: g,
|
|
79
78
|
store: r
|
|
80
79
|
});
|
|
81
|
-
|
|
82
|
-
const
|
|
80
|
+
ie({ el$: K }, r);
|
|
81
|
+
const q = Z(() => {
|
|
83
82
|
const { childNodes: e } = u.value;
|
|
84
83
|
return !e || e.length === 0 || e.every(({ visible: o }) => !o);
|
|
85
84
|
});
|
|
@@ -110,11 +109,11 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
110
109
|
r.value.checkStrictly = e;
|
|
111
110
|
}
|
|
112
111
|
);
|
|
113
|
-
const
|
|
112
|
+
const A = (e) => {
|
|
114
113
|
if (!t.filterNodeMethod)
|
|
115
114
|
throw new Error("[Tree] filterNodeMethod is required when filter");
|
|
116
115
|
r.value.filter(e);
|
|
117
|
-
}, N = (e) =>
|
|
116
|
+
}, N = (e) => pe(t.nodeKey, e.data), $ = (e) => {
|
|
118
117
|
if (!t.nodeKey)
|
|
119
118
|
throw new Error("[Tree] nodeKey is required in getNodePath");
|
|
120
119
|
const o = r.value.getNode(e);
|
|
@@ -124,25 +123,25 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
124
123
|
for (; c && c !== u.value; )
|
|
125
124
|
d.push(c.data), c = c.parent;
|
|
126
125
|
return d.reverse();
|
|
127
|
-
},
|
|
126
|
+
}, z = (e, o) => r.value.getCheckedNodes(e, o), H = (e) => r.value.getCheckedKeys(e), k = () => {
|
|
128
127
|
const e = r.value.getCurrentNode();
|
|
129
128
|
return e ? e.data : null;
|
|
130
|
-
},
|
|
129
|
+
}, I = () => {
|
|
131
130
|
if (!t.nodeKey)
|
|
132
131
|
throw new Error("[Tree] nodeKey is required in getCurrentKey");
|
|
133
132
|
const e = k();
|
|
134
133
|
return e ? e[t.nodeKey] : null;
|
|
135
|
-
},
|
|
134
|
+
}, M = (e, o) => {
|
|
136
135
|
if (!t.nodeKey)
|
|
137
136
|
throw new Error("[Tree] nodeKey is required in setCheckedNodes");
|
|
138
137
|
r.value.setCheckedNodes(e, o);
|
|
139
|
-
},
|
|
138
|
+
}, P = (e, o) => {
|
|
140
139
|
if (!t.nodeKey)
|
|
141
140
|
throw new Error("[Tree] nodeKey is required in setCheckedKeys");
|
|
142
141
|
r.value.setCheckedKeys(e, o);
|
|
143
142
|
}, O = (e, o, d) => {
|
|
144
143
|
r.value.setChecked(e, o, d);
|
|
145
|
-
}, V = () => r.value.getHalfCheckedNodes(), F = () => r.value.getHalfCheckedKeys(),
|
|
144
|
+
}, V = () => r.value.getHalfCheckedNodes(), F = () => r.value.getHalfCheckedKeys(), L = (e, o = !0) => {
|
|
146
145
|
if (!t.nodeKey)
|
|
147
146
|
throw new Error("[Tree] nodeKey is required in setCurrentNode");
|
|
148
147
|
B(
|
|
@@ -150,7 +149,7 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
150
149
|
f,
|
|
151
150
|
() => r.value.setUserCurrentNode(e, o)
|
|
152
151
|
);
|
|
153
|
-
},
|
|
152
|
+
}, R = (e, o = !0) => {
|
|
154
153
|
if (!t.nodeKey)
|
|
155
154
|
throw new Error("[Tree] nodeKey is required in setCurrentKey");
|
|
156
155
|
B(
|
|
@@ -158,21 +157,21 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
158
157
|
f,
|
|
159
158
|
() => r.value.setCurrentNodeKey(e, o)
|
|
160
159
|
);
|
|
161
|
-
},
|
|
160
|
+
}, U = (e) => r.value.getNode(e), j = (e) => {
|
|
162
161
|
r.value.remove(e);
|
|
163
|
-
},
|
|
162
|
+
}, G = (e, o) => {
|
|
164
163
|
r.value.append(e, o);
|
|
165
|
-
},
|
|
164
|
+
}, J = (e, o) => {
|
|
166
165
|
r.value.insertBefore(e, o);
|
|
167
|
-
},
|
|
166
|
+
}, Q = (e, o) => {
|
|
168
167
|
r.value.insertAfter(e, o);
|
|
169
168
|
}, v = (e, o, d) => {
|
|
170
|
-
|
|
171
|
-
},
|
|
169
|
+
S(o), f("node-expand", e, o, d);
|
|
170
|
+
}, W = (e, o) => {
|
|
172
171
|
if (!t.nodeKey)
|
|
173
172
|
throw new Error("[Tree] nodeKey is required in updateKeyChild");
|
|
174
173
|
r.value.updateChildren(e, o);
|
|
175
|
-
},
|
|
174
|
+
}, X = (e, o) => {
|
|
176
175
|
if (!t.nodeKey)
|
|
177
176
|
throw new Error("[Tree] nodeKey is required in updateKeyChild");
|
|
178
177
|
r.value.updateNode(e, o);
|
|
@@ -182,34 +181,34 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
182
181
|
props: t,
|
|
183
182
|
store: r,
|
|
184
183
|
root: u,
|
|
185
|
-
currentNode:
|
|
184
|
+
currentNode: b,
|
|
186
185
|
instance: x()
|
|
187
|
-
}), w(
|
|
188
|
-
filter:
|
|
186
|
+
}), w(he, void 0), T({
|
|
187
|
+
filter: A,
|
|
189
188
|
getNodeKey: N,
|
|
190
|
-
getNodePath:
|
|
191
|
-
getCheckedNodes:
|
|
192
|
-
getCheckedKeys:
|
|
189
|
+
getNodePath: $,
|
|
190
|
+
getCheckedNodes: z,
|
|
191
|
+
getCheckedKeys: H,
|
|
193
192
|
getCurrentNode: k,
|
|
194
|
-
getCurrentKey:
|
|
195
|
-
setCheckedNodes:
|
|
196
|
-
setCheckedKeys:
|
|
193
|
+
getCurrentKey: I,
|
|
194
|
+
setCheckedNodes: M,
|
|
195
|
+
setCheckedKeys: P,
|
|
197
196
|
setChecked: O,
|
|
198
197
|
getHalfCheckedNodes: V,
|
|
199
198
|
getHalfCheckedKeys: F,
|
|
200
|
-
setCurrentNode:
|
|
201
|
-
setCurrentKey:
|
|
202
|
-
getNode:
|
|
203
|
-
remove:
|
|
204
|
-
append:
|
|
205
|
-
insertBefore:
|
|
206
|
-
insertAfter:
|
|
199
|
+
setCurrentNode: L,
|
|
200
|
+
setCurrentKey: R,
|
|
201
|
+
getNode: U,
|
|
202
|
+
remove: j,
|
|
203
|
+
append: G,
|
|
204
|
+
insertBefore: J,
|
|
205
|
+
insertAfter: Q,
|
|
207
206
|
handleNodeExpand: v,
|
|
208
|
-
updateKeyChildren:
|
|
209
|
-
updateNode:
|
|
210
|
-
}), (e, o) => (y(),
|
|
207
|
+
updateKeyChildren: W,
|
|
208
|
+
updateNode: X
|
|
209
|
+
}), (e, o) => (y(), m("div", {
|
|
211
210
|
ref_key: "el$",
|
|
212
|
-
ref:
|
|
211
|
+
ref: K,
|
|
213
212
|
class: h([
|
|
214
213
|
n(a).b(),
|
|
215
214
|
n(a).is("dragging", !!n(p).draggingNode),
|
|
@@ -219,7 +218,7 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
219
218
|
]),
|
|
220
219
|
role: "tree"
|
|
221
220
|
}, [
|
|
222
|
-
(y(!0),
|
|
221
|
+
(y(!0), m(_, null, ee(u.value.childNodes, (d) => (y(), te(ye, {
|
|
223
222
|
key: N(d),
|
|
224
223
|
node: d,
|
|
225
224
|
props: t,
|
|
@@ -229,26 +228,26 @@ const Ie = /* @__PURE__ */ Z({
|
|
|
229
228
|
"render-content": l.renderContent,
|
|
230
229
|
onNodeExpand: v
|
|
231
230
|
}, null, 8, ["node", "accordion", "render-after-expand", "show-checkbox", "render-content"]))), 128)),
|
|
232
|
-
|
|
231
|
+
q.value ? (y(), m("div", {
|
|
233
232
|
key: 0,
|
|
234
233
|
class: h(n(a).e("empty-block"))
|
|
235
234
|
}, [
|
|
236
|
-
|
|
235
|
+
re(e.$slots, "empty", {}, () => [
|
|
237
236
|
E("span", {
|
|
238
237
|
class: h(n(a).e("empty-text"))
|
|
239
|
-
},
|
|
238
|
+
}, oe(l.emptyText ?? "暂无数据"), 3)
|
|
240
239
|
])
|
|
241
|
-
], 2)) :
|
|
242
|
-
|
|
240
|
+
], 2)) : ne("", !0),
|
|
241
|
+
de(E("div", {
|
|
243
242
|
ref_key: "dropIndicator$",
|
|
244
243
|
ref: g,
|
|
245
244
|
class: h(n(a).e("drop-indicator"))
|
|
246
245
|
}, null, 2), [
|
|
247
|
-
[
|
|
246
|
+
[ae, n(p).showDropIndicator]
|
|
248
247
|
])
|
|
249
248
|
], 2));
|
|
250
249
|
}
|
|
251
250
|
});
|
|
252
251
|
export {
|
|
253
|
-
|
|
252
|
+
$e as default
|
|
254
253
|
};
|