@element-plus/nightly 0.0.20220211 → 0.0.20220212
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/index.full.js +199 -200
- package/dist/index.full.min.js +11 -11
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +199 -200
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/button/index.d.ts +59 -7
- package/es/components/button/index.mjs +3 -3
- package/es/components/button/index.mjs.map +1 -1
- package/es/components/button/src/button.d.ts +5 -5
- package/es/components/button/src/button.mjs +5 -5
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button.vue.d.ts +59 -7
- package/es/components/button/src/button2.mjs +72 -76
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/index.mjs +1 -1
- package/es/components/popconfirm/src/popconfirm.mjs +3 -3
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/index.mjs +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/button/index.d.ts +59 -7
- package/lib/components/button/index.js +2 -2
- package/lib/components/button/src/button.d.ts +5 -5
- package/lib/components/button/src/button.js +6 -6
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button.vue.d.ts +59 -7
- package/lib/components/button/src/button2.js +78 -82
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -13,13 +13,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
13
13
|
readonly color: StringConstructor;
|
|
14
14
|
readonly autoInsertSpace: import("../../../utils").BuildPropReturn<BooleanConstructor, undefined, unknown, unknown, unknown>;
|
|
15
15
|
}, {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
readonly size: import("../../../utils").BuildPropReturn<StringConstructor, never, false, "default" | "small" | "large", never>;
|
|
18
|
+
readonly disabled: BooleanConstructor;
|
|
19
|
+
readonly type: import("../../../utils").BuildPropReturn<StringConstructor, "", unknown, "" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text", unknown>;
|
|
20
|
+
readonly icon: import("../../../utils").BuildPropReturn<import("../../../utils").PropWrapper<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>, "", unknown, unknown, unknown>;
|
|
21
|
+
readonly nativeType: import("../../../utils").BuildPropReturn<StringConstructor, "button", unknown, "button" | "submit" | "reset", unknown>;
|
|
22
|
+
readonly loading: BooleanConstructor;
|
|
23
|
+
readonly loadingIcon: import("../../../utils").BuildPropReturn<import("../../../utils").PropWrapper<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>, () => import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>, unknown, unknown, unknown>;
|
|
24
|
+
readonly plain: BooleanConstructor;
|
|
25
|
+
readonly autofocus: BooleanConstructor;
|
|
26
|
+
readonly round: BooleanConstructor;
|
|
27
|
+
readonly circle: BooleanConstructor;
|
|
28
|
+
readonly color: StringConstructor;
|
|
29
|
+
readonly autoInsertSpace: import("../../../utils").BuildPropReturn<BooleanConstructor, undefined, unknown, unknown, unknown>;
|
|
30
|
+
}>> & {
|
|
31
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
32
|
+
}>>;
|
|
33
|
+
emit: (event: "click", evt: MouseEvent) => void;
|
|
34
|
+
slots: Readonly<{
|
|
35
|
+
[name: string]: import("vue").Slot | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
buttonGroupContext: import("element-plus/es/tokens").ButtonGroupContext | undefined;
|
|
38
|
+
globalConfig: import("vue").Ref<import("./button").ButtonConfigContext | undefined>;
|
|
23
39
|
ns: {
|
|
24
40
|
namespace: import("vue").ComputedRef<string>;
|
|
25
41
|
b: (blockSuffix?: string) => string;
|
|
@@ -34,6 +50,42 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
34
50
|
(name: string): string;
|
|
35
51
|
};
|
|
36
52
|
};
|
|
53
|
+
form: import("element-plus/es/tokens").ElFormContext | undefined;
|
|
54
|
+
_size: import("vue").ComputedRef<"default" | "small" | "large">;
|
|
55
|
+
_disabled: import("vue").ComputedRef<boolean>;
|
|
56
|
+
_ref: import("vue").Ref<HTMLButtonElement | undefined>;
|
|
57
|
+
_type: import("vue").ComputedRef<"default" | "" | "primary" | "success" | "warning" | "info" | "danger" | "text">;
|
|
58
|
+
autoInsertSpace: import("vue").ComputedRef<import("../../../utils").BuildPropType<BooleanConstructor, unknown, unknown>>;
|
|
59
|
+
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
60
|
+
typeColor: import("vue").ComputedRef<string>;
|
|
61
|
+
buttonStyle: import("vue").ComputedRef<Record<string, string>>;
|
|
62
|
+
handleClick: (evt: MouseEvent) => void;
|
|
63
|
+
ElIcon: import("../../../utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
64
|
+
readonly size: import("../../../utils").BuildPropReturn<import("../../../utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
|
|
65
|
+
readonly color: import("../../../utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
|
|
66
|
+
}, {
|
|
67
|
+
ns: {
|
|
68
|
+
namespace: import("vue").ComputedRef<string>;
|
|
69
|
+
b: (blockSuffix?: string) => string;
|
|
70
|
+
e: (element?: string | undefined) => string;
|
|
71
|
+
m: (modifier?: string | undefined) => string;
|
|
72
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
73
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
74
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
75
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
76
|
+
is: {
|
|
77
|
+
(name: string, state: boolean | undefined): string;
|
|
78
|
+
(name: string): string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
style: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
82
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
83
|
+
readonly size: import("../../../utils").BuildPropReturn<import("../../../utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
|
|
84
|
+
readonly color: import("../../../utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
|
|
85
|
+
}>>, {
|
|
86
|
+
size: import("../../../utils").BuildPropType<import("../../../utils").PropWrapper<string | number>, unknown, unknown>;
|
|
87
|
+
color: string;
|
|
88
|
+
}>> & Record<string, any>;
|
|
37
89
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
90
|
click: (evt: MouseEvent) => boolean;
|
|
39
91
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, useSlots, inject, computed, ref, Text, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, Fragment, renderSlot, createBlock, withCtx, resolveDynamicComponent, createCommentVNode } from 'vue';
|
|
2
2
|
import { useCssVar } from '@vueuse/core';
|
|
3
3
|
import { TinyColor } from '@ctrl/tinycolor';
|
|
4
4
|
import { ElIcon } from '../../icon/index.mjs';
|
|
5
5
|
import '../../../hooks/index.mjs';
|
|
6
6
|
import '../../../tokens/index.mjs';
|
|
7
|
-
import { Loading } from '@element-plus/icons-vue';
|
|
8
7
|
import { buttonProps, buttonEmits } from './button.mjs';
|
|
9
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
10
8
|
import { buttonGroupContextKey } from '../../../tokens/button.mjs';
|
|
11
9
|
import { useGlobalConfig } from '../../../hooks/use-global-config/index.mjs';
|
|
12
10
|
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
13
11
|
import { useFormItem } from '../../../hooks/use-form-item/index.mjs';
|
|
14
12
|
import { useSize, useDisabled } from '../../../hooks/use-common-props/index.mjs';
|
|
15
13
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const _hoisted_1 = ["disabled", "autofocus", "type"];
|
|
15
|
+
const __default__ = {
|
|
16
|
+
name: "ElButton"
|
|
17
|
+
};
|
|
18
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
|
+
...__default__,
|
|
22
20
|
props: buttonProps,
|
|
23
21
|
emits: buttonEmits,
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
22
|
+
setup(__props, { expose, emit }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const slots = useSlots();
|
|
26
25
|
const buttonGroupContext = inject(buttonGroupContextKey, void 0);
|
|
27
26
|
const globalConfig = useGlobalConfig("button");
|
|
28
27
|
const ns = useNamespace("button");
|
|
28
|
+
const { form } = useFormItem();
|
|
29
|
+
const _size = useSize(computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
|
|
30
|
+
const _disabled = useDisabled();
|
|
31
|
+
const _ref = ref();
|
|
32
|
+
const _type = computed(() => props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
|
|
29
33
|
const autoInsertSpace = computed(() => {
|
|
30
34
|
var _a, _b, _c;
|
|
31
35
|
return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.autoInsertSpace) != null ? _c : false;
|
|
@@ -42,19 +46,16 @@ const _sfc_main = defineComponent({
|
|
|
42
46
|
}
|
|
43
47
|
return false;
|
|
44
48
|
});
|
|
45
|
-
const { form } = useFormItem();
|
|
46
|
-
const buttonSize = useSize(computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
|
|
47
|
-
const buttonDisabled = useDisabled();
|
|
48
|
-
const buttonType = computed(() => props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
|
|
49
49
|
const typeColor = computed(() => useCssVar(`--el-color-${props.type}`).value);
|
|
50
50
|
const buttonStyle = computed(() => {
|
|
51
51
|
let styles = {};
|
|
52
52
|
const buttonColor = props.color || typeColor.value;
|
|
53
53
|
if (buttonColor) {
|
|
54
|
-
const
|
|
54
|
+
const color = new TinyColor(buttonColor);
|
|
55
|
+
const shadeBgColor = color.shade(10).toString();
|
|
55
56
|
if (props.plain) {
|
|
56
57
|
styles = {
|
|
57
|
-
"--el-button-bg-color":
|
|
58
|
+
"--el-button-bg-color": color.tint(90).toString(),
|
|
58
59
|
"--el-button-text-color": buttonColor,
|
|
59
60
|
"--el-button-hover-text-color": "var(--el-color-white)",
|
|
60
61
|
"--el-button-hover-bg-color": buttonColor,
|
|
@@ -64,7 +65,7 @@ const _sfc_main = defineComponent({
|
|
|
64
65
|
"--el-button-active-border-color": shadeBgColor
|
|
65
66
|
};
|
|
66
67
|
} else {
|
|
67
|
-
const tintBgColor =
|
|
68
|
+
const tintBgColor = color.tint(20).toString();
|
|
68
69
|
styles = {
|
|
69
70
|
"--el-button-bg-color": buttonColor,
|
|
70
71
|
"--el-button-border-color": buttonColor,
|
|
@@ -74,8 +75,8 @@ const _sfc_main = defineComponent({
|
|
|
74
75
|
"--el-button-active-border-color": shadeBgColor
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
|
-
if (
|
|
78
|
-
const disabledButtonColor =
|
|
78
|
+
if (_disabled.value) {
|
|
79
|
+
const disabledButtonColor = color.tint(50).toString();
|
|
79
80
|
styles["--el-button-disabled-bg-color"] = disabledButtonColor;
|
|
80
81
|
styles["--el-button-disabled-border-color"] = disabledButtonColor;
|
|
81
82
|
}
|
|
@@ -88,64 +89,59 @@ const _sfc_main = defineComponent({
|
|
|
88
89
|
}
|
|
89
90
|
emit("click", evt);
|
|
90
91
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
expose({
|
|
93
|
+
ref: _ref,
|
|
94
|
+
size: _size,
|
|
95
|
+
type: _type,
|
|
96
|
+
disabled: _disabled,
|
|
97
|
+
shouldAddSpace
|
|
98
|
+
});
|
|
99
|
+
return (_ctx, _cache) => {
|
|
100
|
+
return openBlock(), createElementBlock("button", {
|
|
101
|
+
ref_key: "_ref",
|
|
102
|
+
ref: _ref,
|
|
103
|
+
class: normalizeClass([
|
|
104
|
+
unref(ns).b(),
|
|
105
|
+
unref(ns).m(unref(_type)),
|
|
106
|
+
unref(ns).m(unref(_size)),
|
|
107
|
+
unref(ns).is("disabled", unref(_disabled)),
|
|
108
|
+
unref(ns).is("loading", _ctx.loading),
|
|
109
|
+
unref(ns).is("plain", _ctx.plain),
|
|
110
|
+
unref(ns).is("round", _ctx.round),
|
|
111
|
+
unref(ns).is("circle", _ctx.circle)
|
|
112
|
+
]),
|
|
113
|
+
disabled: unref(_disabled) || _ctx.loading,
|
|
114
|
+
autofocus: _ctx.autofocus,
|
|
115
|
+
type: _ctx.nativeType,
|
|
116
|
+
style: normalizeStyle(unref(buttonStyle)),
|
|
117
|
+
onClick: handleClick
|
|
118
|
+
}, [
|
|
119
|
+
_ctx.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
120
|
+
_ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), {
|
|
121
|
+
key: 1,
|
|
122
|
+
class: normalizeClass(unref(ns).is("loading"))
|
|
123
|
+
}, {
|
|
124
|
+
default: withCtx(() => [
|
|
125
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
|
|
126
|
+
]),
|
|
127
|
+
_: 1
|
|
128
|
+
}, 8, ["class"]))
|
|
129
|
+
], 2112)) : _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
|
|
130
|
+
default: withCtx(() => [
|
|
131
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
})) : createCommentVNode("v-if", true),
|
|
135
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("span", {
|
|
136
|
+
key: 2,
|
|
137
|
+
class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
|
|
138
|
+
}, [
|
|
139
|
+
renderSlot(_ctx.$slots, "default")
|
|
140
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
141
|
+
], 14, _hoisted_1);
|
|
100
142
|
};
|
|
101
143
|
}
|
|
102
144
|
});
|
|
103
|
-
const _hoisted_1 = ["disabled", "autofocus", "type"];
|
|
104
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
105
|
-
const _component_el_icon = resolveComponent("el-icon");
|
|
106
|
-
return openBlock(), createElementBlock("button", {
|
|
107
|
-
ref: "buttonRef",
|
|
108
|
-
class: normalizeClass([
|
|
109
|
-
_ctx.ns.b(),
|
|
110
|
-
_ctx.ns.m(_ctx.buttonType),
|
|
111
|
-
_ctx.ns.m(_ctx.buttonSize),
|
|
112
|
-
_ctx.ns.is("disabled", _ctx.buttonDisabled),
|
|
113
|
-
_ctx.ns.is("loading", _ctx.loading),
|
|
114
|
-
_ctx.ns.is("plain", _ctx.plain),
|
|
115
|
-
_ctx.ns.is("round", _ctx.round),
|
|
116
|
-
_ctx.ns.is("circle", _ctx.circle)
|
|
117
|
-
]),
|
|
118
|
-
disabled: _ctx.buttonDisabled || _ctx.loading,
|
|
119
|
-
autofocus: _ctx.autofocus,
|
|
120
|
-
type: _ctx.nativeType,
|
|
121
|
-
style: normalizeStyle(_ctx.buttonStyle),
|
|
122
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
123
|
-
}, [
|
|
124
|
-
_ctx.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
125
|
-
_ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(_component_el_icon, {
|
|
126
|
-
key: 1,
|
|
127
|
-
class: normalizeClass(_ctx.ns.is("loading"))
|
|
128
|
-
}, {
|
|
129
|
-
default: withCtx(() => [
|
|
130
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
|
|
131
|
-
]),
|
|
132
|
-
_: 1
|
|
133
|
-
}, 8, ["class"]))
|
|
134
|
-
], 2112)) : _ctx.icon ? (openBlock(), createBlock(_component_el_icon, { key: 1 }, {
|
|
135
|
-
default: withCtx(() => [
|
|
136
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
|
|
137
|
-
]),
|
|
138
|
-
_: 1
|
|
139
|
-
})) : createCommentVNode("v-if", true),
|
|
140
|
-
_ctx.$slots.default ? (openBlock(), createElementBlock("span", {
|
|
141
|
-
key: 2,
|
|
142
|
-
class: normalizeClass({ [_ctx.ns.em("text", "expand")]: _ctx.shouldAddSpace })
|
|
143
|
-
}, [
|
|
144
|
-
renderSlot(_ctx.$slots, "default")
|
|
145
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
146
|
-
], 14, _hoisted_1);
|
|
147
|
-
}
|
|
148
|
-
var Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
149
145
|
|
|
150
|
-
export {
|
|
146
|
+
export { _sfc_main as default };
|
|
151
147
|
//# sourceMappingURL=button2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button2.mjs","sources":["../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <button\n ref=\"
|
|
1
|
+
{"version":3,"file":"button2.mjs","sources":["../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <button\n ref=\"_ref\"\n :class=\"[\n ns.b(),\n ns.m(_type),\n ns.m(_size),\n ns.is('disabled', _disabled),\n ns.is('loading', loading),\n ns.is('plain', plain),\n ns.is('round', round),\n ns.is('circle', circle),\n ]\"\n :disabled=\"_disabled || loading\"\n :autofocus=\"autofocus\"\n :type=\"nativeType\"\n :style=\"buttonStyle\"\n @click=\"handleClick\"\n >\n <template v-if=\"loading\">\n <slot v-if=\"$slots.loading\" name=\"loading\"></slot>\n <el-icon v-else :class=\"ns.is('loading')\">\n <component :is=\"loadingIcon\" />\n </el-icon>\n </template>\n <el-icon v-else-if=\"icon\">\n <component :is=\"icon\" />\n </el-icon>\n <span\n v-if=\"$slots.default\"\n :class=\"{ [ns.em('text', 'expand')]: shouldAddSpace }\"\n >\n <slot></slot>\n </span>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, inject, Text, ref, useSlots } from 'vue'\nimport { useCssVar } from '@vueuse/core'\nimport { TinyColor } from '@ctrl/tinycolor'\nimport { ElIcon } from '@element-plus/components/icon'\nimport {\n useDisabled,\n useFormItem,\n useGlobalConfig,\n useNamespace,\n useSize,\n} from '@element-plus/hooks'\nimport { buttonGroupContextKey } from '@element-plus/tokens'\nimport { buttonEmits, buttonProps } from './button'\n\ndefineOptions({\n name: 'ElButton',\n})\n\nconst props = defineProps(buttonProps)\nconst emit = defineEmits(buttonEmits)\nconst slots = useSlots()\n\nconst buttonGroupContext = inject(buttonGroupContextKey, undefined)\nconst globalConfig = useGlobalConfig('button')\nconst ns = useNamespace('button')\nconst { form } = useFormItem()\nconst _size = useSize(computed(() => buttonGroupContext?.size))\nconst _disabled = useDisabled()\nconst _ref = ref<HTMLButtonElement>()\n\nconst _type = computed(() => props.type || buttonGroupContext?.type || '')\nconst autoInsertSpace = computed(\n () => props.autoInsertSpace ?? globalConfig.value?.autoInsertSpace ?? false\n)\n\n// add space between two characters in Chinese\nconst shouldAddSpace = computed(() => {\n const defaultSlot = slots.default?.()\n if (autoInsertSpace.value && defaultSlot?.length === 1) {\n const slot = defaultSlot[0]\n if (slot?.type === Text) {\n const text = slot.children\n return /^\\p{Unified_Ideograph}{2}$/u.test(text as string)\n }\n }\n return false\n})\n\n// calculate hover & active color by color\nconst typeColor = computed(() => useCssVar(`--el-color-${props.type}`).value)\nconst buttonStyle = computed(() => {\n let styles: Record<string, string> = {}\n\n const buttonColor = props.color || typeColor.value\n\n if (buttonColor) {\n const color = new TinyColor(buttonColor)\n const shadeBgColor = color.shade(10).toString()\n if (props.plain) {\n styles = {\n '--el-button-bg-color': color.tint(90).toString(),\n '--el-button-text-color': buttonColor,\n '--el-button-hover-text-color': 'var(--el-color-white)',\n '--el-button-hover-bg-color': buttonColor,\n '--el-button-hover-border-color': buttonColor,\n '--el-button-active-bg-color': shadeBgColor,\n '--el-button-active-text-color': 'var(--el-color-white)',\n '--el-button-active-border-color': shadeBgColor,\n }\n } else {\n const tintBgColor = color.tint(20).toString()\n styles = {\n '--el-button-bg-color': buttonColor,\n '--el-button-border-color': buttonColor,\n '--el-button-hover-bg-color': tintBgColor,\n '--el-button-hover-border-color': tintBgColor,\n '--el-button-active-bg-color': shadeBgColor,\n '--el-button-active-border-color': shadeBgColor,\n }\n }\n\n if (_disabled.value) {\n const disabledButtonColor = color.tint(50).toString()\n styles['--el-button-disabled-bg-color'] = disabledButtonColor\n styles['--el-button-disabled-border-color'] = disabledButtonColor\n }\n }\n\n return styles\n})\n\nconst handleClick = (evt: MouseEvent) => {\n if (props.nativeType === 'reset') {\n form?.resetFields()\n }\n emit('click', evt)\n}\n\ndefineExpose({\n /** @description button html element */\n ref: _ref,\n /** @description button size */\n size: _size,\n /** @description button type */\n type: _type,\n /** @description button disabled */\n disabled: _disabled,\n /** @description whether adding space */\n shouldAddSpace,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA0DA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAKA;;;;;;;;;;;AAaA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/es/components/index.mjs
CHANGED
|
@@ -77,7 +77,7 @@ export { backtopEmits, backtopProps } from './backtop/src/backtop.mjs';
|
|
|
77
77
|
export { badgeProps } from './badge/src/badge.mjs';
|
|
78
78
|
export { breadcrumbProps } from './breadcrumb/src/breadcrumb.mjs';
|
|
79
79
|
export { breadcrumbItemProps } from './breadcrumb/src/breadcrumb-item.mjs';
|
|
80
|
-
export { buttonEmits,
|
|
80
|
+
export { buttonEmits, buttonNativeTypes, buttonProps, buttonTypes } from './button/src/button.mjs';
|
|
81
81
|
export { calendarEmits, calendarProps } from './calendar/src/calendar.mjs';
|
|
82
82
|
export { cardProps } from './card/src/card.mjs';
|
|
83
83
|
export { CASCADER_PANEL_INJECTION_KEY, ExpandTrigger } from './cascader-panel/src/types.mjs';
|
|
@@ -3,7 +3,7 @@ import { QuestionFilled } from '@element-plus/icons-vue';
|
|
|
3
3
|
import '../../../utils/index.mjs';
|
|
4
4
|
import '../../tooltip/index.mjs';
|
|
5
5
|
import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
|
|
6
|
-
import {
|
|
6
|
+
import { buttonTypes } from '../../button/src/button.mjs';
|
|
7
7
|
import { iconPropType } from '../../../utils/vue/icon.mjs';
|
|
8
8
|
import { useTooltipContentProps } from '../../tooltip/src/tooltip.mjs';
|
|
9
9
|
|
|
@@ -19,12 +19,12 @@ const popconfirmProps = buildProps({
|
|
|
19
19
|
},
|
|
20
20
|
confirmButtonType: {
|
|
21
21
|
type: String,
|
|
22
|
-
values:
|
|
22
|
+
values: buttonTypes,
|
|
23
23
|
default: "primary"
|
|
24
24
|
},
|
|
25
25
|
cancelButtonType: {
|
|
26
26
|
type: String,
|
|
27
|
-
values:
|
|
27
|
+
values: buttonTypes,
|
|
28
28
|
default: "text"
|
|
29
29
|
},
|
|
30
30
|
icon: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popconfirm.mjs","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"popconfirm.mjs","sources":["../../../../../../packages/components/popconfirm/src/popconfirm.ts"],"sourcesContent":["import { buttonTypes } from '@element-plus/components/button'\nimport { QuestionFilled } from '@element-plus/icons-vue'\nimport { buildProps, definePropType, iconPropType } from '@element-plus/utils'\nimport { useTooltipContentProps } from '@element-plus/components/tooltip'\nimport type { Component, ExtractPropTypes } from 'vue'\n\nexport const popconfirmProps = buildProps({\n title: {\n type: String,\n },\n confirmButtonText: {\n type: String,\n },\n cancelButtonText: {\n type: String,\n },\n confirmButtonType: {\n type: String,\n values: buttonTypes,\n default: 'primary',\n },\n cancelButtonType: {\n type: String,\n values: buttonTypes,\n default: 'text',\n },\n icon: {\n type: iconPropType,\n default: QuestionFilled as Component,\n },\n iconColor: {\n type: String,\n default: '#f90',\n },\n hideIcon: {\n type: Boolean,\n default: false,\n },\n hideAfter: {\n type: Number,\n default: 200,\n },\n onConfirm: {\n type: definePropType<(e: Event) => Promise<void> | void>(Function),\n },\n onCancel: {\n type: definePropType<(e: Event) => Promise<void> | void>(Function),\n },\n teleported: useTooltipContentProps.teleported,\n} as const)\nexport type PopconfirmProps = ExtractPropTypes<typeof popconfirmProps>\n"],"names":[],"mappings":";;;;;;;;;AAIY,MAAC,eAAe,GAAG,UAAU,CAAC;AAC1C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,WAAW;AACvB,IAAI,OAAO,EAAE,SAAS;AACtB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,WAAW;AACvB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,YAAY;AACtB,IAAI,OAAO,EAAE,cAAc;AAC3B,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,UAAU,EAAE,sBAAsB,CAAC,UAAU;AAC/C,CAAC;;;;"}
|
package/es/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ export { ElBadge } from './components/badge/index.mjs';
|
|
|
19
19
|
export { breadcrumbProps } from './components/breadcrumb/src/breadcrumb.mjs';
|
|
20
20
|
export { breadcrumbItemProps } from './components/breadcrumb/src/breadcrumb-item.mjs';
|
|
21
21
|
export { ElBreadcrumb, ElBreadcrumbItem } from './components/breadcrumb/index.mjs';
|
|
22
|
-
export { buttonEmits,
|
|
22
|
+
export { buttonEmits, buttonNativeTypes, buttonProps, buttonTypes } from './components/button/src/button.mjs';
|
|
23
23
|
export { ElButton, ElButtonGroup } from './components/button/index.mjs';
|
|
24
24
|
export { calendarEmits, calendarProps } from './components/calendar/src/calendar.mjs';
|
|
25
25
|
export { ElCalendar } from './components/calendar/index.mjs';
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20220212";
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220212'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -13,13 +13,29 @@ export declare const ElButton: import("element-plus/es/utils").SFCWithInstall<im
|
|
|
13
13
|
readonly color: StringConstructor;
|
|
14
14
|
readonly autoInsertSpace: import("element-plus/es/utils").BuildPropReturn<BooleanConstructor, undefined, unknown, unknown, unknown>;
|
|
15
15
|
}, {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
17
|
+
readonly size: import("element-plus/es/utils").BuildPropReturn<StringConstructor, never, false, "default" | "small" | "large", never>;
|
|
18
|
+
readonly disabled: BooleanConstructor;
|
|
19
|
+
readonly type: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "", unknown, "" | "default" | "primary" | "success" | "warning" | "info" | "danger" | "text", unknown>;
|
|
20
|
+
readonly icon: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>, "", unknown, unknown, unknown>;
|
|
21
|
+
readonly nativeType: import("element-plus/es/utils").BuildPropReturn<StringConstructor, "button", unknown, "button" | "submit" | "reset", unknown>;
|
|
22
|
+
readonly loading: BooleanConstructor;
|
|
23
|
+
readonly loadingIcon: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>, () => import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>, unknown, unknown, unknown>;
|
|
24
|
+
readonly plain: BooleanConstructor;
|
|
25
|
+
readonly autofocus: BooleanConstructor;
|
|
26
|
+
readonly round: BooleanConstructor;
|
|
27
|
+
readonly circle: BooleanConstructor;
|
|
28
|
+
readonly color: StringConstructor;
|
|
29
|
+
readonly autoInsertSpace: import("element-plus/es/utils").BuildPropReturn<BooleanConstructor, undefined, unknown, unknown, unknown>;
|
|
30
|
+
}>> & {
|
|
31
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
32
|
+
}>>;
|
|
33
|
+
emit: (event: "click", evt: MouseEvent) => void;
|
|
34
|
+
slots: Readonly<{
|
|
35
|
+
[name: string]: import("vue").Slot | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
buttonGroupContext: import("../..").ButtonGroupContext | undefined;
|
|
38
|
+
globalConfig: import("vue").Ref<import("./src/button").ButtonConfigContext | undefined>;
|
|
23
39
|
ns: {
|
|
24
40
|
namespace: import("vue").ComputedRef<string>;
|
|
25
41
|
b: (blockSuffix?: string) => string;
|
|
@@ -34,6 +50,42 @@ export declare const ElButton: import("element-plus/es/utils").SFCWithInstall<im
|
|
|
34
50
|
(name: string): string;
|
|
35
51
|
};
|
|
36
52
|
};
|
|
53
|
+
form: import("../..").ElFormContext | undefined;
|
|
54
|
+
_size: import("vue").ComputedRef<"default" | "small" | "large">;
|
|
55
|
+
_disabled: import("vue").ComputedRef<boolean>;
|
|
56
|
+
_ref: import("vue").Ref<HTMLButtonElement | undefined>;
|
|
57
|
+
_type: import("vue").ComputedRef<"default" | "" | "primary" | "success" | "warning" | "info" | "danger" | "text">;
|
|
58
|
+
autoInsertSpace: import("vue").ComputedRef<import("element-plus/es/utils").BuildPropType<BooleanConstructor, unknown, unknown>>;
|
|
59
|
+
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
60
|
+
typeColor: import("vue").ComputedRef<string>;
|
|
61
|
+
buttonStyle: import("vue").ComputedRef<Record<string, string>>;
|
|
62
|
+
handleClick: (evt: MouseEvent) => void;
|
|
63
|
+
ElIcon: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
64
|
+
readonly size: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
|
|
65
|
+
readonly color: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
|
|
66
|
+
}, {
|
|
67
|
+
ns: {
|
|
68
|
+
namespace: import("vue").ComputedRef<string>;
|
|
69
|
+
b: (blockSuffix?: string) => string;
|
|
70
|
+
e: (element?: string | undefined) => string;
|
|
71
|
+
m: (modifier?: string | undefined) => string;
|
|
72
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
73
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
74
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
75
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
76
|
+
is: {
|
|
77
|
+
(name: string, state: boolean | undefined): string;
|
|
78
|
+
(name: string): string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
style: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
82
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
83
|
+
readonly size: import("element-plus/es/utils").BuildPropReturn<import("element-plus/es/utils").PropWrapper<string | number>, unknown, unknown, unknown, unknown>;
|
|
84
|
+
readonly color: import("element-plus/es/utils").BuildPropReturn<StringConstructor, unknown, unknown, unknown, unknown>;
|
|
85
|
+
}>>, {
|
|
86
|
+
size: import("element-plus/es/utils").BuildPropType<import("element-plus/es/utils").PropWrapper<string | number>, unknown, unknown>;
|
|
87
|
+
color: string;
|
|
88
|
+
}>> & Record<string, any>;
|
|
37
89
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
90
|
click: (evt: MouseEvent) => boolean;
|
|
39
91
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -14,9 +14,9 @@ const ElButton = install.withInstall(button$1["default"], {
|
|
|
14
14
|
const ElButtonGroup = install.withNoopInstall(buttonGroup["default"]);
|
|
15
15
|
|
|
16
16
|
exports.buttonEmits = button.buttonEmits;
|
|
17
|
-
exports.
|
|
17
|
+
exports.buttonNativeTypes = button.buttonNativeTypes;
|
|
18
18
|
exports.buttonProps = button.buttonProps;
|
|
19
|
-
exports.
|
|
19
|
+
exports.buttonTypes = button.buttonTypes;
|
|
20
20
|
exports.ElButton = ElButton;
|
|
21
21
|
exports.ElButtonGroup = ElButtonGroup;
|
|
22
22
|
exports["default"] = ElButton;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue';
|
|
2
2
|
import type button from './button.vue';
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
3
|
+
export declare const buttonTypes: readonly ["default", "primary", "success", "warning", "info", "danger", "text", ""];
|
|
4
|
+
export declare const buttonNativeTypes: readonly ["button", "submit", "reset"];
|
|
5
5
|
export declare const buttonProps: {
|
|
6
6
|
readonly size: import("element-plus/es/utils").BuildPropReturn<StringConstructor, never, false, "default" | "small" | "large", never>;
|
|
7
7
|
readonly disabled: BooleanConstructor;
|
|
@@ -17,9 +17,6 @@ export declare const buttonProps: {
|
|
|
17
17
|
readonly color: StringConstructor;
|
|
18
18
|
readonly autoInsertSpace: import("element-plus/es/utils").BuildPropReturn<BooleanConstructor, undefined, unknown, unknown, unknown>;
|
|
19
19
|
};
|
|
20
|
-
export interface ButtonConfigContext {
|
|
21
|
-
autoInsertSpace?: boolean;
|
|
22
|
-
}
|
|
23
20
|
export declare const buttonEmits: {
|
|
24
21
|
click: (evt: MouseEvent) => boolean;
|
|
25
22
|
};
|
|
@@ -28,3 +25,6 @@ export declare type ButtonEmits = typeof buttonEmits;
|
|
|
28
25
|
export declare type ButtonType = ButtonProps['type'];
|
|
29
26
|
export declare type ButtonNativeType = ButtonProps['nativeType'];
|
|
30
27
|
export declare type ButtonInstance = InstanceType<typeof button>;
|
|
28
|
+
export interface ButtonConfigContext {
|
|
29
|
+
autoInsertSpace?: boolean;
|
|
30
|
+
}
|
|
@@ -9,7 +9,7 @@ var props = require('../../../utils/vue/props.js');
|
|
|
9
9
|
var index = require('../../../hooks/use-common-props/index.js');
|
|
10
10
|
var icon = require('../../../utils/vue/icon.js');
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const buttonTypes = [
|
|
13
13
|
"default",
|
|
14
14
|
"primary",
|
|
15
15
|
"success",
|
|
@@ -19,13 +19,13 @@ const buttonType = [
|
|
|
19
19
|
"text",
|
|
20
20
|
""
|
|
21
21
|
];
|
|
22
|
-
const
|
|
22
|
+
const buttonNativeTypes = ["button", "submit", "reset"];
|
|
23
23
|
const buttonProps = props.buildProps({
|
|
24
24
|
size: index.useSizeProp,
|
|
25
25
|
disabled: Boolean,
|
|
26
26
|
type: {
|
|
27
27
|
type: String,
|
|
28
|
-
values:
|
|
28
|
+
values: buttonTypes,
|
|
29
29
|
default: ""
|
|
30
30
|
},
|
|
31
31
|
icon: {
|
|
@@ -34,7 +34,7 @@ const buttonProps = props.buildProps({
|
|
|
34
34
|
},
|
|
35
35
|
nativeType: {
|
|
36
36
|
type: String,
|
|
37
|
-
values:
|
|
37
|
+
values: buttonNativeTypes,
|
|
38
38
|
default: "button"
|
|
39
39
|
},
|
|
40
40
|
loading: Boolean,
|
|
@@ -57,7 +57,7 @@ const buttonEmits = {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
exports.buttonEmits = buttonEmits;
|
|
60
|
-
exports.
|
|
60
|
+
exports.buttonNativeTypes = buttonNativeTypes;
|
|
61
61
|
exports.buttonProps = buttonProps;
|
|
62
|
-
exports.
|
|
62
|
+
exports.buttonTypes = buttonTypes;
|
|
63
63
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../../../../packages/components/button/src/button.ts"],"sourcesContent":["import { useSizeProp } from '@element-plus/hooks'\nimport { buildProps, iconPropType } from '@element-plus/utils'\nimport { Loading } from '@element-plus/icons-vue'\nimport type { ExtractPropTypes } from 'vue'\nimport type button from './button.vue'\n\nexport const
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../../../../packages/components/button/src/button.ts"],"sourcesContent":["import { useSizeProp } from '@element-plus/hooks'\nimport { buildProps, iconPropType } from '@element-plus/utils'\nimport { Loading } from '@element-plus/icons-vue'\nimport type { ExtractPropTypes } from 'vue'\nimport type button from './button.vue'\n\nexport const buttonTypes = [\n 'default',\n 'primary',\n 'success',\n 'warning',\n 'info',\n 'danger',\n 'text',\n '',\n] as const\nexport const buttonNativeTypes = ['button', 'submit', 'reset'] as const\n\nexport const buttonProps = buildProps({\n size: useSizeProp,\n disabled: Boolean,\n type: {\n type: String,\n values: buttonTypes,\n default: '',\n },\n icon: {\n type: iconPropType,\n default: '',\n },\n nativeType: {\n type: String,\n values: buttonNativeTypes,\n default: 'button',\n },\n loading: Boolean,\n loadingIcon: {\n type: iconPropType,\n default: () => Loading,\n },\n plain: Boolean,\n autofocus: Boolean,\n round: Boolean,\n circle: Boolean,\n color: String,\n autoInsertSpace: {\n type: Boolean,\n default: undefined,\n },\n} as const)\nexport const buttonEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\n\nexport type ButtonProps = ExtractPropTypes<typeof buttonProps>\nexport type ButtonEmits = typeof buttonEmits\n\nexport type ButtonType = ButtonProps['type']\nexport type ButtonNativeType = ButtonProps['nativeType']\n\nexport type ButtonInstance = InstanceType<typeof button>\n\nexport interface ButtonConfigContext {\n autoInsertSpace?: boolean\n}\n"],"names":["buildProps","useSizeProp","iconPropType","Loading"],"mappings":";;;;;;;;;;;AAGY,MAAC,WAAW,GAAG;AAC3B,EAAE,SAAS;AACX,EAAE,SAAS;AACX,EAAE,SAAS;AACX,EAAE,SAAS;AACX,EAAE,MAAM;AACR,EAAE,QAAQ;AACV,EAAE,MAAM;AACR,EAAE,EAAE;AACJ,EAAE;AACU,MAAC,iBAAiB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE;AACnD,MAAC,WAAW,GAAGA,gBAAU,CAAC;AACtC,EAAE,IAAI,EAAEC,iBAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,WAAW;AACvB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,iBAAY;AACtB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,iBAAiB;AAC7B,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAEA,iBAAY;AACtB,IAAI,OAAO,EAAE,MAAMC,gBAAO;AAC1B,GAAG;AACH,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,SAAS,EAAE,OAAO;AACpB,EAAE,KAAK,EAAE,OAAO;AAChB,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,WAAW,GAAG;AAC3B,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;;;;"}
|