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
|
@@ -1,87 +1,145 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { CHANGE_EVENT as
|
|
3
|
-
import { useNamespace as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { defineComponent as B, h as o, withDirectives as N, withModifiers as d, vModelRadio as x, renderSlot as S, nextTick as k } from "vue";
|
|
2
|
+
import { CHANGE_EVENT as p, UPDATE_MODEL_EVENT as V } from "../../constants/event.js";
|
|
3
|
+
import { useNamespace as C } from "../../hooks/use-namespace/index.js";
|
|
4
|
+
import { useSizeProp as P } from "../../hooks/use-size/index.js";
|
|
5
|
+
import { isNumber as n, isBoolean as u } from "../../utils/types.js";
|
|
6
|
+
import "lodash-unified";
|
|
7
|
+
import "@vueuse/core";
|
|
8
|
+
import { isString as m } from "@vue/shared";
|
|
9
|
+
import "@element-plus/icons-vue";
|
|
10
|
+
import { buildProps as v } from "../../utils/vue/props/runtime.js";
|
|
11
|
+
import { useRadio as R } from "./use-radio.js";
|
|
12
|
+
const w = v({
|
|
13
|
+
/**
|
|
14
|
+
* @description binding value
|
|
15
|
+
*/
|
|
16
|
+
modelValue: {
|
|
17
|
+
type: [String, Number, Boolean],
|
|
18
|
+
default: void 0
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* @description size of the Radio
|
|
22
|
+
*/
|
|
23
|
+
size: P,
|
|
24
|
+
/**
|
|
25
|
+
* @description whether Radio is disabled
|
|
26
|
+
*/
|
|
27
|
+
disabled: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: void 0
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* @description the label of Radio
|
|
33
|
+
*/
|
|
34
|
+
label: {
|
|
35
|
+
type: [String, Number, Boolean],
|
|
36
|
+
default: void 0
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* @description the value of Radio
|
|
40
|
+
*/
|
|
41
|
+
value: {
|
|
42
|
+
type: [String, Number, Boolean],
|
|
43
|
+
default: void 0
|
|
44
|
+
},
|
|
45
|
+
/**
|
|
46
|
+
* @description native `name` attribute
|
|
47
|
+
*/
|
|
48
|
+
name: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: void 0
|
|
51
|
+
}
|
|
52
|
+
}), T = v({
|
|
53
|
+
...w,
|
|
54
|
+
/**
|
|
55
|
+
* @description whether to add a border around Radio
|
|
56
|
+
*/
|
|
57
|
+
border: Boolean
|
|
58
|
+
}), _ = {
|
|
59
|
+
[V]: (a) => m(a) || n(a) || u(a),
|
|
60
|
+
[p]: (a) => m(a) || n(a) || u(a)
|
|
61
|
+
}, q = B({
|
|
7
62
|
name: "EpRadio",
|
|
8
|
-
props:
|
|
9
|
-
emits:
|
|
10
|
-
setup(
|
|
11
|
-
const e =
|
|
12
|
-
k(() =>
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
63
|
+
props: T,
|
|
64
|
+
emits: _,
|
|
65
|
+
setup(a, { emit: c, slots: f }) {
|
|
66
|
+
const e = C("radio"), { radioRef: b, radioGroup: r, focus: s, size: g, disabled: t, modelValue: i, actualValue: l } = R(a, c), y = () => {
|
|
67
|
+
k(() => c(p, i.value));
|
|
68
|
+
}, h = () => o("svg", { class: e.e("indicator"), viewBox: "0 0 16 16" }, [
|
|
69
|
+
o("circle", { class: e.e("indicator-ring"), cx: 8, cy: 8, r: 7 }),
|
|
70
|
+
o("g", { class: e.e("indicator-checked") }, [
|
|
71
|
+
o("circle", {
|
|
17
72
|
class: e.e("indicator-ring-outer"),
|
|
18
73
|
cx: 8,
|
|
19
74
|
cy: 8,
|
|
20
75
|
r: 7.5
|
|
21
76
|
}),
|
|
22
|
-
|
|
23
|
-
|
|
77
|
+
o("circle", { class: e.e("indicator-gap"), cx: 8, cy: 8, r: 6 }),
|
|
78
|
+
o("circle", { class: e.e("indicator-dot"), cx: 8, cy: 8, r: 4.09 })
|
|
24
79
|
])
|
|
25
80
|
]);
|
|
26
|
-
return () =>
|
|
81
|
+
return () => o(
|
|
27
82
|
"label",
|
|
28
83
|
{
|
|
29
84
|
class: [
|
|
30
85
|
e.b(),
|
|
31
|
-
e.is("disabled",
|
|
32
|
-
e.is("focus",
|
|
33
|
-
e.is("bordered",
|
|
34
|
-
e.is("checked", i.value ===
|
|
35
|
-
e.m(
|
|
86
|
+
e.is("disabled", t.value),
|
|
87
|
+
e.is("focus", s.value),
|
|
88
|
+
e.is("bordered", a.border),
|
|
89
|
+
e.is("checked", i.value === l.value),
|
|
90
|
+
e.m(g.value)
|
|
36
91
|
]
|
|
37
92
|
},
|
|
38
93
|
[
|
|
39
|
-
|
|
94
|
+
o(
|
|
40
95
|
"span",
|
|
41
96
|
{
|
|
42
97
|
class: [
|
|
43
98
|
e.e("input"),
|
|
44
|
-
e.is("disabled",
|
|
45
|
-
e.is("checked", i.value ===
|
|
99
|
+
e.is("disabled", t.value),
|
|
100
|
+
e.is("checked", i.value === l.value)
|
|
46
101
|
]
|
|
47
102
|
},
|
|
48
103
|
[
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
ref:
|
|
104
|
+
N(
|
|
105
|
+
o("input", {
|
|
106
|
+
ref: b,
|
|
52
107
|
class: e.e("original"),
|
|
53
|
-
value:
|
|
54
|
-
name:
|
|
55
|
-
disabled:
|
|
56
|
-
checked: i.value ===
|
|
108
|
+
value: l.value,
|
|
109
|
+
name: a.name || (r == null ? void 0 : r.name),
|
|
110
|
+
disabled: t.value,
|
|
111
|
+
checked: i.value === l.value,
|
|
57
112
|
type: "radio",
|
|
58
|
-
onFocus: () =>
|
|
59
|
-
onBlur: () =>
|
|
60
|
-
onChange:
|
|
113
|
+
onFocus: () => s.value = !0,
|
|
114
|
+
onBlur: () => s.value = !1,
|
|
115
|
+
onChange: y,
|
|
61
116
|
onClick: d(() => {
|
|
62
117
|
}, ["stop"]),
|
|
63
|
-
"onUpdate:modelValue": (
|
|
64
|
-
i.value =
|
|
118
|
+
"onUpdate:modelValue": (E) => {
|
|
119
|
+
i.value = E;
|
|
65
120
|
}
|
|
66
121
|
}),
|
|
67
|
-
[[
|
|
122
|
+
[[x, i.value]]
|
|
68
123
|
),
|
|
69
|
-
|
|
124
|
+
o("span", { class: e.e("inner") }, [h()])
|
|
70
125
|
]
|
|
71
126
|
),
|
|
72
|
-
|
|
127
|
+
o(
|
|
73
128
|
"span",
|
|
74
129
|
{
|
|
75
130
|
class: e.e("label"),
|
|
76
131
|
onKeydown: d(() => {
|
|
77
132
|
}, ["stop"])
|
|
78
133
|
},
|
|
79
|
-
[
|
|
134
|
+
[S(f, "default", {}, () => [a.label])]
|
|
80
135
|
)
|
|
81
136
|
]
|
|
82
137
|
);
|
|
83
138
|
}
|
|
84
139
|
});
|
|
85
140
|
export {
|
|
86
|
-
|
|
141
|
+
q as default,
|
|
142
|
+
_ as radioEmits,
|
|
143
|
+
T as radioProps,
|
|
144
|
+
w as radioPropsBase
|
|
87
145
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SetupContext } from 'vue';
|
|
2
|
+
import type { RadioEmits, RadioPropsBase } from './radio';
|
|
3
|
+
export declare const useRadio: (props: RadioPropsBase, emit?: SetupContext<RadioEmits>["emit"]) => {
|
|
4
|
+
radioRef: import("vue").Ref<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
5
|
+
isGroup: import("vue").ComputedRef<boolean>;
|
|
6
|
+
radioGroup: import("./constants").RadioGroupContext | undefined;
|
|
7
|
+
focus: import("vue").Ref<boolean, boolean>;
|
|
8
|
+
size: import("vue").ComputedRef<"" | "small" | "default" | "large">;
|
|
9
|
+
disabled: import("vue").ComputedRef<boolean>;
|
|
10
|
+
tabIndex: import("vue").ComputedRef<0 | -1>;
|
|
11
|
+
modelValue: import("vue").WritableComputedRef<string | number | boolean | undefined, string | number | boolean | undefined>;
|
|
12
|
+
actualValue: import("vue").ComputedRef<string | number | boolean | undefined>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ref as i, inject as p, computed as t } from "vue";
|
|
2
|
+
import { UPDATE_MODEL_EVENT as b } from "../../constants/event.js";
|
|
3
|
+
import { useFormSize as V, useFormDisabled as E } from "../form/src/hooks/use-form-common-props.js";
|
|
4
|
+
import { useDeprecated as h } from "../../hooks/use-deprecated/index.js";
|
|
5
|
+
import { isPropAbsent as c } from "../../utils/types.js";
|
|
6
|
+
import "lodash-unified";
|
|
7
|
+
import "@vueuse/core";
|
|
8
|
+
import "@vue/shared";
|
|
9
|
+
import "@element-plus/icons-vue";
|
|
10
|
+
import { radioGroupKey as D } from "./constants.js";
|
|
11
|
+
const _ = (o, r) => {
|
|
12
|
+
const u = i(), e = p(D, void 0), l = t(() => !!e), a = t(() => c(o.value) ? o.label : o.value), m = t({
|
|
13
|
+
get() {
|
|
14
|
+
return l.value ? e.modelValue : o.modelValue;
|
|
15
|
+
},
|
|
16
|
+
set(s) {
|
|
17
|
+
l.value ? e.changeEvent(s) : r && r(b, s), u.value.checked = o.modelValue === a.value;
|
|
18
|
+
}
|
|
19
|
+
}), d = V(t(() => e == null ? void 0 : e.size)), n = E(t(() => e == null ? void 0 : e.disabled)), v = i(!1), f = t(() => n.value || l.value && m.value !== a.value ? -1 : 0);
|
|
20
|
+
return h(
|
|
21
|
+
{
|
|
22
|
+
from: "label act as value",
|
|
23
|
+
replacement: "value",
|
|
24
|
+
version: "3.0.0",
|
|
25
|
+
scope: "el-radio",
|
|
26
|
+
ref: "https://element-plus.org/en-US/component/radio.html"
|
|
27
|
+
},
|
|
28
|
+
t(() => l.value && c(o.value))
|
|
29
|
+
), {
|
|
30
|
+
radioRef: u,
|
|
31
|
+
isGroup: l,
|
|
32
|
+
radioGroup: e,
|
|
33
|
+
focus: v,
|
|
34
|
+
size: d,
|
|
35
|
+
disabled: n,
|
|
36
|
+
tabIndex: f,
|
|
37
|
+
modelValue: m,
|
|
38
|
+
actualValue: a
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
_ as useRadio
|
|
43
|
+
};
|
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EpRadioButton 的 props 定义
|
|
3
|
+
* 从 element-plus radio-button 源码 vendored 而来(内联到本文件顶部)。
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Removed after 3.0.0, Use `RadioButtonProps` instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare const radioButtonProps: {
|
|
9
|
+
readonly modelValue: import("@element-plus/utils").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
10
|
+
readonly size: {
|
|
11
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
12
|
+
readonly required: false;
|
|
13
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
14
|
+
__epPropKey: true;
|
|
15
|
+
};
|
|
16
|
+
readonly disabled: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
17
|
+
readonly label: import("@element-plus/utils").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
18
|
+
readonly value: import("@element-plus/utils").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
19
|
+
readonly name: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @description default values for RadioButtonProps
|
|
23
|
+
*/
|
|
24
|
+
export declare const radioButtonPropsDefaults: {
|
|
25
|
+
readonly modelValue: undefined;
|
|
26
|
+
readonly disabled: undefined;
|
|
27
|
+
readonly label: undefined;
|
|
28
|
+
readonly value: undefined;
|
|
29
|
+
readonly name: undefined;
|
|
30
|
+
};
|
|
1
31
|
/**
|
|
2
32
|
* EpRadioButton —— 从 element-plus 的 radio-button 源码 vendored 而来
|
|
3
33
|
* (el -> ep 命名),样式复用仓库内置的 theme-chalk/src/radio.scss(命名空间为 el)。
|
|
@@ -5,36 +35,36 @@
|
|
|
5
35
|
* 注意:同 EpRadio,通过 inject(radioGroupKey) 识别父级 EpRadioGroup。
|
|
6
36
|
*/
|
|
7
37
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
-
readonly modelValue: import("element-plus/
|
|
38
|
+
readonly modelValue: import("@element-plus/utils").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
9
39
|
readonly size: {
|
|
10
|
-
readonly type: import("vue").PropType<import("element-plus/
|
|
40
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
11
41
|
readonly required: false;
|
|
12
42
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
13
43
|
__epPropKey: true;
|
|
14
44
|
};
|
|
15
|
-
readonly disabled: import("element-plus/
|
|
16
|
-
readonly label: import("element-plus/
|
|
17
|
-
readonly value: import("element-plus/
|
|
18
|
-
readonly name: import("element-plus/
|
|
45
|
+
readonly disabled: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
46
|
+
readonly label: import("@element-plus/utils").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
47
|
+
readonly value: import("@element-plus/utils").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
48
|
+
readonly name: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
19
49
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
20
50
|
[key: string]: any;
|
|
21
51
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
-
readonly modelValue: import("element-plus/
|
|
52
|
+
readonly modelValue: import("@element-plus/utils").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
23
53
|
readonly size: {
|
|
24
|
-
readonly type: import("vue").PropType<import("element-plus/
|
|
54
|
+
readonly type: import("vue").PropType<import("@element-plus/utils").EpPropMergeType<StringConstructor, "" | "small" | "default" | "large", never>>;
|
|
25
55
|
readonly required: false;
|
|
26
56
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
27
57
|
__epPropKey: true;
|
|
28
58
|
};
|
|
29
|
-
readonly disabled: import("element-plus/
|
|
30
|
-
readonly label: import("element-plus/
|
|
31
|
-
readonly value: import("element-plus/
|
|
32
|
-
readonly name: import("element-plus/
|
|
59
|
+
readonly disabled: import("@element-plus/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
60
|
+
readonly label: import("@element-plus/utils").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
61
|
+
readonly value: import("@element-plus/utils").EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
|
|
62
|
+
readonly name: import("@element-plus/utils").EpPropFinalized<StringConstructor, unknown, unknown, undefined, boolean>;
|
|
33
63
|
}>> & Readonly<{}>, {
|
|
34
64
|
readonly name: string;
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
readonly value: import("element-plus/
|
|
38
|
-
readonly modelValue: import("element-plus/
|
|
65
|
+
readonly disabled: import("@element-plus/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
66
|
+
readonly label: import("@element-plus/utils").EpPropMergeType<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
67
|
+
readonly value: import("@element-plus/utils").EpPropMergeType<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
68
|
+
readonly modelValue: import("@element-plus/utils").EpPropMergeType<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown>;
|
|
39
69
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
40
70
|
export default _default;
|
|
@@ -1,61 +1,69 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useNamespace as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { defineComponent as f, computed as b, h as i, withDirectives as p, withModifiers as u, vModelRadio as B, renderSlot as C } from "vue";
|
|
2
|
+
import { useNamespace as R } from "../../hooks/use-namespace/index.js";
|
|
3
|
+
import "@vue/shared";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import { buildProps as h } from "../../utils/vue/props/runtime.js";
|
|
8
|
+
import { radioPropsBase as w } from "../radio/radio.js";
|
|
9
|
+
import { useRadio as x } from "../radio/use-radio.js";
|
|
10
|
+
const y = h({
|
|
11
|
+
...w
|
|
12
|
+
}), F = f({
|
|
6
13
|
name: "EpRadioButton",
|
|
7
|
-
props:
|
|
8
|
-
setup(
|
|
9
|
-
const l =
|
|
14
|
+
props: y,
|
|
15
|
+
setup(t, { slots: m }) {
|
|
16
|
+
const l = R("radio"), { radioRef: r, focus: a, size: d, disabled: n, modelValue: o, radioGroup: e, actualValue: s } = x(t), c = b(() => ({
|
|
10
17
|
backgroundColor: (e == null ? void 0 : e.fill) || "",
|
|
11
18
|
borderColor: (e == null ? void 0 : e.fill) || "",
|
|
12
19
|
boxShadow: e != null && e.fill ? `-1px 0 0 0 ${e.fill}` : "",
|
|
13
20
|
color: (e == null ? void 0 : e.textColor) || ""
|
|
14
21
|
}));
|
|
15
|
-
return () =>
|
|
22
|
+
return () => i(
|
|
16
23
|
"label",
|
|
17
24
|
{
|
|
18
25
|
class: [
|
|
19
26
|
l.b("button"),
|
|
20
|
-
l.is("active",
|
|
21
|
-
l.is("disabled",
|
|
22
|
-
l.is("focus",
|
|
23
|
-
l.bm("button",
|
|
27
|
+
l.is("active", o.value === s.value),
|
|
28
|
+
l.is("disabled", n.value),
|
|
29
|
+
l.is("focus", a.value),
|
|
30
|
+
l.bm("button", d.value)
|
|
24
31
|
]
|
|
25
32
|
},
|
|
26
33
|
[
|
|
27
34
|
p(
|
|
28
|
-
|
|
29
|
-
ref:
|
|
35
|
+
i("input", {
|
|
36
|
+
ref: r,
|
|
30
37
|
class: l.be("button", "original-radio"),
|
|
31
|
-
value:
|
|
38
|
+
value: s.value,
|
|
32
39
|
type: "radio",
|
|
33
|
-
name:
|
|
34
|
-
disabled:
|
|
35
|
-
onFocus: () =>
|
|
36
|
-
onBlur: () =>
|
|
37
|
-
onClick:
|
|
40
|
+
name: t.name || (e == null ? void 0 : e.name),
|
|
41
|
+
disabled: n.value,
|
|
42
|
+
onFocus: () => a.value = !0,
|
|
43
|
+
onBlur: () => a.value = !1,
|
|
44
|
+
onClick: u(() => {
|
|
38
45
|
}, ["stop"]),
|
|
39
|
-
"onUpdate:modelValue": (
|
|
40
|
-
|
|
46
|
+
"onUpdate:modelValue": (v) => {
|
|
47
|
+
o.value = v;
|
|
41
48
|
}
|
|
42
49
|
}),
|
|
43
|
-
[[
|
|
50
|
+
[[B, o.value]]
|
|
44
51
|
),
|
|
45
|
-
|
|
52
|
+
i(
|
|
46
53
|
"span",
|
|
47
54
|
{
|
|
48
55
|
class: l.be("button", "inner"),
|
|
49
|
-
style:
|
|
50
|
-
onKeydown:
|
|
56
|
+
style: o.value === s.value ? c.value : {},
|
|
57
|
+
onKeydown: u(() => {
|
|
51
58
|
}, ["stop"])
|
|
52
59
|
},
|
|
53
|
-
[
|
|
60
|
+
[C(m, "default", {}, () => [t.label])]
|
|
54
61
|
)
|
|
55
62
|
]
|
|
56
63
|
);
|
|
57
64
|
}
|
|
58
65
|
});
|
|
59
66
|
export {
|
|
60
|
-
|
|
67
|
+
F as default,
|
|
68
|
+
y as radioButtonProps
|
|
61
69
|
};
|