morghulis 2.0.44 → 2.0.45

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,4 @@
1
- import { defineComponent as m, computed as b, createElementBlock as a, openBlock as s, normalizeClass as c, createCommentVNode as d, createElementVNode as i, renderSlot as g, createTextVNode as p, toDisplayString as k } from "vue";
1
+ import { defineComponent as m, computed as b, createElementBlock as a, openBlock as s, normalizeClass as r, createCommentVNode as u, createElementVNode as i, renderSlot as g, createTextVNode as p, toDisplayString as k } from "vue";
2
2
  const y = m({
3
3
  name: "MButton",
4
4
  props: {
@@ -73,8 +73,8 @@ const y = m({
73
73
  "m-button--disabled": t.disabled,
74
74
  "m-button--loading": t.loading
75
75
  }
76
- ]), l = (u) => {
77
- t.disabled || t.loading || e("click", u);
76
+ ]), l = (c) => {
77
+ t.disabled || t.loading || e("click", c);
78
78
  };
79
79
  return n({
80
80
  /**
@@ -93,23 +93,23 @@ const y = m({
93
93
  for (const [o, l] of e)
94
94
  n[o] = l;
95
95
  return n;
96
- }, C = ["disabled"], h = {
96
+ }, B = ["disabled"], C = {
97
97
  key: 0,
98
98
  class: "m-button__loading"
99
- }, B = {
99
+ }, h = {
100
100
  key: 1,
101
101
  class: "m-button__icon"
102
102
  }, v = {
103
103
  key: 2,
104
104
  class: "m-button__text"
105
105
  };
106
- function $(t, e, n, o, l, u) {
106
+ function $(t, e, n, o, l, c) {
107
107
  return s(), a("button", {
108
- class: c(t.buttonClass),
108
+ class: r(t.buttonClass),
109
109
  disabled: t.disabled,
110
110
  onClick: e[0] || (e[0] = (...f) => t.handleClick && t.handleClick(...f))
111
111
  }, [
112
- t.loading ? (s(), a("span", h, e[1] || (e[1] = [
112
+ t.loading ? (s(), a("span", C, e[1] || (e[1] = [
113
113
  i("svg", {
114
114
  class: "m-button__loading-icon",
115
115
  viewBox: "0 0 1024 1024",
@@ -126,29 +126,33 @@ function $(t, e, n, o, l, u) {
126
126
  fill: "currentColor"
127
127
  })
128
128
  ], -1)
129
- ]))) : d("", !0),
130
- t.icon && !t.loading ? (s(), a("span", B, [
129
+ ]))) : u("", !0),
130
+ t.icon && !t.loading ? (s(), a("span", h, [
131
131
  i("i", {
132
- class: c(t.icon)
132
+ class: r(t.icon)
133
133
  }, null, 2)
134
- ])) : d("", !0),
134
+ ])) : u("", !0),
135
135
  t.$slots.default || t.text ? (s(), a("span", v, [
136
136
  g(t.$slots, "default", {}, () => [
137
137
  p(k(t.text), 1)
138
138
  ], !0)
139
- ])) : d("", !0)
140
- ], 10, C);
139
+ ])) : u("", !0)
140
+ ], 10, B);
141
141
  }
142
- const r = /* @__PURE__ */ _(y, [["render", $], ["__scopeId", "data-v-1d04af69"]]), w = (t) => {
143
- t.component("MButton", r);
144
- }, z = (t) => {
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) => {
145
149
  w(t);
146
150
  }, S = {
147
- install: z,
148
- MButton: r
151
+ install: M,
152
+ MButton: d
149
153
  };
150
154
  export {
151
- r as MButton,
155
+ d as MButton,
152
156
  S as default,
153
- z as install
157
+ M as install
154
158
  };
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { App } from 'vue';
1
+ import type { App, Component } from 'vue';
2
2
 
3
3
  export declare type ButtonType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text';
4
4
  export declare type ButtonSize = 'large' | 'default' | 'small';
@@ -22,10 +22,7 @@ export interface ButtonEvents {
22
22
  click: (event: MouseEvent) => void;
23
23
  }
24
24
 
25
- export declare const MButton: {
26
- new (): {
27
- $props: ButtonProps;
28
- };
25
+ export declare const MButton: Component & {
29
26
  install(app: App): void;
30
27
  };
31
28
 
@@ -36,4 +33,10 @@ declare const _default: {
36
33
  MButton: typeof MButton;
37
34
  };
38
35
 
39
- export default _default;
36
+ export default _default;
37
+
38
+ declare module '@vue/runtime-core' {
39
+ export interface GlobalComponents {
40
+ MButton: typeof MButton;
41
+ }
42
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "2.0.44",
3
+ "version": "2.0.45",
4
4
  "description": "一个Vue 3按钮组件库,支持TypeScript和IDE自动补全",
5
5
  "type": "module",
6
6
  "main": "dist/morghulis.es.js",
@@ -11,7 +11,8 @@
11
11
  "types": "./index.d.ts",
12
12
  "import": "./dist/morghulis.es.js",
13
13
  "require": "./dist/morghulis.es.js"
14
- }
14
+ },
15
+ "./dist/morghulis.css": "./dist/morghulis.css"
15
16
  },
16
17
  "files": [
17
18
  "dist",