vft 0.0.429 → 0.0.430
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/attributes.json +1 -1
- package/es/components/alert/alert.vue2.js +38 -38
- package/es/components/autocomplete/autocomplete.vue2.js +82 -82
- package/es/components/avatar/avatar.vue2.js +23 -23
- package/es/components/avatar-stack/avatar-stack.vue2.js +25 -25
- package/es/components/breadcrumb/breadcrumb-item.vue2.js +19 -19
- package/es/components/button/button.vue2.js +37 -37
- package/es/components/card/card.vue2.js +19 -19
- package/es/components/carousel/carousel.vue2.js +75 -75
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/cascader-panel/index.vue2.js +2 -2
- package/es/components/cascader-panel/menu.vue2.js +2 -2
- package/es/components/cascader-panel/node.vue2.js +3 -4
- package/es/components/checkbox/checkbox-button.vue2.js +52 -52
- package/es/components/checkbox/checkbox-group.vue2.js +26 -26
- package/es/components/checkbox/checkbox.vue2.js +57 -57
- package/es/components/clamp/clamp.vue2.js +14 -14
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +17 -17
- package/es/components/clamp-tooltip/clamp-tooltip.vue2.js +19 -19
- package/es/components/col/col.vue2.js +20 -20
- package/es/components/color-picker/color-picker.vue2.js +126 -128
- package/es/components/color-picker/components/sv-panel.vue.js +2 -2
- package/es/components/config-provider/hooks/use-global-config.js +3 -3
- package/es/components/context-menu/context-menu.vue2.js +18 -18
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +37 -39
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +8 -10
- package/es/components/date-picker/date-picker.d.ts +1 -1
- package/es/components/date-picker/index.d.ts +2 -2
- package/es/components/descriptions/description.vue2.js +44 -44
- package/es/components/descriptions/descriptions-row.vue2.js +12 -12
- package/es/components/dialog/dialog-content.vue2.js +31 -31
- package/es/components/dialog/dialog.vue2.js +46 -46
- package/es/components/divider/divider.vue2.js +19 -19
- package/es/components/drawer/drawer.vue2.js +41 -41
- package/es/components/dropdown/dropdown-item-impl.vue2.js +40 -40
- package/es/components/dropdown/dropdown-item.vue2.js +28 -28
- package/es/components/dropdown/dropdown.vue2.js +124 -124
- package/es/components/form/form-item.vue2.js +71 -71
- package/es/components/header-layout/header-layout.vue2.js +25 -25
- package/es/components/icon/icon.vue2.js +15 -15
- package/es/components/icon-text/icon-text.vue2.js +28 -28
- package/es/components/iframe-layout/iframe-layout.vue2.js +13 -13
- package/es/components/iframe-layout/iframe-page.vue2.js +11 -11
- package/es/components/image/image.vue2.js +63 -63
- package/es/components/image-viewer/image-viewer.vue2.js +88 -88
- package/es/components/infinite-scroll/index.d.ts +1 -1
- package/es/components/input/input.vue2.js +112 -112
- package/es/components/input-number/input-number.vue2.js +100 -100
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/link/link.vue2.js +20 -20
- package/es/components/list-cell/list-cell.vue2.js +19 -19
- package/es/components/logo/logo.vue2.js +22 -22
- package/es/components/menu/menu-item-group.vue2.js +8 -8
- package/es/components/menu/menu-item.vue2.js +48 -48
- package/es/components/message/message.vue2.js +66 -66
- package/es/components/modal/modal-footer-action.vue2.js +25 -25
- package/es/components/modal/modal.vue2.js +40 -40
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +30 -30
- package/es/components/page-wrapper/page-wrapper.vue2.js +12 -12
- package/es/components/pagination/components/jumper.vue2.js +18 -18
- package/es/components/pagination/components/next.vue2.js +11 -11
- package/es/components/pagination/components/pager.vue2.js +74 -74
- package/es/components/pagination/components/prev.vue2.js +9 -9
- package/es/components/pagination/components/sizes.vue2.js +18 -18
- package/es/components/pagination/components/total.vue2.js +8 -8
- package/es/components/popconfirm/popconfirm.vue2.js +47 -47
- package/es/components/popover/popover.vue2.js +28 -28
- package/es/components/popper/trigger.vue2.js +9 -9
- package/es/components/progress/progress.vue2.js +87 -87
- package/es/components/qrcode/qrcode.vue2.js +31 -31
- package/es/components/radio/radio-button.vue2.js +17 -17
- package/es/components/radio/radio-group.vue2.js +35 -35
- package/es/components/router-view-content/router-view-content.vue2.js +25 -25
- package/es/components/roving-focus-group/roving-focus-item.vue2.js +30 -30
- package/es/components/row/row.vue2.js +5 -5
- package/es/components/scrollbar/bar.vue2.js +16 -16
- package/es/components/scrollbar/scrollbar.vue2.js +48 -48
- package/es/components/scrollbar/thumb.vue2.js +27 -27
- package/es/components/search/search.vue2.js +29 -29
- package/es/components/select/index.d.ts +1 -1
- package/es/components/select/select.vue.d.ts +1 -1
- package/es/components/side-menu/index.d.ts +2 -8
- package/es/components/side-menu/side-menu.vue.d.ts +5 -59
- package/es/components/side-menu/types.d.ts +107 -0
- package/es/components/skeleton/skeleton-item.vue2.js +9 -9
- package/es/components/skeleton/skeleton.vue2.js +14 -14
- package/es/components/slider/button.vue2.js +54 -54
- package/es/components/slider/slider.vue2.js +106 -106
- package/es/components/steps/item.vue2.js +56 -56
- package/es/components/steps/steps.vue2.js +16 -16
- package/es/components/super-form/super-form-action.vue2.js +28 -28
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/components/switch/switch.vue2.js +108 -108
- package/es/components/table/field.d.ts +4 -4
- package/es/components/teleport/teleport.vue2.js +6 -6
- package/es/components/time-picker/common/picker.vue.d.ts +1 -1
- package/es/components/time-picker/index.d.ts +2 -2
- package/es/components/time-picker/time-picker.d.ts +1 -1
- package/es/components/timeline/timeline-item.vue2.js +20 -20
- package/es/components/tooltip/content.vue2.js +57 -57
- package/es/components/tooltip/tooltip.vue2.js +66 -66
- package/es/components/tooltip/trigger.vue2.js +42 -42
- package/es/components/tree/tree.vue2.js +72 -72
- package/es/components/upload/upload-content.vue2.js +85 -85
- package/es/components/upload/upload-list.vue2.js +70 -70
- package/es/components/upload/upload.vue2.js +86 -86
- package/es/components/verify-code/verify-code.vue2.js +18 -18
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/alert/alert.vue2.cjs +1 -1
- package/lib/components/autocomplete/autocomplete.vue2.cjs +1 -1
- package/lib/components/avatar/avatar.vue2.cjs +1 -1
- package/lib/components/avatar-stack/avatar-stack.vue2.cjs +1 -1
- package/lib/components/breadcrumb/breadcrumb-item.vue2.cjs +1 -1
- package/lib/components/button/button.vue2.cjs +1 -1
- package/lib/components/card/card.vue2.cjs +1 -1
- package/lib/components/carousel/carousel.vue2.cjs +1 -1
- package/lib/components/cascader-panel/index.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +1 -1
- package/lib/components/cascader-panel/node.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-button.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-group.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox.vue2.cjs +1 -1
- package/lib/components/clamp/clamp.vue2.cjs +1 -1
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/clamp-tooltip/clamp-tooltip.vue2.cjs +1 -1
- package/lib/components/col/col.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/color-picker/components/sv-panel.vue.cjs +1 -1
- package/lib/components/context-menu/context-menu.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-picker/date-picker.d.ts +1 -1
- package/lib/components/date-picker/index.d.ts +2 -2
- package/lib/components/descriptions/description.vue2.cjs +1 -1
- package/lib/components/descriptions/descriptions-row.vue2.cjs +1 -1
- package/lib/components/dialog/dialog-content.vue2.cjs +1 -1
- package/lib/components/dialog/dialog.vue2.cjs +1 -1
- package/lib/components/divider/divider.vue2.cjs +1 -1
- package/lib/components/drawer/drawer.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/form/form-item.vue2.cjs +1 -1
- package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
- package/lib/components/icon/icon.vue2.cjs +1 -1
- package/lib/components/icon-text/icon-text.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-layout.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-page.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/infinite-scroll/index.d.ts +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/input-number/input-number.vue2.cjs +1 -1
- package/lib/components/link/link.vue2.cjs +1 -1
- package/lib/components/list-cell/list-cell.vue2.cjs +1 -1
- package/lib/components/logo/logo.vue2.cjs +1 -1
- package/lib/components/menu/menu-item-group.vue2.cjs +1 -1
- package/lib/components/menu/menu-item.vue2.cjs +1 -1
- package/lib/components/message/message.vue2.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/modal/modal.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/page-wrapper/page-wrapper.vue2.cjs +1 -1
- package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
- package/lib/components/pagination/components/next.vue2.cjs +1 -1
- package/lib/components/pagination/components/pager.vue2.cjs +1 -1
- package/lib/components/pagination/components/prev.vue2.cjs +1 -1
- package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
- package/lib/components/pagination/components/total.vue2.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/popover/popover.vue2.cjs +1 -1
- package/lib/components/popper/trigger.vue2.cjs +1 -1
- package/lib/components/progress/progress.vue2.cjs +5 -5
- package/lib/components/qrcode/qrcode.vue2.cjs +1 -1
- package/lib/components/radio/radio-button.vue2.cjs +1 -1
- package/lib/components/radio/radio-group.vue2.cjs +1 -1
- package/lib/components/router-view-content/router-view-content.vue2.cjs +1 -1
- package/lib/components/roving-focus-group/roving-focus-item.vue2.cjs +1 -1
- package/lib/components/row/row.vue2.cjs +1 -1
- package/lib/components/scrollbar/bar.vue2.cjs +1 -1
- package/lib/components/scrollbar/scrollbar.vue2.cjs +1 -1
- package/lib/components/scrollbar/thumb.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/index.d.ts +1 -1
- package/lib/components/select/select.vue.d.ts +1 -1
- package/lib/components/side-menu/index.d.ts +2 -8
- package/lib/components/side-menu/side-menu.vue.d.ts +5 -59
- package/lib/components/side-menu/types.d.ts +107 -0
- package/lib/components/skeleton/skeleton-item.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton.vue2.cjs +1 -1
- package/lib/components/slider/button.vue2.cjs +1 -1
- package/lib/components/slider/slider.vue2.cjs +1 -1
- package/lib/components/steps/item.vue2.cjs +1 -1
- package/lib/components/steps/steps.vue2.cjs +1 -1
- package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
- package/lib/components/switch/switch.vue2.cjs +1 -1
- package/lib/components/table/field.d.ts +4 -4
- package/lib/components/teleport/teleport.vue2.cjs +1 -1
- package/lib/components/time-picker/common/picker.vue.d.ts +1 -1
- package/lib/components/time-picker/index.d.ts +2 -2
- package/lib/components/time-picker/time-picker.d.ts +1 -1
- package/lib/components/timeline/timeline-item.vue2.cjs +1 -1
- package/lib/components/tooltip/content.vue2.cjs +1 -1
- package/lib/components/tooltip/tooltip.vue2.cjs +1 -1
- package/lib/components/tooltip/trigger.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/components/verify-code/verify-code.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/tags.json +1 -1
- package/theme-style/src/mixins/mixins.scss +1 -0
- package/web-types.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Y, getCurrentInstance as x, ref as s, computed as Z, watch as i, provide as w, createElementBlock as m, openBlock as y, normalizeClass as h, unref as n, createCommentVNode as _, withDirectives as ee, Fragment as te, renderList as re, createBlock as oe, renderSlot as ne, createElementVNode as E, toDisplayString as de, vShow as ae } from "vue";
|
|
2
2
|
import "../form/index.js";
|
|
3
3
|
import "../icon/index.js";
|
|
4
4
|
import "@vueuse/core";
|
|
@@ -9,14 +9,14 @@ 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 { useDragNodeHandler as
|
|
12
|
+
import ce from "./model/tree-store.js";
|
|
13
|
+
import { useDragNodeHandler as se } from "./model/useDragNode.js";
|
|
14
14
|
import { useKeydown as ie } from "./model/useKeydown.js";
|
|
15
15
|
import { useNodeExpandEventBroadcast as ue } from "./model/useNodeExpandEventBroadcast.js";
|
|
16
|
-
import { getNodeKey as pe, handleCurrentChange as
|
|
16
|
+
import { getNodeKey as pe, handleCurrentChange as B } from "./model/util.js";
|
|
17
17
|
import ye from "./tree-node.vue.js";
|
|
18
18
|
import { formItemContextKey as he } from "../form/constants.js";
|
|
19
|
-
const $e = /* @__PURE__ */
|
|
19
|
+
const $e = /* @__PURE__ */ Y({
|
|
20
20
|
__name: "tree",
|
|
21
21
|
props: {
|
|
22
22
|
data: { default: [] },
|
|
@@ -51,9 +51,9 @@ const $e = /* @__PURE__ */ X({
|
|
|
51
51
|
icon: {}
|
|
52
52
|
},
|
|
53
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"],
|
|
54
|
-
setup(
|
|
55
|
-
const t =
|
|
56
|
-
new
|
|
54
|
+
setup(l, { expose: T, emit: D }) {
|
|
55
|
+
const t = l, f = D, C = x(), a = le("tree"), r = s(
|
|
56
|
+
new ce({
|
|
57
57
|
key: t.nodeKey,
|
|
58
58
|
data: t.data,
|
|
59
59
|
lazy: t.lazy,
|
|
@@ -70,40 +70,40 @@ const $e = /* @__PURE__ */ X({
|
|
|
70
70
|
})
|
|
71
71
|
);
|
|
72
72
|
r.value.initialize();
|
|
73
|
-
const
|
|
73
|
+
const u = s(r.value.root), b = s(null), K = s(null), g = s(null), { broadcastExpanded: S } = ue(t), { dragState: p } = se({
|
|
74
74
|
props: t,
|
|
75
|
-
ctx:
|
|
76
|
-
el$:
|
|
77
|
-
dropIndicator$:
|
|
75
|
+
ctx: C,
|
|
76
|
+
el$: K,
|
|
77
|
+
dropIndicator$: g,
|
|
78
78
|
store: r
|
|
79
79
|
});
|
|
80
|
-
ie({ el$:
|
|
81
|
-
const q =
|
|
82
|
-
const { childNodes: e } =
|
|
80
|
+
ie({ el$: K }, r);
|
|
81
|
+
const q = Z(() => {
|
|
82
|
+
const { childNodes: e } = u.value;
|
|
83
83
|
return !e || e.length === 0 || e.every(({ visible: o }) => !o);
|
|
84
84
|
});
|
|
85
|
-
|
|
85
|
+
i(
|
|
86
86
|
() => t.currentNodeKey,
|
|
87
87
|
(e) => {
|
|
88
88
|
r.value.setCurrentNodeKey(e);
|
|
89
89
|
}
|
|
90
|
-
),
|
|
90
|
+
), i(
|
|
91
91
|
() => t.defaultCheckedKeys,
|
|
92
92
|
(e) => {
|
|
93
93
|
r.value.setDefaultCheckedKey(e);
|
|
94
94
|
}
|
|
95
|
-
),
|
|
95
|
+
), i(
|
|
96
96
|
() => t.defaultExpandedKeys,
|
|
97
97
|
(e) => {
|
|
98
98
|
r.value.setDefaultExpandedKeys(e);
|
|
99
99
|
}
|
|
100
|
-
),
|
|
100
|
+
), i(
|
|
101
101
|
() => t.data,
|
|
102
102
|
(e) => {
|
|
103
103
|
r.value.setData(e);
|
|
104
104
|
},
|
|
105
105
|
{ deep: !0 }
|
|
106
|
-
),
|
|
106
|
+
), i(
|
|
107
107
|
() => t.checkStrictly,
|
|
108
108
|
(e) => {
|
|
109
109
|
r.value.checkStrictly = e;
|
|
@@ -113,23 +113,23 @@ const $e = /* @__PURE__ */ X({
|
|
|
113
113
|
if (!t.filterNodeMethod)
|
|
114
114
|
throw new Error("[Tree] filterNodeMethod is required when filter");
|
|
115
115
|
r.value.filter(e);
|
|
116
|
-
},
|
|
116
|
+
}, N = (e) => pe(t.nodeKey, e.data), $ = (e) => {
|
|
117
117
|
if (!t.nodeKey)
|
|
118
118
|
throw new Error("[Tree] nodeKey is required in getNodePath");
|
|
119
119
|
const o = r.value.getNode(e);
|
|
120
120
|
if (!o) return [];
|
|
121
121
|
const d = [o.data];
|
|
122
|
-
let
|
|
123
|
-
for (;
|
|
124
|
-
d.push(
|
|
122
|
+
let c = o.parent;
|
|
123
|
+
for (; c && c !== u.value; )
|
|
124
|
+
d.push(c.data), c = c.parent;
|
|
125
125
|
return d.reverse();
|
|
126
|
-
}, z = (e, o) => r.value.getCheckedNodes(e, o), H = (e) => r.value.getCheckedKeys(e),
|
|
126
|
+
}, z = (e, o) => r.value.getCheckedNodes(e, o), H = (e) => r.value.getCheckedKeys(e), k = () => {
|
|
127
127
|
const e = r.value.getCurrentNode();
|
|
128
128
|
return e ? e.data : null;
|
|
129
129
|
}, I = () => {
|
|
130
130
|
if (!t.nodeKey)
|
|
131
131
|
throw new Error("[Tree] nodeKey is required in getCurrentKey");
|
|
132
|
-
const e =
|
|
132
|
+
const e = k();
|
|
133
133
|
return e ? e[t.nodeKey] : null;
|
|
134
134
|
}, M = (e, o) => {
|
|
135
135
|
if (!t.nodeKey)
|
|
@@ -144,52 +144,52 @@ const $e = /* @__PURE__ */ X({
|
|
|
144
144
|
}, V = () => r.value.getHalfCheckedNodes(), F = () => r.value.getHalfCheckedKeys(), L = (e, o = !0) => {
|
|
145
145
|
if (!t.nodeKey)
|
|
146
146
|
throw new Error("[Tree] nodeKey is required in setCurrentNode");
|
|
147
|
-
|
|
147
|
+
B(
|
|
148
148
|
r,
|
|
149
|
-
|
|
149
|
+
f,
|
|
150
150
|
() => r.value.setUserCurrentNode(e, o)
|
|
151
151
|
);
|
|
152
152
|
}, R = (e, o = !0) => {
|
|
153
153
|
if (!t.nodeKey)
|
|
154
154
|
throw new Error("[Tree] nodeKey is required in setCurrentKey");
|
|
155
|
-
|
|
155
|
+
B(
|
|
156
156
|
r,
|
|
157
|
-
|
|
157
|
+
f,
|
|
158
158
|
() => r.value.setCurrentNodeKey(e, o)
|
|
159
159
|
);
|
|
160
|
-
}, U = (e) => r.value.getNode(e),
|
|
160
|
+
}, U = (e) => r.value.getNode(e), j = (e) => {
|
|
161
161
|
r.value.remove(e);
|
|
162
|
-
}, j = (e, o) => {
|
|
163
|
-
r.value.append(e, o);
|
|
164
162
|
}, G = (e, o) => {
|
|
165
|
-
r.value.
|
|
163
|
+
r.value.append(e, o);
|
|
166
164
|
}, J = (e, o) => {
|
|
167
|
-
r.value.
|
|
168
|
-
}, k = (e, o, d) => {
|
|
169
|
-
S(o), h("node-expand", e, o, d);
|
|
165
|
+
r.value.insertBefore(e, o);
|
|
170
166
|
}, Q = (e, o) => {
|
|
167
|
+
r.value.insertAfter(e, o);
|
|
168
|
+
}, v = (e, o, d) => {
|
|
169
|
+
S(o), f("node-expand", e, o, d);
|
|
170
|
+
}, W = (e, o) => {
|
|
171
171
|
if (!t.nodeKey)
|
|
172
172
|
throw new Error("[Tree] nodeKey is required in updateKeyChild");
|
|
173
173
|
r.value.updateChildren(e, o);
|
|
174
|
-
},
|
|
174
|
+
}, X = (e, o) => {
|
|
175
175
|
if (!t.nodeKey)
|
|
176
176
|
throw new Error("[Tree] nodeKey is required in updateKeyChild");
|
|
177
177
|
r.value.updateNode(e, o);
|
|
178
178
|
};
|
|
179
179
|
return w("RootTree", {
|
|
180
|
-
ctx:
|
|
180
|
+
ctx: C,
|
|
181
181
|
props: t,
|
|
182
182
|
store: r,
|
|
183
|
-
root:
|
|
183
|
+
root: u,
|
|
184
184
|
currentNode: b,
|
|
185
|
-
instance:
|
|
185
|
+
instance: x()
|
|
186
186
|
}), w(he, void 0), T({
|
|
187
187
|
filter: A,
|
|
188
|
-
getNodeKey:
|
|
188
|
+
getNodeKey: N,
|
|
189
189
|
getNodePath: $,
|
|
190
190
|
getCheckedNodes: z,
|
|
191
191
|
getCheckedKeys: H,
|
|
192
|
-
getCurrentNode:
|
|
192
|
+
getCurrentNode: k,
|
|
193
193
|
getCurrentKey: I,
|
|
194
194
|
setCheckedNodes: M,
|
|
195
195
|
setCheckedKeys: P,
|
|
@@ -199,51 +199,51 @@ const $e = /* @__PURE__ */ X({
|
|
|
199
199
|
setCurrentNode: L,
|
|
200
200
|
setCurrentKey: R,
|
|
201
201
|
getNode: U,
|
|
202
|
-
remove:
|
|
203
|
-
append:
|
|
204
|
-
insertBefore:
|
|
205
|
-
insertAfter:
|
|
206
|
-
handleNodeExpand:
|
|
207
|
-
updateKeyChildren:
|
|
208
|
-
updateNode:
|
|
209
|
-
}), (e, o) => (
|
|
202
|
+
remove: j,
|
|
203
|
+
append: G,
|
|
204
|
+
insertBefore: J,
|
|
205
|
+
insertAfter: Q,
|
|
206
|
+
handleNodeExpand: v,
|
|
207
|
+
updateKeyChildren: W,
|
|
208
|
+
updateNode: X
|
|
209
|
+
}), (e, o) => (y(), m("div", {
|
|
210
210
|
ref_key: "el$",
|
|
211
|
-
ref:
|
|
212
|
-
class:
|
|
211
|
+
ref: K,
|
|
212
|
+
class: h([
|
|
213
213
|
n(a).b(),
|
|
214
|
-
n(a).is("dragging", !!n(
|
|
215
|
-
n(a).is("drop-not-allow", !n(
|
|
216
|
-
n(a).is("drop-inner", n(
|
|
217
|
-
{ [n(a).m("highlight-current")]:
|
|
214
|
+
n(a).is("dragging", !!n(p).draggingNode),
|
|
215
|
+
n(a).is("drop-not-allow", !n(p).allowDrop),
|
|
216
|
+
n(a).is("drop-inner", n(p).dropType === "inner"),
|
|
217
|
+
{ [n(a).m("highlight-current")]: l.highlightCurrent }
|
|
218
218
|
]),
|
|
219
219
|
role: "tree"
|
|
220
220
|
}, [
|
|
221
|
-
(
|
|
222
|
-
key:
|
|
221
|
+
(y(!0), m(te, null, re(u.value.childNodes, (d) => (y(), oe(ye, {
|
|
222
|
+
key: N(d),
|
|
223
223
|
node: d,
|
|
224
224
|
props: t,
|
|
225
|
-
accordion:
|
|
226
|
-
"render-after-expand":
|
|
227
|
-
"show-checkbox":
|
|
228
|
-
"render-content":
|
|
229
|
-
onNodeExpand:
|
|
225
|
+
accordion: l.accordion,
|
|
226
|
+
"render-after-expand": l.renderAfterExpand,
|
|
227
|
+
"show-checkbox": l.showCheckbox,
|
|
228
|
+
"render-content": l.renderContent,
|
|
229
|
+
onNodeExpand: v
|
|
230
230
|
}, null, 8, ["node", "accordion", "render-after-expand", "show-checkbox", "render-content"]))), 128)),
|
|
231
|
-
q.value ? (
|
|
231
|
+
q.value ? (y(), m("div", {
|
|
232
232
|
key: 0,
|
|
233
|
-
class:
|
|
233
|
+
class: h(n(a).e("empty-block"))
|
|
234
234
|
}, [
|
|
235
235
|
ne(e.$slots, "empty", {}, () => [
|
|
236
236
|
E("span", {
|
|
237
|
-
class:
|
|
238
|
-
}, de(
|
|
237
|
+
class: h(n(a).e("empty-text"))
|
|
238
|
+
}, de(l.emptyText ?? "暂无数据"), 3)
|
|
239
239
|
])
|
|
240
|
-
], 2)) :
|
|
240
|
+
], 2)) : _("", !0),
|
|
241
241
|
ee(E("div", {
|
|
242
242
|
ref_key: "dropIndicator$",
|
|
243
|
-
ref:
|
|
244
|
-
class:
|
|
243
|
+
ref: g,
|
|
244
|
+
class: h(n(a).e("drop-indicator"))
|
|
245
245
|
}, null, 2), [
|
|
246
|
-
[ae, n(
|
|
246
|
+
[ae, n(p).showDropIndicator]
|
|
247
247
|
])
|
|
248
248
|
], 2));
|
|
249
249
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as D, shallowRef as I, createElementBlock as $, openBlock as q, withKeys as A, normalizeClass as T, withModifiers as w, unref as g, createBlock as N, renderSlot as L, createElementVNode as X, withCtx as G, nextTick as J } from "vue";
|
|
2
2
|
import "../form/index.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
|
-
import { isObject as
|
|
5
|
-
import { debugWarn as
|
|
4
|
+
import { isObject as O, entriesOf as Q } from "@vft/utils";
|
|
5
|
+
import { debugWarn as Y } from "../../utils/error.js";
|
|
6
6
|
import "../config-provider/hooks/use-global-config.js";
|
|
7
|
-
import { cloneDeep as
|
|
8
|
-
import { useNamespace as
|
|
7
|
+
import { cloneDeep as F, isEqual as Z } from "lodash-es";
|
|
8
|
+
import { useNamespace as _ } 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
12
|
import { ajaxUpload as ee } from "./ajax.js";
|
|
13
13
|
import { genFileId as te } from "./constants.js";
|
|
14
14
|
import oe from "./upload-dragger.vue2.js";
|
|
15
|
-
import { validateFileType as
|
|
15
|
+
import { validateFileType as P, isImageOrVideo as ae, validateFileSize as ne } from "./utils.js";
|
|
16
16
|
import { useFormDisabled as ie } from "../form/hooks/use-form-common-props.js";
|
|
17
17
|
import { useFormItem as le } from "../form/hooks/use-form-item.js";
|
|
18
|
-
const se = ["onKeydown"], re = ["name", "multiple", "accept"], de =
|
|
18
|
+
const se = ["onKeydown"], re = ["name", "multiple", "accept"], de = D({
|
|
19
19
|
name: "VftUploadContent",
|
|
20
20
|
inheritAttrs: !1
|
|
21
|
-
}),
|
|
21
|
+
}), Ue = /* @__PURE__ */ D({
|
|
22
22
|
...de,
|
|
23
23
|
props: {
|
|
24
24
|
fileList: { default: [] },
|
|
@@ -54,75 +54,75 @@ const se = ["onKeydown"], re = ["name", "multiple", "accept"], de = F({
|
|
|
54
54
|
onExceed: {},
|
|
55
55
|
onSizeExceed: {}
|
|
56
56
|
},
|
|
57
|
-
setup(
|
|
58
|
-
const l =
|
|
57
|
+
setup(r, { expose: K }) {
|
|
58
|
+
const l = r, v = _("upload"), k = ie(), { formItem: V } = le(), u = I(
|
|
59
59
|
{}
|
|
60
|
-
),
|
|
60
|
+
), b = I(), B = async (e) => {
|
|
61
61
|
if (e.length === 0) return;
|
|
62
62
|
const {
|
|
63
63
|
autoUpload: o,
|
|
64
64
|
limit: a,
|
|
65
65
|
fileList: i,
|
|
66
|
-
multiple:
|
|
67
|
-
onStart:
|
|
68
|
-
onExceed:
|
|
69
|
-
replaceOnLimit:
|
|
70
|
-
maxSize:
|
|
71
|
-
onSizeExceed:
|
|
72
|
-
sizeWidth:
|
|
73
|
-
sizeHeight:
|
|
74
|
-
onSizeInvalid:
|
|
66
|
+
multiple: p,
|
|
67
|
+
onStart: m,
|
|
68
|
+
onExceed: E,
|
|
69
|
+
replaceOnLimit: S,
|
|
70
|
+
maxSize: d,
|
|
71
|
+
onSizeExceed: z,
|
|
72
|
+
sizeWidth: h,
|
|
73
|
+
sizeHeight: y,
|
|
74
|
+
onSizeInvalid: f,
|
|
75
75
|
accept: s,
|
|
76
|
-
onTypeInvalid:
|
|
76
|
+
onTypeInvalid: c
|
|
77
77
|
} = l;
|
|
78
78
|
if (s) {
|
|
79
|
-
const n = e.filter((t) => !
|
|
79
|
+
const n = e.filter((t) => !P(t, s));
|
|
80
80
|
if (n.length > 0 && (n.forEach((t) => {
|
|
81
|
-
|
|
82
|
-
}), e = e.filter((t) =>
|
|
81
|
+
c && c(t, s);
|
|
82
|
+
}), e = e.filter((t) => P(t, s)), e.length === 0))
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
86
|
-
const n = e.filter((t) => t.size >
|
|
85
|
+
if (d) {
|
|
86
|
+
const n = e.filter((t) => t.size > d);
|
|
87
87
|
if (n.length > 0 && (n.forEach((t) => {
|
|
88
|
-
|
|
89
|
-
}), e = e.filter((t) => t.size <=
|
|
88
|
+
z && z(t, d);
|
|
89
|
+
}), e = e.filter((t) => t.size <= d), e.length === 0))
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
if (
|
|
92
|
+
if (h && y) {
|
|
93
93
|
const n = [];
|
|
94
94
|
for (const t of e)
|
|
95
95
|
if (ae(t))
|
|
96
96
|
try {
|
|
97
|
-
const { isValid:
|
|
97
|
+
const { isValid: x, width: M, height: W } = await ne(
|
|
98
98
|
t,
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
h,
|
|
100
|
+
y
|
|
101
101
|
);
|
|
102
|
-
|
|
103
|
-
} catch (
|
|
104
|
-
console.error("尺寸校验失败:",
|
|
102
|
+
x ? n.push(t) : f && f(t, M, W, h, y);
|
|
103
|
+
} catch (x) {
|
|
104
|
+
console.error("尺寸校验失败:", x);
|
|
105
105
|
}
|
|
106
106
|
else
|
|
107
107
|
n.push(t);
|
|
108
108
|
if (e = n, e.length === 0) return;
|
|
109
109
|
}
|
|
110
|
-
if (a && i && i.length + e.length > a && !(a === 1 &&
|
|
111
|
-
|
|
110
|
+
if (a && i && i.length + e.length > a && !(a === 1 && S)) {
|
|
111
|
+
E?.(e, i);
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
p || (e = e.slice(0, 1));
|
|
115
115
|
for (const n of e) {
|
|
116
116
|
const t = n;
|
|
117
|
-
t.uid = te(),
|
|
117
|
+
t.uid = te(), m?.(t), o && C(t);
|
|
118
118
|
}
|
|
119
119
|
}, C = async (e) => {
|
|
120
|
-
if (
|
|
120
|
+
if (b.value.value = "", !l.beforeUpload)
|
|
121
121
|
return R(e);
|
|
122
122
|
let o, a = {};
|
|
123
123
|
try {
|
|
124
|
-
const
|
|
125
|
-
a =
|
|
124
|
+
const p = l.data, m = l.beforeUpload(e);
|
|
125
|
+
a = O(l.data) ? F(l.data) : l.data, o = await m, O(l.data) && Z(p, a) && (a = F(l.data));
|
|
126
126
|
} catch {
|
|
127
127
|
o = !1;
|
|
128
128
|
}
|
|
@@ -138,83 +138,83 @@ const se = ["onKeydown"], re = ["name", "multiple", "accept"], de = F({
|
|
|
138
138
|
const {
|
|
139
139
|
headers: a,
|
|
140
140
|
data: i,
|
|
141
|
-
method:
|
|
142
|
-
withCredentials:
|
|
143
|
-
name:
|
|
144
|
-
action:
|
|
145
|
-
onProgress:
|
|
146
|
-
onSuccess:
|
|
147
|
-
onError:
|
|
148
|
-
httpRequest:
|
|
149
|
-
} = l, { uid:
|
|
141
|
+
method: p,
|
|
142
|
+
withCredentials: m,
|
|
143
|
+
name: E,
|
|
144
|
+
action: S,
|
|
145
|
+
onProgress: d,
|
|
146
|
+
onSuccess: z,
|
|
147
|
+
onError: h,
|
|
148
|
+
httpRequest: y
|
|
149
|
+
} = l, { uid: f } = e, s = {
|
|
150
150
|
headers: a || {},
|
|
151
|
-
withCredentials:
|
|
151
|
+
withCredentials: m,
|
|
152
152
|
file: e,
|
|
153
153
|
data: o ?? (i || {}),
|
|
154
|
-
method:
|
|
155
|
-
filename:
|
|
156
|
-
action:
|
|
154
|
+
method: p,
|
|
155
|
+
filename: E,
|
|
156
|
+
action: S,
|
|
157
157
|
onProgress: (n) => {
|
|
158
|
-
|
|
158
|
+
d?.(n, e);
|
|
159
159
|
},
|
|
160
160
|
onSuccess: (n) => {
|
|
161
|
-
|
|
161
|
+
z?.(n, e), delete u.value[f];
|
|
162
162
|
},
|
|
163
163
|
onError: (n) => {
|
|
164
|
-
|
|
164
|
+
h?.(n, e), delete u.value[f];
|
|
165
165
|
}
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
},
|
|
166
|
+
}, c = y(s);
|
|
167
|
+
u.value[f] = c, c instanceof Promise && c.then(s.onSuccess, s.onError);
|
|
168
|
+
}, j = async (e) => {
|
|
169
169
|
const o = e.target.files;
|
|
170
|
-
o && (await B(Array.from(o)),
|
|
171
|
-
|
|
170
|
+
o && (await B(Array.from(o)), J(() => {
|
|
171
|
+
V?.validate("change").catch((a) => Y(a));
|
|
172
172
|
}));
|
|
173
173
|
}, U = () => {
|
|
174
|
-
k.value || (
|
|
175
|
-
},
|
|
174
|
+
k.value || (b.value.value = "", b.value.click());
|
|
175
|
+
}, H = () => {
|
|
176
176
|
U();
|
|
177
177
|
};
|
|
178
|
-
return
|
|
178
|
+
return K({
|
|
179
179
|
abort: (e) => {
|
|
180
|
-
|
|
180
|
+
Q(u.value).filter(
|
|
181
181
|
e ? ([a]) => String(e.uid) === a : () => !0
|
|
182
182
|
).forEach(([a, i]) => {
|
|
183
|
-
i instanceof XMLHttpRequest && i.abort(), delete
|
|
183
|
+
i instanceof XMLHttpRequest && i.abort(), delete u.value[a];
|
|
184
184
|
});
|
|
185
185
|
},
|
|
186
186
|
upload: C
|
|
187
|
-
}), (e, o) => (q(),
|
|
188
|
-
class:
|
|
187
|
+
}), (e, o) => (q(), $("div", {
|
|
188
|
+
class: T([g(v).b(), g(v).m(r.listType), g(v).is("drag", r.drag)]),
|
|
189
189
|
tabindex: "0",
|
|
190
190
|
onClick: U,
|
|
191
|
-
onKeydown:
|
|
191
|
+
onKeydown: A(w(H, ["self"]), ["enter", "space"])
|
|
192
192
|
}, [
|
|
193
|
-
|
|
193
|
+
r.drag ? (q(), N(oe, {
|
|
194
194
|
key: 0,
|
|
195
|
-
disabled:
|
|
195
|
+
disabled: g(k),
|
|
196
196
|
onFile: o[0] || (o[0] = (a) => B(a.file))
|
|
197
197
|
}, {
|
|
198
|
-
default:
|
|
199
|
-
|
|
198
|
+
default: G(() => [
|
|
199
|
+
L(e.$slots, "default")
|
|
200
200
|
]),
|
|
201
201
|
_: 3
|
|
202
|
-
}, 8, ["disabled"])) :
|
|
203
|
-
|
|
202
|
+
}, 8, ["disabled"])) : L(e.$slots, "default", { key: 1 }),
|
|
203
|
+
X("input", {
|
|
204
204
|
ref_key: "inputRef",
|
|
205
|
-
ref:
|
|
206
|
-
class:
|
|
207
|
-
name:
|
|
208
|
-
multiple:
|
|
209
|
-
accept:
|
|
205
|
+
ref: b,
|
|
206
|
+
class: T(g(v).e("input")),
|
|
207
|
+
name: r.name,
|
|
208
|
+
multiple: r.multiple,
|
|
209
|
+
accept: r.accept,
|
|
210
210
|
type: "file",
|
|
211
|
-
onChange:
|
|
212
|
-
onClick: o[1] || (o[1] =
|
|
211
|
+
onChange: j,
|
|
212
|
+
onClick: o[1] || (o[1] = w(() => {
|
|
213
213
|
}, ["stop"]))
|
|
214
214
|
}, null, 42, re)
|
|
215
215
|
], 42, se));
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
218
|
export {
|
|
219
|
-
|
|
219
|
+
Ue as default
|
|
220
220
|
};
|