vft 0.0.429 → 0.0.431
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/dist/index.css +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/menu/sub-menu.vue2.js +33 -31
- 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 +8 -62
- package/es/components/side-menu/side-menu.vue2.js +48 -46
- package/es/components/side-menu/types.d.ts +107 -0
- package/es/components/side-menu/use-drag-line.d.ts +3 -1
- package/es/components/side-menu/use-drag-line.js +39 -28
- 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/menu/sub-menu.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 +8 -62
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/components/side-menu/types.d.ts +107 -0
- package/lib/components/side-menu/use-drag-line.cjs +1 -1
- package/lib/components/side-menu/use-drag-line.d.ts +3 -1
- 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 +4 -4
- package/tags.json +1 -1
- package/theme-style/index.css +1 -1
- package/theme-style/src/header-layout.scss +1 -1
- package/theme-style/src/menu.scss +7 -2
- package/theme-style/src/mixins/mixins.scss +1 -0
- package/theme-style/src/side-menu.scss +0 -3
- package/theme-style/vft-header-layout.css +1 -1
- package/theme-style/vft-menu.css +1 -1
- package/theme-style/vft-side-menu.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as P, getCurrentInstance as F, useAttrs as O, inject as N, computed as a, reactive as q, onMounted as G, onBeforeUnmount as H, createElementBlock as k, openBlock as n, Fragment as b, createBlock as s, createCommentVNode as m, createElementVNode as M, unref as t, normalizeClass as y, withCtx as $, renderSlot as A, normalizeProps as I, mergeProps as V, createVNode as J } from "vue";
|
|
2
2
|
import { singleAttrToObj as K, renderTNode as L, VNode as Q } from "@vft/utils";
|
|
3
3
|
import { VftIcon as h } from "../icon/index.js";
|
|
4
4
|
import { VftDivider as j } from "../divider/index.js";
|
|
5
5
|
import { VftTooltip as R } from "../tooltip/index.js";
|
|
6
6
|
import "@vueuse/core";
|
|
7
|
-
import { throwError as
|
|
7
|
+
import { throwError as p } from "../../utils/error.js";
|
|
8
8
|
import "../config-provider/hooks/use-global-config.js";
|
|
9
9
|
import "lodash-es";
|
|
10
10
|
import "../form/index.js";
|
|
11
|
-
import { useNamespace as
|
|
11
|
+
import { useNamespace as x } from "../../hooks/use-namespace/index.js";
|
|
12
12
|
import "../../hooks/use-model-toggle/index.js";
|
|
13
13
|
import "@popperjs/core";
|
|
14
14
|
import "../../hooks/use-z-index/index.js";
|
|
15
15
|
import W from "./use-menu.js";
|
|
16
|
-
const X = ["title"], Y =
|
|
16
|
+
const X = ["title"], Y = P({
|
|
17
17
|
name: "vft-menu-item",
|
|
18
18
|
inheritAttrs: !1
|
|
19
|
-
}), fe = /* @__PURE__ */
|
|
19
|
+
}), fe = /* @__PURE__ */ P({
|
|
20
20
|
...Y,
|
|
21
21
|
props: {
|
|
22
22
|
index: {},
|
|
@@ -30,79 +30,79 @@ const X = ["title"], Y = E({
|
|
|
30
30
|
reverse: { type: Boolean }
|
|
31
31
|
},
|
|
32
32
|
emits: ["click", "mouseenter", "mouseleave"],
|
|
33
|
-
setup(
|
|
34
|
-
const
|
|
35
|
-
!
|
|
33
|
+
setup(e, { emit: E }) {
|
|
34
|
+
const c = E, d = x("menu-item"), g = F(), S = O(), T = x("menu"), f = x("menu-item"), o = e.isAloneUse ? null : N("rootMenu");
|
|
35
|
+
!o && !e.isAloneUse && p(d.b(), "can not inject root menu");
|
|
36
36
|
const { parentMenu: U, indexPath: B } = W(
|
|
37
37
|
g,
|
|
38
|
-
a(() =>
|
|
39
|
-
), v =
|
|
40
|
-
!v && !
|
|
41
|
-
const C = a(() =>
|
|
42
|
-
index:
|
|
38
|
+
a(() => e.index)
|
|
39
|
+
), v = e.isAloneUse ? null : N(`subMenu:${U.value.uid}`);
|
|
40
|
+
!v && !e.isAloneUse && p(d.b(), "can not inject sub menu");
|
|
41
|
+
const C = a(() => e.index === o?.activeIndex), i = q({
|
|
42
|
+
index: e.index,
|
|
43
43
|
indexPath: B,
|
|
44
44
|
active: C
|
|
45
|
-
}),
|
|
46
|
-
|
|
47
|
-
...
|
|
48
|
-
index:
|
|
45
|
+
}), w = () => {
|
|
46
|
+
e.disabled || (o?.handleMenuItemClick({
|
|
47
|
+
...S,
|
|
48
|
+
index: e.index,
|
|
49
49
|
indexPath: B.value,
|
|
50
|
-
route:
|
|
51
|
-
}),
|
|
52
|
-
}, r = a(() => K(
|
|
50
|
+
route: e.route
|
|
51
|
+
}), c("click", i));
|
|
52
|
+
}, r = a(() => K(e.icon, "icon")), z = a(() => L(g, "title"));
|
|
53
53
|
return G(() => {
|
|
54
|
-
|
|
54
|
+
e.isAloneUse || (v?.addSubMenu(i), o?.addMenuItem(i));
|
|
55
55
|
}), H(() => {
|
|
56
|
-
|
|
57
|
-
}), (
|
|
58
|
-
|
|
56
|
+
e.isAloneUse || (v?.removeSubMenu(i), o?.removeMenuItem(i));
|
|
57
|
+
}), (l, u) => (n(), k(b, null, [
|
|
58
|
+
e.reverse && e.divider ? (n(), s(t(j), {
|
|
59
59
|
key: 0,
|
|
60
60
|
"margin-y": "0"
|
|
61
61
|
})) : m("", !0),
|
|
62
|
-
|
|
63
|
-
class:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
M("li", {
|
|
63
|
+
class: y([
|
|
64
|
+
e.className,
|
|
65
|
+
t(f).b(),
|
|
66
|
+
t(f).is("active", e.isAloneUse ? !1 : C.value),
|
|
67
|
+
t(f).is("disabled", e.disabled)
|
|
68
68
|
]),
|
|
69
|
-
onMouseenter: u[0] || (u[0] = (D) =>
|
|
70
|
-
onMouseleave: u[1] || (u[1] = (D) =>
|
|
69
|
+
onMouseenter: u[0] || (u[0] = (D) => c("mouseenter")),
|
|
70
|
+
onMouseleave: u[1] || (u[1] = (D) => c("mouseleave")),
|
|
71
71
|
role: "menuitem",
|
|
72
72
|
tabindex: "-1",
|
|
73
|
-
onClick:
|
|
73
|
+
onClick: w
|
|
74
74
|
}, [
|
|
75
|
-
|
|
75
|
+
t(U)?.type?.name === "vft-menu" && t(o)?.props.collapse && l.$slots.title ? (n(), s(t(R), {
|
|
76
76
|
key: 0,
|
|
77
77
|
placement: "right",
|
|
78
78
|
"fallback-placements": ["left"],
|
|
79
|
-
persistent:
|
|
79
|
+
persistent: t(o).props.persistent
|
|
80
80
|
}, {
|
|
81
81
|
content: $(() => [
|
|
82
|
-
|
|
82
|
+
A(l.$slots, "title")
|
|
83
83
|
]),
|
|
84
84
|
default: $(() => [
|
|
85
|
-
|
|
86
|
-
class:
|
|
85
|
+
M("div", {
|
|
86
|
+
class: y(t(T).be("tooltip", "trigger"))
|
|
87
87
|
}, [
|
|
88
|
-
r.value?.icon ? (
|
|
89
|
-
|
|
88
|
+
r.value?.icon ? (n(), s(t(h), I(V({ key: 0 }, r.value)), null, 16)) : m("", !0),
|
|
89
|
+
A(l.$slots, "default")
|
|
90
90
|
], 2)
|
|
91
91
|
]),
|
|
92
92
|
_: 3
|
|
93
|
-
}, 8, ["persistent"])) : (
|
|
94
|
-
|
|
95
|
-
r.value?.icon ? (
|
|
96
|
-
|
|
97
|
-
class:
|
|
98
|
-
title:
|
|
93
|
+
}, 8, ["persistent"])) : (n(), k(b, { key: 1 }, [
|
|
94
|
+
l.$slots?.default ? A(l.$slots, "default", { key: 0 }) : (n(), k(b, { key: 1 }, [
|
|
95
|
+
r.value?.icon ? (n(), s(t(h), I(V({ key: 0 }, r.value)), null, 16)) : m("", !0),
|
|
96
|
+
M("span", {
|
|
97
|
+
class: y(t(d).e("text")),
|
|
98
|
+
title: e.title
|
|
99
99
|
}, [
|
|
100
|
-
J(
|
|
100
|
+
J(t(Q), { content: z.value }, null, 8, ["content"])
|
|
101
101
|
], 10, X)
|
|
102
102
|
], 64))
|
|
103
103
|
], 64))
|
|
104
104
|
], 34),
|
|
105
|
-
!
|
|
105
|
+
!e.reverse && e.divider ? (n(), s(t(j), {
|
|
106
106
|
key: 1,
|
|
107
107
|
"margin-y": "0"
|
|
108
108
|
})) : m("", !0)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Z, getCurrentInstance as le, computed as l, inject as D, ref as C, reactive as ue, watch as ae, provide as se, onMounted as re, onBeforeUnmount as ie, useSlots as ce, h as
|
|
1
|
+
import { defineComponent as Z, getCurrentInstance as le, computed as l, inject as D, ref as C, reactive as ue, watch as ae, provide as se, onMounted as re, onBeforeUnmount as ie, useSlots as ce, h as u, Fragment as pe, withDirectives as me, vShow as de } from "vue";
|
|
2
2
|
import { singleAttrToObj as g, renderTNode as ve, isMobile as fe } from "@vft/utils";
|
|
3
3
|
import { VftTooltip as Me } from "../tooltip/index.js";
|
|
4
4
|
import { VftIcon as L } from "../icon/index.js";
|
|
@@ -56,7 +56,7 @@ const Ce = Z({
|
|
|
56
56
|
const y = G, I = w("sub-menu"), m = le(), {
|
|
57
57
|
indexPath: f,
|
|
58
58
|
parentMenu: k
|
|
59
|
-
} = he(m, l(() => o.index)), i = w("menu"),
|
|
59
|
+
} = he(m, l(() => o.index)), i = w("menu"), a = w("sub-menu"), e = D("rootMenu");
|
|
60
60
|
e || U(I.b(), "can not inject root menu");
|
|
61
61
|
const r = D(`subMenu:${k.value.uid}`);
|
|
62
62
|
r || U(I.b(), "can not inject sub menu");
|
|
@@ -64,8 +64,8 @@ const Ce = Z({
|
|
|
64
64
|
let M;
|
|
65
65
|
const z = C(!1), J = C(), E = C(null), A = l(() => p.value === "horizontal" && b.value ? "bottom-start" : "right-start"), b = l(() => r.level === 0), x = l(() => o.teleported === void 0 ? b.value : o.teleported), K = l(() => e.props.collapse ? `${i.namespace.value}-zoom-in-left` : `${i.namespace.value}-zoom-in-top`), Q = l(() => p.value === "horizontal" && b.value ? ["bottom-start", "bottom-end", "top-start", "top-end", "right-start", "left-start"] : ["right-start", "left-start", "bottom-start", "bottom-end", "top-start", "top-end"]), c = l(() => e.openedMenus.includes(o.index)), d = l(() => {
|
|
66
66
|
let t = !1;
|
|
67
|
-
return Object.values(S.value).forEach((
|
|
68
|
-
|
|
67
|
+
return Object.values(S.value).forEach((s) => {
|
|
68
|
+
s.active && (t = !0);
|
|
69
69
|
}), o.index === e.activeIndex && (t = !0), t;
|
|
70
70
|
}), B = l(() => e.props.backgroundColor || ""), P = l(() => e.props.activeTextColor || ""), F = l(() => e.props.textColor || ""), p = l(() => e.props.mode), W = l(() => e.props.persistent), h = ue({
|
|
71
71
|
index: o.index,
|
|
@@ -79,7 +79,7 @@ const Ce = Z({
|
|
|
79
79
|
}), X = () => E.value?.popperRef?.popperInstanceRef?.destroy(), Y = (t) => {
|
|
80
80
|
t || X();
|
|
81
81
|
}, O = (t) => {
|
|
82
|
-
const
|
|
82
|
+
const s = {
|
|
83
83
|
e: t,
|
|
84
84
|
index: o.index,
|
|
85
85
|
indexPath: f.value,
|
|
@@ -87,18 +87,18 @@ const Ce = Z({
|
|
|
87
87
|
};
|
|
88
88
|
if (e.props.menuTrigger === "hover" && e.props.mode === "horizontal" && !fe() || e.props.collapse && e.props.mode === "vertical" || o.disabled) {
|
|
89
89
|
e.handleSubMenuClick({
|
|
90
|
-
...
|
|
90
|
+
...s,
|
|
91
91
|
isFirstLevel: !0
|
|
92
92
|
});
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
-
e.handleSubMenuClick(
|
|
96
|
-
}, v = (t,
|
|
95
|
+
e.handleSubMenuClick(s);
|
|
96
|
+
}, v = (t, s = o.showTimeout) => {
|
|
97
97
|
t.type !== "focus" && (e.props.menuTrigger === "click" && e.props.mode === "horizontal" || !e.props.collapse && e.props.mode === "vertical" || o.disabled || (r.mouseInChild.value = !0, M?.(), {
|
|
98
98
|
stop: M
|
|
99
99
|
} = H(() => {
|
|
100
100
|
e.openMenu(o.index, f.value);
|
|
101
|
-
},
|
|
101
|
+
}, s), x.value && k.value.vnode.el?.dispatchEvent(new MouseEvent("mouseenter")), y("mouseenter", t)));
|
|
102
102
|
}, _ = () => {
|
|
103
103
|
e.inSubMenuMouseEnterTimer && clearTimeout(e.inSubMenuMouseEnterTimer), e.inSubMenuMouseleaveTimer && clearTimeout(e.inSubMenuMouseleaveTimer), e.inSubMenuMouseEnterTimer = setTimeout(() => {
|
|
104
104
|
e.inSubMenu = !0;
|
|
@@ -107,23 +107,23 @@ const Ce = Z({
|
|
|
107
107
|
e.inSubMenuMouseEnterTimer && clearTimeout(e.inSubMenuMouseEnterTimer), e.inSubMenuMouseleaveTimer && clearTimeout(e.inSubMenuMouseleaveTimer), e.inSubMenuMouseleaveTimer = setTimeout(() => {
|
|
108
108
|
e.inSubMenu = !1;
|
|
109
109
|
}, o.hideTimeout - 10);
|
|
110
|
-
}, T = (t,
|
|
110
|
+
}, T = (t, s = !1) => {
|
|
111
111
|
e.props.menuTrigger === "click" && e.props.mode === "horizontal" || !e.props.collapse && e.props.mode === "vertical" || (M?.(), r.mouseInChild.value = !1, {
|
|
112
112
|
stop: M
|
|
113
113
|
} = H(() => {
|
|
114
114
|
!z.value && e.closeMenu(o.index, f.value);
|
|
115
|
-
}, o.hideTimeout), x.value &&
|
|
115
|
+
}, o.hideTimeout), x.value && s && m.parent?.type.name === "vft-sub-menu" && r.handleMouseleave?.(t, !0), y("mouseleave", t));
|
|
116
116
|
};
|
|
117
117
|
ae(() => e.props.collapse, (t) => Y(!!t));
|
|
118
118
|
{
|
|
119
119
|
const t = (n) => {
|
|
120
120
|
S.value[n.index] = n;
|
|
121
|
-
},
|
|
121
|
+
}, s = (n) => {
|
|
122
122
|
delete S.value[n.index];
|
|
123
123
|
};
|
|
124
124
|
se(`subMenu:${m.uid}`, {
|
|
125
125
|
addSubMenu: t,
|
|
126
|
-
removeSubMenu:
|
|
126
|
+
removeSubMenu: s,
|
|
127
127
|
handleMouseleave: T,
|
|
128
128
|
mouseInChild: z,
|
|
129
129
|
level: r.level + 1
|
|
@@ -146,18 +146,18 @@ const Ce = Z({
|
|
|
146
146
|
...te.value
|
|
147
147
|
}), R = l(() => ve(m, "title"));
|
|
148
148
|
return () => {
|
|
149
|
-
const t = [N.value?.icon ?
|
|
149
|
+
const t = [N.value?.icon ? u(L, {
|
|
150
150
|
...N.value
|
|
151
|
-
}) : null,
|
|
152
|
-
class: [
|
|
151
|
+
}) : null, u("span", {
|
|
152
|
+
class: [a.e("text"), a.is("arrow", o.showArrow)],
|
|
153
153
|
title: m.props.title
|
|
154
|
-
}, R.value), o.showArrow ?
|
|
155
|
-
class:
|
|
154
|
+
}, R.value), o.showArrow ? u(L, {
|
|
155
|
+
class: a.e("icon-arrow"),
|
|
156
156
|
...ne.value,
|
|
157
157
|
style: {
|
|
158
158
|
transform: c.value ? "rotateZ(180deg)" : "none"
|
|
159
159
|
}
|
|
160
|
-
}) : !1],
|
|
160
|
+
}) : !1], s = e.isMenuPopup ? u(Me, {
|
|
161
161
|
ref: E,
|
|
162
162
|
visible: c.value,
|
|
163
163
|
effect: "light",
|
|
@@ -173,17 +173,19 @@ const Ce = Z({
|
|
|
173
173
|
gpuAcceleration: !1,
|
|
174
174
|
...o.toolTipCfg
|
|
175
175
|
}, {
|
|
176
|
-
content: () =>
|
|
176
|
+
content: () => u("div", {
|
|
177
177
|
class: [i.m(p.value), i.m("popup-container"), o.popperClass],
|
|
178
178
|
onMouseenter: (n) => v(n, 100),
|
|
179
179
|
onMouseleave: (n) => T(n, !0),
|
|
180
180
|
onFocus: (n) => v(n, 100)
|
|
181
|
-
}, [
|
|
181
|
+
}, [u("div", {
|
|
182
182
|
class: [i.b(), i.m("popup"), i.m(`popup-${A.value}`)],
|
|
183
183
|
style: j.value
|
|
184
|
-
}, [
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
}, [u("ul", {
|
|
185
|
+
class: i.m("popup-ul-list")
|
|
186
|
+
}, V.default?.())])]),
|
|
187
|
+
default: () => u("div", {
|
|
188
|
+
class: a.e("title"),
|
|
187
189
|
style: [$.value, {
|
|
188
190
|
backgroundColor: B.value
|
|
189
191
|
}],
|
|
@@ -193,30 +195,30 @@ const Ce = Z({
|
|
|
193
195
|
}, t)
|
|
194
196
|
}) : (
|
|
195
197
|
// 以下是无需 tooltip 渲染的组件,通常是侧边栏没有折叠的时候
|
|
196
|
-
|
|
197
|
-
class:
|
|
198
|
+
u(pe, {}, [R.value ? u("div", {
|
|
199
|
+
class: a.e("title"),
|
|
198
200
|
style: [$.value, {
|
|
199
201
|
backgroundColor: B.value
|
|
200
202
|
}],
|
|
201
203
|
ref: J,
|
|
202
204
|
onClick: O
|
|
203
|
-
}, t) : null,
|
|
204
|
-
default: () => me(
|
|
205
|
+
}, t) : null, u(be, {}, {
|
|
206
|
+
default: () => me(u("ul", {
|
|
205
207
|
role: "menu",
|
|
206
208
|
class: [i.b(), i.m("inline")],
|
|
207
209
|
style: j.value
|
|
208
210
|
}, [V.default?.()]), [[de, c.value]])
|
|
209
211
|
})])
|
|
210
212
|
);
|
|
211
|
-
return
|
|
212
|
-
class: [
|
|
213
|
+
return u("li", {
|
|
214
|
+
class: [a.b(), a.is("active", d.value), a.e(String(r.level)), a.is("in-popup", r.level !== 0), a.is("opened", c.value), a.is("arrow", !0), a.is("disabled", o.disabled)],
|
|
213
215
|
role: "menuitem",
|
|
214
216
|
ariaHaspopup: !0,
|
|
215
217
|
ariaExpanded: c.value,
|
|
216
218
|
onMouseenter: [_, (n) => v(n)],
|
|
217
219
|
onMouseleave: [ee, (n) => T(n, !0)],
|
|
218
220
|
onFocus: v
|
|
219
|
-
}, [
|
|
221
|
+
}, [s]);
|
|
220
222
|
};
|
|
221
223
|
}
|
|
222
224
|
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { EVENT_CODE as
|
|
3
|
-
import { useEventListener as
|
|
4
|
-
import { isObject as
|
|
5
|
-
import { VftIcon as
|
|
6
|
-
import { useResizeObserver as
|
|
1
|
+
import { defineComponent as N, ref as d, computed as i, onMounted as R, watch as V, createBlock as H, openBlock as c, Transition as $, unref as o, withCtx as D, withDirectives as F, createElementVNode as j, normalizeStyle as P, normalizeClass as r, createElementBlock as u, createCommentVNode as w, renderSlot as U, createVNode as k, normalizeProps as Z, guardReactiveProps as A, toDisplayString as G, withModifiers as q, vShow as J } from "vue";
|
|
2
|
+
import { EVENT_CODE as K } from "@vft/constants";
|
|
3
|
+
import { useEventListener as Q } from "@vft/use";
|
|
4
|
+
import { isObject as W } from "@vft/utils";
|
|
5
|
+
import { VftIcon as B } from "../icon/index.js";
|
|
6
|
+
import { useResizeObserver as X, useTimeoutFn as Y } from "@vueuse/core";
|
|
7
7
|
import "../config-provider/index.js";
|
|
8
|
-
import { getLastOffset as
|
|
9
|
-
import { useGlobalComponentSettings as
|
|
10
|
-
const
|
|
8
|
+
import { getLastOffset as _, getOffsetOrSpace as ee } from "./instance.js";
|
|
9
|
+
import { useGlobalComponentSettings as te } from "../config-provider/hooks/use-global-config.js";
|
|
10
|
+
const oe = ["id"], ne = ["innerHTML"], ge = /* @__PURE__ */ N({
|
|
11
11
|
__name: "message",
|
|
12
12
|
props: {
|
|
13
13
|
customClass: {},
|
|
@@ -26,96 +26,96 @@ const ne = ["id"], te = ["innerHTML"], de = /* @__PURE__ */ R({
|
|
|
26
26
|
repeatNum: {}
|
|
27
27
|
},
|
|
28
28
|
emits: ["destroy"],
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
31
|
-
let
|
|
32
|
-
const
|
|
29
|
+
setup(e, { expose: b }) {
|
|
30
|
+
const t = e, { ns: n, zIndex: M } = te("message"), { currentZIndex: S, nextZIndex: T } = M, m = d(), l = d(!1), g = d(0);
|
|
31
|
+
let v;
|
|
32
|
+
const x = /* @__PURE__ */ new Map([
|
|
33
33
|
["success", { icon: "icon-success-filled" }],
|
|
34
34
|
["error", { icon: "icon-circle-close-filled" }],
|
|
35
35
|
["warning", { icon: "icon-warning-filled" }]
|
|
36
|
-
]),
|
|
37
|
-
const
|
|
38
|
-
return { [
|
|
39
|
-
}),
|
|
40
|
-
() => ee(
|
|
41
|
-
),
|
|
42
|
-
top: `${
|
|
36
|
+
]), y = i(() => (t.icon ? W(t.icon) ? t.icon : { icon: t.icon } : "") || x.get(t.type) || ""), L = i(() => {
|
|
37
|
+
const s = t.type;
|
|
38
|
+
return { [n.bm("icon", s)]: s };
|
|
39
|
+
}), O = i(() => _(t.id)), p = i(
|
|
40
|
+
() => ee(t.id, t.offset) + O.value
|
|
41
|
+
), z = i(() => g.value + p.value), E = i(() => ({
|
|
42
|
+
top: `${p.value}px`,
|
|
43
43
|
zIndex: S.value
|
|
44
44
|
}));
|
|
45
|
-
function
|
|
46
|
-
|
|
45
|
+
function f() {
|
|
46
|
+
t.duration !== 0 && ({ stop: v } = Y(() => {
|
|
47
47
|
a();
|
|
48
|
-
},
|
|
48
|
+
}, t.duration));
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
50
|
+
function C() {
|
|
51
|
+
v?.();
|
|
52
52
|
}
|
|
53
53
|
function a() {
|
|
54
54
|
l.value = !1;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
56
|
+
function I({ code: s }) {
|
|
57
|
+
s === K.esc && a();
|
|
58
58
|
}
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
}),
|
|
62
|
-
() =>
|
|
59
|
+
return R(() => {
|
|
60
|
+
f(), T(), l.value = !0;
|
|
61
|
+
}), V(
|
|
62
|
+
() => t.repeatNum,
|
|
63
63
|
() => {
|
|
64
|
-
|
|
64
|
+
C(), f();
|
|
65
65
|
}
|
|
66
|
-
),
|
|
67
|
-
|
|
66
|
+
), Q(document, "keydown", I), X(m, () => {
|
|
67
|
+
g.value = m.value.getBoundingClientRect().height;
|
|
68
68
|
}), b({
|
|
69
69
|
visible: l,
|
|
70
|
-
bottom:
|
|
70
|
+
bottom: z,
|
|
71
71
|
close: a
|
|
72
|
-
}), (
|
|
73
|
-
name: n
|
|
72
|
+
}), (s, h) => (c(), H($, {
|
|
73
|
+
name: o(n).b("fade"),
|
|
74
74
|
onBeforeLeave: e.onClose,
|
|
75
|
-
onAfterLeave:
|
|
75
|
+
onAfterLeave: h[0] || (h[0] = (se) => s.$emit("destroy"))
|
|
76
76
|
}, {
|
|
77
|
-
default:
|
|
78
|
-
j(
|
|
77
|
+
default: D(() => [
|
|
78
|
+
F(j("div", {
|
|
79
79
|
id: e.id,
|
|
80
80
|
ref_key: "messageRef",
|
|
81
|
-
ref:
|
|
81
|
+
ref: m,
|
|
82
82
|
class: r([
|
|
83
|
-
n
|
|
84
|
-
{ [n
|
|
85
|
-
n
|
|
86
|
-
n
|
|
83
|
+
o(n).b(),
|
|
84
|
+
{ [o(n).m(e.type)]: e.type && !e.icon },
|
|
85
|
+
o(n).is("center", e.center),
|
|
86
|
+
o(n).is("closable", e.showClose),
|
|
87
87
|
e.customClass
|
|
88
88
|
]),
|
|
89
|
-
style:
|
|
89
|
+
style: P(E.value),
|
|
90
90
|
role: "alert",
|
|
91
|
-
onMouseenter:
|
|
92
|
-
onMouseleave:
|
|
91
|
+
onMouseenter: C,
|
|
92
|
+
onMouseleave: f
|
|
93
93
|
}, [
|
|
94
|
-
|
|
94
|
+
y.value?.icon ? (c(), u("div", {
|
|
95
95
|
key: 0,
|
|
96
|
-
class: r([n
|
|
96
|
+
class: r([o(n).e("icon"), L.value])
|
|
97
97
|
}, [
|
|
98
|
-
|
|
99
|
-
], 2)) :
|
|
100
|
-
|
|
101
|
-
e.dangerouslyUseHTMLString ? (
|
|
98
|
+
k(o(B), Z(A(y.value)), null, 16)
|
|
99
|
+
], 2)) : w("", !0),
|
|
100
|
+
U(s.$slots, "default", {}, () => [
|
|
101
|
+
e.dangerouslyUseHTMLString ? (c(), u("p", {
|
|
102
102
|
key: 1,
|
|
103
|
-
class: r(n
|
|
103
|
+
class: r(o(n).e("content")),
|
|
104
104
|
innerHTML: e.message
|
|
105
|
-
}, null, 10,
|
|
105
|
+
}, null, 10, ne)) : (c(), u("p", {
|
|
106
106
|
key: 0,
|
|
107
|
-
class: r(n
|
|
108
|
-
},
|
|
107
|
+
class: r(o(n).e("content"))
|
|
108
|
+
}, G(e.message), 3))
|
|
109
109
|
]),
|
|
110
|
-
e.showClose ? (
|
|
110
|
+
e.showClose ? (c(), u("div", {
|
|
111
111
|
key: 1,
|
|
112
|
-
class: r(n
|
|
113
|
-
onClick:
|
|
112
|
+
class: r(o(n).e("closeBtn")),
|
|
113
|
+
onClick: q(a, ["stop"])
|
|
114
114
|
}, [
|
|
115
|
-
|
|
116
|
-
], 2)) :
|
|
117
|
-
], 46,
|
|
118
|
-
[
|
|
115
|
+
k(o(B), { icon: "icon-circle-close" })
|
|
116
|
+
], 2)) : w("", !0)
|
|
117
|
+
], 46, oe), [
|
|
118
|
+
[J, l.value]
|
|
119
119
|
])
|
|
120
120
|
]),
|
|
121
121
|
_: 3
|
|
@@ -123,5 +123,5 @@ const ne = ["id"], te = ["innerHTML"], de = /* @__PURE__ */ R({
|
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
export {
|
|
126
|
-
|
|
126
|
+
ge as default
|
|
127
127
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as O, computed as
|
|
1
|
+
import { defineComponent as O, computed as e, createBlock as n, openBlock as i, unref as o, normalizeProps as w, guardReactiveProps as y, withCtx as s, createCommentVNode as c, renderSlot as p, mergeProps as l, createTextVNode as f, toDisplayString as B } from "vue";
|
|
2
2
|
import { VftRow as g } from "../row/index.js";
|
|
3
3
|
import { VftButton as b } from "../button/index.js";
|
|
4
4
|
import "../super-form/index.js";
|
|
@@ -12,7 +12,7 @@ import { useNamespace as h } from "../../hooks/use-namespace/index.js";
|
|
|
12
12
|
import "../../hooks/use-model-toggle/index.js";
|
|
13
13
|
import "@popperjs/core";
|
|
14
14
|
import "../../hooks/use-z-index/index.js";
|
|
15
|
-
const
|
|
15
|
+
const q = /* @__PURE__ */ O({
|
|
16
16
|
__name: "modal-footer-action",
|
|
17
17
|
props: {
|
|
18
18
|
showSubmitButton: { type: Boolean },
|
|
@@ -21,42 +21,42 @@ const D = /* @__PURE__ */ O({
|
|
|
21
21
|
cancelButtonOptions: {},
|
|
22
22
|
actionRowOptions: {}
|
|
23
23
|
},
|
|
24
|
-
setup(
|
|
25
|
-
const a = h("form-action"), d =
|
|
24
|
+
setup(t) {
|
|
25
|
+
const a = h("form-action"), d = e(() => ({
|
|
26
26
|
justify: "end",
|
|
27
|
-
...
|
|
28
|
-
})),
|
|
29
|
-
() => Object.assign({ btnText: "确认" },
|
|
30
|
-
),
|
|
31
|
-
() => Object.assign({ btnText: "取消" },
|
|
27
|
+
...t.actionRowOptions
|
|
28
|
+
})), r = e(
|
|
29
|
+
() => Object.assign({ btnText: "确认" }, t.submitButtonOptions)
|
|
30
|
+
), m = e(
|
|
31
|
+
() => Object.assign({ btnText: "取消" }, t.cancelButtonOptions)
|
|
32
32
|
);
|
|
33
|
-
return (
|
|
34
|
-
default:
|
|
35
|
-
|
|
36
|
-
class:
|
|
33
|
+
return (u, v) => (i(), n(o(g), w(y(d.value)), {
|
|
34
|
+
default: s(() => [
|
|
35
|
+
t.showCancelButton ? (i(), n(o(b), l({ key: 0 }, m.value, {
|
|
36
|
+
class: o(a).e("cancel")
|
|
37
37
|
}), {
|
|
38
|
-
default:
|
|
39
|
-
f(B(
|
|
38
|
+
default: s(() => [
|
|
39
|
+
f(B(m.value.btnText), 1)
|
|
40
40
|
]),
|
|
41
41
|
_: 1
|
|
42
|
-
}, 16, ["class"])) :
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
}, 16, ["class"])) : c("", !0),
|
|
43
|
+
p(u.$slots, "submitBefore"),
|
|
44
|
+
t.showSubmitButton ? (i(), n(o(b), l({
|
|
45
45
|
key: 1,
|
|
46
46
|
type: "primary",
|
|
47
|
-
class:
|
|
48
|
-
},
|
|
49
|
-
default:
|
|
50
|
-
f(B(
|
|
47
|
+
class: o(a).e("submit")
|
|
48
|
+
}, r.value), {
|
|
49
|
+
default: s(() => [
|
|
50
|
+
f(B(r.value.btnText), 1)
|
|
51
51
|
]),
|
|
52
52
|
_: 1
|
|
53
|
-
}, 16, ["class"])) :
|
|
54
|
-
|
|
53
|
+
}, 16, ["class"])) : c("", !0),
|
|
54
|
+
p(u.$slots, "submitAfter")
|
|
55
55
|
]),
|
|
56
56
|
_: 3
|
|
57
57
|
}, 16));
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
export {
|
|
61
|
-
|
|
61
|
+
q as default
|
|
62
62
|
};
|