ep-craft 0.1.0 → 0.1.2

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/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # ep-craft
2
+
3
+ 基于 Vue 3 和 Element Plus 的组件库封装,统一使用 `Ep` 前缀对外提供组件与服务类 API。
4
+
5
+ ## 环境要求
6
+
7
+ - Node.js:建议 18+(Vite 5 需要较新的 Node 版本)
8
+ - 包管理器:npm(项目已包含 `package-lock.json`)
9
+
10
+ ## 依赖安装
11
+
12
+ 在项目根目录执行:
13
+
14
+ ```bash
15
+ npm install
16
+ ```
17
+
18
+ ## 开发与构建
19
+
20
+ ### 组件库构建
21
+
22
+ ```bash
23
+ npm run build
24
+ ```
25
+
26
+ 构建产物输出到 `dist/`,包含:
27
+
28
+ - `dist/ep-craft.js`
29
+ - `dist/index.d.ts`
30
+ - `dist/index.css`
31
+
32
+ ### 生成代码/文档(可选)
33
+
34
+ ```bash
35
+ npm run gen
36
+ npm run gen:docs
37
+ ```
38
+
39
+ ### 本地启动文档站
40
+
41
+ ```bash
42
+ npm run docs:dev
43
+ ```
44
+
45
+ ### 构建与预览文档站
46
+
47
+ ```bash
48
+ npm run docs:build
49
+ npm run docs:preview
50
+ ```
51
+
52
+ ## 在业务项目中使用
53
+
54
+ `ep-craft` 的对等依赖(peerDependencies)为 `vue` 与 `element-plus`,请确保业务项目已安装并满足版本要求。
55
+
56
+ ### 方式一:全量注册
57
+
58
+ ```ts
59
+ import { createApp } from 'vue'
60
+ import App from './App.vue'
61
+
62
+ import EpCraft from 'ep-craft'
63
+ import 'ep-craft/dist/index.css'
64
+
65
+ const app = createApp(App)
66
+ app.use(EpCraft)
67
+ app.mount('#app')
68
+ ```
69
+
70
+ ### 方式二:按需导入(配合 unplugin-vue-components)
71
+
72
+ 安装依赖:
73
+
74
+ ```bash
75
+ npm i -D unplugin-vue-components
76
+ ```
77
+
78
+ 在 `vite.config.ts` 中配置解析器:
79
+
80
+ ```ts
81
+ import Components from 'unplugin-vue-components/vite'
82
+ import { EpCraftResolver } from 'ep-craft/resolver'
83
+
84
+ export default {
85
+ plugins: [
86
+ Components({
87
+ resolvers: [EpCraftResolver()],
88
+ }),
89
+ ],
90
+ }
91
+ ```
92
+
93
+ ## Element Plus 服务类 API(Ep 前缀)
94
+
95
+ 库内对 Element Plus 的部分服务类 API 做了前缀导出,便于统一使用:
96
+
97
+ - `EpMessage`
98
+ - `EpMessageBox`
99
+ - `EpNotification`
100
+ - `EpLoading`
101
+ - `EpInfiniteScroll`
102
+
103
+ ```ts
104
+ import { EpMessage } from 'ep-craft'
105
+
106
+ EpMessage.success('Hello')
107
+ ```
108
+
@@ -0,0 +1,157 @@
1
+ declare var __VLS_11: {}, __VLS_29: {}, __VLS_31: {};
2
+ type __VLS_Slots = {} & {
3
+ loading?: (props: typeof __VLS_11) => any;
4
+ } & {
5
+ icon?: (props: typeof __VLS_29) => any;
6
+ } & {
7
+ default?: (props: typeof __VLS_31) => any;
8
+ };
9
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
10
+ readonly size: {
11
+ readonly type: import("vue").PropType<"" | "large" | "default" | "small">;
12
+ readonly values: readonly ["", "large", "default", "small"];
13
+ };
14
+ readonly disabled: {
15
+ readonly type: BooleanConstructor;
16
+ readonly default: undefined;
17
+ };
18
+ readonly type: {
19
+ readonly type: import("vue").PropType<typeof import("./button").buttonTypes[number]>;
20
+ readonly values: readonly ["default", "primary", "success", "warning", "info", "danger", "text", ""];
21
+ readonly default: "";
22
+ };
23
+ readonly icon: {
24
+ readonly type: import("vue").PropType<any>;
25
+ };
26
+ readonly nativeType: {
27
+ readonly type: import("vue").PropType<typeof import("./button").buttonNativeTypes[number]>;
28
+ readonly values: readonly ["button", "submit", "reset"];
29
+ readonly default: "button";
30
+ };
31
+ readonly loading: BooleanConstructor;
32
+ readonly loadingIcon: {
33
+ readonly type: import("vue").PropType<any>;
34
+ readonly default: () => import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
35
+ };
36
+ readonly plain: {
37
+ readonly type: BooleanConstructor;
38
+ readonly default: undefined;
39
+ };
40
+ readonly text: {
41
+ readonly type: BooleanConstructor;
42
+ readonly default: undefined;
43
+ };
44
+ readonly link: BooleanConstructor;
45
+ readonly bg: BooleanConstructor;
46
+ readonly autofocus: BooleanConstructor;
47
+ readonly round: {
48
+ readonly type: BooleanConstructor;
49
+ readonly default: undefined;
50
+ };
51
+ readonly circle: BooleanConstructor;
52
+ readonly dashed: {
53
+ readonly type: BooleanConstructor;
54
+ readonly default: undefined;
55
+ };
56
+ readonly color: StringConstructor;
57
+ readonly dark: BooleanConstructor;
58
+ readonly autoInsertSpace: {
59
+ readonly type: BooleanConstructor;
60
+ readonly default: undefined;
61
+ };
62
+ readonly tag: {
63
+ readonly type: import("vue").PropType<string | object>;
64
+ readonly default: "button";
65
+ };
66
+ }>, {
67
+ ref: import("vue").Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
68
+ size: import("vue").ComputedRef<"" | "default" | "small" | "large">;
69
+ type: import("vue").ComputedRef<any>;
70
+ disabled: import("vue").ComputedRef<boolean>;
71
+ shouldAddSpace: import("vue").ComputedRef<boolean>;
72
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
73
+ click: (evt: MouseEvent) => void;
74
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
75
+ readonly size: {
76
+ readonly type: import("vue").PropType<"" | "large" | "default" | "small">;
77
+ readonly values: readonly ["", "large", "default", "small"];
78
+ };
79
+ readonly disabled: {
80
+ readonly type: BooleanConstructor;
81
+ readonly default: undefined;
82
+ };
83
+ readonly type: {
84
+ readonly type: import("vue").PropType<typeof import("./button").buttonTypes[number]>;
85
+ readonly values: readonly ["default", "primary", "success", "warning", "info", "danger", "text", ""];
86
+ readonly default: "";
87
+ };
88
+ readonly icon: {
89
+ readonly type: import("vue").PropType<any>;
90
+ };
91
+ readonly nativeType: {
92
+ readonly type: import("vue").PropType<typeof import("./button").buttonNativeTypes[number]>;
93
+ readonly values: readonly ["button", "submit", "reset"];
94
+ readonly default: "button";
95
+ };
96
+ readonly loading: BooleanConstructor;
97
+ readonly loadingIcon: {
98
+ readonly type: import("vue").PropType<any>;
99
+ readonly default: () => import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
100
+ };
101
+ readonly plain: {
102
+ readonly type: BooleanConstructor;
103
+ readonly default: undefined;
104
+ };
105
+ readonly text: {
106
+ readonly type: BooleanConstructor;
107
+ readonly default: undefined;
108
+ };
109
+ readonly link: BooleanConstructor;
110
+ readonly bg: BooleanConstructor;
111
+ readonly autofocus: BooleanConstructor;
112
+ readonly round: {
113
+ readonly type: BooleanConstructor;
114
+ readonly default: undefined;
115
+ };
116
+ readonly circle: BooleanConstructor;
117
+ readonly dashed: {
118
+ readonly type: BooleanConstructor;
119
+ readonly default: undefined;
120
+ };
121
+ readonly color: StringConstructor;
122
+ readonly dark: BooleanConstructor;
123
+ readonly autoInsertSpace: {
124
+ readonly type: BooleanConstructor;
125
+ readonly default: undefined;
126
+ };
127
+ readonly tag: {
128
+ readonly type: import("vue").PropType<string | object>;
129
+ readonly default: "button";
130
+ };
131
+ }>> & Readonly<{
132
+ onClick?: ((evt: MouseEvent) => any) | undefined;
133
+ }>, {
134
+ readonly type: "" | "primary" | "success" | "warning" | "info" | "default" | "text" | "danger";
135
+ readonly dark: boolean;
136
+ readonly disabled: boolean;
137
+ readonly autofocus: boolean;
138
+ readonly text: boolean;
139
+ readonly loading: boolean;
140
+ readonly circle: boolean;
141
+ readonly nativeType: "button" | "submit" | "reset";
142
+ readonly loadingIcon: any;
143
+ readonly plain: boolean;
144
+ readonly link: boolean;
145
+ readonly bg: boolean;
146
+ readonly round: boolean;
147
+ readonly dashed: boolean;
148
+ readonly autoInsertSpace: boolean;
149
+ readonly tag: string | object;
150
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
151
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
152
+ export default _default;
153
+ type __VLS_WithSlots<T, S> = T & {
154
+ new (): {
155
+ $slots: S;
156
+ };
157
+ };
@@ -0,0 +1,171 @@
1
+ import { defineComponent as Z, useSlots as j, inject as G, computed as a, ref as oo, Text as eo, openBlock as d, createBlock as m, resolveDynamicComponent as C, mergeProps as to, withCtx as x, createElementBlock as T, Fragment as ro, renderSlot as _, unref as N, normalizeClass as K, createCommentVNode as A } from "vue";
2
+ import { ElIcon as lo } from "element-plus/es/components/icon/index.mjs";
3
+ import { useFormSize as no, useFormDisabled as ao } from "element-plus/es/components/form/src/hooks/use-form-common-props.mjs";
4
+ import { useFormItem as so } from "element-plus/es/components/form/src/hooks/use-form-item.mjs";
5
+ import { useGlobalConfig as io } from "element-plus/es/components/config-provider/src/hooks/use-global-config.mjs";
6
+ import { buttonGroupContextKey as co } from "element-plus/es/components/button/src/constants.mjs";
7
+ import { buttonEmits as uo, buttonProps as po } from "./button.js";
8
+ import { TinyColor as vo } from "../../node_modules/@ctrl/tinycolor/dist/module/index.js";
9
+ const b = "ep", k = "button", So = /* @__PURE__ */ Z({
10
+ name: "EpButton",
11
+ __name: "EpButton",
12
+ props: po,
13
+ emits: uo,
14
+ setup(U, { expose: q, emit: H }) {
15
+ const w = lo, e = U, J = H, h = j(), L = (o = "") => o ? `${b}-${k}-${o}` : `${b}-${k}`, B = (o) => o ? `${b}-${k}--${o}` : "", i = (o, r = !0) => o && r ? `is-${o}` : "", l = (o) => `--${b}-${k}-${o}`, g = (o) => `--${b}-${o}`, y = (o) => {
16
+ const r = {};
17
+ for (const n in o) o[n] && (r[`--${b}-${k}-${n}`] = o[n]);
18
+ return r;
19
+ }, u = G(co, void 0), p = io("button"), { form: S } = so(), I = no(a(() => u == null ? void 0 : u.size)), c = ao(), E = oo(), z = a(
20
+ () => {
21
+ var o;
22
+ return e.type || (u == null ? void 0 : u.type) || ((o = p.value) == null ? void 0 : o.type) || "";
23
+ }
24
+ ), M = a(
25
+ () => {
26
+ var o;
27
+ return e.autoInsertSpace ?? ((o = p.value) == null ? void 0 : o.autoInsertSpace) ?? !1;
28
+ }
29
+ ), F = a(() => {
30
+ var o;
31
+ return e.plain ?? ((o = p.value) == null ? void 0 : o.plain) ?? !1;
32
+ }), O = a(() => {
33
+ var o;
34
+ return e.round ?? ((o = p.value) == null ? void 0 : o.round) ?? !1;
35
+ }), V = a(() => {
36
+ var o;
37
+ return e.text ?? ((o = p.value) == null ? void 0 : o.text) ?? !1;
38
+ }), Q = a(() => {
39
+ var o;
40
+ return e.dashed ?? ((o = p.value) == null ? void 0 : o.dashed) ?? !1;
41
+ }), R = a(() => e.tag === "button" ? {
42
+ ariaDisabled: c.value || e.loading,
43
+ disabled: c.value || e.loading,
44
+ autofocus: e.autofocus,
45
+ type: e.nativeType
46
+ } : {}), D = a(() => {
47
+ var r;
48
+ const o = (r = h.default) == null ? void 0 : r.call(h);
49
+ if (M.value && (o == null ? void 0 : o.length) === 1) {
50
+ const n = o[0];
51
+ if ((n == null ? void 0 : n.type) === eo) {
52
+ const t = n.children;
53
+ return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(t.trim());
54
+ }
55
+ }
56
+ return !1;
57
+ }), W = (o) => {
58
+ if (c.value || e.loading) {
59
+ o.stopPropagation();
60
+ return;
61
+ }
62
+ e.nativeType === "reset" && (S == null || S.resetFields()), J("click", o);
63
+ };
64
+ function s(o, r = 20) {
65
+ return o.mix("#141414", r).toString();
66
+ }
67
+ const X = a(() => {
68
+ let o = {}, r = e.color;
69
+ if (r) {
70
+ const n = r.match(/var\((.*?)\)/);
71
+ n && (r = window.getComputedStyle(window.document.documentElement).getPropertyValue(n[1]));
72
+ const t = new vo(r), v = e.dark ? t.tint(20).toString() : s(t, 20);
73
+ if (F.value)
74
+ o = y({
75
+ "bg-color": e.dark ? s(t, 90) : t.tint(90).toString(),
76
+ "text-color": r,
77
+ "border-color": e.dark ? s(t, 50) : t.tint(50).toString(),
78
+ "hover-text-color": `var(${g("color-white")})`,
79
+ "hover-bg-color": r,
80
+ "hover-border-color": r,
81
+ "active-bg-color": v,
82
+ "active-text-color": `var(${g("color-white")})`,
83
+ "active-border-color": v
84
+ }), c.value && (o[l("disabled-bg-color")] = e.dark ? s(t, 90) : t.tint(90).toString(), o[l("disabled-text-color")] = e.dark ? s(t, 50) : t.tint(50).toString(), o[l("disabled-border-color")] = e.dark ? s(t, 80) : t.tint(80).toString());
85
+ else if (e.link || V.value) {
86
+ const f = e.dark ? s(t, 30) : t.tint(30).toString();
87
+ if (o = y({
88
+ "text-color": r,
89
+ "hover-text-color": f,
90
+ "active-text-color": v
91
+ }), e.link && (o[l("hover-link-text-color")] = f, o[l("active-color")] = v), c.value) {
92
+ const $ = e.dark ? s(t, 50) : t.tint(50).toString();
93
+ o[l("disabled-bg-color")] = "transparent", o[l("disabled-text-color")] = $, o[l("disabled-border-color")] = "transparent";
94
+ }
95
+ } else {
96
+ const f = e.dark ? s(t, 30) : t.tint(30).toString(), $ = t.isDark() ? `var(${g("color-white")})` : `var(${g("color-black")})`;
97
+ if (o = y({
98
+ "bg-color": r,
99
+ "text-color": $,
100
+ "border-color": r,
101
+ "hover-bg-color": f,
102
+ "hover-text-color": $,
103
+ "hover-border-color": f,
104
+ "active-bg-color": v,
105
+ "active-border-color": v
106
+ }), c.value) {
107
+ const P = e.dark ? s(t, 50) : t.tint(50).toString();
108
+ o[l("disabled-bg-color")] = P, o[l("disabled-text-color")] = e.dark ? "rgba(255, 255, 255, 0.5)" : `var(${g("color-white")})`, o[l("disabled-border-color")] = P;
109
+ }
110
+ }
111
+ }
112
+ return o;
113
+ }), Y = a(() => [
114
+ L(),
115
+ B(z.value),
116
+ B(I.value),
117
+ i("disabled", c.value),
118
+ i("loading", e.loading),
119
+ i("plain", F.value),
120
+ i("round", O.value),
121
+ i("circle", e.circle),
122
+ i("text", V.value),
123
+ i("dashed", Q.value),
124
+ i("link", e.link),
125
+ i("has-bg", e.bg)
126
+ ]);
127
+ return q({
128
+ ref: E,
129
+ size: I,
130
+ type: z,
131
+ disabled: c,
132
+ shouldAddSpace: D
133
+ }), (o, r) => (d(), m(C(o.tag), to({
134
+ ref_key: "_ref",
135
+ ref: E
136
+ }, R.value, {
137
+ class: Y.value,
138
+ style: X.value,
139
+ onClick: W
140
+ }), {
141
+ default: x(() => [
142
+ o.loading ? (d(), T(ro, { key: 0 }, [
143
+ o.$slots.loading ? _(o.$slots, "loading", { key: 0 }) : (d(), m(N(w), {
144
+ key: 1,
145
+ class: K("is-loading")
146
+ }, {
147
+ default: x(() => [
148
+ (d(), m(C(o.loadingIcon)))
149
+ ]),
150
+ _: 1
151
+ }))
152
+ ], 64)) : o.icon || o.$slots.icon ? (d(), m(N(w), { key: 1 }, {
153
+ default: x(() => [
154
+ o.icon ? (d(), m(C(o.icon), { key: 0 })) : _(o.$slots, "icon", { key: 1 })
155
+ ]),
156
+ _: 3
157
+ })) : A("", !0),
158
+ o.$slots.default ? (d(), T("span", {
159
+ key: 2,
160
+ class: K({ "ep-button__text--expand": D.value })
161
+ }, [
162
+ _(o.$slots, "default")
163
+ ], 2)) : A("", !0)
164
+ ]),
165
+ _: 3
166
+ }, 16, ["class", "style"]));
167
+ }
168
+ });
169
+ export {
170
+ So as default
171
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./EpButton.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,88 @@
1
+ import type { ExtractPropTypes, PropType } from 'vue';
2
+ /**
3
+ * EpButton 的 props / emits / 常量定义
4
+ * 从 element-plus 按钮源码 vendored 而来,可直接修改。
5
+ */
6
+ export declare const buttonTypes: readonly ["default", "primary", "success", "warning", "info", "danger", "text", ""];
7
+ export declare const buttonNativeTypes: readonly ["button", "submit", "reset"];
8
+ export declare const buttonProps: {
9
+ /** 按钮尺寸 */
10
+ readonly size: {
11
+ readonly type: PropType<"" | "large" | "default" | "small">;
12
+ readonly values: readonly ["", "large", "default", "small"];
13
+ };
14
+ /** 是否禁用 */
15
+ readonly disabled: {
16
+ readonly type: BooleanConstructor;
17
+ readonly default: undefined;
18
+ };
19
+ /** 按钮类型 */
20
+ readonly type: {
21
+ readonly type: PropType<(typeof buttonTypes)[number]>;
22
+ readonly values: readonly ["default", "primary", "success", "warning", "info", "danger", "text", ""];
23
+ readonly default: "";
24
+ };
25
+ /** 图标组件 */
26
+ readonly icon: {
27
+ readonly type: PropType<any>;
28
+ };
29
+ /** 原生 button 类型 */
30
+ readonly nativeType: {
31
+ readonly type: PropType<(typeof buttonNativeTypes)[number]>;
32
+ readonly values: readonly ["button", "submit", "reset"];
33
+ readonly default: "button";
34
+ };
35
+ /** 是否为加载中状态 */
36
+ readonly loading: BooleanConstructor;
37
+ /** 自定义加载中图标组件 */
38
+ readonly loadingIcon: {
39
+ readonly type: PropType<any>;
40
+ readonly default: () => import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
41
+ };
42
+ /** 是否为朴素按钮 */
43
+ readonly plain: {
44
+ readonly type: BooleanConstructor;
45
+ readonly default: undefined;
46
+ };
47
+ /** 是否为文字按钮 */
48
+ readonly text: {
49
+ readonly type: BooleanConstructor;
50
+ readonly default: undefined;
51
+ };
52
+ /** 是否为链接按钮 */
53
+ readonly link: BooleanConstructor;
54
+ /** 文字按钮背景色是否常亮 */
55
+ readonly bg: BooleanConstructor;
56
+ /** 原生 autofocus */
57
+ readonly autofocus: BooleanConstructor;
58
+ /** 是否为圆角按钮 */
59
+ readonly round: {
60
+ readonly type: BooleanConstructor;
61
+ readonly default: undefined;
62
+ };
63
+ /** 是否为圆形按钮 */
64
+ readonly circle: BooleanConstructor;
65
+ /** 是否为虚线按钮 */
66
+ readonly dashed: {
67
+ readonly type: BooleanConstructor;
68
+ readonly default: undefined;
69
+ };
70
+ /** 自定义按钮颜色,自动计算 hover 和 active 颜色 */
71
+ readonly color: StringConstructor;
72
+ /** 暗黑模式,将 color 自动转换为暗黑模式颜色 */
73
+ readonly dark: BooleanConstructor;
74
+ /** 是否在两个中文字符之间自动插入空格 */
75
+ readonly autoInsertSpace: {
76
+ readonly type: BooleanConstructor;
77
+ readonly default: undefined;
78
+ };
79
+ /** 自定义元素标签 */
80
+ readonly tag: {
81
+ readonly type: PropType<string | object>;
82
+ readonly default: "button";
83
+ };
84
+ };
85
+ export declare const buttonEmits: {
86
+ click: (evt: MouseEvent) => boolean;
87
+ };
88
+ export type ButtonProps = ExtractPropTypes<typeof buttonProps>;
@@ -0,0 +1,95 @@
1
+ import { Loading as e } from "@element-plus/icons-vue";
2
+ const o = [
3
+ "default",
4
+ "primary",
5
+ "success",
6
+ "warning",
7
+ "info",
8
+ "danger",
9
+ "text",
10
+ ""
11
+ ], n = ["button", "submit", "reset"], l = {
12
+ /** 按钮尺寸 */
13
+ size: {
14
+ type: String,
15
+ values: ["", "large", "default", "small"]
16
+ },
17
+ /** 是否禁用 */
18
+ disabled: {
19
+ type: Boolean,
20
+ default: void 0
21
+ },
22
+ /** 按钮类型 */
23
+ type: {
24
+ type: String,
25
+ values: o,
26
+ default: ""
27
+ },
28
+ /** 图标组件 */
29
+ icon: {
30
+ type: [String, Object, Function]
31
+ },
32
+ /** 原生 button 类型 */
33
+ nativeType: {
34
+ type: String,
35
+ values: n,
36
+ default: "button"
37
+ },
38
+ /** 是否为加载中状态 */
39
+ loading: Boolean,
40
+ /** 自定义加载中图标组件 */
41
+ loadingIcon: {
42
+ type: [String, Object, Function],
43
+ default: () => e
44
+ },
45
+ /** 是否为朴素按钮 */
46
+ plain: {
47
+ type: Boolean,
48
+ default: void 0
49
+ },
50
+ /** 是否为文字按钮 */
51
+ text: {
52
+ type: Boolean,
53
+ default: void 0
54
+ },
55
+ /** 是否为链接按钮 */
56
+ link: Boolean,
57
+ /** 文字按钮背景色是否常亮 */
58
+ bg: Boolean,
59
+ /** 原生 autofocus */
60
+ autofocus: Boolean,
61
+ /** 是否为圆角按钮 */
62
+ round: {
63
+ type: Boolean,
64
+ default: void 0
65
+ },
66
+ /** 是否为圆形按钮 */
67
+ circle: Boolean,
68
+ /** 是否为虚线按钮 */
69
+ dashed: {
70
+ type: Boolean,
71
+ default: void 0
72
+ },
73
+ /** 自定义按钮颜色,自动计算 hover 和 active 颜色 */
74
+ color: String,
75
+ /** 暗黑模式,将 color 自动转换为暗黑模式颜色 */
76
+ dark: Boolean,
77
+ /** 是否在两个中文字符之间自动插入空格 */
78
+ autoInsertSpace: {
79
+ type: Boolean,
80
+ default: void 0
81
+ },
82
+ /** 自定义元素标签 */
83
+ tag: {
84
+ type: [String, Object],
85
+ default: "button"
86
+ }
87
+ }, i = {
88
+ click: (t) => t instanceof MouseEvent
89
+ };
90
+ export {
91
+ i as buttonEmits,
92
+ n as buttonNativeTypes,
93
+ l as buttonProps,
94
+ o as buttonTypes
95
+ };
@@ -1,4 +1,6 @@
1
1
  import type { Plugin } from 'vue';
2
- import { ElButton } from 'element-plus';
3
- export declare const EpButton: typeof ElButton & Plugin;
2
+ import EpButtonComponent from './EpButton.vue';
3
+ import './theme/index.scss';
4
+ export declare const EpButton: typeof EpButtonComponent & Plugin;
4
5
  export default EpButton;
6
+ export * from './button';
@@ -1,6 +1,8 @@
1
- import { ElButton as t } from "element-plus";
2
- import { withInstall as o } from "../../utils/with-install.js";
3
- const n = Object.assign({}, t, { name: "EpButton" }), r = o(n, "ep-button");
1
+ import { withInstall as t } from "../../utils/with-install.js";
2
+ import o from "./EpButton.vue.js";
3
+ /* empty css */
4
+ import "@element-plus/icons-vue";
5
+ const n = t(o, "ep-button");
4
6
  export {
5
- r as EpButton
7
+ n as EpButton
6
8
  };