ep-craft 0.1.17 → 0.1.19
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 +87 -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/index.css +1 -1
- package/package.json +1 -1
- package/theme-chalk/src/common/var.scss +11 -10
- package/theme-chalk/src/radio.scss +41 -56
|
@@ -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,87 @@
|
|
|
1
|
+
import { defineComponent as b, h as a, withDirectives as h, withModifiers as d, vModelRadio as g, renderSlot as x, nextTick as k } from "vue";
|
|
2
|
+
import { CHANGE_EVENT as y } 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 E } 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 C, radioProps as R } 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 _ = b({
|
|
7
|
+
name: "EpRadio",
|
|
8
|
+
props: R,
|
|
9
|
+
emits: C,
|
|
10
|
+
setup(l, { emit: n, slots: t }) {
|
|
11
|
+
const e = E("radio"), { radioRef: u, radioGroup: c, focus: o, size: v, disabled: r, modelValue: i, actualValue: s } = w(l, n), m = () => {
|
|
12
|
+
k(() => n(y, i.value));
|
|
13
|
+
}, p = () => a("svg", { class: e.e("indicator"), viewBox: "0 0 16 16" }, [
|
|
14
|
+
a("circle", { class: e.e("indicator-ring"), cx: 8, cy: 8, r: 7 }),
|
|
15
|
+
a("g", { class: e.e("indicator-checked") }, [
|
|
16
|
+
a("circle", {
|
|
17
|
+
class: e.e("indicator-ring-outer"),
|
|
18
|
+
cx: 8,
|
|
19
|
+
cy: 8,
|
|
20
|
+
r: 7.5
|
|
21
|
+
}),
|
|
22
|
+
a("circle", { class: e.e("indicator-gap"), cx: 8, cy: 8, r: 6 }),
|
|
23
|
+
a("circle", { class: e.e("indicator-dot"), cx: 8, cy: 8, r: 4.09 })
|
|
24
|
+
])
|
|
25
|
+
]);
|
|
26
|
+
return () => a(
|
|
27
|
+
"label",
|
|
28
|
+
{
|
|
29
|
+
class: [
|
|
30
|
+
e.b(),
|
|
31
|
+
e.is("disabled", r.value),
|
|
32
|
+
e.is("focus", o.value),
|
|
33
|
+
e.is("bordered", l.border),
|
|
34
|
+
e.is("checked", i.value === s.value),
|
|
35
|
+
e.m(v.value)
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
[
|
|
39
|
+
a(
|
|
40
|
+
"span",
|
|
41
|
+
{
|
|
42
|
+
class: [
|
|
43
|
+
e.e("input"),
|
|
44
|
+
e.is("disabled", r.value),
|
|
45
|
+
e.is("checked", i.value === s.value)
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
[
|
|
49
|
+
h(
|
|
50
|
+
a("input", {
|
|
51
|
+
ref: u,
|
|
52
|
+
class: e.e("original"),
|
|
53
|
+
value: s.value,
|
|
54
|
+
name: l.name || (c == null ? void 0 : c.name),
|
|
55
|
+
disabled: r.value,
|
|
56
|
+
checked: i.value === s.value,
|
|
57
|
+
type: "radio",
|
|
58
|
+
onFocus: () => o.value = !0,
|
|
59
|
+
onBlur: () => o.value = !1,
|
|
60
|
+
onChange: m,
|
|
61
|
+
onClick: d(() => {
|
|
62
|
+
}, ["stop"]),
|
|
63
|
+
"onUpdate:modelValue": (f) => {
|
|
64
|
+
i.value = f;
|
|
65
|
+
}
|
|
66
|
+
}),
|
|
67
|
+
[[g, i.value]]
|
|
68
|
+
),
|
|
69
|
+
a("span", { class: e.e("inner") }, [p()])
|
|
70
|
+
]
|
|
71
|
+
),
|
|
72
|
+
a(
|
|
73
|
+
"span",
|
|
74
|
+
{
|
|
75
|
+
class: e.e("label"),
|
|
76
|
+
onKeydown: d(() => {
|
|
77
|
+
}, ["stop"])
|
|
78
|
+
},
|
|
79
|
+
[x(t, "default", {}, () => [l.label])]
|
|
80
|
+
)
|
|
81
|
+
]
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
export {
|
|
86
|
+
_ as default
|
|
87
|
+
};
|
|
@@ -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
|
+
};
|