morghulis 2.0.64 → 2.0.66

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.
@@ -1,6 +1,22 @@
1
1
  import { default as MButton } from './MButton.vue';
2
2
 
3
3
  export type { ButtonColor, ButtonSize, ButtonProps, ButtonEmits, ButtonExpose } from './MButton.d.ts';
4
+ /**
5
+ * 按钮组件
6
+ *
7
+ * @component MButton
8
+ * @property {string} color - 按钮颜色,可选值为 'primary', 'success', 'warning', 'danger', 'info'
9
+ * @property {boolean} round - 是否为圆角按钮
10
+ * @property {string} size - 按钮尺寸,可选值为 'small', 'medium', 'large'
11
+ * @property {boolean} disabled - 是否禁用
12
+ * @property {string} popupMessage - 自定义弹窗消息
13
+ * @method {Function} popup - 显示弹窗,参数为弹窗消息
14
+ *
15
+ * @example
16
+ * <MButton>默认按钮</MButton>
17
+ * <MButton color="success" round>成功按钮</MButton>
18
+ * <MButton color="warning" size="large">警告按钮</MButton>
19
+ */
4
20
  export { MButton };
5
21
  export default MButton;
6
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAA;AACnC,YAAY,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACb,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,CAAA;AAClB,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAA;AACnC,YAAY,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACb,MAAM,gBAAgB,CAAA;AAEvB;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,OAAO,EAAE,CAAA;AAClB,eAAe,OAAO,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,12 @@
1
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ import { ButtonColor, ButtonSize } from './components/MButton.d';
1
3
  export { MButton } from './components/index';
2
- export type { ButtonColor, ButtonSize, ButtonProps, ButtonEmits, ButtonExpose } from './components/index';
4
+ export type { ButtonColor, ButtonSize, ButtonProps, ButtonEmits, ButtonExpose } from './components/MButton.d';
5
+ export { MButtonColors, MButtonSizes } from './components/MButton.d';
3
6
  export interface MButtonProps {
4
7
  /**
5
8
  * 按钮颜色
9
+ * @values 'primary', 'success', 'warning', 'danger', 'info'
6
10
  */
7
11
  color?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
8
12
  /**
@@ -11,6 +15,7 @@ export interface MButtonProps {
11
15
  round?: boolean;
12
16
  /**
13
17
  * 按钮尺寸
18
+ * @values 'small', 'medium', 'large'
14
19
  */
15
20
  size?: 'small' | 'medium' | 'large';
16
21
  /**
@@ -40,7 +45,65 @@ export interface MButtonExpose {
40
45
  popup: (message: string) => string;
41
46
  }
42
47
  declare const _default: {
43
- MButton: any;
48
+ MButton: DefineComponent<ExtractPropTypes<{
49
+ color: {
50
+ type: PropType<ButtonColor>;
51
+ default: string;
52
+ validator: (val: string) => boolean;
53
+ };
54
+ round: {
55
+ type: BooleanConstructor;
56
+ default: boolean;
57
+ };
58
+ size: {
59
+ type: PropType<ButtonSize>;
60
+ default: string;
61
+ validator: (val: string) => boolean;
62
+ };
63
+ disabled: {
64
+ type: BooleanConstructor;
65
+ default: boolean;
66
+ };
67
+ popupMessage: {
68
+ type: StringConstructor;
69
+ default: string;
70
+ };
71
+ }>, {
72
+ popup: (message: string) => string;
73
+ handleClick: (e: MouseEvent) => void;
74
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("click" | "popup")[], "click" | "popup", PublicProps, Readonly< ExtractPropTypes<{
75
+ color: {
76
+ type: PropType<ButtonColor>;
77
+ default: string;
78
+ validator: (val: string) => boolean;
79
+ };
80
+ round: {
81
+ type: BooleanConstructor;
82
+ default: boolean;
83
+ };
84
+ size: {
85
+ type: PropType<ButtonSize>;
86
+ default: string;
87
+ validator: (val: string) => boolean;
88
+ };
89
+ disabled: {
90
+ type: BooleanConstructor;
91
+ default: boolean;
92
+ };
93
+ popupMessage: {
94
+ type: StringConstructor;
95
+ default: string;
96
+ };
97
+ }>> & Readonly<{
98
+ onClick?: ((...args: any[]) => any) | undefined;
99
+ onPopup?: ((...args: any[]) => any) | undefined;
100
+ }>, {
101
+ color: ButtonColor;
102
+ round: boolean;
103
+ size: ButtonSize;
104
+ disabled: boolean;
105
+ popupMessage: string;
106
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
44
107
  };
45
108
  export default _default;
46
109
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAG5C,YAAY,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACb,MAAM,oBAAoB,CAAA;AAG3B,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC7D;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;CACnC;;;;AAID,wBAA2C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAG5C,YAAY,EAEV,WAAW,EAEX,UAAU,EAEV,WAAW,EAEX,WAAW,EAEX,YAAY,EACb,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAGpE,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC7D;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;CACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAID,wBAAkC"}
package/dist/main.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- .m-btn[data-v-51bacf79]{border:none;cursor:pointer;padding:.5em 1.2em;font-size:1em;transition:all .3s;display:inline-block;line-height:1;white-space:nowrap;background:#fff;border:1px solid #dcdfe6;color:#606266;-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:none;margin:0;font-weight:500}.m-btn.round[data-v-51bacf79]{border-radius:20px}.m-btn.primary[data-v-51bacf79]{background-color:#409eff;border-color:#409eff;color:#fff}.m-btn.success[data-v-51bacf79]{background-color:#67c23a;border-color:#67c23a;color:#fff}.m-btn.warning[data-v-51bacf79]{background-color:#e6a23c;border-color:#e6a23c;color:#fff}.m-btn.danger[data-v-51bacf79]{background-color:#f56c6c;border-color:#f56c6c;color:#fff}.m-btn.info[data-v-51bacf79]{background-color:#909399;border-color:#909399;color:#fff}.m-btn.small[data-v-51bacf79]{font-size:.8em;padding:.3em .8em}.m-btn.medium[data-v-51bacf79]{font-size:1em;padding:.5em 1.2em}.m-btn.large[data-v-51bacf79]{font-size:1.2em;padding:.7em 1.6em}.m-btn.disabled[data-v-51bacf79]{opacity:.6;cursor:not-allowed;pointer-events:none}.m-btn[data-v-51bacf79]:hover:not(.disabled){opacity:.8}
1
+ .m-btn[data-v-9c44e49a]{border:none;cursor:pointer;padding:.5em 1.2em;font-size:1em;transition:all .3s;display:inline-block;line-height:1;white-space:nowrap;background:#fff;border:1px solid #dcdfe6;color:#606266;-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:none;margin:0;font-weight:500}.m-btn.round[data-v-9c44e49a]{border-radius:20px}.m-btn.primary[data-v-9c44e49a]{background-color:#409eff;border-color:#409eff;color:#fff}.m-btn.success[data-v-9c44e49a]{background-color:#67c23a;border-color:#67c23a;color:#fff}.m-btn.warning[data-v-9c44e49a]{background-color:#e6a23c;border-color:#e6a23c;color:#fff}.m-btn.danger[data-v-9c44e49a]{background-color:#f56c6c;border-color:#f56c6c;color:#fff}.m-btn.info[data-v-9c44e49a]{background-color:#909399;border-color:#909399;color:#fff}.m-btn.small[data-v-9c44e49a]{font-size:.8em;padding:.3em .8em}.m-btn.medium[data-v-9c44e49a]{font-size:1em;padding:.5em 1.2em}.m-btn.large[data-v-9c44e49a]{font-size:1.2em;padding:.7em 1.6em}.m-btn.disabled[data-v-9c44e49a]{opacity:.6;cursor:not-allowed;pointer-events:none}.m-btn[data-v-9c44e49a]:hover:not(.disabled){opacity:.8}
@@ -1,9 +1,10 @@
1
- import { defineComponent as r, createElementBlock as s, openBlock as i, normalizeClass as u, renderSlot as p } from "vue";
2
- const c = r({
1
+ import { defineComponent as s, createElementBlock as d, openBlock as i, normalizeClass as u, renderSlot as p } from "vue";
2
+ const c = s({
3
3
  name: "MButton",
4
4
  props: {
5
5
  /**
6
6
  * 按钮颜色
7
+ * @values 'primary', 'success', 'warning', 'danger', 'info'
7
8
  */
8
9
  color: {
9
10
  type: String,
@@ -19,6 +20,7 @@ const c = r({
19
20
  },
20
21
  /**
21
22
  * 按钮尺寸
23
+ * @values 'small', 'medium', 'large'
22
24
  */
23
25
  size: {
24
26
  type: String,
@@ -61,8 +63,8 @@ const c = r({
61
63
  a[o] = l;
62
64
  return a;
63
65
  }, m = ["disabled"];
64
- function b(e, n, a, o, l, t) {
65
- return i(), s("button", {
66
+ function B(e, n, a, o, l, t) {
67
+ return i(), d("button", {
66
68
  class: u([
67
69
  "m-btn",
68
70
  e.size,
@@ -73,13 +75,17 @@ function b(e, n, a, o, l, t) {
73
75
  }
74
76
  ]),
75
77
  disabled: e.disabled,
76
- onClick: n[0] || (n[0] = (...d) => e.handleClick && e.handleClick(...d))
78
+ onClick: n[0] || (n[0] = (...r) => e.handleClick && e.handleClick(...r))
77
79
  }, [
78
80
  p(e.$slots, "default", {}, void 0, !0)
79
81
  ], 10, m);
80
82
  }
81
- const k = /* @__PURE__ */ f(c, [["render", b], ["__scopeId", "data-v-51bacf79"]]), B = { MButton: k };
83
+ const g = /* @__PURE__ */ f(c, [["render", B], ["__scopeId", "data-v-9c44e49a"]]), k = ["primary", "success", "warning", "danger", "info"], y = ["small", "medium", "large"];
84
+ MButton;
85
+ const M = { MButton: g };
82
86
  export {
83
- k as MButton,
84
- B as default
87
+ g as MButton,
88
+ k as MButtonColors,
89
+ y as MButtonSizes,
90
+ M as default
85
91
  };
@@ -1 +1 @@
1
- (function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t.Morghulis={},t.Vue))})(this,function(t,n){"use strict";const r=n.defineComponent({name:"MButton",props:{color:{type:String,default:"primary",validator:e=>["primary","success","warning","danger","info"].includes(e)},round:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:e=>["small","medium","large"].includes(e)},disabled:{type:Boolean,default:!1},popupMessage:{type:String,default:"按钮被点击!"}},emits:["click","popup"],setup(e,{emit:o,expose:l}){function d(i){return window.alert(i),o("popup",i),i}function s(i){e.disabled||(o("click",i),d(e.popupMessage))}return l({popup:d}),{popup:d,handleClick:s}}}),a=(e,o)=>{const l=e.__vccOpts||e;for(const[d,s]of o)l[d]=s;return l},p=["disabled"];function f(e,o,l,d,s,i){return n.openBlock(),n.createElementBlock("button",{class:n.normalizeClass(["m-btn",e.size,e.color,{round:e.round,disabled:e.disabled}]),disabled:e.disabled,onClick:o[0]||(o[0]=(...m)=>e.handleClick&&e.handleClick(...m))},[n.renderSlot(e.$slots,"default",{},void 0,!0)],10,p)}const u=a(r,[["render",f],["__scopeId","data-v-51bacf79"]]),c={MButton:u};t.MButton=u,t.default=c,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n.Morghulis={},n.Vue))})(this,function(n,t){"use strict";const r=t.defineComponent({name:"MButton",props:{color:{type:String,default:"primary",validator:e=>["primary","success","warning","danger","info"].includes(e)},round:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:e=>["small","medium","large"].includes(e)},disabled:{type:Boolean,default:!1},popupMessage:{type:String,default:"按钮被点击!"}},emits:["click","popup"],setup(e,{emit:o,expose:s}){function i(d){return window.alert(d),o("popup",d),d}function l(d){e.disabled||(o("click",d),i(e.popupMessage))}return s({popup:i}),{popup:i,handleClick:l}}}),a=(e,o)=>{const s=e.__vccOpts||e;for(const[i,l]of o)s[i]=l;return s},p=["disabled"];function c(e,o,s,i,l,d){return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["m-btn",e.size,e.color,{round:e.round,disabled:e.disabled}]),disabled:e.disabled,onClick:o[0]||(o[0]=(...M)=>e.handleClick&&e.handleClick(...M))},[t.renderSlot(e.$slots,"default",{},void 0,!0)],10,p)}const u=a(r,[["render",c],["__scopeId","data-v-9c44e49a"]]),f=["primary","success","warning","danger","info"],m=["small","medium","large"];MButton;const B={MButton:u};n.MButton=u,n.MButtonColors=f,n.MButtonSizes=m,n.default=B,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,66 +1,61 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "2.0.64",
3
+ "version": "2.0.66",
4
4
  "private": false,
5
- "type": "module",
5
+ "description": "A Material Design inspired button for Vue 3",
6
+ "keywords": [
7
+ "vue",
8
+ "button",
9
+ "material design",
10
+ "component",
11
+ "vue3"
12
+ ],
13
+ "author": "jm",
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/username/morghulis.git"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/username/morghulis/issues"
21
+ },
22
+ "homepage": "https://github.com/username/morghulis#readme",
6
23
  "main": "dist/morghulis.umd.js",
7
24
  "module": "dist/morghulis.es.js",
8
25
  "types": "types/index.d.ts",
9
- "style": "dist/morghulis.css",
10
26
  "typings": "types/index.d.ts",
11
- "web-types": "web-types.json",
12
- "vetur": {
13
- "tags": "vetur/tags.json",
14
- "attributes": "vetur/attributes.json"
27
+ "exports": {
28
+ ".": {
29
+ "types": "./types/index.d.ts",
30
+ "import": "./dist/morghulis.es.js",
31
+ "require": "./dist/morghulis.umd.js"
32
+ },
33
+ "./styles": "./dist/morghulis.css"
15
34
  },
16
- "intellisense": "intellisense.json",
17
35
  "files": [
18
36
  "dist",
37
+ "types",
19
38
  "web-types.json",
20
- "vetur",
21
- "morghulis.d.ts",
22
- "intellisense.json",
23
- "types"
39
+ "vetur"
24
40
  ],
41
+ "sideEffects": false,
25
42
  "scripts": {
26
43
  "dev": "vite",
27
- "build": "run-p type-check \"build-only {@}\" --",
28
- "preview": "vite preview",
29
- "build-only": "vite build",
44
+ "build": "vite build",
30
45
  "build-lib": "vite build --config vite.lib.config.ts",
31
- "type-check": "vue-tsc --build",
46
+ "preview": "vite preview",
32
47
  "prepublishOnly": "npm run build-lib"
33
48
  },
34
- "keywords": [
35
- "vue",
36
- "vue3",
37
- "component",
38
- "button",
39
- "ui",
40
- "typescript"
41
- ],
42
- "author": "MorghulisDev",
43
- "license": "MIT",
44
- "repository": {
45
- "type": "git",
46
- "url": "https://github.com/morghulis/morghulis"
47
- },
48
49
  "dependencies": {
49
- "vue": "^3.5.13"
50
+ "vue": "^3.2.25"
50
51
  },
51
52
  "devDependencies": {
52
- "@tsconfig/node22": "^22.0.1",
53
- "@types/node": "^22.14.0",
54
- "@vitejs/plugin-vue": "^5.2.3",
55
- "@vue/tsconfig": "^0.7.0",
56
- "npm-run-all2": "^7.0.2",
57
- "typescript": "~5.8.0",
58
- "vite": "^6.2.4",
53
+ "@types/node": "^20.3.1",
54
+ "@vitejs/plugin-vue": "^4.2.3",
55
+ "typescript": "^5.1.3",
56
+ "vite": "^4.3.9",
59
57
  "vite-plugin-dts": "^3.7.3",
60
- "vite-plugin-vue-devtools": "^7.7.2",
61
- "vue-tsc": "^2.2.8"
58
+ "vue-tsc": "^1.8.0"
62
59
  },
63
- "peerDependencies": {
64
- "vue": "^3.0.0"
65
- }
60
+ "web-types": "web-types.json"
66
61
  }
package/intellisense.json DELETED
@@ -1,125 +0,0 @@
1
- {
2
- "version": 1,
3
- "components": [
4
- {
5
- "name": "MButton",
6
- "type": "component",
7
- "description": "一个简单的按钮组件,具有多种颜色主题、尺寸选项和弹窗功能",
8
- "props": [
9
- {
10
- "name": "color",
11
- "type": "string",
12
- "description": "按钮颜色",
13
- "defaultValue": "primary",
14
- "values": [
15
- {
16
- "name": "primary",
17
- "description": "主要按钮"
18
- },
19
- {
20
- "name": "success",
21
- "description": "成功按钮"
22
- },
23
- {
24
- "name": "warning",
25
- "description": "警告按钮"
26
- },
27
- {
28
- "name": "danger",
29
- "description": "危险按钮"
30
- },
31
- {
32
- "name": "info",
33
- "description": "信息按钮"
34
- }
35
- ]
36
- },
37
- {
38
- "name": "round",
39
- "type": "boolean",
40
- "description": "是否为圆角按钮",
41
- "defaultValue": false
42
- },
43
- {
44
- "name": "size",
45
- "type": "string",
46
- "description": "按钮尺寸",
47
- "defaultValue": "medium",
48
- "values": [
49
- {
50
- "name": "small",
51
- "description": "小型按钮"
52
- },
53
- {
54
- "name": "medium",
55
- "description": "中型按钮"
56
- },
57
- {
58
- "name": "large",
59
- "description": "大型按钮"
60
- }
61
- ]
62
- },
63
- {
64
- "name": "disabled",
65
- "type": "boolean",
66
- "description": "是否禁用",
67
- "defaultValue": false
68
- },
69
- {
70
- "name": "popupMessage",
71
- "type": "string",
72
- "description": "自定义弹窗消息",
73
- "defaultValue": "按钮被点击!"
74
- }
75
- ],
76
- "events": [
77
- {
78
- "name": "click",
79
- "description": "按钮点击事件",
80
- "arguments": [
81
- {
82
- "name": "event",
83
- "type": "MouseEvent",
84
- "description": "鼠标事件对象"
85
- }
86
- ]
87
- },
88
- {
89
- "name": "popup",
90
- "description": "弹窗显示事件",
91
- "arguments": [
92
- {
93
- "name": "message",
94
- "type": "string",
95
- "description": "弹窗消息"
96
- }
97
- ]
98
- }
99
- ],
100
- "slots": [
101
- {
102
- "name": "default",
103
- "description": "按钮内容"
104
- }
105
- ],
106
- "methods": [
107
- {
108
- "name": "popup",
109
- "description": "显示弹窗",
110
- "arguments": [
111
- {
112
- "name": "message",
113
- "type": "string",
114
- "description": "弹窗消息"
115
- }
116
- ],
117
- "returns": {
118
- "type": "string",
119
- "description": "弹窗消息"
120
- }
121
- }
122
- ]
123
- }
124
- ]
125
- }
package/morghulis.d.ts DELETED
@@ -1,132 +0,0 @@
1
- import { DefineComponent } from 'vue'
2
-
3
- // 导出类型定义
4
- declare module 'morghulis' {
5
- export type ButtonColor = 'primary' | 'success' | 'warning' | 'danger' | 'info';
6
- export type ButtonSize = 'small' | 'medium' | 'large';
7
-
8
- // 按钮属性
9
- export interface ButtonProps {
10
- /**
11
- * 按钮颜色
12
- * @values 'primary', 'success', 'warning', 'danger', 'info'
13
- */
14
- color?: ButtonColor;
15
-
16
- /**
17
- * 是否为圆角按钮
18
- */
19
- round?: boolean;
20
-
21
- /**
22
- * 按钮尺寸
23
- * @values 'small', 'medium', 'large'
24
- */
25
- size?: ButtonSize;
26
-
27
- /**
28
- * 是否禁用
29
- */
30
- disabled?: boolean;
31
-
32
- /**
33
- * 自定义弹窗消息
34
- */
35
- popupMessage?: string;
36
- }
37
-
38
- // 组件事件
39
- export interface ButtonEmits {
40
- /**
41
- * 点击事件
42
- * @param event - 鼠标事件对象
43
- */
44
- (e: 'click', event: MouseEvent): void;
45
-
46
- /**
47
- * 弹窗显示事件
48
- * @param message - 弹窗消息
49
- */
50
- (e: 'popup', message: string): void;
51
- }
52
-
53
- // 组件暴露的方法
54
- export interface ButtonExpose {
55
- /**
56
- * 显示弹窗
57
- * @param message - 弹窗消息
58
- * @returns 弹窗消息
59
- */
60
- popup?: (message: string) => string;
61
- }
62
-
63
- // 组件定义
64
- /**
65
- * 按钮组件
66
- *
67
- * @description 一个简单的按钮组件,具有多种颜色主题、尺寸选项和弹窗功能
68
- * @example
69
- * <MButton>默认按钮</MButton>
70
- * <MButton color="success" round>成功按钮</MButton>
71
- * <MButton color="warning" size="large">警告按钮</MButton>
72
- * <MButton color="danger" disabled>危险按钮</MButton>
73
- * <MButton popup-message="自定义消息">弹窗按钮</MButton>
74
- */
75
- export const MButton: DefineComponent<ButtonProps>;
76
- }
77
-
78
- // 增强全局类型定义,用于支持JSX
79
- declare global {
80
- namespace JSX {
81
- interface IntrinsicElements {
82
- /**
83
- * 按钮组件
84
- */
85
- MButton: {
86
- /**
87
- * 按钮颜色
88
- * @values 'primary', 'success', 'warning', 'danger', 'info'
89
- */
90
- color?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
91
-
92
- /**
93
- * 是否为圆角按钮
94
- */
95
- round?: boolean;
96
-
97
- /**
98
- * 按钮尺寸
99
- * @values 'small', 'medium', 'large'
100
- */
101
- size?: 'small' | 'medium' | 'large';
102
-
103
- /**
104
- * 是否禁用
105
- */
106
- disabled?: boolean;
107
-
108
- /**
109
- * 自定义弹窗消息
110
- */
111
- popupMessage?: string;
112
-
113
- /**
114
- * 点击事件
115
- */
116
- onClick?: (event: MouseEvent) => void;
117
-
118
- /**
119
- * 弹窗事件
120
- */
121
- onPopup?: (message: string) => void;
122
-
123
- /**
124
- * 子元素/插槽内容
125
- */
126
- children?: any;
127
- }
128
- }
129
- }
130
- }
131
-
132
- export {};