yanzhi-ui 0.1.2 → 0.1.4

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.
package/dist/yanzhi-ui.js CHANGED
@@ -1 +1 @@
1
- "use strict";var d=Object.defineProperty;var u=(o,t,s)=>t in o?d(o,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[t]=s;var l=(o,t,s)=>u(o,typeof t!="symbol"?t+"":t,s);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),b=["disabled"],h=n.defineComponent({__name:"Button",props:{type:{},size:{},color:{},textColor:{},disabled:{type:Boolean},loading:{type:Boolean}},setup(o){class t{constructor(e){l(this,"type");l(this,"size");l(this,"color");l(this,"textColor");l(this,"disabled");l(this,"loading");this.type=e.type||"default",this.size=e.size||"medium",this.color=e.color,this.textColor=e.textColor,this.disabled=e.disabled??!1,this.loading=e.loading??!1}get classes(){const e=["i-button",this.type,this.size];return this.disabled&&e.push("disabled"),this.loading&&e.push("loading"),e.join(" ")}get styles(){return{backgroundColor:this.color||"",color:this.textColor||""}}}const s=o,i=n.reactive(new t(s));return(a,e)=>(n.openBlock(),n.createElementBlock("button",{class:n.normalizeClass(i.classes),style:n.normalizeStyle(i.styles),disabled:i.disabled,onClick:e[0]||(e[0]=r=>a.$emit("click",r))},[n.renderSlot(a.$slots,"default",{},void 0,!0)],14,b))}}),f=(o,t)=>{const s=o.__vccOpts||o;for(const[i,a]of t)s[i]=a;return s},c=f(h,[["__scopeId","data-v-63e0e36c"]]),y=[c],g=o=>{y.forEach(t=>{o.component(t.name||"",t)})},m={install:g};exports.IButton=c;exports.default=m;
1
+ "use strict";var d=Object.defineProperty;var u=(o,t,s)=>t in o?d(o,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[t]=s;var l=(o,t,s)=>u(o,typeof t!="symbol"?t+"":t,s);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),b=["disabled"],h=n.defineComponent({__name:"Button",props:{type:{},size:{},color:{},textColor:{},disabled:{type:Boolean},loading:{type:Boolean}},setup(o){class t{constructor(e){l(this,"type");l(this,"size");l(this,"color");l(this,"textColor");l(this,"disabled");l(this,"loading");this.type=e.type||"default",this.size=e.size||"medium",this.color=e.color,this.textColor=e.textColor,this.disabled=e.disabled??!1,this.loading=e.loading??!1}get classes(){const e=["i-button",this.type,this.size];return this.disabled&&e.push("disabled"),this.loading&&e.push("loading"),e.join(" ")}get styles(){return{backgroundColor:this.color||"",color:this.textColor||""}}}const s=o,i=n.reactive(new t(s));return(a,e)=>(n.openBlock(),n.createElementBlock("button",{class:n.normalizeClass(i.classes),style:n.normalizeStyle(i.styles),disabled:i.disabled,onClick:e[0]||(e[0]=r=>a.$emit("click",r))},[n.renderSlot(a.$slots,"default",{},void 0,!0)],14,b))}}),f=(o,t)=>{const s=o.__vccOpts||o;for(const[i,a]of t)s[i]=a;return s},c=f(h,[["__scopeId","data-v-63e0e36c"]]),y=[c],g=o=>{y.forEach(t=>{o.component(t.name,t)})},m={install:g};exports.IButton=c;exports.default=m;
@@ -51,7 +51,7 @@ const y = ["disabled"], g = /* @__PURE__ */ r({
51
51
  return s;
52
52
  }, C = /* @__PURE__ */ _(g, [["__scopeId", "data-v-63e0e36c"]]), x = [C], z = (o) => {
53
53
  x.forEach((t) => {
54
- o.component(t.name || "", t);
54
+ o.component(t.name, t);
55
55
  });
56
56
  }, v = { install: z };
57
57
  export {
@@ -1 +1 @@
1
- (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.YanzhiUI={},t.Vue))})(this,(function(t,e){"use strict";var p=Object.defineProperty;var _=(t,e,n)=>e in t?p(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var s=(t,e,n)=>_(t,typeof e!="symbol"?e+"":e,n);const n=["disabled"],r=((i,l)=>{const c=i.__vccOpts||i;for(const[d,a]of l)c[d]=a;return c})(e.defineComponent({__name:"Button",props:{type:{},size:{},color:{},textColor:{},disabled:{type:Boolean},loading:{type:Boolean}},setup(i){class l{constructor(o){s(this,"type");s(this,"size");s(this,"color");s(this,"textColor");s(this,"disabled");s(this,"loading");this.type=o.type||"default",this.size=o.size||"medium",this.color=o.color,this.textColor=o.textColor,this.disabled=o.disabled??!1,this.loading=o.loading??!1}get classes(){const o=["i-button",this.type,this.size];return this.disabled&&o.push("disabled"),this.loading&&o.push("loading"),o.join(" ")}get styles(){return{backgroundColor:this.color||"",color:this.textColor||""}}}const c=i,d=e.reactive(new l(c));return(a,o)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(d.classes),style:e.normalizeStyle(d.styles),disabled:d.disabled,onClick:o[0]||(o[0]=h=>a.$emit("click",h))},[e.renderSlot(a.$slots,"default",{},void 0,!0)],14,n))}}),[["__scopeId","data-v-63e0e36c"]]),u=[r],f={install:i=>{u.forEach(l=>{i.component(l.name||"",l)})}};t.IButton=r,t.default=f,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.YanzhiUI={},t.Vue))})(this,(function(t,e){"use strict";var p=Object.defineProperty;var _=(t,e,n)=>e in t?p(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var s=(t,e,n)=>_(t,typeof e!="symbol"?e+"":e,n);const n=["disabled"],r=((i,l)=>{const c=i.__vccOpts||i;for(const[d,a]of l)c[d]=a;return c})(e.defineComponent({__name:"Button",props:{type:{},size:{},color:{},textColor:{},disabled:{type:Boolean},loading:{type:Boolean}},setup(i){class l{constructor(o){s(this,"type");s(this,"size");s(this,"color");s(this,"textColor");s(this,"disabled");s(this,"loading");this.type=o.type||"default",this.size=o.size||"medium",this.color=o.color,this.textColor=o.textColor,this.disabled=o.disabled??!1,this.loading=o.loading??!1}get classes(){const o=["i-button",this.type,this.size];return this.disabled&&o.push("disabled"),this.loading&&o.push("loading"),o.join(" ")}get styles(){return{backgroundColor:this.color||"",color:this.textColor||""}}}const c=i,d=e.reactive(new l(c));return(a,o)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(d.classes),style:e.normalizeStyle(d.styles),disabled:d.disabled,onClick:o[0]||(o[0]=h=>a.$emit("click",h))},[e.renderSlot(a.$slots,"default",{},void 0,!0)],14,n))}}),[["__scopeId","data-v-63e0e36c"]]),u=[r],f={install:i=>{u.forEach(l=>{i.component(l.name,l)})}};t.IButton=r,t.default=f,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "yanzhi-ui",
3
3
  "private": false,
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
5
5
  "types": "dist/yanzhi-ui.d.ts",
6
- "main": "dist/yanzhi-ui.umd.cjs",
7
- "module": "dist/yanzhi-ui.es.js",
6
+ "main": "dist/yanzhi-ui.umd.js",
7
+ "module": "dist/yanzhi-ui.mjs",
8
8
  "files": [
9
9
  "dist",
10
10
  "src/packages"
@@ -22,5 +22,11 @@
22
22
  "vite": "^6.0.0",
23
23
  "vite-plugin-dts": "^4.5.4",
24
24
  "vue": "^3.2.0"
25
+ },
26
+ "exports": {
27
+ ".": {
28
+ "import": "./dist/yanzhi-ui.mjs",
29
+ "require": "./dist/yanzhi-ui.umd.js"
30
+ }
25
31
  }
26
32
  }
@@ -0,0 +1,9 @@
1
+ import type { Component } from 'vue'
2
+
3
+ declare module 'vue' {
4
+ export interface GlobalComponents {
5
+ IButton: typeof Component
6
+ }
7
+ }
8
+
9
+ export {}
@@ -1,3 +1,4 @@
1
+ // packages/index.ts
1
2
  import type { App } from 'vue'
2
3
  import IButton from './button/Button.vue'
3
4
 
@@ -5,11 +6,9 @@ const components = [IButton]
5
6
 
6
7
  const install = (app: App) => {
7
8
  components.forEach(component => {
8
- app.component(component.name || '', component)
9
+ app.component(component.name!, component)
9
10
  })
10
11
  }
11
12
 
12
- // 支持按需导入
13
13
  export { IButton }
14
-
15
- export default { install }
14
+ export default { install }