ep-craft 0.1.16 → 0.1.18
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/radio/index.d.ts +2 -2
- package/dist/components/radio/index.js +3 -4
- package/dist/components/radio/radio.d.ts +51 -0
- package/dist/components/radio/radio.js +75 -0
- package/dist/components/radio-button/index.d.ts +2 -2
- package/dist/components/radio-button/index.js +6 -4
- package/dist/components/radio-button/radio-button.d.ts +40 -0
- package/dist/components/radio-button/radio-button.js +61 -0
- package/dist/components/radio-group/index.d.ts +2 -2
- package/dist/components/radio-group/index.js +6 -4
- package/dist/components/radio-group/radio-group.d.ts +66 -0
- package/dist/components/radio-group/radio-group.js +89 -0
- package/dist/components/tab-pane/index.d.ts +2 -2
- package/dist/components/tab-pane/index.js +6 -4
- package/dist/components/tab-pane/tab-pane.d.ts +31 -0
- package/dist/components/tab-pane/tab-pane.js +58 -0
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tabs/index.js +4 -5
- package/dist/components/tabs/tabs.d.ts +111 -0
- package/dist/components/tabs/tabs.js +133 -0
- package/dist/node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/tabs/index.js +2 -2
- package/dist/node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/tabs/src/tabs.js +5 -5
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/index.js";
|
|
2
1
|
import { withInstall as o } from "../../utils/with-install.js";
|
|
3
|
-
import
|
|
4
|
-
const t =
|
|
2
|
+
import i from "./radio.js";
|
|
3
|
+
const t = o(i, "ep-radio");
|
|
5
4
|
export {
|
|
6
|
-
|
|
5
|
+
t as EpRadio
|
|
7
6
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EpRadio —— 从 element-plus 的 radio 源码 vendored 而来(el -> ep 命名),
|
|
3
|
+
* 样式复用仓库内置的 theme-chalk/src/radio.scss(命名空间为 el)。
|
|
4
|
+
*
|
|
5
|
+
* 注意:radio 通过 inject(radioGroupKey) 识别父级 EpRadioGroup,该 key 与
|
|
6
|
+
* EpRadioGroup 共用 element-plus constants.mjs 中的同一 Symbol,父子识别
|
|
7
|
+
* 不受组件改名影响。
|
|
8
|
+
*/
|
|
9
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
readonly border: BooleanConstructor;
|
|
11
|
+
readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
12
|
+
readonly size: {
|
|
13
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
14
|
+
readonly required: false;
|
|
15
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
16
|
+
__epPropKey: true;
|
|
17
|
+
};
|
|
18
|
+
readonly disabled: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
19
|
+
readonly label: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
20
|
+
readonly value: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
21
|
+
readonly name: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
22
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
|
+
"update:modelValue": (val: string | number | boolean | undefined) => val is string | number | boolean;
|
|
26
|
+
change: (val: string | number | boolean | undefined) => val is string | number | boolean;
|
|
27
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
readonly border: BooleanConstructor;
|
|
29
|
+
readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
30
|
+
readonly size: {
|
|
31
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
32
|
+
readonly required: false;
|
|
33
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
34
|
+
__epPropKey: true;
|
|
35
|
+
};
|
|
36
|
+
readonly disabled: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
37
|
+
readonly label: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
38
|
+
readonly value: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
39
|
+
readonly name: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
40
|
+
}>> & Readonly<{
|
|
41
|
+
onChange?: ((val: string | number | boolean | undefined) => any) | undefined;
|
|
42
|
+
"onUpdate:modelValue"?: ((val: string | number | boolean | undefined) => any) | undefined;
|
|
43
|
+
}>, {
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly disabled: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
46
|
+
readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropMergeType<(BooleanConstructor | StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
47
|
+
readonly value: import("element-plus/es/utils/index.mjs").EpPropMergeType<(BooleanConstructor | StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
48
|
+
readonly label: import("element-plus/es/utils/index.mjs").EpPropMergeType<(BooleanConstructor | StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
49
|
+
readonly border: boolean;
|
|
50
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
51
|
+
export default _default;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { defineComponent as f, h as l, withDirectives as b, withModifiers as t, vModelRadio as h, renderSlot as E, nextTick as k } from "vue";
|
|
2
|
+
import { CHANGE_EVENT as C } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/constants/event.js";
|
|
3
|
+
import { useNamespace as R } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
|
|
4
|
+
import { radioEmits as V, radioProps as g } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/radio/src/radio.js";
|
|
5
|
+
import { useRadio as w } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/radio/src/use-radio.js";
|
|
6
|
+
const _ = f({
|
|
7
|
+
name: "EpRadio",
|
|
8
|
+
props: g,
|
|
9
|
+
emits: V,
|
|
10
|
+
setup(o, { emit: n, slots: r }) {
|
|
11
|
+
const e = R("radio"), { radioRef: c, radioGroup: i, focus: u, size: m, disabled: d, modelValue: a, actualValue: s } = w(o, n), v = () => {
|
|
12
|
+
k(() => n(C, a.value));
|
|
13
|
+
};
|
|
14
|
+
return () => l(
|
|
15
|
+
"label",
|
|
16
|
+
{
|
|
17
|
+
class: [
|
|
18
|
+
e.b(),
|
|
19
|
+
e.is("disabled", d.value),
|
|
20
|
+
e.is("focus", u.value),
|
|
21
|
+
e.is("bordered", o.border),
|
|
22
|
+
e.is("checked", a.value === s.value),
|
|
23
|
+
e.m(m.value)
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
[
|
|
27
|
+
l(
|
|
28
|
+
"span",
|
|
29
|
+
{
|
|
30
|
+
class: [
|
|
31
|
+
e.e("input"),
|
|
32
|
+
e.is("disabled", d.value),
|
|
33
|
+
e.is("checked", a.value === s.value)
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
[
|
|
37
|
+
b(
|
|
38
|
+
l("input", {
|
|
39
|
+
ref: c,
|
|
40
|
+
class: e.e("original"),
|
|
41
|
+
value: s.value,
|
|
42
|
+
name: o.name || (i == null ? void 0 : i.name),
|
|
43
|
+
disabled: d.value,
|
|
44
|
+
checked: a.value === s.value,
|
|
45
|
+
type: "radio",
|
|
46
|
+
onFocus: () => u.value = !0,
|
|
47
|
+
onBlur: () => u.value = !1,
|
|
48
|
+
onChange: v,
|
|
49
|
+
onClick: t(() => {
|
|
50
|
+
}, ["stop"]),
|
|
51
|
+
"onUpdate:modelValue": (p) => {
|
|
52
|
+
a.value = p;
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
[[h, a.value]]
|
|
56
|
+
),
|
|
57
|
+
l("span", { class: e.e("inner") })
|
|
58
|
+
]
|
|
59
|
+
),
|
|
60
|
+
l(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
class: e.e("label"),
|
|
64
|
+
onKeydown: t(() => {
|
|
65
|
+
}, ["stop"])
|
|
66
|
+
},
|
|
67
|
+
[E(r, "default", {}, () => [o.label])]
|
|
68
|
+
)
|
|
69
|
+
]
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export {
|
|
74
|
+
_ as default
|
|
75
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
|
-
import
|
|
3
|
-
export declare const EpRadioButton: typeof
|
|
2
|
+
import _EpRadioButton from './radio-button';
|
|
3
|
+
export declare const EpRadioButton: typeof _EpRadioButton & Plugin;
|
|
4
4
|
export default EpRadioButton;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { withInstall as o } from "../../utils/with-install.js";
|
|
2
|
+
import t from "./radio-button.js";
|
|
3
|
+
const r = o(
|
|
4
|
+
t,
|
|
5
|
+
"ep-radio-button"
|
|
6
|
+
);
|
|
5
7
|
export {
|
|
6
8
|
r as EpRadioButton
|
|
7
9
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EpRadioButton —— 从 element-plus 的 radio-button 源码 vendored 而来
|
|
3
|
+
* (el -> ep 命名),样式复用仓库内置的 theme-chalk/src/radio.scss(命名空间为 el)。
|
|
4
|
+
*
|
|
5
|
+
* 注意:同 EpRadio,通过 inject(radioGroupKey) 识别父级 EpRadioGroup。
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
9
|
+
readonly size: {
|
|
10
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
11
|
+
readonly required: false;
|
|
12
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
13
|
+
__epPropKey: true;
|
|
14
|
+
};
|
|
15
|
+
readonly disabled: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
16
|
+
readonly label: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
17
|
+
readonly value: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
18
|
+
readonly name: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
19
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
23
|
+
readonly size: {
|
|
24
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
25
|
+
readonly required: false;
|
|
26
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
27
|
+
__epPropKey: true;
|
|
28
|
+
};
|
|
29
|
+
readonly disabled: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
30
|
+
readonly label: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
31
|
+
readonly value: import("element-plus/es/utils/index.mjs").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
32
|
+
readonly name: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
33
|
+
}>> & Readonly<{}>, {
|
|
34
|
+
readonly name: string;
|
|
35
|
+
readonly disabled: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
36
|
+
readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropMergeType<(BooleanConstructor | StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
37
|
+
readonly value: import("element-plus/es/utils/index.mjs").EpPropMergeType<(BooleanConstructor | StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
38
|
+
readonly label: import("element-plus/es/utils/index.mjs").EpPropMergeType<(BooleanConstructor | StringConstructor | NumberConstructor)[], unknown, unknown>;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { defineComponent as b, computed as r, h as s, withDirectives as p, withModifiers as i, vModelRadio as C, renderSlot as R } from "vue";
|
|
2
|
+
import { useNamespace as h } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
|
|
3
|
+
import { radioButtonProps as w } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/radio/src/radio-button.js";
|
|
4
|
+
import { useRadio as x } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/radio/src/use-radio.js";
|
|
5
|
+
const g = b({
|
|
6
|
+
name: "EpRadioButton",
|
|
7
|
+
props: w,
|
|
8
|
+
setup(a, { slots: d }) {
|
|
9
|
+
const l = h("radio"), { radioRef: c, focus: o, size: v, disabled: u, modelValue: t, radioGroup: e, actualValue: n } = x(a), m = r(() => ({
|
|
10
|
+
backgroundColor: (e == null ? void 0 : e.fill) || "",
|
|
11
|
+
borderColor: (e == null ? void 0 : e.fill) || "",
|
|
12
|
+
boxShadow: e != null && e.fill ? `-1px 0 0 0 ${e.fill}` : "",
|
|
13
|
+
color: (e == null ? void 0 : e.textColor) || ""
|
|
14
|
+
}));
|
|
15
|
+
return () => s(
|
|
16
|
+
"label",
|
|
17
|
+
{
|
|
18
|
+
class: [
|
|
19
|
+
l.b("button"),
|
|
20
|
+
l.is("active", t.value === n.value),
|
|
21
|
+
l.is("disabled", u.value),
|
|
22
|
+
l.is("focus", o.value),
|
|
23
|
+
l.bm("button", v.value)
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
[
|
|
27
|
+
p(
|
|
28
|
+
s("input", {
|
|
29
|
+
ref: c,
|
|
30
|
+
class: l.be("button", "original-radio"),
|
|
31
|
+
value: n.value,
|
|
32
|
+
type: "radio",
|
|
33
|
+
name: a.name || (e == null ? void 0 : e.name),
|
|
34
|
+
disabled: u.value,
|
|
35
|
+
onFocus: () => o.value = !0,
|
|
36
|
+
onBlur: () => o.value = !1,
|
|
37
|
+
onClick: i(() => {
|
|
38
|
+
}, ["stop"]),
|
|
39
|
+
"onUpdate:modelValue": (f) => {
|
|
40
|
+
t.value = f;
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
[[C, t.value]]
|
|
44
|
+
),
|
|
45
|
+
s(
|
|
46
|
+
"span",
|
|
47
|
+
{
|
|
48
|
+
class: l.be("button", "inner"),
|
|
49
|
+
style: t.value === n.value ? m.value : {},
|
|
50
|
+
onKeydown: i(() => {
|
|
51
|
+
}, ["stop"])
|
|
52
|
+
},
|
|
53
|
+
[R(d, "default", {}, () => [a.label])]
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
export {
|
|
60
|
+
g as default
|
|
61
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
|
-
import
|
|
3
|
-
export declare const EpRadioGroup: typeof
|
|
2
|
+
import _EpRadioGroup from './radio-group';
|
|
3
|
+
export declare const EpRadioGroup: typeof _EpRadioGroup & Plugin;
|
|
4
4
|
export default EpRadioGroup;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/index.js";
|
|
2
1
|
import { withInstall as o } from "../../utils/with-install.js";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import p from "./radio-group.js";
|
|
3
|
+
const t = o(
|
|
4
|
+
p,
|
|
5
|
+
"ep-radio-group"
|
|
6
|
+
);
|
|
5
7
|
export {
|
|
6
|
-
|
|
8
|
+
t as EpRadioGroup
|
|
7
9
|
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
readonly ariaLabel: StringConstructor;
|
|
3
|
+
readonly id: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
4
|
+
readonly size: {
|
|
5
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
6
|
+
readonly required: false;
|
|
7
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
8
|
+
__epPropKey: true;
|
|
9
|
+
};
|
|
10
|
+
readonly disabled: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
11
|
+
readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, undefined, boolean>;
|
|
12
|
+
readonly fill: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
13
|
+
readonly textColor: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
14
|
+
readonly name: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
15
|
+
readonly validateEvent: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
16
|
+
readonly options: {
|
|
17
|
+
readonly type: import("vue").PropType<import("element-plus").radioOption[]>;
|
|
18
|
+
readonly required: false;
|
|
19
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
20
|
+
__epPropKey: true;
|
|
21
|
+
};
|
|
22
|
+
readonly props: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").radioOptionProp) | (() => import("element-plus").radioOptionProp) | (((new (...args: any[]) => import("element-plus").radioOptionProp) | (() => import("element-plus").radioOptionProp)) | null)[], unknown, unknown, () => Required<import("element-plus").radioOptionProp>, boolean>;
|
|
23
|
+
readonly type: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "button" | "radio", unknown, "radio", boolean>;
|
|
24
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
|
+
"update:modelValue": (val: string | number | boolean | undefined) => val is string | number | boolean;
|
|
28
|
+
change: (val: string | number | boolean | undefined) => val is string | number | boolean;
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
30
|
+
readonly ariaLabel: StringConstructor;
|
|
31
|
+
readonly id: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
32
|
+
readonly size: {
|
|
33
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
|
|
34
|
+
readonly required: false;
|
|
35
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
36
|
+
__epPropKey: true;
|
|
37
|
+
};
|
|
38
|
+
readonly disabled: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
39
|
+
readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown, undefined, boolean>;
|
|
40
|
+
readonly fill: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
41
|
+
readonly textColor: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
42
|
+
readonly name: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
43
|
+
readonly validateEvent: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
44
|
+
readonly options: {
|
|
45
|
+
readonly type: import("vue").PropType<import("element-plus").radioOption[]>;
|
|
46
|
+
readonly required: false;
|
|
47
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
48
|
+
__epPropKey: true;
|
|
49
|
+
};
|
|
50
|
+
readonly props: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => import("element-plus").radioOptionProp) | (() => import("element-plus").radioOptionProp) | (((new (...args: any[]) => import("element-plus").radioOptionProp) | (() => import("element-plus").radioOptionProp)) | null)[], unknown, unknown, () => Required<import("element-plus").radioOptionProp>, boolean>;
|
|
51
|
+
readonly type: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "button" | "radio", unknown, "radio", boolean>;
|
|
52
|
+
}>> & Readonly<{
|
|
53
|
+
onChange?: ((val: string | number | boolean | undefined) => any) | undefined;
|
|
54
|
+
"onUpdate:modelValue"?: ((val: string | number | boolean | undefined) => any) | undefined;
|
|
55
|
+
}>, {
|
|
56
|
+
readonly props: import("element-plus").radioOptionProp;
|
|
57
|
+
readonly name: string;
|
|
58
|
+
readonly fill: string;
|
|
59
|
+
readonly type: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "button" | "radio", unknown>;
|
|
60
|
+
readonly id: string;
|
|
61
|
+
readonly disabled: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
62
|
+
readonly modelValue: import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor, BooleanConstructor], unknown, unknown>;
|
|
63
|
+
readonly validateEvent: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
64
|
+
readonly textColor: string;
|
|
65
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
66
|
+
export default _default;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineComponent as h, ref as G, onMounted as P, computed as u, provide as R, reactive as _, toRefs as L, watch as x, h as s, renderSlot as A, Fragment as C, renderList as F, mergeProps as N, nextTick as T } from "vue";
|
|
2
|
+
import { UPDATE_MODEL_EVENT as k, CHANGE_EVENT as D } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/constants/event.js";
|
|
3
|
+
import { useNamespace as V } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
|
|
4
|
+
import { useId as B } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-id/index.js";
|
|
5
|
+
import { useFormItem as M, useFormItemInputId as O } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/form/src/hooks/use-form-item.js";
|
|
6
|
+
import { radioGroupKey as S } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/radio/src/constants.js";
|
|
7
|
+
import { radioGroupEmits as q, radioGroupProps as w, radioDefaultProps as H } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/radio/src/radio-group.js";
|
|
8
|
+
import K from "../radio/radio.js";
|
|
9
|
+
import U from "../radio-button/radio-button.js";
|
|
10
|
+
const j = (o, i) => {
|
|
11
|
+
const n = { ...o };
|
|
12
|
+
return i.forEach((l) => delete n[l]), n;
|
|
13
|
+
}, oe = h({
|
|
14
|
+
name: "EpRadioGroup",
|
|
15
|
+
props: w,
|
|
16
|
+
emits: q,
|
|
17
|
+
setup(o, { emit: i, slots: n }) {
|
|
18
|
+
const l = V("radio"), p = B(), m = G(), { formItem: r } = M(), { inputId: f, isLabeledByFormItem: c } = O(o, {
|
|
19
|
+
formItemContext: r
|
|
20
|
+
}), v = (e) => {
|
|
21
|
+
i(k, e), T(() => i(D, e));
|
|
22
|
+
};
|
|
23
|
+
P(() => {
|
|
24
|
+
var a;
|
|
25
|
+
const e = (a = m.value) == null ? void 0 : a.querySelectorAll("[type=radio]"), t = e == null ? void 0 : e[0];
|
|
26
|
+
!Array.from(e ?? []).some(
|
|
27
|
+
(d) => d.checked
|
|
28
|
+
) && t && (t.tabIndex = 0);
|
|
29
|
+
});
|
|
30
|
+
const b = u(() => o.name || p.value), E = u(() => ({
|
|
31
|
+
...H,
|
|
32
|
+
...o.props
|
|
33
|
+
})), g = (e) => {
|
|
34
|
+
const { label: t, value: a, disabled: d } = E.value, y = {
|
|
35
|
+
label: e[t],
|
|
36
|
+
value: e[a],
|
|
37
|
+
disabled: e[d]
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
...j(e, [t, a, d]),
|
|
41
|
+
...y
|
|
42
|
+
};
|
|
43
|
+
}, I = u(
|
|
44
|
+
() => o.type === "button" ? U : K
|
|
45
|
+
);
|
|
46
|
+
return R(
|
|
47
|
+
S,
|
|
48
|
+
_({
|
|
49
|
+
...L(o),
|
|
50
|
+
changeEvent: v,
|
|
51
|
+
name: b
|
|
52
|
+
})
|
|
53
|
+
), x(
|
|
54
|
+
() => o.modelValue,
|
|
55
|
+
(e, t) => {
|
|
56
|
+
o.validateEvent && e !== t && (r == null || r.validate("change").catch(() => {
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
), () => s(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
id: f.value,
|
|
63
|
+
ref: m,
|
|
64
|
+
class: l.b("group"),
|
|
65
|
+
role: "radiogroup",
|
|
66
|
+
"aria-label": c.value ? void 0 : o.ariaLabel || "radio-group",
|
|
67
|
+
"aria-labelledby": c.value ? r == null ? void 0 : r.labelId : void 0
|
|
68
|
+
},
|
|
69
|
+
[
|
|
70
|
+
A(n, "default", {}, () => [
|
|
71
|
+
s(
|
|
72
|
+
C,
|
|
73
|
+
null,
|
|
74
|
+
F(
|
|
75
|
+
o.options,
|
|
76
|
+
(e, t) => s(
|
|
77
|
+
I.value,
|
|
78
|
+
N({ key: t }, g(e))
|
|
79
|
+
)
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
|
+
])
|
|
83
|
+
]
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
oe as default
|
|
89
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/index.js";
|
|
2
1
|
import { withInstall as a } from "../../utils/with-install.js";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import p from "./tab-pane.js";
|
|
3
|
+
const e = a(
|
|
4
|
+
p,
|
|
5
|
+
"ep-tab-pane"
|
|
6
|
+
);
|
|
5
7
|
export {
|
|
6
|
-
|
|
8
|
+
e as EpTabPane
|
|
7
9
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
readonly label: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
3
|
+
readonly name: {
|
|
4
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
|
|
5
|
+
readonly required: false;
|
|
6
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
7
|
+
__epPropKey: true;
|
|
8
|
+
};
|
|
9
|
+
readonly closable: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
10
|
+
readonly disabled: BooleanConstructor;
|
|
11
|
+
readonly lazy: BooleanConstructor;
|
|
12
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
readonly label: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
16
|
+
readonly name: {
|
|
17
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
|
|
18
|
+
readonly required: false;
|
|
19
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
20
|
+
__epPropKey: true;
|
|
21
|
+
};
|
|
22
|
+
readonly closable: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
23
|
+
readonly disabled: BooleanConstructor;
|
|
24
|
+
readonly lazy: BooleanConstructor;
|
|
25
|
+
}>> & Readonly<{}>, {
|
|
26
|
+
readonly closable: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
27
|
+
readonly disabled: boolean;
|
|
28
|
+
readonly label: string;
|
|
29
|
+
readonly lazy: boolean;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { defineComponent as P, getCurrentInstance as N, inject as C, ref as c, computed as o, watch as E, reactive as g, onBeforeUnmount as R, onBeforeUpdate as w, withDirectives as x, h as y, renderSlot as B, vShow as T, createCommentVNode as $ } from "vue";
|
|
2
|
+
import { throwError as I } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/error.js";
|
|
3
|
+
import { useNamespace as M } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
|
|
4
|
+
import { tabsRootContextKey as O } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/tabs/src/constants.js";
|
|
5
|
+
import { tabPaneProps as S } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/tabs/src/tab-pane.js";
|
|
6
|
+
const v = "EpTabPane", A = P({
|
|
7
|
+
name: v,
|
|
8
|
+
props: S,
|
|
9
|
+
setup(n, { slots: r }) {
|
|
10
|
+
const u = N(), a = C(O);
|
|
11
|
+
a || I(v, "usage: <ep-tabs><ep-tab-pane /></ep-tabs/>");
|
|
12
|
+
const p = M("tab-pane"), i = c(), s = c(), b = o(() => n.closable ?? a.props.closable), t = o(
|
|
13
|
+
() => a.currentName.value === (n.name ?? s.value)
|
|
14
|
+
), d = c(t.value), l = o(() => n.name ?? s.value), f = o(
|
|
15
|
+
() => !n.lazy || d.value || t.value
|
|
16
|
+
), h = () => {
|
|
17
|
+
var e;
|
|
18
|
+
return (e = i.value) == null ? void 0 : e.contains(document.activeElement);
|
|
19
|
+
};
|
|
20
|
+
E(t, (e) => {
|
|
21
|
+
e && (d.value = !0);
|
|
22
|
+
});
|
|
23
|
+
const m = g({
|
|
24
|
+
uid: u.uid,
|
|
25
|
+
getVnode: () => u.vnode,
|
|
26
|
+
slots: r,
|
|
27
|
+
props: n,
|
|
28
|
+
paneName: l,
|
|
29
|
+
active: t,
|
|
30
|
+
index: s,
|
|
31
|
+
isClosable: b,
|
|
32
|
+
isFocusInsidePane: h
|
|
33
|
+
});
|
|
34
|
+
return a.registerPane(m), R(() => {
|
|
35
|
+
a.unregisterPane(m);
|
|
36
|
+
}), w(() => {
|
|
37
|
+
var e;
|
|
38
|
+
r.label && ((e = a.nav$.value) == null || e.scheduleRender());
|
|
39
|
+
}), () => f.value ? x(
|
|
40
|
+
y(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
id: `pane-${l.value}`,
|
|
44
|
+
ref: i,
|
|
45
|
+
class: p.b(),
|
|
46
|
+
role: "tabpanel",
|
|
47
|
+
"aria-hidden": !t.value,
|
|
48
|
+
"aria-labelledby": `tab-${l.value}`
|
|
49
|
+
},
|
|
50
|
+
[B(r, "default")]
|
|
51
|
+
),
|
|
52
|
+
[[T, t.value]]
|
|
53
|
+
) : $("v-if", !0);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
A as default
|
|
58
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const a = Object.assign({}, t, { name: "EpTabs" }), m = s(a, "ep-tabs");
|
|
1
|
+
import { withInstall as t } from "../../utils/with-install.js";
|
|
2
|
+
import o from "./tabs.js";
|
|
3
|
+
const s = t(o, "ep-tabs");
|
|
5
4
|
export {
|
|
6
|
-
|
|
5
|
+
s as EpTabs
|
|
7
6
|
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
import type { TabPaneName, TabsPaneContext } from 'element-plus/es/components/tabs/src/constants.mjs';
|
|
3
|
+
/**
|
|
4
|
+
* EpTabs —— 从 element-plus 的 tabs 源码 vendored 而来(el -> ep 命名),
|
|
5
|
+
* 样式复用仓库内置的 theme-chalk/src/tabs.scss(命名空间为 el)。
|
|
6
|
+
*
|
|
7
|
+
* 注意:内部通过 useOrderedChildren 按子组件 name 匹配 TabPane,
|
|
8
|
+
* 因此必须将子组件命名为 EpTabPane(对应 useOrderedChildren(..., 'EpTabPane')),
|
|
9
|
+
* 否则用改名包装(ElTabs -> EpTabs)会导致 TabPane 无法被识别、标签页不展示。
|
|
10
|
+
*/
|
|
11
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
12
|
+
readonly type: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "" | "card" | "border-card", unknown, "", boolean>;
|
|
13
|
+
readonly closable: BooleanConstructor;
|
|
14
|
+
readonly addable: BooleanConstructor;
|
|
15
|
+
readonly modelValue: {
|
|
16
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
|
|
17
|
+
readonly required: false;
|
|
18
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
19
|
+
__epPropKey: true;
|
|
20
|
+
};
|
|
21
|
+
readonly defaultValue: {
|
|
22
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
|
|
23
|
+
readonly required: false;
|
|
24
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
25
|
+
__epPropKey: true;
|
|
26
|
+
};
|
|
27
|
+
readonly editable: BooleanConstructor;
|
|
28
|
+
readonly tabPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right" | "bottom" | "top", unknown, "top", boolean>;
|
|
29
|
+
readonly beforeLeave: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>) | (() => (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>) | {
|
|
30
|
+
(): (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>;
|
|
31
|
+
new (): any;
|
|
32
|
+
readonly prototype: any;
|
|
33
|
+
} | (((new (...args: any[]) => (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>) | (() => (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>) | {
|
|
34
|
+
(): (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>;
|
|
35
|
+
new (): any;
|
|
36
|
+
readonly prototype: any;
|
|
37
|
+
}) | null)[], unknown, unknown, () => true, boolean>;
|
|
38
|
+
readonly stretch: BooleanConstructor;
|
|
39
|
+
readonly tabindex: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 0, boolean>;
|
|
40
|
+
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
|
+
"update:modelValue": (name: TabPaneName) => name is string | number;
|
|
44
|
+
tabClick: (pane: TabsPaneContext, ev: Event) => boolean;
|
|
45
|
+
tabChange: (name: TabPaneName) => name is string | number;
|
|
46
|
+
edit: (paneName: TabPaneName | undefined, action: "remove" | "add") => boolean;
|
|
47
|
+
tabRemove: (name: TabPaneName) => name is string | number;
|
|
48
|
+
tabAdd: () => boolean;
|
|
49
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
50
|
+
readonly type: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "" | "card" | "border-card", unknown, "", boolean>;
|
|
51
|
+
readonly closable: BooleanConstructor;
|
|
52
|
+
readonly addable: BooleanConstructor;
|
|
53
|
+
readonly modelValue: {
|
|
54
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
|
|
55
|
+
readonly required: false;
|
|
56
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
57
|
+
__epPropKey: true;
|
|
58
|
+
};
|
|
59
|
+
readonly defaultValue: {
|
|
60
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>>;
|
|
61
|
+
readonly required: false;
|
|
62
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
63
|
+
__epPropKey: true;
|
|
64
|
+
};
|
|
65
|
+
readonly editable: BooleanConstructor;
|
|
66
|
+
readonly tabPosition: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "left" | "right" | "bottom" | "top", unknown, "top", boolean>;
|
|
67
|
+
readonly beforeLeave: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>) | (() => (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>) | {
|
|
68
|
+
(): (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>;
|
|
69
|
+
new (): any;
|
|
70
|
+
readonly prototype: any;
|
|
71
|
+
} | (((new (...args: any[]) => (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>) | (() => (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>) | {
|
|
72
|
+
(): (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>;
|
|
73
|
+
new (): any;
|
|
74
|
+
readonly prototype: any;
|
|
75
|
+
}) | null)[], unknown, unknown, () => true, boolean>;
|
|
76
|
+
readonly stretch: BooleanConstructor;
|
|
77
|
+
readonly tabindex: import("element-plus/es/utils/index.mjs").EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 0, boolean>;
|
|
78
|
+
}>> & Readonly<{
|
|
79
|
+
"onUpdate:modelValue"?: ((name: TabPaneName) => any) | undefined;
|
|
80
|
+
onTabClick?: ((pane: {
|
|
81
|
+
uid: number;
|
|
82
|
+
getVnode: () => VNode;
|
|
83
|
+
slots: import("vue").Slots;
|
|
84
|
+
props: {
|
|
85
|
+
label?: string | undefined;
|
|
86
|
+
name?: string | number | undefined;
|
|
87
|
+
closable?: boolean | undefined;
|
|
88
|
+
disabled?: boolean | undefined;
|
|
89
|
+
lazy?: boolean | undefined;
|
|
90
|
+
};
|
|
91
|
+
paneName: TabPaneName | undefined;
|
|
92
|
+
active: boolean;
|
|
93
|
+
index: string | undefined;
|
|
94
|
+
isClosable: boolean;
|
|
95
|
+
isFocusInsidePane: () => boolean | undefined;
|
|
96
|
+
}, ev: Event) => any) | undefined;
|
|
97
|
+
onTabChange?: ((name: TabPaneName) => any) | undefined;
|
|
98
|
+
onEdit?: ((paneName: TabPaneName | undefined, action: "add" | "remove") => any) | undefined;
|
|
99
|
+
onTabRemove?: ((name: TabPaneName) => any) | undefined;
|
|
100
|
+
onTabAdd?: (() => any) | undefined;
|
|
101
|
+
}>, {
|
|
102
|
+
readonly type: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "card" | "border-card", unknown>;
|
|
103
|
+
readonly closable: boolean;
|
|
104
|
+
readonly tabindex: import("element-plus/es/utils/index.mjs").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
105
|
+
readonly editable: boolean;
|
|
106
|
+
readonly stretch: boolean;
|
|
107
|
+
readonly addable: boolean;
|
|
108
|
+
readonly tabPosition: import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "top" | "bottom" | "right" | "left", unknown>;
|
|
109
|
+
readonly beforeLeave: (newName: TabPaneName, oldName: TabPaneName) => import("element-plus/es/utils/typescript.mjs").Awaitable<void | boolean>;
|
|
110
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
111
|
+
export default _default;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { defineComponent as F, computed as I, getCurrentInstance as L, ref as E, watch as p, nextTick as S, provide as D, h as i, renderSlot as y } from "vue";
|
|
2
|
+
import { Plus as K } from "../../node_modules/.pnpm/@element-plus_icons-vue@2.3.2_vue@3.5.40_typescript@5.9.3_/node_modules/@element-plus/icons-vue/dist/index.js";
|
|
3
|
+
import { EVENT_CODE as N } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/constants/aria.js";
|
|
4
|
+
import { UPDATE_MODEL_EVENT as O } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/constants/event.js";
|
|
5
|
+
import { getEventCode as U } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/dom/event.js";
|
|
6
|
+
import { isUndefined as b } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/utils/types.js";
|
|
7
|
+
import { useNamespace as M } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-namespace/index.js";
|
|
8
|
+
import { useOrderedChildren as B } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/hooks/use-ordered-children/index.js";
|
|
9
|
+
import { ElIcon as $ } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/icon/index.js";
|
|
10
|
+
import { tabsRootContextKey as j } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/tabs/src/constants.js";
|
|
11
|
+
import { tabsEmits as q, tabsProps as z } from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/tabs/src/tabs.js";
|
|
12
|
+
import G from "../../node_modules/.pnpm/element-plus@2.14.3_vue@3.5.40_typescript@5.9.3_/node_modules/element-plus/es/components/tabs/src/tab-nav.js";
|
|
13
|
+
const re = F({
|
|
14
|
+
name: "EpTabs",
|
|
15
|
+
props: z,
|
|
16
|
+
emits: q,
|
|
17
|
+
setup(t, { emit: d, slots: m, expose: g }) {
|
|
18
|
+
const n = M("tabs"), v = I(
|
|
19
|
+
() => ["left", "right"].includes(t.tabPosition)
|
|
20
|
+
), {
|
|
21
|
+
children: h,
|
|
22
|
+
addChild: w,
|
|
23
|
+
removeChild: V,
|
|
24
|
+
ChildrenSorter: R
|
|
25
|
+
} = B(L(), "EpTabPane"), s = E(), r = E(
|
|
26
|
+
(b(t.modelValue) ? t.defaultValue : t.modelValue) ?? "0"
|
|
27
|
+
), C = async (e, a = !1) => {
|
|
28
|
+
var o, l, u;
|
|
29
|
+
if (!(r.value === e || b(e)))
|
|
30
|
+
try {
|
|
31
|
+
let f;
|
|
32
|
+
if (t.beforeLeave) {
|
|
33
|
+
const c = t.beforeLeave(e, r.value);
|
|
34
|
+
f = c instanceof Promise ? await c : c;
|
|
35
|
+
} else
|
|
36
|
+
f = !0;
|
|
37
|
+
if (f !== !1) {
|
|
38
|
+
const c = (o = h.value.find((_) => _.paneName === r.value)) == null ? void 0 : o.isFocusInsidePane();
|
|
39
|
+
r.value = e, a && (d(O, e), d("tabChange", e)), (l = s.value) == null || l.removeFocus(), c && ((u = s.value) == null || u.focusActiveTab());
|
|
40
|
+
}
|
|
41
|
+
} catch {
|
|
42
|
+
}
|
|
43
|
+
}, k = (e, a, o) => {
|
|
44
|
+
e.props.disabled || (d("tabClick", e, o), C(a, !0));
|
|
45
|
+
}, x = (e, a) => {
|
|
46
|
+
e.props.disabled || b(e.props.name) || (a.stopPropagation(), d("edit", e.props.name, "remove"), d("tabRemove", e.props.name));
|
|
47
|
+
}, T = () => {
|
|
48
|
+
d("edit", void 0, "add"), d("tabAdd");
|
|
49
|
+
}, A = (e) => {
|
|
50
|
+
const a = U(e);
|
|
51
|
+
[N.enter, N.numpadEnter].includes(a) && T();
|
|
52
|
+
}, P = (e) => {
|
|
53
|
+
const a = e.el.firstChild, o = e.children, l = ["bottom", "right"].includes(t.tabPosition) ? o[0].el : o[1].el;
|
|
54
|
+
a !== l && a.before(l);
|
|
55
|
+
};
|
|
56
|
+
return p(
|
|
57
|
+
() => t.modelValue,
|
|
58
|
+
(e) => C(e)
|
|
59
|
+
), p(r, async () => {
|
|
60
|
+
var e;
|
|
61
|
+
await S(), (e = s.value) == null || e.scrollToActiveTab();
|
|
62
|
+
}), D(j, {
|
|
63
|
+
props: t,
|
|
64
|
+
currentName: r,
|
|
65
|
+
registerPane: w,
|
|
66
|
+
unregisterPane: V,
|
|
67
|
+
nav$: s
|
|
68
|
+
}), g({
|
|
69
|
+
currentName: r,
|
|
70
|
+
get tabNavRef() {
|
|
71
|
+
if (!s.value) return;
|
|
72
|
+
const { scheduleRender: e, ...a } = s.value;
|
|
73
|
+
return a;
|
|
74
|
+
}
|
|
75
|
+
}), () => {
|
|
76
|
+
const e = m["add-icon"], a = t.editable || t.addable ? i(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
class: [
|
|
80
|
+
n.e("new-tab"),
|
|
81
|
+
v.value && n.e("new-tab-vertical")
|
|
82
|
+
],
|
|
83
|
+
tabindex: t.tabindex,
|
|
84
|
+
onClick: T,
|
|
85
|
+
onKeydown: A
|
|
86
|
+
},
|
|
87
|
+
[
|
|
88
|
+
e ? y(m, "add-icon") : i($, { class: n.is("icon-plus") }, { default: () => [i(K)] })
|
|
89
|
+
]
|
|
90
|
+
) : null, o = () => i(G, {
|
|
91
|
+
ref: s,
|
|
92
|
+
currentName: r.value,
|
|
93
|
+
editable: t.editable,
|
|
94
|
+
type: t.type,
|
|
95
|
+
panes: h.value,
|
|
96
|
+
stretch: t.stretch,
|
|
97
|
+
onTabClick: k,
|
|
98
|
+
onTabRemove: x
|
|
99
|
+
}), l = i(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
class: [
|
|
103
|
+
n.e("header"),
|
|
104
|
+
v.value && n.e("header-vertical"),
|
|
105
|
+
n.is(t.tabPosition)
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
[i(R, null, { default: o }), a]
|
|
109
|
+
), u = i("div", { class: n.e("content") }, [
|
|
110
|
+
y(m, "default")
|
|
111
|
+
]);
|
|
112
|
+
return i(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
class: [
|
|
116
|
+
n.b(),
|
|
117
|
+
n.m(t.tabPosition),
|
|
118
|
+
{
|
|
119
|
+
[n.m("card")]: t.type === "card",
|
|
120
|
+
[n.m("border-card")]: t.type === "border-card"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
onVnodeMounted: P,
|
|
124
|
+
onVnodeUpdated: P
|
|
125
|
+
},
|
|
126
|
+
[u, l]
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
export {
|
|
132
|
+
re as default
|
|
133
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { withNoopInstall as a, withInstall as o } from "../../utils/vue/install.js";
|
|
2
2
|
import s from "./src/tabs.js";
|
|
3
3
|
import { tabsEmits as f, tabsProps as i } from "./src/tabs.js";
|
|
4
4
|
import t from "./src/tab-pane2.js";
|
|
5
|
-
const p =
|
|
5
|
+
const p = o(s, { TabPane: t }), b = a(t);
|
|
6
6
|
export {
|
|
7
7
|
b as ElTabPane,
|
|
8
8
|
p as ElTabs,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EVENT_CODE as N } from "../../../constants/aria.js";
|
|
2
2
|
import { UPDATE_MODEL_EVENT as S } from "../../../constants/event.js";
|
|
3
3
|
import { getEventCode as I } from "../../../utils/dom/event.js";
|
|
4
|
-
import {
|
|
4
|
+
import { isNumber as _, isUndefined as f } from "../../../utils/types.js";
|
|
5
5
|
import { buildProps as D, definePropType as K } from "../../../utils/vue/props/runtime.js";
|
|
6
6
|
import { useNamespace as O } from "../../../hooks/use-namespace/index.js";
|
|
7
7
|
import { useOrderedChildren as U } from "../../../hooks/use-ordered-children/index.js";
|
|
@@ -10,8 +10,8 @@ import { tabsRootContextKey as $ } from "./constants.js";
|
|
|
10
10
|
import j from "./tab-nav.js";
|
|
11
11
|
import { Plus as q } from "../../../../../../../@element-plus_icons-vue@2.3.2_vue@3.5.40_typescript@5.9.3_/node_modules/@element-plus/icons-vue/dist/index.js";
|
|
12
12
|
import { defineComponent as z, computed as G, getCurrentInstance as H, ref as T, watch as E, nextTick as J, provide as Q, createVNode as d, renderSlot as V } from "vue";
|
|
13
|
-
import W from "
|
|
14
|
-
import
|
|
13
|
+
import { isString as W } from "../../../../../../../@vue_shared@3.5.40/node_modules/@vue/shared/dist/shared.esm-bundler.js";
|
|
14
|
+
import X from "../../../../../../../lodash-es@4.18.1/node_modules/lodash-es/omit.js";
|
|
15
15
|
const Y = D({
|
|
16
16
|
/**
|
|
17
17
|
* @description type of Tab
|
|
@@ -76,7 +76,7 @@ const Y = D({
|
|
|
76
76
|
type: [String, Number],
|
|
77
77
|
default: 0
|
|
78
78
|
}
|
|
79
|
-
}), v = (e) =>
|
|
79
|
+
}), v = (e) => W(e) || _(e), Z = {
|
|
80
80
|
[S]: (e) => v(e),
|
|
81
81
|
tabClick: (e, n) => n instanceof Event,
|
|
82
82
|
tabChange: (e) => v(e),
|
|
@@ -128,7 +128,7 @@ const Y = D({
|
|
|
128
128
|
}), w({
|
|
129
129
|
currentName: i,
|
|
130
130
|
get tabNavRef() {
|
|
131
|
-
return
|
|
131
|
+
return X(l.value, ["scheduleRender"]);
|
|
132
132
|
}
|
|
133
133
|
}), () => {
|
|
134
134
|
const t = m["add-icon"], a = e.editable || e.addable ? d("div", {
|