@king-one/antdv 1.0.40 → 1.0.41

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @king-one/antdv
2
2
 
3
+ ## 1.0.41
4
+
5
+ ### Patch Changes
6
+
7
+ - perf:优化部分功能
8
+
3
9
  ## 1.0.40
4
10
 
5
11
  ### Patch Changes
@@ -1,56 +1,54 @@
1
- import { defineComponent as c, mergeModels as d, useModel as m, reactive as f, watch as u, openBlock as h, createBlock as y, unref as r, createSlots as v, withCtx as b, createVNode as g } from "vue";
2
- import { debounce as P } from "lodash-es";
3
- import { Select as k, Spin as S } from "ant-design-vue";
4
- import { proPickerApi as n } from "../apis/pro-picker.api.mjs";
5
- import { ProPickerProps as w } from "./types.mjs";
6
- const j = /* @__PURE__ */ c({
1
+ import { defineComponent as d, mergeModels as m, useModel as f, reactive as u, watch as h, openBlock as y, createBlock as b, unref as i, createSlots as v, withCtx as g, createVNode as P } from "vue";
2
+ import { debounce as k } from "lodash-es";
3
+ import { Select as S, Spin as w } from "ant-design-vue";
4
+ import { proPickerApi as l } from "../apis/pro-picker.api.mjs";
5
+ import { ProPickerProps as V } from "./types.mjs";
6
+ const x = /* @__PURE__ */ d({
7
7
  name: "ProPicker",
8
8
  __name: "ProPicker",
9
- props: /* @__PURE__ */ d(w, {
9
+ props: /* @__PURE__ */ m(V, {
10
10
  modelValue: {},
11
11
  modelModifiers: {}
12
12
  }),
13
13
  emits: ["update:modelValue"],
14
- setup(i) {
15
- const p = i, l = m(i, "modelValue"), a = f({
14
+ setup(p) {
15
+ const s = p, r = f(p, "modelValue"), a = u({
16
16
  data: [],
17
17
  fetching: !1
18
18
  });
19
- u(l, (e) => {
20
- typeof e == "string" || typeof e == "number" ? n.company({
19
+ h(r, (e) => {
20
+ !e || a.data.some((o) => o.value === e) || (typeof e == "string" || typeof e == "number" ? l.company({
21
21
  params: { value: e }
22
- }).then((t) => {
23
- a.data = t.data.options.map((o) => ({
24
- label: o.label,
25
- value: o.value
22
+ }).then((o) => {
23
+ a.data = o.data.options.map((n) => ({
24
+ label: n.label,
25
+ value: n.value
26
26
  })), a.fetching = !1;
27
- }) : Array.isArray(e) && n.company({
27
+ }) : Array.isArray(e) && l.company({
28
28
  params: { value: e.join(",") }
29
- }).then((t) => {
30
- a.data = t.data.options.map((o) => ({
31
- label: o.label,
32
- value: o.value
29
+ }).then((o) => {
30
+ a.data = o.data.options.map((n) => ({
31
+ label: n.label,
32
+ value: n.value
33
33
  })), a.fetching = !1;
34
- });
35
- }, {
36
- once: !0
34
+ }));
37
35
  });
38
- const s = P((e) => {
39
- e && (a.fetching = !0, p.type === "company" ? n.company({
36
+ const c = k((e) => {
37
+ e && (a.fetching = !0, s.type === "company" ? l.company({
40
38
  params: { label: e }
41
39
  }).then((t) => {
42
40
  a.data = t.data.options.map((o) => ({
43
41
  label: o.label,
44
42
  value: o.value
45
43
  })), a.fetching = !1;
46
- }) : n.user({
44
+ }) : l.user({
47
45
  params: { label: e }
48
46
  }).then(() => {
49
47
  }));
50
- }, p.delay);
51
- return (e, t) => (h(), y(r(k), {
52
- value: l.value,
53
- "onUpdate:value": t[0] || (t[0] = (o) => l.value = o),
48
+ }, s.delay);
49
+ return (e, t) => (y(), b(i(S), {
50
+ value: r.value,
51
+ "onUpdate:value": t[0] || (t[0] = (o) => r.value = o),
54
52
  mode: e.mode,
55
53
  "show-search": "",
56
54
  placeholder: e.placeholder,
@@ -58,15 +56,15 @@ const j = /* @__PURE__ */ c({
58
56
  "filter-option": !1,
59
57
  "not-found-content": a.fetching ? void 0 : null,
60
58
  options: a.data,
61
- onSearch: r(s)
59
+ onSearch: i(c)
62
60
  }, v({
63
61
  _: 2
64
62
  /* DYNAMIC */
65
63
  }, [
66
64
  a.fetching ? {
67
65
  name: "notFoundContent",
68
- fn: b(() => [
69
- g(r(S), { size: "small" })
66
+ fn: g(() => [
67
+ P(i(w), { size: "small" })
70
68
  ]),
71
69
  key: "0"
72
70
  } : void 0
@@ -74,5 +72,5 @@ const j = /* @__PURE__ */ c({
74
72
  }
75
73
  });
76
74
  export {
77
- j as default
75
+ x as default
78
76
  };
@@ -10,9 +10,6 @@ const e = {
10
10
  mode: {
11
11
  type: String
12
12
  },
13
- isInit: {
14
- type: Boolean
15
- },
16
13
  delay: {
17
14
  type: Number,
18
15
  default: 200
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("lodash-es"),c=require("ant-design-vue"),r=require("../apis/pro-picker.api.js"),d=require("./types.js"),f=e.defineComponent({name:"ProPicker",__name:"ProPicker",props:e.mergeModels(d.ProPickerProps,{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const s=i,l=e.useModel(i,"modelValue"),o=e.reactive({data:[],fetching:!1});e.watch(l,a=>{typeof a=="string"||typeof a=="number"?r.proPickerApi.company({params:{value:a}}).then(n=>{o.data=n.data.options.map(t=>({label:t.label,value:t.value})),o.fetching=!1}):Array.isArray(a)&&r.proPickerApi.company({params:{value:a.join(",")}}).then(n=>{o.data=n.data.options.map(t=>({label:t.label,value:t.value})),o.fetching=!1})},{once:!0});const p=u.debounce(a=>{a&&(o.fetching=!0,s.type==="company"?r.proPickerApi.company({params:{label:a}}).then(n=>{o.data=n.data.options.map(t=>({label:t.label,value:t.value})),o.fetching=!1}):r.proPickerApi.user({params:{label:a}}).then(()=>{}))},s.delay);return(a,n)=>(e.openBlock(),e.createBlock(e.unref(c.Select),{value:l.value,"onUpdate:value":n[0]||(n[0]=t=>l.value=t),mode:a.mode,"show-search":"",placeholder:a.placeholder,style:{width:"100%"},"filter-option":!1,"not-found-content":o.fetching?void 0:null,options:o.data,onSearch:e.unref(p)},e.createSlots({_:2},[o.fetching?{name:"notFoundContent",fn:e.withCtx(()=>[e.createVNode(e.unref(c.Spin),{size:"small"})]),key:"0"}:void 0]),1032,["value","mode","placeholder","not-found-content","options","onSearch"]))}});exports.default=f;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),d=require("lodash-es"),p=require("ant-design-vue"),l=require("../apis/pro-picker.api.js"),f=require("./types.js"),m=a.defineComponent({name:"ProPicker",__name:"ProPicker",props:a.mergeModels(f.ProPickerProps,{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(s){const c=s,i=a.useModel(s,"modelValue"),o=a.reactive({data:[],fetching:!1});a.watch(i,e=>{!e||o.data.some(t=>t.value===e)||(typeof e=="string"||typeof e=="number"?l.proPickerApi.company({params:{value:e}}).then(t=>{o.data=t.data.options.map(r=>({label:r.label,value:r.value})),o.fetching=!1}):Array.isArray(e)&&l.proPickerApi.company({params:{value:e.join(",")}}).then(t=>{o.data=t.data.options.map(r=>({label:r.label,value:r.value})),o.fetching=!1}))});const u=d.debounce(e=>{e&&(o.fetching=!0,c.type==="company"?l.proPickerApi.company({params:{label:e}}).then(n=>{o.data=n.data.options.map(t=>({label:t.label,value:t.value})),o.fetching=!1}):l.proPickerApi.user({params:{label:e}}).then(()=>{}))},c.delay);return(e,n)=>(a.openBlock(),a.createBlock(a.unref(p.Select),{value:i.value,"onUpdate:value":n[0]||(n[0]=t=>i.value=t),mode:e.mode,"show-search":"",placeholder:e.placeholder,style:{width:"100%"},"filter-option":!1,"not-found-content":o.fetching?void 0:null,options:o.data,onSearch:a.unref(u)},a.createSlots({_:2},[o.fetching?{name:"notFoundContent",fn:a.withCtx(()=>[a.createVNode(a.unref(p.Spin),{size:"small"})]),key:"0"}:void 0]),1032,["value","mode","placeholder","not-found-content","options","onSearch"]))}});exports.default=m;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={type:{type:String,default:"company"},placeholder:{type:String,default:"请选择"},mode:{type:String},isInit:{type:Boolean},delay:{type:Number,default:200}};exports.ProPickerProps=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={type:{type:String,default:"company"},placeholder:{type:String,default:"请选择"},mode:{type:String},delay:{type:Number,default:200}};exports.ProPickerProps=e;
@@ -14,9 +14,6 @@ export declare const KProPicker: SFCWithInstall<DefineComponent<{
14
14
  mode: {
15
15
  readonly type: PropType<"multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE">;
16
16
  };
17
- isInit: {
18
- readonly type: BooleanConstructor;
19
- };
20
17
  delay: {
21
18
  readonly type: NumberConstructor;
22
19
  readonly default: 200;
@@ -38,9 +35,6 @@ export declare const KProPicker: SFCWithInstall<DefineComponent<{
38
35
  mode: {
39
36
  readonly type: PropType<"multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE">;
40
37
  };
41
- isInit: {
42
- readonly type: BooleanConstructor;
43
- };
44
38
  delay: {
45
39
  readonly type: NumberConstructor;
46
40
  readonly default: 200;
@@ -53,7 +47,6 @@ export declare const KProPicker: SFCWithInstall<DefineComponent<{
53
47
  }, {
54
48
  type: "company" | "user";
55
49
  placeholder: string;
56
- isInit: boolean;
57
50
  delay: number;
58
51
  }, {}>>;
59
52
  export default KProPicker;
@@ -12,9 +12,6 @@ declare const _default: DefineComponent<{
12
12
  mode: {
13
13
  readonly type: PropType<"multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE">;
14
14
  };
15
- isInit: {
16
- readonly type: BooleanConstructor;
17
- };
18
15
  delay: {
19
16
  readonly type: NumberConstructor;
20
17
  readonly default: 200;
@@ -36,9 +33,6 @@ declare const _default: DefineComponent<{
36
33
  mode: {
37
34
  readonly type: PropType<"multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE">;
38
35
  };
39
- isInit: {
40
- readonly type: BooleanConstructor;
41
- };
42
36
  delay: {
43
37
  readonly type: NumberConstructor;
44
38
  readonly default: 200;
@@ -51,7 +45,6 @@ declare const _default: DefineComponent<{
51
45
  }, {
52
46
  type: "company" | "user";
53
47
  placeholder: string;
54
- isInit: boolean;
55
48
  delay: number;
56
49
  }, {}>;
57
50
  export default _default;
@@ -13,9 +13,6 @@ export declare const ProPickerProps: {
13
13
  readonly mode: {
14
14
  readonly type: PropType<"multiple" | "tags" | "SECRET_COMBOBOX_MODE_DO_NOT_USE">;
15
15
  };
16
- readonly isInit: {
17
- readonly type: BooleanConstructor;
18
- };
19
16
  readonly delay: {
20
17
  readonly type: NumberConstructor;
21
18
  readonly default: 200;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@king-one/antdv",
3
3
  "type": "module",
4
- "version": "1.0.40",
4
+ "version": "1.0.41",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",