sand-components-vben 1.0.2 → 1.0.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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "sand-components-vben",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "main": "sandComponents.js",
5
- "scripts": {
6
- "test": "echo \"Error: no test specified\" && exit 1"
7
- },
8
5
  "keywords": [],
9
6
  "author": "",
10
7
  "license": "ISC",
11
- "description": ""
12
- }
8
+ "description": "",
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ }
12
+ }
@@ -0,0 +1 @@
1
+ .ant-select[data-v-b42694f6]{width:100%}
package/sandComponents.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as h, reactive as m, toRefs as _, onMounted as w, watch as y, resolveComponent as c, openBlock as n, createBlock as r, unref as u, isRef as S, withCtx as i, createElementBlock as g, Fragment as b, renderList as k, createTextVNode as x, toDisplayString as B } from "vue";
1
+ import { defineComponent as h, reactive as _, toRefs as m, onMounted as y, watch as w, resolveComponent as r, openBlock as s, createBlock as u, unref as i, isRef as S, withCtx as d, createElementBlock as g, Fragment as x, renderList as k, createTextVNode as b, toDisplayString as B } from "vue";
2
2
  const C = /* @__PURE__ */ h({
3
3
  __name: "ApiSelect",
4
4
  props: {
@@ -8,8 +8,8 @@ const C = /* @__PURE__ */ h({
8
8
  },
9
9
  // 公共下拉请求
10
10
  api: {
11
- type: Object,
12
- default: () => ({})
11
+ type: Function,
12
+ default: () => null
13
13
  },
14
14
  // 支持搜索
15
15
  showSearch: {
@@ -23,41 +23,45 @@ const C = /* @__PURE__ */ h({
23
23
  pageSize: 100,
24
24
  pageNo: 1
25
25
  })
26
+ },
27
+ placeholder: {
28
+ type: String,
29
+ default: "请选择"
26
30
  }
27
31
  },
28
- setup(l) {
29
- const e = l, p = m({
32
+ setup(t) {
33
+ const e = t, n = _({
30
34
  options: [],
31
- propsValue: ""
35
+ propsValue: void 0
32
36
  });
33
- let { options: d, propsValue: t } = _(p);
34
- return w(async () => {
37
+ let { options: c, propsValue: o } = m(n);
38
+ return y(async () => {
35
39
  if (e.api) {
36
- const { data: o } = await e.api(e.params);
37
- p.options = o, t.value = e.value;
40
+ const { data: l } = await e.api(e.params);
41
+ n.options = l, o.value = e.value;
38
42
  }
39
- }), y(
43
+ }), w(
40
44
  () => e.value,
41
- (o) => {
42
- t.value = o;
45
+ (l) => {
46
+ o.value = l;
43
47
  },
44
48
  { deep: !0 }
45
- ), (o, s) => {
46
- const f = c("a-select-option"), v = c("a-select");
47
- return n(), r(v, {
48
- value: u(t),
49
- "onUpdate:value": s[0] || (s[0] = (a) => S(t) ? t.value = a : t = a),
50
- "show-search": l.showSearch,
51
- placeholder: o.placeholder,
49
+ ), (l, p) => {
50
+ const f = r("a-select-option"), v = r("a-select");
51
+ return s(), u(v, {
52
+ value: i(o),
53
+ "onUpdate:value": p[0] || (p[0] = (a) => S(o) ? o.value = a : o = a),
54
+ "show-search": t.showSearch,
55
+ placeholder: t.placeholder,
52
56
  style: { width: "100%" }
53
57
  }, {
54
- default: i(() => [
55
- (n(!0), g(b, null, k(u(d), (a) => (n(), r(f, {
58
+ default: d(() => [
59
+ (s(!0), g(x, null, k(i(c), (a) => (s(), u(f, {
56
60
  value: a.value,
57
61
  key: a.value
58
62
  }, {
59
- default: i(() => [
60
- x(B(a.label), 1)
63
+ default: d(() => [
64
+ b(B(a.label), 1)
61
65
  ]),
62
66
  _: 2
63
67
  }, 1032, ["value"]))), 128))
@@ -66,12 +70,17 @@ const C = /* @__PURE__ */ h({
66
70
  }, 8, ["value", "show-search", "placeholder"]);
67
71
  };
68
72
  }
69
- }), N = [C], V = function(l) {
70
- N.forEach((e) => {
71
- l.component(e.name, e);
73
+ }), N = (t, e) => {
74
+ const n = t.__vccOpts || t;
75
+ for (const [c, o] of e)
76
+ n[c] = o;
77
+ return n;
78
+ }, V = /* @__PURE__ */ N(C, [["__scopeId", "data-v-b42694f6"]]), A = [V], E = function(t) {
79
+ A.forEach((e) => {
80
+ t.component(e.name, e);
72
81
  });
73
- }, A = { install: V };
82
+ }, O = { install: E };
74
83
  export {
75
- C as ApiSelect,
76
- A as default
84
+ V as ApiSelect,
85
+ O as default
77
86
  };
@@ -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.sandComponents={},t.Vue))})(this,function(t,e){"use strict";const p=e.defineComponent({__name:"ApiSelect",props:{value:{type:[String,Number],default:void 0},api:{type:Object,default:()=>({})},showSearch:{type:Boolean,default:!0},params:{type:Object,default:()=>({pageSize:100,pageNo:1})}},setup(s){const o=s,c=e.reactive({options:[],propsValue:""});let{options:u,propsValue:n}=e.toRefs(c);return e.onMounted(async()=>{if(o.api){const{data:l}=await o.api(o.params);c.options=l,n.value=o.value}}),e.watch(()=>o.value,l=>{n.value=l},{deep:!0}),(l,r)=>{const f=e.resolveComponent("a-select-option"),h=e.resolveComponent("a-select");return e.openBlock(),e.createBlock(h,{value:e.unref(n),"onUpdate:value":r[0]||(r[0]=a=>e.isRef(n)?n.value=a:n=a),"show-search":s.showSearch,placeholder:l.placeholder,style:{width:"100%"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),a=>(e.openBlock(),e.createBlock(f,{value:a.value,key:a.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","show-search","placeholder"])}}}),i=[p],d={install:function(s){i.forEach(o=>{s.component(o.name,o)})}};t.ApiSelect=p,t.default=d,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o.sandComponents={},o.Vue))})(this,function(o,e){"use strict";const r=((n,t)=>{const c=n.__vccOpts||n;for(const[p,a]of t)c[p]=a;return c})(e.defineComponent({__name:"ApiSelect",props:{value:{type:[String,Number],default:void 0},api:{type:Function,default:()=>null},showSearch:{type:Boolean,default:!0},params:{type:Object,default:()=>({pageSize:100,pageNo:1})},placeholder:{type:String,default:"请选择"}},setup(n){const t=n,c=e.reactive({options:[],propsValue:void 0});let{options:p,propsValue:a}=e.toRefs(c);return e.onMounted(async()=>{if(t.api){const{data:s}=await t.api(t.params);c.options=s,a.value=t.value}}),e.watch(()=>t.value,s=>{a.value=s},{deep:!0}),(s,i)=>{const u=e.resolveComponent("a-select-option"),_=e.resolveComponent("a-select");return e.openBlock(),e.createBlock(_,{value:e.unref(a),"onUpdate:value":i[0]||(i[0]=l=>e.isRef(a)?a.value=l:a=l),"show-search":n.showSearch,placeholder:n.placeholder,style:{width:"100%"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),l=>(e.openBlock(),e.createBlock(u,{value:l.value,key:l.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","show-search","placeholder"])}}}),[["__scopeId","data-v-b42694f6"]]),d=[r],f={install:function(n){d.forEach(t=>{n.component(t.name,t)})}};o.ApiSelect=r,o.default=f,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});