morghulis 2.0.63 → 2.0.65

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"}
@@ -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,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,wBAAkC"}
package/package.json CHANGED
@@ -1,62 +1,61 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "2.0.63",
3
+ "version": "2.0.65",
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
- "types": "dist/index.d.ts",
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"
25
+ "types": "types/index.d.ts",
26
+ "typings": "types/index.d.ts",
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
35
  "files": [
17
36
  "dist",
37
+ "types",
18
38
  "web-types.json",
19
39
  "vetur"
20
40
  ],
41
+ "sideEffects": false,
21
42
  "scripts": {
22
43
  "dev": "vite",
23
- "build": "run-p type-check \"build-only {@}\" --",
24
- "preview": "vite preview",
25
- "build-only": "vite build",
44
+ "build": "vite build",
26
45
  "build-lib": "vite build --config vite.lib.config.ts",
27
- "type-check": "vue-tsc --build",
46
+ "preview": "vite preview",
28
47
  "prepublishOnly": "npm run build-lib"
29
48
  },
30
- "keywords": [
31
- "vue",
32
- "vue3",
33
- "component",
34
- "button",
35
- "ui",
36
- "typescript"
37
- ],
38
- "author": "MorghulisDev",
39
- "license": "MIT",
40
- "repository": {
41
- "type": "git",
42
- "url": "https://github.com/morghulis/morghulis"
43
- },
44
49
  "dependencies": {
45
- "vue": "^3.5.13"
50
+ "vue": "^3.2.25"
46
51
  },
47
52
  "devDependencies": {
48
- "@tsconfig/node22": "^22.0.1",
49
- "@types/node": "^22.14.0",
50
- "@vitejs/plugin-vue": "^5.2.3",
51
- "@vue/tsconfig": "^0.7.0",
52
- "npm-run-all2": "^7.0.2",
53
- "typescript": "~5.8.0",
54
- "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",
55
57
  "vite-plugin-dts": "^3.7.3",
56
- "vite-plugin-vue-devtools": "^7.7.2",
57
- "vue-tsc": "^2.2.8"
58
+ "vue-tsc": "^1.8.0"
58
59
  },
59
- "peerDependencies": {
60
- "vue": "^3.0.0"
61
- }
60
+ "web-types": "web-types.json"
62
61
  }
@@ -0,0 +1,114 @@
1
+ import { DefineComponent, VNode, AllowedComponentProps, ComponentCustomProps } from 'vue'
2
+
3
+ /**
4
+ * 按钮颜色类型
5
+ * @public
6
+ */
7
+ export type ButtonColor =
8
+ /** 主要按钮 */
9
+ 'primary' |
10
+ /** 成功按钮 */
11
+ 'success' |
12
+ /** 警告按钮 */
13
+ 'warning' |
14
+ /** 危险按钮 */
15
+ 'danger' |
16
+ /** 信息按钮 */
17
+ 'info';
18
+
19
+ /**
20
+ * 按钮尺寸类型
21
+ * @public
22
+ */
23
+ export type ButtonSize =
24
+ /** 小型按钮 */
25
+ 'small' |
26
+ /** 中型按钮 */
27
+ 'medium' |
28
+ /** 大型按钮 */
29
+ 'large';
30
+
31
+ /**
32
+ * 按钮属性
33
+ * @public
34
+ */
35
+ export interface ButtonProps {
36
+ /**
37
+ * 按钮颜色
38
+ * @default 'primary'
39
+ */
40
+ color?: ButtonColor;
41
+
42
+ /**
43
+ * 是否为圆角按钮
44
+ * @default false
45
+ */
46
+ round?: boolean;
47
+
48
+ /**
49
+ * 按钮尺寸
50
+ * @default 'medium'
51
+ */
52
+ size?: ButtonSize;
53
+
54
+ /**
55
+ * 是否禁用
56
+ * @default false
57
+ */
58
+ disabled?: boolean;
59
+
60
+ /**
61
+ * 自定义弹窗消息
62
+ * @default '按钮被点击!'
63
+ */
64
+ popupMessage?: string;
65
+ }
66
+
67
+ /**
68
+ * 按钮暴露的方法
69
+ * @public
70
+ */
71
+ export interface ButtonExpose {
72
+ /**
73
+ * 显示弹窗
74
+ * @param message - 弹窗消息
75
+ * @returns 弹窗消息
76
+ */
77
+ popup(message: string): string;
78
+ }
79
+
80
+ /**
81
+ * 按钮事件
82
+ * @public
83
+ */
84
+ export interface ButtonEvents {
85
+ /**
86
+ * 点击事件
87
+ * @param e - 鼠标事件对象
88
+ */
89
+ onClick?: (e: MouseEvent) => void;
90
+
91
+ /**
92
+ * 弹窗事件
93
+ * @param message - 弹窗消息
94
+ */
95
+ onPopup?: (message: string) => void;
96
+ }
97
+
98
+ /**
99
+ * 按钮组件
100
+ *
101
+ * @description 一个简单的按钮组件,具有多种颜色主题、尺寸选项和弹窗功能
102
+ * @example
103
+ * ```vue
104
+ * <MButton>默认按钮</MButton>
105
+ * <MButton color="success" round>成功按钮</MButton>
106
+ * <MButton color="warning" size="large">警告按钮</MButton>
107
+ * <MButton color="danger" disabled>危险按钮</MButton>
108
+ * <MButton popup-message="自定义消息">弹窗按钮</MButton>
109
+ * ```
110
+ *
111
+ * @see [文档](https://github.com/morghulis/morghulis)
112
+ * @public
113
+ */
114
+ export declare const MButton: DefineComponent<ButtonProps>;
@@ -0,0 +1,5 @@
1
+ export * from './MButton';
2
+
3
+ // 导出组件集合
4
+ import { MButton } from './MButton';
5
+ export { MButton };
@@ -2,7 +2,14 @@
2
2
  "m-button/color": {
3
3
  "type": "string",
4
4
  "description": "按钮颜色,可选值为 'primary', 'success', 'warning', 'danger', 'info'",
5
- "options": ["primary", "success", "warning", "danger", "info"]
5
+ "options": ["primary", "success", "warning", "danger", "info"],
6
+ "optionDescriptions": {
7
+ "primary": "主要按钮",
8
+ "success": "成功按钮",
9
+ "warning": "警告按钮",
10
+ "danger": "危险按钮",
11
+ "info": "信息按钮"
12
+ }
6
13
  },
7
14
  "m-button/round": {
8
15
  "type": "boolean",
@@ -11,7 +18,12 @@
11
18
  "m-button/size": {
12
19
  "type": "string",
13
20
  "description": "按钮尺寸,可选值为 'small', 'medium', 'large'",
14
- "options": ["small", "medium", "large"]
21
+ "options": ["small", "medium", "large"],
22
+ "optionDescriptions": {
23
+ "small": "小型按钮",
24
+ "medium": "中型按钮",
25
+ "large": "大型按钮"
26
+ }
15
27
  },
16
28
  "m-button/disabled": {
17
29
  "type": "boolean",
package/web-types.json CHANGED
@@ -16,10 +16,31 @@
16
16
  "description": "按钮颜色",
17
17
  "value": {
18
18
  "kind": "expression",
19
- "type": "string",
20
- "enum": ["primary", "success", "warning", "danger", "info"]
19
+ "type": "string"
21
20
  },
22
- "default": "primary"
21
+ "default": "primary",
22
+ "values": [
23
+ {
24
+ "name": "primary",
25
+ "description": "主要按钮"
26
+ },
27
+ {
28
+ "name": "success",
29
+ "description": "成功按钮"
30
+ },
31
+ {
32
+ "name": "warning",
33
+ "description": "警告按钮"
34
+ },
35
+ {
36
+ "name": "danger",
37
+ "description": "危险按钮"
38
+ },
39
+ {
40
+ "name": "info",
41
+ "description": "信息按钮"
42
+ }
43
+ ]
23
44
  },
24
45
  {
25
46
  "name": "round",
@@ -35,10 +56,23 @@
35
56
  "description": "按钮尺寸",
36
57
  "value": {
37
58
  "kind": "expression",
38
- "type": "string",
39
- "enum": ["small", "medium", "large"]
59
+ "type": "string"
40
60
  },
41
- "default": "medium"
61
+ "default": "medium",
62
+ "values": [
63
+ {
64
+ "name": "small",
65
+ "description": "小型按钮"
66
+ },
67
+ {
68
+ "name": "medium",
69
+ "description": "中型按钮"
70
+ },
71
+ {
72
+ "name": "large",
73
+ "description": "大型按钮"
74
+ }
75
+ ]
42
76
  },
43
77
  {
44
78
  "name": "disabled",