morghulis 2.0.61 → 2.0.63

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,4 +1,47 @@
1
- import { DefineComponent } from 'vue';
1
+ import { DefineComponent, ComponentOptionsMixin, ComponentPropsOptions, EmitsOptions } from 'vue';
2
2
  import { ButtonProps, ButtonEmits, ButtonExpose } from './MButton';
3
- declare const MButton: DefineComponent<ButtonProps, {}, {}, {}, {}, {}, {}, ButtonEmits, string, Readonly<ButtonProps>, ButtonExpose>;
3
+
4
+ declare type Props = {
5
+ /**
6
+ * 按钮颜色
7
+ */
8
+ color?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
9
+ /**
10
+ * 是否为圆角按钮
11
+ */
12
+ round?: boolean;
13
+ /**
14
+ * 按钮尺寸
15
+ */
16
+ size?: 'small' | 'medium' | 'large';
17
+ /**
18
+ * 是否禁用
19
+ */
20
+ disabled?: boolean;
21
+ /**
22
+ * 自定义弹窗消息
23
+ */
24
+ popupMessage?: string;
25
+ };
26
+
27
+ declare type Emits = {
28
+ /**
29
+ * 点击事件
30
+ */
31
+ (e: 'click', event: MouseEvent): void;
32
+ /**
33
+ * 弹窗显示事件
34
+ */
35
+ (e: 'popup', message: string): void;
36
+ };
37
+
38
+ declare type Expose = {
39
+ /**
40
+ * 显示弹窗
41
+ * @param message 弹窗消息
42
+ */
43
+ popup?: (message: string) => string;
44
+ };
45
+
46
+ declare const MButton: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Emits, string, ButtonProps, Expose>;
4
47
  export default MButton;
@@ -0,0 +1,47 @@
1
+ import { DefineComponent, ComponentOptionsMixin, ComponentPropsOptions, EmitsOptions } from 'vue';
2
+ import { ButtonProps, ButtonEmits, ButtonExpose } from './MButton';
3
+
4
+ declare type Props = {
5
+ /**
6
+ * 按钮颜色
7
+ */
8
+ color?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
9
+ /**
10
+ * 是否为圆角按钮
11
+ */
12
+ round?: boolean;
13
+ /**
14
+ * 按钮尺寸
15
+ */
16
+ size?: 'small' | 'medium' | 'large';
17
+ /**
18
+ * 是否禁用
19
+ */
20
+ disabled?: boolean;
21
+ /**
22
+ * 自定义弹窗消息
23
+ */
24
+ popupMessage?: string;
25
+ };
26
+
27
+ declare type Emits = {
28
+ /**
29
+ * 点击事件
30
+ */
31
+ (e: 'click', event: MouseEvent): void;
32
+ /**
33
+ * 弹窗显示事件
34
+ */
35
+ (e: 'popup', message: string): void;
36
+ };
37
+
38
+ declare type Expose = {
39
+ /**
40
+ * 显示弹窗
41
+ * @param message 弹窗消息
42
+ */
43
+ popup?: (message: string) => string;
44
+ };
45
+
46
+ declare const MButton: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, Emits, string, ButtonProps, Expose>;
47
+ export default MButton;
@@ -3,3 +3,4 @@ import { default as MButton } from './MButton.vue';
3
3
  export type { ButtonColor, ButtonSize, ButtonProps, ButtonEmits, ButtonExpose } from './MButton.d.ts';
4
4
  export { MButton };
5
5
  export default MButton;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,46 @@
1
1
  export { MButton } from './components/index';
2
2
  export type { ButtonColor, ButtonSize, ButtonProps, ButtonEmits, ButtonExpose } from './components/index';
3
+ export interface MButtonProps {
4
+ /**
5
+ * 按钮颜色
6
+ */
7
+ color?: 'primary' | 'success' | 'warning' | 'danger' | 'info';
8
+ /**
9
+ * 是否为圆角按钮
10
+ */
11
+ round?: boolean;
12
+ /**
13
+ * 按钮尺寸
14
+ */
15
+ size?: 'small' | 'medium' | 'large';
16
+ /**
17
+ * 是否禁用
18
+ */
19
+ disabled?: boolean;
20
+ /**
21
+ * 自定义弹窗消息
22
+ */
23
+ popupMessage?: string;
24
+ }
25
+ export interface MButtonEvents {
26
+ /**
27
+ * 点击事件
28
+ */
29
+ onClick?: (event: MouseEvent) => void;
30
+ /**
31
+ * 弹窗显示事件
32
+ */
33
+ onPopup?: (message: string) => void;
34
+ }
35
+ export interface MButtonExpose {
36
+ /**
37
+ * 显示弹窗
38
+ * @param message 弹窗消息
39
+ */
40
+ popup: (message: string) => string;
41
+ }
3
42
  declare const _default: {
4
43
  MButton: any;
5
44
  };
6
45
  export default _default;
46
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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 +1 @@
1
- .m-btn[data-v-658f9125]{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-658f9125]{border-radius:20px}.m-btn.primary[data-v-658f9125]{background-color:#409eff;border-color:#409eff;color:#fff}.m-btn.success[data-v-658f9125]{background-color:#67c23a;border-color:#67c23a;color:#fff}.m-btn.warning[data-v-658f9125]{background-color:#e6a23c;border-color:#e6a23c;color:#fff}.m-btn.danger[data-v-658f9125]{background-color:#f56c6c;border-color:#f56c6c;color:#fff}.m-btn.info[data-v-658f9125]{background-color:#909399;border-color:#909399;color:#fff}.m-btn.small[data-v-658f9125]{font-size:.8em;padding:.3em .8em}.m-btn.medium[data-v-658f9125]{font-size:1em;padding:.5em 1.2em}.m-btn.large[data-v-658f9125]{font-size:1.2em;padding:.7em 1.6em}.m-btn.disabled[data-v-658f9125]{opacity:.6;cursor:not-allowed;pointer-events:none}.m-btn[data-v-658f9125]:hover:not(.disabled){opacity:.8}
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}
@@ -41,27 +41,27 @@ const c = r({
41
41
  }
42
42
  },
43
43
  emits: ["click", "popup"],
44
- setup(e, { emit: n, expose: l }) {
44
+ setup(e, { emit: n, expose: a }) {
45
45
  function o(t) {
46
46
  return window.alert(t), n("popup", t), t;
47
47
  }
48
- function a(t) {
48
+ function l(t) {
49
49
  e.disabled || (n("click", t), o(e.popupMessage));
50
50
  }
51
- return l({
51
+ return a({
52
52
  popup: o
53
53
  }), {
54
54
  popup: o,
55
- handleClick: a
55
+ handleClick: l
56
56
  };
57
57
  }
58
58
  }), f = (e, n) => {
59
- const l = e.__vccOpts || e;
60
- for (const [o, a] of n)
61
- l[o] = a;
62
- return l;
59
+ const a = e.__vccOpts || e;
60
+ for (const [o, l] of n)
61
+ a[o] = l;
62
+ return a;
63
63
  }, m = ["disabled"];
64
- function b(e, n, l, o, a, t) {
64
+ function b(e, n, a, o, l, t) {
65
65
  return i(), s("button", {
66
66
  class: u([
67
67
  "m-btn",
@@ -78,7 +78,7 @@ function b(e, n, l, o, a, t) {
78
78
  p(e.$slots, "default", {}, void 0, !0)
79
79
  ], 10, m);
80
80
  }
81
- const k = /* @__PURE__ */ f(c, [["render", b], ["__scopeId", "data-v-658f9125"]]), B = { MButton: k };
81
+ const k = /* @__PURE__ */ f(c, [["render", b], ["__scopeId", "data-v-51bacf79"]]), B = { MButton: k };
82
82
  export {
83
83
  k as MButton,
84
84
  B as default
@@ -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-658f9125"]]),c={MButton:u};t.MButton=u,t.default=c,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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"}})});
package/package.json CHANGED
@@ -1,14 +1,22 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "2.0.61",
3
+ "version": "2.0.63",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/morghulis.umd.js",
7
7
  "module": "dist/morghulis.es.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "style": "dist/morghulis.css",
10
+ "typings": "dist/index.d.ts",
11
+ "web-types": "web-types.json",
12
+ "vetur": {
13
+ "tags": "vetur/tags.json",
14
+ "attributes": "vetur/attributes.json"
15
+ },
10
16
  "files": [
11
- "dist"
17
+ "dist",
18
+ "web-types.json",
19
+ "vetur"
12
20
  ],
13
21
  "scripts": {
14
22
  "dev": "vite",
@@ -0,0 +1,24 @@
1
+ {
2
+ "m-button/color": {
3
+ "type": "string",
4
+ "description": "按钮颜色,可选值为 'primary', 'success', 'warning', 'danger', 'info'",
5
+ "options": ["primary", "success", "warning", "danger", "info"]
6
+ },
7
+ "m-button/round": {
8
+ "type": "boolean",
9
+ "description": "是否为圆角按钮"
10
+ },
11
+ "m-button/size": {
12
+ "type": "string",
13
+ "description": "按钮尺寸,可选值为 'small', 'medium', 'large'",
14
+ "options": ["small", "medium", "large"]
15
+ },
16
+ "m-button/disabled": {
17
+ "type": "boolean",
18
+ "description": "是否禁用"
19
+ },
20
+ "m-button/popup-message": {
21
+ "type": "string",
22
+ "description": "自定义弹窗消息"
23
+ }
24
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "m-button": {
3
+ "attributes": ["color", "round", "size", "disabled", "popup-message"],
4
+ "description": "一个简单的按钮组件,具有多种颜色主题、尺寸选项和弹窗功能"
5
+ }
6
+ }
package/web-types.json ADDED
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "framework": "vue",
4
+ "version": "2.0.0",
5
+ "name": "morghulis",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
10
+ "name": "MButton",
11
+ "description": "一个简单的按钮组件,具有多种颜色主题、尺寸选项和弹窗功能",
12
+ "doc-url": "https://github.com/morghulis/morghulis",
13
+ "attributes": [
14
+ {
15
+ "name": "color",
16
+ "description": "按钮颜色",
17
+ "value": {
18
+ "kind": "expression",
19
+ "type": "string",
20
+ "enum": ["primary", "success", "warning", "danger", "info"]
21
+ },
22
+ "default": "primary"
23
+ },
24
+ {
25
+ "name": "round",
26
+ "description": "是否为圆角按钮",
27
+ "value": {
28
+ "kind": "expression",
29
+ "type": "boolean"
30
+ },
31
+ "default": "false"
32
+ },
33
+ {
34
+ "name": "size",
35
+ "description": "按钮尺寸",
36
+ "value": {
37
+ "kind": "expression",
38
+ "type": "string",
39
+ "enum": ["small", "medium", "large"]
40
+ },
41
+ "default": "medium"
42
+ },
43
+ {
44
+ "name": "disabled",
45
+ "description": "是否禁用",
46
+ "value": {
47
+ "kind": "expression",
48
+ "type": "boolean"
49
+ },
50
+ "default": "false"
51
+ },
52
+ {
53
+ "name": "popup-message",
54
+ "description": "自定义弹窗消息",
55
+ "value": {
56
+ "kind": "expression",
57
+ "type": "string"
58
+ },
59
+ "default": "按钮被点击!"
60
+ }
61
+ ],
62
+ "events": [
63
+ {
64
+ "name": "click",
65
+ "description": "按钮点击事件"
66
+ },
67
+ {
68
+ "name": "popup",
69
+ "description": "弹窗显示事件,参数为弹窗消息"
70
+ }
71
+ ],
72
+ "slots": [
73
+ {
74
+ "name": "default",
75
+ "description": "按钮内容"
76
+ }
77
+ ],
78
+ "js": {
79
+ "properties": [
80
+ {
81
+ "name": "popup",
82
+ "description": "显示弹窗,参数为弹窗消息"
83
+ }
84
+ ]
85
+ }
86
+ }
87
+ ]
88
+ }
89
+ }
90
+ }
@@ -1,46 +0,0 @@
1
- import { DefineComponent } from 'vue';
2
-
3
-
4
- export type ButtonColor = 'primary' | 'success' | 'warning' | 'danger' | 'info'
5
- export type ButtonSize = 'small' | 'medium' | 'large'
6
-
7
- export interface ButtonProps {
8
- /**
9
- * 按钮颜色
10
- */
11
- color?: ButtonColor
12
- /**
13
- * 是否为圆角按钮
14
- */
15
- round?: boolean
16
- /**
17
- * 按钮尺寸
18
- */
19
- size?: ButtonSize
20
- /**
21
- * 是否禁用
22
- */
23
- disabled?: boolean
24
- /**
25
- * 自定义弹窗消息
26
- */
27
- popupMessage?: string
28
- }
29
-
30
- export interface ButtonEmits {
31
- (e: 'click', event: MouseEvent): void
32
- (e: 'popup', message: string): void
33
- }
34
-
35
- export interface ButtonExpose {
36
- /**
37
- * 显示弹窗
38
- * @param message 弹窗消息
39
- */
40
- popup?: (message: string) => string
41
- }
42
-
43
- declare const MButton: DefineComponent<ButtonProps, {}, {}, {}, {}, {}, {}, ButtonEmits, string, Readonly<ButtonProps>, Partial<ButtonExpose>>
44
-
45
- export default MButton
46
- export function popup(message: string): void