morghulis 2.0.47 → 2.0.49
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/components.d.ts +15 -0
- package/dist/morghulis.css +1 -1
- package/dist/morghulis.es.js +115 -147
- package/global.d.ts +66 -17
- package/index.d.ts +14 -30
- package/package.json +12 -4
- package/volar.d.ts +14 -0
package/components.d.ts
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
// 自动生成的组件声明文件
|
2
|
+
declare module '@vue/runtime-core' {
|
3
|
+
export interface GlobalComponents {
|
4
|
+
MButton: {
|
5
|
+
type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
|
6
|
+
size?: 'large' | 'default' | 'small'
|
7
|
+
plain?: boolean
|
8
|
+
round?: boolean
|
9
|
+
circle?: boolean
|
10
|
+
disabled?: boolean
|
11
|
+
loading?: boolean
|
12
|
+
icon?: string
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
package/dist/morghulis.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
.m-button
|
1
|
+
.m-button{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:#606266;text-align:center;box-sizing:border-box;outline:none;transition:.1s;font-weight:500;-webkit-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:#fff;border:1px solid #dcdfe6;padding:8px 15px;font-size:14px;border-radius:4px}.m-button:hover{color:#409eff;border-color:#c6e2ff;background-color:#ecf5ff}.m-button:active{color:#3a8ee6;border-color:#3a8ee6;outline:none}.m-button--primary{color:#fff;background-color:#409eff;border-color:#409eff}.m-button--primary:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}.m-button--primary:active{background:#3a8ee6;border-color:#3a8ee6;color:#fff}.m-button--success{color:#fff;background-color:#67c23a;border-color:#67c23a}.m-button--success:hover{background:#85ce61;border-color:#85ce61;color:#fff}.m-button--success:active{background:#5daf34;border-color:#5daf34;color:#fff}.m-button--warning{color:#fff;background-color:#e6a23c;border-color:#e6a23c}.m-button--warning:hover{background:#ebb563;border-color:#ebb563;color:#fff}.m-button--warning:active{background:#cf9236;border-color:#cf9236;color:#fff}.m-button--danger{color:#fff;background-color:#f56c6c;border-color:#f56c6c}.m-button--danger:hover{background:#f78989;border-color:#f78989;color:#fff}.m-button--danger:active{background:#dd6161;border-color:#dd6161;color:#fff}.m-button--info{color:#fff;background-color:#909399;border-color:#909399}.m-button--info:hover{background:#a6a9ad;border-color:#a6a9ad;color:#fff}.m-button--info:active{background:#82848a;border-color:#82848a;color:#fff}.m-button--small{height:24px;padding:5px 11px;font-size:12px;border-radius:3px}.m-button--large{height:40px;padding:12px 19px;font-size:16px;border-radius:4px}.m-button--round{border-radius:20px}.m-button--circle{border-radius:50%;padding:8px}.m-button--plain{background:transparent}.m-button--plain.m-button--primary{color:#409eff}.m-button--plain.m-button--success{color:#67c23a}.m-button--plain.m-button--warning{color:#e6a23c}.m-button--plain.m-button--danger{color:#f56c6c}.m-button--plain.m-button--info{color:#909399}.m-button--disabled,.m-button--disabled:hover,.m-button--disabled:focus,.m-button--disabled:active{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5}.m-button--disabled.m-button--primary,.m-button--disabled.m-button--success,.m-button--disabled.m-button--warning,.m-button--disabled.m-button--danger,.m-button--disabled.m-button--info{color:#fff;background-color:#a0cfff;border-color:#a0cfff;opacity:.6}.m-button__loading{display:inline-flex;align-items:center;margin-right:5px}.m-button__loading-icon{animation:rotating 2s linear infinite}.m-button__icon{margin-right:5px}.m-button__icon+.m-button__text{margin-left:5px}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
package/dist/morghulis.es.js
CHANGED
@@ -1,158 +1,126 @@
|
|
1
|
-
import { defineComponent as
|
2
|
-
const
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
type: Boolean,
|
40
|
-
default: !1
|
41
|
-
},
|
42
|
-
/**
|
43
|
-
* 按钮文本
|
44
|
-
*/
|
45
|
-
text: {
|
46
|
-
type: String,
|
47
|
-
default: void 0
|
48
|
-
},
|
49
|
-
/**
|
50
|
-
* 是否显示加载状态
|
51
|
-
*/
|
52
|
-
loading: {
|
53
|
-
type: Boolean,
|
54
|
-
default: !1
|
55
|
-
},
|
56
|
-
/**
|
57
|
-
* 按钮图标类名
|
58
|
-
*/
|
59
|
-
icon: {
|
60
|
-
type: String,
|
61
|
-
default: void 0
|
62
|
-
}
|
1
|
+
import { defineComponent as u, computed as c, createVNode as n } from "vue";
|
2
|
+
const s = {
|
3
|
+
/**
|
4
|
+
* 按钮类型
|
5
|
+
* @values default, primary, success, warning, danger, info, text
|
6
|
+
*/
|
7
|
+
type: {
|
8
|
+
type: String,
|
9
|
+
default: "default"
|
10
|
+
},
|
11
|
+
/**
|
12
|
+
* 按钮尺寸
|
13
|
+
* @values large, default, small
|
14
|
+
*/
|
15
|
+
size: {
|
16
|
+
type: String,
|
17
|
+
default: "default"
|
18
|
+
},
|
19
|
+
/**
|
20
|
+
* 是否为朴素按钮
|
21
|
+
*/
|
22
|
+
plain: {
|
23
|
+
type: Boolean,
|
24
|
+
default: !1
|
25
|
+
},
|
26
|
+
/**
|
27
|
+
* 是否为圆角按钮
|
28
|
+
*/
|
29
|
+
round: {
|
30
|
+
type: Boolean,
|
31
|
+
default: !1
|
32
|
+
},
|
33
|
+
/**
|
34
|
+
* 是否为圆形按钮
|
35
|
+
*/
|
36
|
+
circle: {
|
37
|
+
type: Boolean,
|
38
|
+
default: !1
|
63
39
|
},
|
40
|
+
/**
|
41
|
+
* 是否禁用按钮
|
42
|
+
*/
|
43
|
+
disabled: {
|
44
|
+
type: Boolean,
|
45
|
+
default: !1
|
46
|
+
},
|
47
|
+
/**
|
48
|
+
* 是否显示加载状态
|
49
|
+
*/
|
50
|
+
loading: {
|
51
|
+
type: Boolean,
|
52
|
+
default: !1
|
53
|
+
},
|
54
|
+
/**
|
55
|
+
* 按钮图标类名
|
56
|
+
*/
|
57
|
+
icon: {
|
58
|
+
type: String,
|
59
|
+
default: ""
|
60
|
+
},
|
61
|
+
/**
|
62
|
+
* 按钮文本
|
63
|
+
*/
|
64
|
+
text: {
|
65
|
+
type: String,
|
66
|
+
default: ""
|
67
|
+
}
|
68
|
+
}, a = /* @__PURE__ */ u({
|
69
|
+
name: "MButton",
|
70
|
+
props: s,
|
64
71
|
emits: ["click"],
|
65
|
-
setup(t, {
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
t.disabled || t.loading || e("click", c);
|
78
|
-
};
|
79
|
-
return n({
|
80
|
-
/**
|
81
|
-
* 触发按钮点击事件
|
82
|
-
*/
|
83
|
-
triggerClick: () => {
|
84
|
-
!t.disabled && !t.loading && e("click", new MouseEvent("click"));
|
85
|
-
}
|
86
|
-
}), {
|
87
|
-
buttonClass: o,
|
88
|
-
handleClick: l
|
72
|
+
setup(t, {
|
73
|
+
slots: l,
|
74
|
+
emit: o
|
75
|
+
}) {
|
76
|
+
const i = c(() => ["m-button", `m-button--${t.type}`, `m-button--${t.size}`, {
|
77
|
+
"m-button--round": t.round,
|
78
|
+
"m-button--plain": t.plain,
|
79
|
+
"m-button--circle": t.circle,
|
80
|
+
"m-button--disabled": t.disabled,
|
81
|
+
"m-button--loading": t.loading
|
82
|
+
}]), d = (e) => {
|
83
|
+
t.disabled || t.loading || o("click", e);
|
89
84
|
};
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
},
|
97
|
-
|
98
|
-
|
99
|
-
}, h = {
|
100
|
-
key: 1,
|
101
|
-
class: "m-button__icon"
|
102
|
-
}, v = {
|
103
|
-
key: 2,
|
104
|
-
class: "m-button__text"
|
105
|
-
};
|
106
|
-
function $(t, e, n, o, l, c) {
|
107
|
-
return s(), a("button", {
|
108
|
-
class: r(t.buttonClass),
|
109
|
-
disabled: t.disabled,
|
110
|
-
onClick: e[0] || (e[0] = (...f) => t.handleClick && t.handleClick(...f))
|
111
|
-
}, [
|
112
|
-
t.loading ? (s(), a("span", C, e[1] || (e[1] = [
|
113
|
-
i("svg", {
|
85
|
+
return () => {
|
86
|
+
var e;
|
87
|
+
return n("button", {
|
88
|
+
class: i.value,
|
89
|
+
disabled: t.disabled,
|
90
|
+
onClick: d
|
91
|
+
}, [t.loading && n("span", {
|
92
|
+
class: "m-button__loading"
|
93
|
+
}, [n("svg", {
|
114
94
|
class: "m-button__loading-icon",
|
115
95
|
viewBox: "0 0 1024 1024",
|
116
96
|
xmlns: "http://www.w3.org/2000/svg",
|
117
97
|
width: "16",
|
118
98
|
height: "16"
|
119
|
-
}, [
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
}
|
142
|
-
const d = /* @__PURE__ */ _(y, [["render", $], ["__scopeId", "data-v-1d04af69"]]), w = (t) => {
|
143
|
-
t.component("MButton", d);
|
144
|
-
};
|
145
|
-
d.install = (t) => {
|
146
|
-
t.component("MButton", d);
|
147
|
-
};
|
148
|
-
const M = (t) => {
|
149
|
-
w(t);
|
150
|
-
}, S = {
|
151
|
-
install: M,
|
152
|
-
MButton: d
|
99
|
+
}, [n("path", {
|
100
|
+
d: "M512 64c-247.42 0-448 200.58-448 448s200.58 448 448 448 448-200.58 448-448-200.58-448-448-448zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z",
|
101
|
+
fill: "#e6e6e6"
|
102
|
+
}, null), n("path", {
|
103
|
+
d: "M512 140c-205.4 0-372 166.6-372 372s166.6 372 372 372V140z",
|
104
|
+
fill: "currentColor"
|
105
|
+
}, null)])]), t.icon && !t.loading && n("span", {
|
106
|
+
class: "m-button__icon"
|
107
|
+
}, [n("i", {
|
108
|
+
class: t.icon
|
109
|
+
}, null)]), n("span", {
|
110
|
+
class: "m-button__text"
|
111
|
+
}, [((e = l.default) == null ? void 0 : e.call(l)) || t.text])]);
|
112
|
+
};
|
113
|
+
}
|
114
|
+
}), f = (t) => {
|
115
|
+
t.component("MButton", a);
|
116
|
+
}, b = (t) => {
|
117
|
+
f(t);
|
118
|
+
}, g = {
|
119
|
+
install: b,
|
120
|
+
MButton: a
|
153
121
|
};
|
154
122
|
export {
|
155
|
-
|
156
|
-
|
157
|
-
|
123
|
+
a as MButton,
|
124
|
+
g as default,
|
125
|
+
b as install
|
158
126
|
};
|
package/global.d.ts
CHANGED
@@ -1,58 +1,107 @@
|
|
1
|
-
|
1
|
+
import { DefineComponent } from 'vue'
|
2
|
+
|
3
|
+
declare module 'morghulis' {
|
4
|
+
export interface MButtonProps {
|
5
|
+
/**
|
6
|
+
* 按钮类型
|
7
|
+
* @default 'default'
|
8
|
+
*/
|
9
|
+
type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
|
10
|
+
|
11
|
+
/**
|
12
|
+
* 按钮尺寸
|
13
|
+
* @default 'default'
|
14
|
+
*/
|
15
|
+
size?: 'large' | 'default' | 'small'
|
16
|
+
|
17
|
+
/**
|
18
|
+
* 是否为朴素按钮
|
19
|
+
* @default false
|
20
|
+
*/
|
21
|
+
plain?: boolean
|
22
|
+
|
23
|
+
/**
|
24
|
+
* 是否为圆角按钮
|
25
|
+
* @default false
|
26
|
+
*/
|
27
|
+
round?: boolean
|
28
|
+
|
29
|
+
/**
|
30
|
+
* 是否为圆形按钮
|
31
|
+
* @default false
|
32
|
+
*/
|
33
|
+
circle?: boolean
|
34
|
+
|
35
|
+
/**
|
36
|
+
* 是否禁用按钮
|
37
|
+
* @default false
|
38
|
+
*/
|
39
|
+
disabled?: boolean
|
40
|
+
|
41
|
+
/**
|
42
|
+
* 是否显示加载状态
|
43
|
+
* @default false
|
44
|
+
*/
|
45
|
+
loading?: boolean
|
46
|
+
|
47
|
+
/**
|
48
|
+
* 按钮图标类名
|
49
|
+
*/
|
50
|
+
icon?: string
|
51
|
+
}
|
52
|
+
|
53
|
+
export const MButton: DefineComponent<MButtonProps>
|
54
|
+
}
|
55
|
+
|
2
56
|
declare module '@vue/runtime-core' {
|
3
|
-
|
4
|
-
MButton: {
|
57
|
+
interface GlobalComponents {
|
58
|
+
MButton: DefineComponent<{
|
5
59
|
/**
|
6
60
|
* 按钮类型
|
7
61
|
* @default 'default'
|
8
62
|
*/
|
9
|
-
type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
|
63
|
+
type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
|
10
64
|
|
11
65
|
/**
|
12
66
|
* 按钮尺寸
|
13
67
|
* @default 'default'
|
14
68
|
*/
|
15
|
-
size?: 'large' | 'default' | 'small'
|
69
|
+
size?: 'large' | 'default' | 'small'
|
16
70
|
|
17
71
|
/**
|
18
72
|
* 是否为朴素按钮
|
19
73
|
* @default false
|
20
74
|
*/
|
21
|
-
plain?: boolean
|
75
|
+
plain?: boolean
|
22
76
|
|
23
77
|
/**
|
24
78
|
* 是否为圆角按钮
|
25
79
|
* @default false
|
26
80
|
*/
|
27
|
-
round?: boolean
|
81
|
+
round?: boolean
|
28
82
|
|
29
83
|
/**
|
30
84
|
* 是否为圆形按钮
|
31
85
|
* @default false
|
32
86
|
*/
|
33
|
-
circle?: boolean
|
87
|
+
circle?: boolean
|
34
88
|
|
35
89
|
/**
|
36
90
|
* 是否禁用按钮
|
37
91
|
* @default false
|
38
92
|
*/
|
39
|
-
disabled?: boolean
|
93
|
+
disabled?: boolean
|
40
94
|
|
41
95
|
/**
|
42
96
|
* 是否显示加载状态
|
43
97
|
* @default false
|
44
98
|
*/
|
45
|
-
loading?: boolean
|
99
|
+
loading?: boolean
|
46
100
|
|
47
101
|
/**
|
48
102
|
* 按钮图标类名
|
49
103
|
*/
|
50
|
-
icon?: string
|
51
|
-
|
52
|
-
/**
|
53
|
-
* 点击按钮时触发
|
54
|
-
*/
|
55
|
-
onClick?: (event: MouseEvent) => void;
|
56
|
-
}
|
104
|
+
icon?: string
|
105
|
+
}>
|
57
106
|
}
|
58
107
|
}
|
package/index.d.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
import type {
|
1
|
+
import type { DefineComponent, PropType } from 'vue';
|
2
2
|
|
3
3
|
// 按钮类型
|
4
|
-
export
|
4
|
+
export type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
|
5
5
|
|
6
6
|
// 按钮尺寸
|
7
|
-
export
|
7
|
+
export type ButtonSize = 'large' | 'default' | 'small';
|
8
8
|
|
9
|
-
//
|
10
|
-
export interface
|
9
|
+
// 按钮属性类型
|
10
|
+
export interface MButtonProps {
|
11
11
|
/**
|
12
12
|
* 按钮类型
|
13
13
|
* @default 'default'
|
@@ -54,34 +54,18 @@ export interface ButtonProps {
|
|
54
54
|
* 按钮图标类名
|
55
55
|
*/
|
56
56
|
icon?: string;
|
57
|
-
}
|
58
|
-
|
59
|
-
// 按钮事件
|
60
|
-
export interface ButtonEvents {
|
61
|
-
/**
|
62
|
-
* 点击按钮时触发
|
63
|
-
* @param event 鼠标事件对象
|
64
|
-
*/
|
65
|
-
click: (event: MouseEvent) => void;
|
66
|
-
}
|
67
|
-
|
68
|
-
// 按钮实例
|
69
|
-
export interface ButtonInstance {
|
70
|
-
$props: ButtonProps;
|
71
57
|
|
72
58
|
/**
|
73
|
-
*
|
59
|
+
* 按钮文本
|
74
60
|
*/
|
75
|
-
|
61
|
+
text?: string;
|
76
62
|
}
|
77
63
|
|
78
|
-
//
|
79
|
-
export declare const MButton:
|
80
|
-
install(app: App): void;
|
81
|
-
};
|
64
|
+
// 按钮组件
|
65
|
+
export declare const MButton: DefineComponent<MButtonProps>;
|
82
66
|
|
83
|
-
//
|
84
|
-
export declare function install(app:
|
67
|
+
// 安装函数
|
68
|
+
export declare function install(app: any): void;
|
85
69
|
|
86
70
|
// 默认导出
|
87
71
|
declare const _default: {
|
@@ -91,9 +75,9 @@ declare const _default: {
|
|
91
75
|
|
92
76
|
export default _default;
|
93
77
|
|
94
|
-
//
|
95
|
-
declare module '
|
96
|
-
|
78
|
+
// 自定义Vue类型扩展
|
79
|
+
declare module 'vue' {
|
80
|
+
interface GlobalComponents {
|
97
81
|
MButton: typeof MButton;
|
98
82
|
}
|
99
83
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "morghulis",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.49",
|
4
4
|
"description": "一个Vue 3按钮组件库,支持TypeScript和IDE自动补全",
|
5
5
|
"type": "module",
|
6
6
|
"main": "dist/morghulis.es.js",
|
@@ -8,7 +8,12 @@
|
|
8
8
|
"types": "index.d.ts",
|
9
9
|
"exports": {
|
10
10
|
".": {
|
11
|
-
"types": [
|
11
|
+
"types": [
|
12
|
+
"./index.d.ts",
|
13
|
+
"./global.d.ts",
|
14
|
+
"./volar.d.ts",
|
15
|
+
"./components.d.ts"
|
16
|
+
],
|
12
17
|
"import": "./dist/morghulis.es.js",
|
13
18
|
"require": "./dist/morghulis.es.js"
|
14
19
|
},
|
@@ -17,7 +22,9 @@
|
|
17
22
|
"files": [
|
18
23
|
"dist",
|
19
24
|
"index.d.ts",
|
20
|
-
"global.d.ts"
|
25
|
+
"global.d.ts",
|
26
|
+
"volar.d.ts",
|
27
|
+
"components.d.ts"
|
21
28
|
],
|
22
29
|
"scripts": {
|
23
30
|
"dev": "vite",
|
@@ -39,12 +46,13 @@
|
|
39
46
|
"author": "",
|
40
47
|
"license": "MIT",
|
41
48
|
"dependencies": {
|
42
|
-
"vue": "^3.
|
49
|
+
"vue": "^3.0.0"
|
43
50
|
},
|
44
51
|
"devDependencies": {
|
45
52
|
"@tsconfig/node22": "^22.0.1",
|
46
53
|
"@types/node": "^22.14.0",
|
47
54
|
"@vitejs/plugin-vue": "^5.2.3",
|
55
|
+
"@vitejs/plugin-vue-jsx": "^4.1.2",
|
48
56
|
"@vue/tsconfig": "^0.7.0",
|
49
57
|
"npm-run-all2": "^7.0.2",
|
50
58
|
"typescript": "~5.8.0",
|
package/volar.d.ts
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
declare module 'vue' {
|
2
|
+
export interface GlobalComponents {
|
3
|
+
MButton: {
|
4
|
+
type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
|
5
|
+
size?: 'large' | 'default' | 'small'
|
6
|
+
plain?: boolean
|
7
|
+
round?: boolean
|
8
|
+
circle?: boolean
|
9
|
+
disabled?: boolean
|
10
|
+
loading?: boolean
|
11
|
+
icon?: string
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|