ep-craft 0.1.22 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/affix/affix.d.ts +19 -19
- package/dist/components/affix/affix.js +61 -53
- package/dist/components/alert/alert.d.ts +71 -17
- package/dist/components/alert/alert.js +99 -43
- package/dist/components/anchor/anchor.d.ts +19 -19
- package/dist/components/anchor/anchor.js +166 -102
- package/dist/components/anchor/constants.d.ts +15 -0
- package/dist/components/anchor/constants.js +4 -0
- package/dist/components/anchor-link/anchor-link.d.ts +1 -1
- package/dist/components/anchor-link/anchor-link.js +39 -26
- package/dist/components/button/EpButton.vue.d.ts +8 -8
- package/dist/components/button/EpButton.vue.js +5 -5
- package/dist/components/button/constants.d.ts +7 -0
- package/dist/components/button/constants.js +6 -0
- package/dist/components/check-tag/EpCheckTag.vue.d.ts +1 -1
- package/dist/components/collapse-transition/index.js +2 -2
- package/dist/components/config-provider/src/constants.js +4 -0
- package/dist/components/config-provider/src/hooks/use-global-config.d.ts +1 -1
- package/dist/components/config-provider/src/hooks/use-global-config.js +24 -0
- package/dist/components/form/src/constants.js +2 -1
- package/dist/components/form/src/hooks/use-form-common-props.d.ts +2 -2
- package/dist/components/form/src/hooks/use-form-common-props.js +17 -0
- package/dist/components/form/src/hooks/use-form-item.js +51 -0
- package/dist/components/icon/index.js +5 -5
- package/dist/components/menu/menu-collapse-transition.vue.js +10 -6
- package/dist/components/menu/menu.d.ts +47 -47
- package/dist/components/menu/menu.js +59 -52
- package/dist/components/menu/use-menu-color.d.ts +2 -0
- package/dist/components/menu/use-menu-color.js +11 -0
- package/dist/components/menu/use-menu-css-var.d.ts +2 -0
- package/dist/components/menu/use-menu-css-var.js +30 -0
- package/dist/components/menu/utils/menu-bar.d.ts +7 -0
- package/dist/components/menu/utils/menu-bar.js +15 -0
- package/dist/components/menu/utils/menu-item.d.ts +9 -0
- package/dist/components/menu/utils/menu-item.js +50 -0
- package/dist/components/menu/utils/submenu.d.ts +11 -0
- package/dist/components/menu/utils/submenu.js +49 -0
- package/dist/components/menu-item/EpMenuItem.vue.js +17 -13
- package/dist/components/menu-item-group/EpMenuItemGroup.vue.js +1 -1
- package/dist/components/popper/src/composables/use-content.d.ts +6 -6
- package/dist/components/popper/src/content.vue.d.ts +6 -6
- package/dist/components/popper/src/popper.d.ts +2 -2
- package/dist/components/radio/constants.d.ts +64 -0
- package/dist/components/radio/constants.js +4 -0
- package/dist/components/radio/radio.d.ts +98 -19
- package/dist/components/radio/radio.js +101 -43
- package/dist/components/radio/use-radio.d.ts +13 -0
- package/dist/components/radio/use-radio.js +43 -0
- package/dist/components/radio-button/radio-button.d.ts +46 -16
- package/dist/components/radio-button/radio-button.js +37 -29
- package/dist/components/radio-group/radio-group.d.ts +142 -28
- package/dist/components/radio-group/radio-group.js +136 -55
- package/dist/components/sub-menu/sub-menu.d.ts +19 -19
- package/dist/components/sub-menu/sub-menu.js +65 -58
- package/dist/components/tab-pane/tab-pane.d.ts +45 -8
- package/dist/components/tab-pane/tab-pane.js +66 -32
- package/dist/components/tabs/composables/use-tab-nav-touch.d.ts +19 -0
- package/dist/components/tabs/composables/use-tab-nav-touch.js +58 -0
- package/dist/components/tabs/constants.d.ts +63 -0
- package/dist/components/tabs/constants.js +4 -0
- package/dist/components/tabs/tab-bar.d.ts +97 -0
- package/dist/components/tabs/tab-bar.vue.d.ts +14 -0
- package/dist/components/tabs/tab-bar.vue.js +80 -0
- package/dist/components/tabs/tab-bar2.vue.js +4 -0
- package/dist/components/tabs/tab-nav.d.ts +295 -0
- package/dist/components/tabs/tab-nav.js +297 -0
- package/dist/components/tabs/tabs.d.ts +71 -28
- package/dist/components/tabs/tabs.js +165 -93
- package/dist/components/tag/EpTag.vue.d.ts +3 -3
- package/dist/components/tag/EpTag.vue.js +3 -3
- package/dist/components/tooltip/index.d.ts +34 -34
- package/dist/components/tooltip/index.js +12 -12
- package/dist/components/tooltip/src/content.vue.d.ts +8 -8
- package/dist/components/tooltip/src/tooltip.d.ts +2 -2
- package/dist/components/tooltip/src/tooltip.vue.d.ts +12 -12
- package/dist/components/tooltip/src/trigger.d.ts +1 -1
- package/dist/constants/event.js +5 -0
- package/dist/directives/click-outside/index.js +49 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-deprecated/index.js +25 -0
- package/dist/hooks/use-locale/index.js +24 -0
- package/dist/hooks/use-ordered-children/index.js +53 -0
- package/dist/hooks/use-popper/index.d.ts +6 -6
- package/dist/hooks/use-prop/index.js +11 -0
- package/dist/hooks/use-size/index.d.ts +3 -3
- package/dist/hooks/use-size/index.js +14 -6
- package/dist/hooks/use-wheel/defaults.d.ts +27 -0
- package/dist/hooks/use-wheel/defaults.js +4 -0
- package/dist/hooks/use-wheel/index.d.ts +13 -0
- package/dist/hooks/use-wheel/index.js +26 -0
- package/dist/utils/browser.js +6 -5
- package/dist/utils/dom/aria.js +13 -6
- package/dist/utils/dom/element.js +16 -0
- package/dist/utils/dom/position.js +18 -0
- package/dist/utils/dom/scroll.js +50 -0
- package/dist/utils/dom/style.js +40 -13
- package/dist/utils/easings.js +7 -0
- package/dist/utils/error.js +11 -7
- package/dist/utils/numbers.js +6 -0
- package/dist/utils/objects.js +7 -0
- package/dist/utils/raf.js +6 -0
- package/dist/utils/strings.js +8 -0
- package/dist/utils/throttleByRaf.js +15 -0
- package/dist/utils/types.js +19 -16
- package/dist/utils/typescript.js +4 -0
- package/dist/utils/vue/icon.js +20 -0
- package/dist/utils/vue/vnode.d.ts +4 -4
- package/dist/utils/vue/vnode.js +17 -0
- package/dist/vendored-components.d.ts +6 -3
- package/dist/vendored-components.js +11 -5
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ref as p, getCurrentInstance as n, inject as e, computed as c } from "vue";
|
|
2
|
+
import "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
import "../../../../hooks/use-size/index.js";
|
|
7
|
+
import "@popperjs/core";
|
|
8
|
+
import "../../../../hooks/use-z-index/index.js";
|
|
9
|
+
import "../../../../hooks/use-delayed-toggle/index.js";
|
|
10
|
+
import "../../../../hooks/use-aria/index.js";
|
|
11
|
+
import "../../../../hooks/use-model-toggle/index.js";
|
|
12
|
+
import "../../../../hooks/use-empty-values/index.js";
|
|
13
|
+
import { configProviderContextKey as f } from "../constants.js";
|
|
14
|
+
const t = p();
|
|
15
|
+
function I(r, i = void 0) {
|
|
16
|
+
const m = n() ? e(f, t) : t;
|
|
17
|
+
return c(() => {
|
|
18
|
+
var o;
|
|
19
|
+
return ((o = m.value) == null ? void 0 : o[r]) ?? i;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
I as useGlobalConfig
|
|
24
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentSize } from '@element-plus/constants';
|
|
2
2
|
import type { MaybeRef } from 'vue';
|
|
3
|
-
export declare const useFormSize: (fallback?: MaybeRef<ComponentSize | undefined>, ignore?: Partial<Record<"prop" | "form" | "formItem" | "global", boolean>>) => import("vue").ComputedRef<"" | "
|
|
3
|
+
export declare const useFormSize: (fallback?: MaybeRef<ComponentSize | undefined>, ignore?: Partial<Record<"prop" | "form" | "formItem" | "global", boolean>>) => import("vue").ComputedRef<"" | "small" | "default" | "large">;
|
|
4
4
|
export declare const useFormDisabled: (fallback?: MaybeRef<boolean | undefined>) => import("vue").ComputedRef<boolean>;
|
|
5
|
-
export declare const useSize: (fallback?: MaybeRef<ComponentSize | undefined>, ignore?: Partial<Record<"prop" | "form" | "formItem" | "global", boolean>>) => import("vue").ComputedRef<"" | "
|
|
5
|
+
export declare const useSize: (fallback?: MaybeRef<ComponentSize | undefined>, ignore?: Partial<Record<"prop" | "form" | "formItem" | "global", boolean>>) => import("vue").ComputedRef<"" | "small" | "default" | "large">;
|
|
6
6
|
export declare const useDisabled: (fallback?: MaybeRef<boolean | undefined>) => import("vue").ComputedRef<boolean>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ref as c, inject as r, computed as d, unref as l } from "vue";
|
|
2
|
+
import { useGlobalSize as f } from "../../../../hooks/use-size/index.js";
|
|
3
|
+
import { useProp as m } from "../../../../hooks/use-prop/index.js";
|
|
4
|
+
import { formContextKey as n, formItemContextKey as p } from "../constants.js";
|
|
5
|
+
const y = (t, o = {}) => {
|
|
6
|
+
const e = c(void 0), u = o.prop ? e : m("size"), a = o.global ? e : f(), s = o.form ? { size: void 0 } : r(n, void 0), i = o.formItem ? { size: void 0 } : r(p, void 0);
|
|
7
|
+
return d(
|
|
8
|
+
() => u.value || l(t) || (i == null ? void 0 : i.size) || (s == null ? void 0 : s.size) || a.value || ""
|
|
9
|
+
);
|
|
10
|
+
}, C = (t) => {
|
|
11
|
+
const o = m("disabled"), e = r(n, void 0);
|
|
12
|
+
return d(() => o.value ?? l(t) ?? (e == null ? void 0 : e.disabled) ?? !1);
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
C as useFormDisabled,
|
|
16
|
+
y as useFormSize
|
|
17
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { inject as f, ref as s, getCurrentInstance as y, computed as h, onMounted as t, watch as w, toRef as F, onUnmounted as L } from "vue";
|
|
2
|
+
import { useId as E } from "../../../../hooks/use-id/index.js";
|
|
3
|
+
import { formContextKey as K, formItemContextKey as U } from "../constants.js";
|
|
4
|
+
const W = () => {
|
|
5
|
+
const v = f(K, void 0), u = f(U, void 0);
|
|
6
|
+
return {
|
|
7
|
+
form: v,
|
|
8
|
+
formItem: u
|
|
9
|
+
};
|
|
10
|
+
}, k = (v, {
|
|
11
|
+
formItemContext: u,
|
|
12
|
+
disableIdGeneration: c,
|
|
13
|
+
disableIdManagement: l
|
|
14
|
+
}) => {
|
|
15
|
+
c || (c = s(!1)), l || (l = s(!1));
|
|
16
|
+
const e = y(), a = () => {
|
|
17
|
+
let r = e == null ? void 0 : e.parent;
|
|
18
|
+
for (; r; ) {
|
|
19
|
+
if (r.type.name === "ElFormItem")
|
|
20
|
+
return !1;
|
|
21
|
+
if (r.type.name === "ElLabelWrap")
|
|
22
|
+
return !0;
|
|
23
|
+
r = r.parent;
|
|
24
|
+
}
|
|
25
|
+
return !1;
|
|
26
|
+
}, p = s();
|
|
27
|
+
let n;
|
|
28
|
+
const o = h(() => {
|
|
29
|
+
var r;
|
|
30
|
+
return !!(!(v.label || v.ariaLabel) && u && u.inputIds && ((r = u.inputIds) == null ? void 0 : r.length) <= 1);
|
|
31
|
+
});
|
|
32
|
+
return t(() => {
|
|
33
|
+
n = w(
|
|
34
|
+
[F(v, "id"), c],
|
|
35
|
+
([r, d]) => {
|
|
36
|
+
const i = r ?? (d ? void 0 : E().value);
|
|
37
|
+
i !== p.value && (u != null && u.removeInputId && !a() && (p.value && u.removeInputId(p.value), !(l != null && l.value) && !d && i && u.addInputId(i)), p.value = i);
|
|
38
|
+
},
|
|
39
|
+
{ immediate: !0 }
|
|
40
|
+
);
|
|
41
|
+
}), L(() => {
|
|
42
|
+
n && n(), u != null && u.removeInputId && p.value && u.removeInputId(p.value);
|
|
43
|
+
}), {
|
|
44
|
+
isLabeledByFormItem: o,
|
|
45
|
+
inputId: p
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
W as useFormItem,
|
|
50
|
+
k as useFormItemInputId
|
|
51
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { withInstall as
|
|
1
|
+
import { withInstall as t } from "../../utils/with-install.js";
|
|
2
2
|
import "@vue/shared";
|
|
3
3
|
import "lodash-unified";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import "@element-plus/icons-vue";
|
|
6
6
|
import "vue";
|
|
7
7
|
import { withInstall as i } from "../../utils/vue/install.js";
|
|
8
|
-
import
|
|
8
|
+
import o from "./src/icon.vue.js";
|
|
9
9
|
import "./src/icon.js";
|
|
10
|
-
i(t);
|
|
11
|
-
const I = o(t, "ep-icon");
|
|
10
|
+
const f = i(o), h = t(o, "ep-icon");
|
|
12
11
|
export {
|
|
13
|
-
|
|
12
|
+
f as ElIcon,
|
|
13
|
+
h as EpIcon
|
|
14
14
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { defineComponent as r, openBlock as i, createBlock as l, Transition as
|
|
2
|
-
import { useNamespace as f } from "
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as r, openBlock as i, createBlock as l, Transition as p, mergeProps as c, withCtx as d, renderSlot as m } from "vue";
|
|
2
|
+
import { useNamespace as f } from "../../hooks/use-namespace/index.js";
|
|
3
|
+
import "@vue/shared";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import { addClass as e, hasClass as h, removeClass as a } from "../../utils/dom/style.js";
|
|
7
|
+
import "@element-plus/icons-vue";
|
|
8
|
+
const x = /* @__PURE__ */ r({
|
|
5
9
|
name: "EpMenuCollapseTransition",
|
|
6
10
|
__name: "menu-collapse-transition",
|
|
7
11
|
setup(u) {
|
|
@@ -20,7 +24,7 @@ const _ = /* @__PURE__ */ r({
|
|
|
20
24
|
e(t, "horizontal-collapse-transition"), t.style.width = `${t.dataset.scrollWidth}px`;
|
|
21
25
|
}
|
|
22
26
|
};
|
|
23
|
-
return (t, s) => (i(), l(
|
|
27
|
+
return (t, s) => (i(), l(p, c({ mode: "out-in" }, n), {
|
|
24
28
|
default: d(() => [
|
|
25
29
|
m(t.$slots, "default")
|
|
26
30
|
]),
|
|
@@ -29,5 +33,5 @@ const _ = /* @__PURE__ */ r({
|
|
|
29
33
|
}
|
|
30
34
|
});
|
|
31
35
|
export {
|
|
32
|
-
|
|
36
|
+
x as default
|
|
33
37
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import type { MenuItemClicked } from './types';
|
|
2
2
|
import type { Component, CSSProperties, ExtractPropTypes, VNode } from 'vue';
|
|
3
3
|
export declare const menuProps: {
|
|
4
|
-
readonly mode: import("element-plus/
|
|
5
|
-
readonly defaultActive: import("element-plus/
|
|
6
|
-
readonly defaultOpeneds: import("element-plus/
|
|
4
|
+
readonly mode: import("@element-plus/utils").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "vertical", boolean>;
|
|
5
|
+
readonly defaultActive: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
6
|
+
readonly defaultOpeneds: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | (((new (...args: any[]) => string[]) | (() => string[])) | null)[], unknown, unknown, () => [], boolean>;
|
|
7
7
|
readonly uniqueOpened: BooleanConstructor;
|
|
8
8
|
readonly router: BooleanConstructor;
|
|
9
|
-
readonly menuTrigger: import("element-plus/
|
|
9
|
+
readonly menuTrigger: import("@element-plus/utils").EpPropFinalized<StringConstructor, "click" | "hover", unknown, "hover", boolean>;
|
|
10
10
|
readonly collapse: BooleanConstructor;
|
|
11
11
|
readonly backgroundColor: StringConstructor;
|
|
12
12
|
readonly textColor: StringConstructor;
|
|
13
13
|
readonly activeTextColor: StringConstructor;
|
|
14
14
|
readonly closeOnClickOutside: BooleanConstructor;
|
|
15
|
-
readonly collapseTransition: import("element-plus/
|
|
16
|
-
readonly ellipsis: import("element-plus/
|
|
17
|
-
readonly popperOffset: import("element-plus/
|
|
18
|
-
readonly ellipsisIcon: import("element-plus/
|
|
19
|
-
readonly popperEffect: import("element-plus/
|
|
15
|
+
readonly collapseTransition: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
16
|
+
readonly ellipsis: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
17
|
+
readonly popperOffset: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 6, boolean>;
|
|
18
|
+
readonly ellipsisIcon: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
|
|
19
|
+
readonly popperEffect: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => "dark" | "light") | (() => "dark" | "light") | (((new (...args: any[]) => "dark" | "light") | (() => "dark" | "light")) | null)[], unknown, unknown, "dark", boolean>;
|
|
20
20
|
readonly popperClass: StringConstructor;
|
|
21
21
|
readonly popperStyle: {
|
|
22
|
-
readonly type: import("vue").PropType<import("element-plus/
|
|
22
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
|
|
23
23
|
readonly required: false;
|
|
24
24
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
25
25
|
__epPropKey: true;
|
|
26
26
|
};
|
|
27
|
-
readonly showTimeout: import("element-plus/
|
|
28
|
-
readonly hideTimeout: import("element-plus/
|
|
29
|
-
readonly persistent: import("element-plus/
|
|
27
|
+
readonly showTimeout: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 300, boolean>;
|
|
28
|
+
readonly hideTimeout: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 300, boolean>;
|
|
29
|
+
readonly persistent: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
30
30
|
};
|
|
31
31
|
export type MenuProps = ExtractPropTypes<typeof menuProps>;
|
|
32
32
|
export declare const menuEmits: {
|
|
@@ -36,32 +36,32 @@ export declare const menuEmits: {
|
|
|
36
36
|
};
|
|
37
37
|
export type MenuEmits = typeof menuEmits;
|
|
38
38
|
declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
39
|
-
readonly mode: import("element-plus/
|
|
40
|
-
readonly defaultActive: import("element-plus/
|
|
41
|
-
readonly defaultOpeneds: import("element-plus/
|
|
39
|
+
readonly mode: import("@element-plus/utils").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "vertical", boolean>;
|
|
40
|
+
readonly defaultActive: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
41
|
+
readonly defaultOpeneds: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | (((new (...args: any[]) => string[]) | (() => string[])) | null)[], unknown, unknown, () => [], boolean>;
|
|
42
42
|
readonly uniqueOpened: BooleanConstructor;
|
|
43
43
|
readonly router: BooleanConstructor;
|
|
44
|
-
readonly menuTrigger: import("element-plus/
|
|
44
|
+
readonly menuTrigger: import("@element-plus/utils").EpPropFinalized<StringConstructor, "click" | "hover", unknown, "hover", boolean>;
|
|
45
45
|
readonly collapse: BooleanConstructor;
|
|
46
46
|
readonly backgroundColor: StringConstructor;
|
|
47
47
|
readonly textColor: StringConstructor;
|
|
48
48
|
readonly activeTextColor: StringConstructor;
|
|
49
49
|
readonly closeOnClickOutside: BooleanConstructor;
|
|
50
|
-
readonly collapseTransition: import("element-plus/
|
|
51
|
-
readonly ellipsis: import("element-plus/
|
|
52
|
-
readonly popperOffset: import("element-plus/
|
|
53
|
-
readonly ellipsisIcon: import("element-plus/
|
|
54
|
-
readonly popperEffect: import("element-plus/
|
|
50
|
+
readonly collapseTransition: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
51
|
+
readonly ellipsis: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
52
|
+
readonly popperOffset: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 6, boolean>;
|
|
53
|
+
readonly ellipsisIcon: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
|
|
54
|
+
readonly popperEffect: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => "dark" | "light") | (() => "dark" | "light") | (((new (...args: any[]) => "dark" | "light") | (() => "dark" | "light")) | null)[], unknown, unknown, "dark", boolean>;
|
|
55
55
|
readonly popperClass: StringConstructor;
|
|
56
56
|
readonly popperStyle: {
|
|
57
|
-
readonly type: import("vue").PropType<import("element-plus/
|
|
57
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
|
|
58
58
|
readonly required: false;
|
|
59
59
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
60
60
|
__epPropKey: true;
|
|
61
61
|
};
|
|
62
|
-
readonly showTimeout: import("element-plus/
|
|
63
|
-
readonly hideTimeout: import("element-plus/
|
|
64
|
-
readonly persistent: import("element-plus/
|
|
62
|
+
readonly showTimeout: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 300, boolean>;
|
|
63
|
+
readonly hideTimeout: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 300, boolean>;
|
|
64
|
+
readonly persistent: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
65
65
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
66
66
|
[key: string]: any;
|
|
67
67
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -69,50 +69,50 @@ declare const _default: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
69
69
|
open: (index: string, indexPath: string[]) => boolean;
|
|
70
70
|
select: (index: string, indexPath: string[], item: MenuItemClicked, routerResult?: Promise<unknown>) => boolean;
|
|
71
71
|
}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
72
|
-
readonly mode: import("element-plus/
|
|
73
|
-
readonly defaultActive: import("element-plus/
|
|
74
|
-
readonly defaultOpeneds: import("element-plus/
|
|
72
|
+
readonly mode: import("@element-plus/utils").EpPropFinalized<StringConstructor, "horizontal" | "vertical", unknown, "vertical", boolean>;
|
|
73
|
+
readonly defaultActive: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
74
|
+
readonly defaultOpeneds: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => string[]) | (() => string[]) | (((new (...args: any[]) => string[]) | (() => string[])) | null)[], unknown, unknown, () => [], boolean>;
|
|
75
75
|
readonly uniqueOpened: BooleanConstructor;
|
|
76
76
|
readonly router: BooleanConstructor;
|
|
77
|
-
readonly menuTrigger: import("element-plus/
|
|
77
|
+
readonly menuTrigger: import("@element-plus/utils").EpPropFinalized<StringConstructor, "click" | "hover", unknown, "hover", boolean>;
|
|
78
78
|
readonly collapse: BooleanConstructor;
|
|
79
79
|
readonly backgroundColor: StringConstructor;
|
|
80
80
|
readonly textColor: StringConstructor;
|
|
81
81
|
readonly activeTextColor: StringConstructor;
|
|
82
82
|
readonly closeOnClickOutside: BooleanConstructor;
|
|
83
|
-
readonly collapseTransition: import("element-plus/
|
|
84
|
-
readonly ellipsis: import("element-plus/
|
|
85
|
-
readonly popperOffset: import("element-plus/
|
|
86
|
-
readonly ellipsisIcon: import("element-plus/
|
|
87
|
-
readonly popperEffect: import("element-plus/
|
|
83
|
+
readonly collapseTransition: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
84
|
+
readonly ellipsis: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
85
|
+
readonly popperOffset: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 6, boolean>;
|
|
86
|
+
readonly ellipsisIcon: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown, () => import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
|
|
87
|
+
readonly popperEffect: import("@element-plus/utils").EpPropFinalized<(new (...args: any[]) => "dark" | "light") | (() => "dark" | "light") | (((new (...args: any[]) => "dark" | "light") | (() => "dark" | "light")) | null)[], unknown, unknown, "dark", boolean>;
|
|
88
88
|
readonly popperClass: StringConstructor;
|
|
89
89
|
readonly popperStyle: {
|
|
90
|
-
readonly type: import("vue").PropType<import("element-plus/
|
|
90
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties) | (((new (...args: any[]) => string | CSSProperties) | (() => string | CSSProperties)) | null)[], unknown, unknown>>;
|
|
91
91
|
readonly required: false;
|
|
92
92
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
93
93
|
__epPropKey: true;
|
|
94
94
|
};
|
|
95
|
-
readonly showTimeout: import("element-plus/
|
|
96
|
-
readonly hideTimeout: import("element-plus/
|
|
97
|
-
readonly persistent: import("element-plus/
|
|
95
|
+
readonly showTimeout: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 300, boolean>;
|
|
96
|
+
readonly hideTimeout: import("@element-plus/utils").EpPropFinalized<NumberConstructor, unknown, unknown, 300, boolean>;
|
|
97
|
+
readonly persistent: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
98
98
|
}>> & Readonly<{
|
|
99
|
+
onOpen?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
99
100
|
onSelect?: ((index: string, indexPath: string[], item: MenuItemClicked, routerResult?: Promise<unknown> | undefined) => any) | undefined;
|
|
100
101
|
onClose?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
101
|
-
onOpen?: ((index: string, indexPath: string[]) => any) | undefined;
|
|
102
102
|
}>, {
|
|
103
|
-
readonly mode: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "horizontal" | "vertical", unknown>;
|
|
104
|
-
readonly persistent: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
105
103
|
readonly collapse: boolean;
|
|
106
|
-
readonly ellipsis: import("element-plus/
|
|
104
|
+
readonly ellipsis: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
105
|
+
readonly mode: import("@element-plus/utils").EpPropMergeType<StringConstructor, "horizontal" | "vertical", unknown>;
|
|
106
|
+
readonly persistent: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
107
107
|
readonly showTimeout: number;
|
|
108
108
|
readonly hideTimeout: number;
|
|
109
109
|
readonly defaultActive: string;
|
|
110
110
|
readonly defaultOpeneds: string[];
|
|
111
|
-
readonly menuTrigger: import("element-plus/
|
|
112
|
-
readonly collapseTransition: import("element-plus/
|
|
111
|
+
readonly menuTrigger: import("@element-plus/utils").EpPropMergeType<StringConstructor, "click" | "hover", unknown>;
|
|
112
|
+
readonly collapseTransition: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
113
113
|
readonly popperOffset: number;
|
|
114
|
-
readonly ellipsisIcon: import("element-plus/
|
|
115
|
-
readonly popperEffect: import("element-plus/
|
|
114
|
+
readonly ellipsisIcon: import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => (string | Component) & {}) | (() => string | Component) | (((new (...args: any[]) => (string | Component) & {}) | (() => string | Component)) | null)[], unknown, unknown>;
|
|
115
|
+
readonly popperEffect: import("@element-plus/utils").EpPropMergeType<(new (...args: any[]) => "dark" | "light") | (() => "dark" | "light") | (((new (...args: any[]) => "dark" | "light") | (() => "dark" | "light")) | null)[], unknown, unknown>;
|
|
116
116
|
readonly uniqueOpened: boolean;
|
|
117
117
|
readonly router: boolean;
|
|
118
118
|
readonly closeOnClickOutside: boolean;
|
|
@@ -1,32 +1,39 @@
|
|
|
1
|
-
import { defineComponent as Q, getCurrentInstance as X, ref as f, computed as Z, watch as x, watchEffect as ee, provide as U, reactive as te, onMounted as ne, h as I, withDirectives as
|
|
2
|
-
import { ElIcon as ue } from "
|
|
3
|
-
import { More as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
1
|
+
import { defineComponent as Q, getCurrentInstance as X, ref as f, computed as Z, watch as x, watchEffect as ee, provide as U, reactive as te, onMounted as ne, h as I, withDirectives as oe, nextTick as le } from "vue";
|
|
2
|
+
import { ElIcon as ue } from "../icon/index.js";
|
|
3
|
+
import { More as ie } from "@element-plus/icons-vue";
|
|
4
|
+
import { isString as C, isObject as ae, isArray as ce } from "@vue/shared";
|
|
5
|
+
import "lodash-unified";
|
|
6
|
+
import "@vueuse/core";
|
|
7
|
+
import { mutable as se } from "../../utils/typescript.js";
|
|
8
|
+
import { iconPropType as re } from "../../utils/vue/icon.js";
|
|
9
|
+
import { flattedChildren as de } from "../../utils/vue/vnode.js";
|
|
10
|
+
import { buildProps as fe, definePropType as N } from "../../utils/vue/props/runtime.js";
|
|
11
|
+
import { useNamespace as j } from "../../hooks/use-namespace/index.js";
|
|
12
|
+
import me from "../../directives/click-outside/index.js";
|
|
13
|
+
import "normalize-wheel-es";
|
|
14
|
+
import ve from "./utils/menu-bar.js";
|
|
15
|
+
import { useMenuCssVar as pe } from "./use-menu-css-var.js";
|
|
9
16
|
import he from "./menu-collapse-transition.vue.js";
|
|
10
17
|
import { MENU_INJECTION_KEY as ge, SUB_MENU_INJECTION_KEY as Me } from "./tokens.js";
|
|
11
18
|
import be from "../sub-menu/sub-menu.js";
|
|
12
19
|
const ye = (e) => {
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
}, Ie = (e,
|
|
16
|
-
let
|
|
20
|
+
const l = (e == null ? void 0 : e.value) ?? e;
|
|
21
|
+
return l && typeof l == "object" && "$el" in l ? l.$el : l;
|
|
22
|
+
}, Ie = (e, l) => {
|
|
23
|
+
let i;
|
|
17
24
|
const h = x(
|
|
18
25
|
e,
|
|
19
26
|
(g) => {
|
|
20
|
-
|
|
27
|
+
i == null || i.disconnect(), i = void 0, g && typeof ResizeObserver < "u" && (i = new ResizeObserver(l), i.observe(g));
|
|
21
28
|
},
|
|
22
29
|
{ immediate: !0 }
|
|
23
30
|
);
|
|
24
31
|
return {
|
|
25
32
|
stop: () => {
|
|
26
|
-
|
|
33
|
+
i == null || i.disconnect(), h();
|
|
27
34
|
}
|
|
28
35
|
};
|
|
29
|
-
}, Se =
|
|
36
|
+
}, Se = fe({
|
|
30
37
|
/** menu display mode */
|
|
31
38
|
mode: {
|
|
32
39
|
type: String,
|
|
@@ -80,8 +87,8 @@ const ye = (e) => {
|
|
|
80
87
|
},
|
|
81
88
|
/** custom ellipsis icon (available only in horizontal mode and ellipsis is true) */
|
|
82
89
|
ellipsisIcon: {
|
|
83
|
-
type:
|
|
84
|
-
default: () =>
|
|
90
|
+
type: re,
|
|
91
|
+
default: () => ie
|
|
85
92
|
},
|
|
86
93
|
/** Tooltip theme, built-in theme: `dark` / `light` when menu is collapsed */
|
|
87
94
|
popperEffect: {
|
|
@@ -109,15 +116,15 @@ const ye = (e) => {
|
|
|
109
116
|
type: Boolean,
|
|
110
117
|
default: !0
|
|
111
118
|
}
|
|
112
|
-
}), T = (e) =>
|
|
113
|
-
close: (e,
|
|
114
|
-
open: (e,
|
|
115
|
-
select: (e,
|
|
116
|
-
}, F = 64,
|
|
119
|
+
}), T = (e) => ce(e) && e.every((l) => C(l)), Oe = {
|
|
120
|
+
close: (e, l) => C(e) && T(l),
|
|
121
|
+
open: (e, l) => C(e) && T(l),
|
|
122
|
+
select: (e, l, i, h) => C(e) && T(l) && ae(i) && (h === void 0 || h instanceof Promise)
|
|
123
|
+
}, F = 64, je = Q({
|
|
117
124
|
name: "EpMenu",
|
|
118
125
|
props: Se,
|
|
119
126
|
emits: Oe,
|
|
120
|
-
setup(e, { emit:
|
|
127
|
+
setup(e, { emit: l, slots: i, expose: h }) {
|
|
121
128
|
const g = X(), P = g.appContext.config.globalProperties.$router, m = f(), k = f(), S = j("menu"), _ = j("sub-menu");
|
|
122
129
|
let z = F;
|
|
123
130
|
const v = f(-1), c = f(
|
|
@@ -127,19 +134,19 @@ const ye = (e) => {
|
|
|
127
134
|
), J = () => {
|
|
128
135
|
const t = d.value && p.value[d.value];
|
|
129
136
|
if (!t || e.mode === "horizontal" || e.collapse) return;
|
|
130
|
-
t.indexPath.forEach((
|
|
131
|
-
const
|
|
132
|
-
|
|
137
|
+
t.indexPath.forEach((o) => {
|
|
138
|
+
const a = M.value[o];
|
|
139
|
+
a && O(o, a.indexPath);
|
|
133
140
|
});
|
|
134
141
|
}, O = (t, n) => {
|
|
135
142
|
c.value.includes(t) || (e.uniqueOpened && (c.value = c.value.filter(
|
|
136
|
-
(
|
|
137
|
-
)), c.value.push(t),
|
|
143
|
+
(o) => n.includes(o)
|
|
144
|
+
)), c.value.push(t), l("open", t, n));
|
|
138
145
|
}, R = (t) => {
|
|
139
146
|
const n = c.value.indexOf(t);
|
|
140
147
|
n !== -1 && c.value.splice(n, 1);
|
|
141
148
|
}, w = (t, n) => {
|
|
142
|
-
R(t),
|
|
149
|
+
R(t), l("close", t, n);
|
|
143
150
|
}, K = ({
|
|
144
151
|
index: t,
|
|
145
152
|
indexPath: n
|
|
@@ -147,32 +154,32 @@ const ye = (e) => {
|
|
|
147
154
|
c.value.includes(t) ? w(t, n) : O(t, n);
|
|
148
155
|
}, V = (t) => {
|
|
149
156
|
(e.mode === "horizontal" || e.collapse) && (c.value = []);
|
|
150
|
-
const { index: n, indexPath:
|
|
151
|
-
if (!(n == null ||
|
|
157
|
+
const { index: n, indexPath: o } = t;
|
|
158
|
+
if (!(n == null || o == null))
|
|
152
159
|
if (e.router && P) {
|
|
153
|
-
const
|
|
154
|
-
|
|
160
|
+
const a = t.route || n, u = P.push(a).then((s) => (s || (d.value = n), s));
|
|
161
|
+
l("select", n, o, { index: n, indexPath: o, route: a }, u);
|
|
155
162
|
} else
|
|
156
|
-
d.value = n,
|
|
163
|
+
d.value = n, l("select", n, o, { index: n, indexPath: o });
|
|
157
164
|
}, A = (t) => {
|
|
158
|
-
const n = p.value,
|
|
159
|
-
d.value = (
|
|
165
|
+
const n = p.value, o = n[t] || d.value && n[d.value] || n[e.defaultActive];
|
|
166
|
+
d.value = (o == null ? void 0 : o.index) ?? t;
|
|
160
167
|
}, B = (t) => {
|
|
161
|
-
const n = getComputedStyle(t),
|
|
162
|
-
return t.offsetWidth +
|
|
168
|
+
const n = getComputedStyle(t), o = Number.parseInt(n.marginLeft, 10), a = Number.parseInt(n.marginRight, 10);
|
|
169
|
+
return t.offsetWidth + o + a || 0;
|
|
163
170
|
}, W = () => {
|
|
164
171
|
if (!m.value) return -1;
|
|
165
172
|
const t = Array.from(m.value.childNodes).filter(
|
|
166
173
|
(r) => r.nodeName !== "#comment" && (r.nodeName !== "#text" || r.nodeValue)
|
|
167
|
-
), n = getComputedStyle(m.value),
|
|
174
|
+
), n = getComputedStyle(m.value), o = Number.parseInt(n.paddingLeft, 10), a = Number.parseInt(n.paddingRight, 10), u = m.value.clientWidth - o - a;
|
|
168
175
|
let s = 0, b = 0;
|
|
169
176
|
return t.forEach((r, y) => {
|
|
170
177
|
s += B(r), s <= u - z && (b = y + 1);
|
|
171
178
|
}), b === t.length ? -1 : b;
|
|
172
179
|
}, Y = (t) => M.value[t].indexPath, H = (t, n = 33.34) => {
|
|
173
|
-
let
|
|
180
|
+
let o;
|
|
174
181
|
return () => {
|
|
175
|
-
|
|
182
|
+
o && clearTimeout(o), o = setTimeout(() => {
|
|
176
183
|
t();
|
|
177
184
|
}, n);
|
|
178
185
|
};
|
|
@@ -182,7 +189,7 @@ const ye = (e) => {
|
|
|
182
189
|
const t = ye(k);
|
|
183
190
|
if (t && (z = B(t) || F), v.value === W()) return;
|
|
184
191
|
const n = () => {
|
|
185
|
-
v.value = -1,
|
|
192
|
+
v.value = -1, le(() => {
|
|
186
193
|
v.value = W();
|
|
187
194
|
});
|
|
188
195
|
};
|
|
@@ -243,8 +250,8 @@ const ye = (e) => {
|
|
|
243
250
|
e.mode === "horizontal" && new ve(g.vnode.el, S.namespace.value);
|
|
244
251
|
}), h({
|
|
245
252
|
open: (n) => {
|
|
246
|
-
const { indexPath:
|
|
247
|
-
|
|
253
|
+
const { indexPath: o } = M.value[n];
|
|
254
|
+
o.forEach((a) => O(a, o));
|
|
248
255
|
},
|
|
249
256
|
close: R,
|
|
250
257
|
updateActiveIndex: A,
|
|
@@ -253,10 +260,10 @@ const ye = (e) => {
|
|
|
253
260
|
const G = pe(e, 0);
|
|
254
261
|
return () => {
|
|
255
262
|
var u;
|
|
256
|
-
let t = ((u =
|
|
263
|
+
let t = ((u = i.default) == null ? void 0 : u.call(i)) ?? [];
|
|
257
264
|
const n = [];
|
|
258
265
|
if (e.mode === "horizontal" && m.value) {
|
|
259
|
-
const s =
|
|
266
|
+
const s = de(t).filter((y) => (y == null ? void 0 : y.shapeFlag) !== 8), b = v.value === -1 ? s : s.slice(0, v.value), r = v.value === -1 ? [] : s.slice(v.value);
|
|
260
267
|
r != null && r.length && e.ellipsis && (t = b, n.push(
|
|
261
268
|
I(
|
|
262
269
|
be,
|
|
@@ -281,16 +288,16 @@ const ye = (e) => {
|
|
|
281
288
|
)
|
|
282
289
|
));
|
|
283
290
|
}
|
|
284
|
-
const
|
|
291
|
+
const o = e.closeOnClickOutside ? [
|
|
285
292
|
[
|
|
286
293
|
me,
|
|
287
294
|
() => {
|
|
288
295
|
c.value.length && ($.value || (c.value.forEach(
|
|
289
|
-
(s) =>
|
|
296
|
+
(s) => l("close", s, Y(s))
|
|
290
297
|
), c.value = []));
|
|
291
298
|
}
|
|
292
299
|
]
|
|
293
|
-
] : [],
|
|
300
|
+
] : [], a = oe(
|
|
294
301
|
I(
|
|
295
302
|
"ul",
|
|
296
303
|
{
|
|
@@ -306,14 +313,14 @@ const ye = (e) => {
|
|
|
306
313
|
},
|
|
307
314
|
[...t, ...n]
|
|
308
315
|
),
|
|
309
|
-
|
|
316
|
+
o
|
|
310
317
|
);
|
|
311
|
-
return e.collapseTransition && e.mode === "vertical" ? I(he, () =>
|
|
318
|
+
return e.collapseTransition && e.mode === "vertical" ? I(he, () => a) : a;
|
|
312
319
|
};
|
|
313
320
|
}
|
|
314
321
|
});
|
|
315
322
|
export {
|
|
316
|
-
|
|
323
|
+
je as default,
|
|
317
324
|
Oe as menuEmits,
|
|
318
325
|
Se as menuProps
|
|
319
326
|
};
|