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,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,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
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as O, useAttrs as M, ref as
|
|
1
|
+
import { defineComponent as O, useAttrs as M, ref as r, getCurrentInstance as F, computed as i, unref as t, watchEffect as P, watch as R, nextTick as d, createBlock as B, openBlock as b, mergeProps as S, createSlots as T, withCtx as y, renderSlot as A, createCommentVNode as x } from "vue";
|
|
2
2
|
import { deepMerge as D, isFunction as G } from "@vft/utils";
|
|
3
3
|
import { VftDialog as I } from "../dialog/index.js";
|
|
4
4
|
import $ from "./modal-footer-action.vue2.js";
|
|
@@ -53,74 +53,74 @@ const N = /* @__PURE__ */ O({
|
|
|
53
53
|
"update:modelValue": [],
|
|
54
54
|
submit: []
|
|
55
55
|
},
|
|
56
|
-
setup(
|
|
57
|
-
const
|
|
56
|
+
setup(n, { emit: h }) {
|
|
57
|
+
const o = n, a = h, C = M(), c = r(null), l = r(!1), s = r(null), f = {
|
|
58
58
|
setModalProps: V,
|
|
59
59
|
emitVisible: void 0,
|
|
60
60
|
redoModalHeight: () => {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
d(() => {
|
|
62
|
+
t(s) && t(s).setModalHeight();
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
const g =
|
|
68
|
-
...
|
|
69
|
-
...
|
|
70
|
-
})), w =
|
|
65
|
+
}, u = F();
|
|
66
|
+
u && a("register", f, u.uid);
|
|
67
|
+
const g = i(() => ({
|
|
68
|
+
...o,
|
|
69
|
+
...t(c)
|
|
70
|
+
})), w = i(() => ({
|
|
71
71
|
...C,
|
|
72
|
-
...
|
|
73
|
-
modelValue:
|
|
72
|
+
...t(g),
|
|
73
|
+
modelValue: t(l)
|
|
74
74
|
}));
|
|
75
75
|
P(() => {
|
|
76
|
-
l.value = !!
|
|
76
|
+
l.value = !!o.modelValue;
|
|
77
77
|
}), R(
|
|
78
|
-
() =>
|
|
78
|
+
() => t(l),
|
|
79
79
|
(e) => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}),
|
|
83
|
-
|
|
80
|
+
a("visible-change", e), a("update:modelValue", e), u && d(() => {
|
|
81
|
+
f.emitVisible(e, u.uid);
|
|
82
|
+
}), d(() => {
|
|
83
|
+
o.scrollTop && e && t(s) && t(s).scrollTop();
|
|
84
84
|
});
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
immediate: !1
|
|
88
88
|
}
|
|
89
89
|
);
|
|
90
|
-
async function
|
|
91
|
-
if (e?.stopPropagation(),
|
|
92
|
-
const
|
|
93
|
-
l.value = !
|
|
90
|
+
async function p(e) {
|
|
91
|
+
if (e?.stopPropagation(), o.closeFunc && G(o.closeFunc)) {
|
|
92
|
+
const m = await o.closeFunc();
|
|
93
|
+
l.value = !m;
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
l.value = !1,
|
|
96
|
+
l.value = !1, a("close", e);
|
|
97
97
|
}
|
|
98
98
|
function V(e) {
|
|
99
|
-
|
|
99
|
+
c.value = D(t(c) || {}, e), Reflect.has(e, "modelValue") && (l.value = !!e.modelValue);
|
|
100
100
|
}
|
|
101
|
-
const v =
|
|
102
|
-
onClick: (e) =>
|
|
103
|
-
...
|
|
104
|
-
})), k =
|
|
105
|
-
onClick: () =>
|
|
106
|
-
...
|
|
101
|
+
const v = i(() => ({
|
|
102
|
+
onClick: (e) => p(e),
|
|
103
|
+
...o.cancelButtonOptions
|
|
104
|
+
})), k = i(() => ({
|
|
105
|
+
onClick: () => a("submit"),
|
|
106
|
+
...o.submitButtonOptions
|
|
107
107
|
}));
|
|
108
|
-
return (e,
|
|
109
|
-
default:
|
|
110
|
-
|
|
108
|
+
return (e, m) => (b(), B(t(I), S(w.value, { onClose: p }), T({
|
|
109
|
+
default: y(() => [
|
|
110
|
+
A(e.$slots, "default")
|
|
111
111
|
]),
|
|
112
112
|
_: 2
|
|
113
113
|
}, [
|
|
114
|
-
e.$slots.footer ||
|
|
114
|
+
e.$slots.footer || n.showActionButtonGroup ? {
|
|
115
115
|
name: "footer",
|
|
116
|
-
fn:
|
|
117
|
-
|
|
116
|
+
fn: y(() => [
|
|
117
|
+
n.showActionButtonGroup ? (b(), B($, {
|
|
118
118
|
key: 0,
|
|
119
|
-
"show-cancel-button":
|
|
120
|
-
"show-submit-button":
|
|
119
|
+
"show-cancel-button": n.showCancelButton,
|
|
120
|
+
"show-submit-button": n.showSubmitButton,
|
|
121
121
|
"cancel-button-options": v.value,
|
|
122
122
|
"submit-button-options": k.value
|
|
123
|
-
}, null, 8, ["show-cancel-button", "show-submit-button", "cancel-button-options", "submit-button-options"])) :
|
|
123
|
+
}, null, 8, ["show-cancel-button", "show-submit-button", "cancel-button-options", "submit-button-options"])) : x("", !0)
|
|
124
124
|
]),
|
|
125
125
|
key: "0"
|
|
126
126
|
} : void 0
|