wtsk-comps 1.2.1 → 1.2.2

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 +1 @@
1
- "use strict";const n=require("vue"),u=n.defineComponent({name:"WtskBtn",inheritAttrs:!1,__name:"WtskBtn",props:{onClick:{type:Function}},setup(c){const o=c,t=n.ref(!1);function i(e,r){const s={};for(const l in e)l!==r&&(s[l]=e[l]);return s}async function a(){t.value=!0;try{typeof o.onClick=="function"&&await o.onClick?.()}finally{t.value=!1}}return(e,r)=>{const s=n.resolveComponent("el-button");return n.openBlock(),n.createBlock(s,n.mergeProps(i(e.$props,"onClick"),{loading:t.value,onClick:a}),{default:n.withCtx(()=>[n.renderSlot(e.$slots,"default")]),_:3},16,["loading"])}}}),p=[{name:"WtskBtn",component:u}],f={install(c){p.forEach(({name:o,component:t})=>{c.component(o,t)})}};module.exports=f;
1
+ "use strict";const e=require("vue"),p=e.defineComponent({name:"WtskBtn",inheritAttrs:!1,__name:"WtskBtn",props:{onClick:{type:Function},size:{},disabled:{type:Boolean},type:{},icon:{},nativeType:{},loading:{type:Boolean},loadingIcon:{},plain:{type:Boolean},text:{type:Boolean},link:{type:Boolean},bg:{type:Boolean},autofocus:{type:Boolean},round:{type:Boolean},circle:{type:Boolean},color:{},dark:{type:Boolean},autoInsertSpace:{type:Boolean},tag:{}},setup(o){const t=o,n=e.useAttrs(),l=e.ref(!1),c=e.computed(()=>({...Object.fromEntries(Object.entries(t).filter(([s])=>s!=="onClick")),...n}));async function r(){l.value=!0;try{typeof t.onClick=="function"&&await t.onClick?.()}finally{l.value=!1}}return(a,s)=>{const i=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(i,e.mergeProps(c.value,{loading:l.value,onClick:r}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["loading"])}}}),u=[{name:"WtskBtn",component:p}],f={install(o){u.forEach(({name:t,component:n})=>{o.component(t,n)})}};module.exports=f;
@@ -1,49 +1,63 @@
1
- import { defineComponent as i, ref as f, resolveComponent as p, openBlock as u, createBlock as m, mergeProps as k, withCtx as C, renderSlot as d } from "vue";
2
- const _ = /* @__PURE__ */ i({
1
+ import { defineComponent as i, useAttrs as p, ref as u, computed as f, resolveComponent as d, openBlock as y, createBlock as B, mergeProps as m, withCtx as k, renderSlot as g } from "vue";
2
+ const C = /* @__PURE__ */ i({
3
3
  name: "WtskBtn",
4
4
  inheritAttrs: !1,
5
5
  __name: "WtskBtn",
6
6
  props: {
7
- onClick: { type: Function }
7
+ onClick: { type: Function },
8
+ size: {},
9
+ disabled: { type: Boolean },
10
+ type: {},
11
+ icon: {},
12
+ nativeType: {},
13
+ loading: { type: Boolean },
14
+ loadingIcon: {},
15
+ plain: { type: Boolean },
16
+ text: { type: Boolean },
17
+ link: { type: Boolean },
18
+ bg: { type: Boolean },
19
+ autofocus: { type: Boolean },
20
+ round: { type: Boolean },
21
+ circle: { type: Boolean },
22
+ color: {},
23
+ dark: { type: Boolean },
24
+ autoInsertSpace: { type: Boolean },
25
+ tag: {}
8
26
  },
9
- setup(s) {
10
- const o = s, n = f(!1);
11
- function r(t, l) {
12
- const e = {};
13
- for (const c in t)
14
- c !== l && (e[c] = t[c]);
15
- return e;
16
- }
17
- async function a() {
27
+ setup(t) {
28
+ const e = t, o = p(), n = u(!1), s = f(() => ({ ...Object.fromEntries(
29
+ Object.entries(e).filter(([a]) => a !== "onClick")
30
+ ), ...o }));
31
+ async function c() {
18
32
  n.value = !0;
19
33
  try {
20
- typeof o.onClick == "function" && await o.onClick?.();
34
+ typeof e.onClick == "function" && await e.onClick?.();
21
35
  } finally {
22
36
  n.value = !1;
23
37
  }
24
38
  }
25
- return (t, l) => {
26
- const e = p("el-button");
27
- return u(), m(e, k(r(t.$props, "onClick"), {
39
+ return (l, a) => {
40
+ const r = d("el-button");
41
+ return y(), B(r, m(s.value, {
28
42
  loading: n.value,
29
- onClick: a
43
+ onClick: c
30
44
  }), {
31
- default: C(() => [
32
- d(t.$slots, "default")
45
+ default: k(() => [
46
+ g(l.$slots, "default")
33
47
  ]),
34
48
  _: 3
35
49
  }, 16, ["loading"]);
36
50
  };
37
51
  }
38
- }), y = [
39
- { name: "WtskBtn", component: _ }
52
+ }), _ = [
53
+ { name: "WtskBtn", component: C }
40
54
  // { name: 'WtskTree', component: WtskTree },
41
55
  // { name: 'WtskForm', component: WtskForm },
42
56
  // { name: 'WtskTable', component: WtskTable }
43
57
  ], v = {
44
- install(s) {
45
- y.forEach(({ name: o, component: n }) => {
46
- s.component(o, n);
58
+ install(t) {
59
+ _.forEach(({ name: e, component: o }) => {
60
+ t.component(e, o);
47
61
  });
48
62
  }
49
63
  };
@@ -1 +1 @@
1
- (function(n,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(n=typeof globalThis<"u"?globalThis:n||self,n.WtskComps=o(n.Vue))})(this,(function(n){"use strict";const f=[{name:"WtskBtn",component:n.defineComponent({name:"WtskBtn",inheritAttrs:!1,__name:"WtskBtn",props:{onClick:{type:Function}},setup(c){const s=c,t=n.ref(!1);function a(e,r){const i={};for(const l in e)l!==r&&(i[l]=e[l]);return i}async function p(){t.value=!0;try{typeof s.onClick=="function"&&await s.onClick?.()}finally{t.value=!1}}return(e,r)=>{const i=n.resolveComponent("el-button");return n.openBlock(),n.createBlock(i,n.mergeProps(a(e.$props,"onClick"),{loading:t.value,onClick:p}),{default:n.withCtx(()=>[n.renderSlot(e.$slots,"default")]),_:3},16,["loading"])}}})}];return{install(c){f.forEach(({name:s,component:t})=>{c.component(s,t)})}}}));
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("vue")):typeof define=="function"&&define.amd?define(["vue"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.WtskComps=n(e.Vue))})(this,(function(e){"use strict";const c=[{name:"WtskBtn",component:e.defineComponent({name:"WtskBtn",inheritAttrs:!1,__name:"WtskBtn",props:{onClick:{type:Function},size:{},disabled:{type:Boolean},type:{},icon:{},nativeType:{},loading:{type:Boolean},loadingIcon:{},plain:{type:Boolean},text:{type:Boolean},link:{type:Boolean},bg:{type:Boolean},autofocus:{type:Boolean},round:{type:Boolean},circle:{type:Boolean},color:{},dark:{type:Boolean},autoInsertSpace:{type:Boolean},tag:{}},setup(o){const t=o,s=e.useAttrs(),i=e.ref(!1),r=e.computed(()=>({...Object.fromEntries(Object.entries(t).filter(([a])=>a!=="onClick")),...s}));async function p(){i.value=!0;try{typeof t.onClick=="function"&&await t.onClick?.()}finally{i.value=!1}}return(l,a)=>{const f=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(f,e.mergeProps(r.value,{loading:i.value,onClick:p}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["loading"])}}})}];return{install(o){c.forEach(({name:t,component:s})=>{o.component(t,s)})}}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wtsk-comps",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Vue3+Element Plus基础组件库(wtsk-btn/form/table/tree)",
5
5
  "author": "lujh",
6
6
  "license": "MIT",