morghulis 2.0.33 → 2.0.36

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.
@@ -0,0 +1,60 @@
1
+ import { App, DefineComponent } from 'vue'
2
+
3
+ export interface MButtonProps {
4
+ /**
5
+ * 按钮类型
6
+ * @default 'default'
7
+ */
8
+ type?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info'
9
+ /**
10
+ * 按钮尺寸
11
+ * @default 'medium'
12
+ */
13
+ size?: 'small' | 'medium' | 'large'
14
+ /**
15
+ * 是否为圆角按钮
16
+ * @default false
17
+ */
18
+ round?: boolean
19
+ /**
20
+ * 是否为朴素按钮
21
+ * @default false
22
+ */
23
+ plain?: boolean
24
+ /**
25
+ * 是否禁用
26
+ * @default false
27
+ */
28
+ disabled?: boolean
29
+ /**
30
+ * 按钮文本
31
+ */
32
+ text?: string
33
+ /**
34
+ * 按钮加载状态
35
+ * @default false
36
+ */
37
+ loading?: boolean
38
+ /**
39
+ * 自定义图标
40
+ */
41
+ icon?: string
42
+ }
43
+
44
+ export interface MButtonExpose {
45
+ /**
46
+ * 模拟点击按钮
47
+ */
48
+ triggerClick: () => void
49
+ }
50
+
51
+ export type MButtonInstance = InstanceType<typeof MButton>
52
+
53
+ export const MButton: DefineComponent<MButtonProps>
54
+
55
+ export function install(app: App): void
56
+
57
+ export default {
58
+ install,
59
+ MButton
60
+ }
@@ -1,4 +1,4 @@
1
- import { defineComponent as f, computed as b, createElementBlock as s, openBlock as a, normalizeClass as r, createCommentVNode as u, createElementVNode as i, renderSlot as g, createTextVNode as _, toDisplayString as k } from "vue";
1
+ import { defineComponent as f, computed as b, createElementBlock as s, openBlock as a, normalizeClass as r, createCommentVNode as c, createElementVNode as i, renderSlot as g, createTextVNode as _, toDisplayString as k } from "vue";
2
2
  const y = ["disabled"], B = {
3
3
  key: 0,
4
4
  class: "m-button__loading"
@@ -40,12 +40,12 @@ const y = ["disabled"], B = {
40
40
  triggerClick: () => {
41
41
  !t.disabled && !t.loading && l("click", new MouseEvent("click"));
42
42
  }
43
- }), (e, c) => (a(), s("button", {
43
+ }), (e, u) => (a(), s("button", {
44
44
  class: r(m.value),
45
45
  disabled: e.disabled,
46
46
  onClick: p
47
47
  }, [
48
- e.loading ? (a(), s("span", B, c[0] || (c[0] = [
48
+ e.loading ? (a(), s("span", B, u[0] || (u[0] = [
49
49
  i("svg", {
50
50
  class: "m-button__loading-icon",
51
51
  viewBox: "0 0 1024 1024",
@@ -62,17 +62,17 @@ const y = ["disabled"], B = {
62
62
  fill: "currentColor"
63
63
  })
64
64
  ], -1)
65
- ]))) : u("", !0),
65
+ ]))) : c("", !0),
66
66
  e.icon && !e.loading ? (a(), s("span", h, [
67
67
  i("i", {
68
68
  class: r(e.icon)
69
69
  }, null, 2)
70
- ])) : u("", !0),
70
+ ])) : c("", !0),
71
71
  e.$slots.default || e.text ? (a(), s("span", C, [
72
72
  g(e.$slots, "default", {}, () => [
73
73
  _(k(e.text), 1)
74
74
  ], !0)
75
- ])) : u("", !0)
75
+ ])) : c("", !0)
76
76
  ], 10, y));
77
77
  }
78
78
  }), w = (o, d) => {
@@ -80,12 +80,13 @@ const y = ["disabled"], B = {
80
80
  for (const [t, l] of d)
81
81
  n[t] = l;
82
82
  return n;
83
- }, M = /* @__PURE__ */ w(v, [["__scopeId", "data-v-191e53ce"]]), $ = {
84
- install(o) {
85
- o.component("MButton", M);
86
- }
83
+ }, M = /* @__PURE__ */ w(v, [["__scopeId", "data-v-191e53ce"]]), z = (o) => {
84
+ o.component("MButton", M);
85
+ }, x = {
86
+ install: z
87
87
  };
88
88
  export {
89
89
  M as MButton,
90
- $ as default
90
+ x as default,
91
+ z as install
91
92
  };
package/package.json CHANGED
@@ -1,25 +1,26 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "2.0.33",
3
+ "version": "2.0.36",
4
4
  "private": false,
5
5
  "type": "module",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
6
+ "main": "./dist/morghulis.js",
7
+ "module": "./dist/morghulis.js",
8
+ "types": "./dist/morghulis.d.ts",
9
+ "typings": "./dist/morghulis.d.ts",
9
10
  "files": [
10
11
  "dist"
11
12
  ],
12
13
  "exports": {
13
14
  ".": {
14
- "import": "./dist/index.js",
15
- "types": "./dist/index.d.ts"
15
+ "import": "./dist/morghulis.js",
16
+ "types": "./dist/morghulis.d.ts"
16
17
  },
17
- "./style": "./dist/index.css"
18
+ "./style": "./dist/morghulis.css"
18
19
  },
19
20
  "scripts": {
20
21
  "dev": "vite",
21
- "build": "vue-tsc && vite build && npm run build:types",
22
- "build:types": "tsc --emitDeclarationOnly --declaration --project tsconfig.app.json",
22
+ "build": "vite build && npm run build:types",
23
+ "build:types": "cp ./src/morghulis.d.ts ./dist/morghulis.d.ts",
23
24
  "preview": "vite preview",
24
25
  "type-check": "vue-tsc --build",
25
26
  "prepublishOnly": "npm run build"
File without changes