@king-one/antdv 1.0.41 → 1.0.43
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,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as m, mergeModels as c, 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
2
|
import { debounce as k } from "lodash-es";
|
|
3
3
|
import { Select as S, Spin as w } from "ant-design-vue";
|
|
4
4
|
import { proPickerApi as l } from "../apis/pro-picker.api.mjs";
|
|
5
5
|
import { ProPickerProps as V } from "./types.mjs";
|
|
6
|
-
const x = /* @__PURE__ */
|
|
6
|
+
const x = /* @__PURE__ */ m({
|
|
7
7
|
name: "ProPicker",
|
|
8
8
|
__name: "ProPicker",
|
|
9
|
-
props: /* @__PURE__ */
|
|
9
|
+
props: /* @__PURE__ */ c(V, {
|
|
10
10
|
modelValue: {},
|
|
11
11
|
modelModifiers: {}
|
|
12
12
|
}),
|
|
@@ -16,24 +16,30 @@ const x = /* @__PURE__ */ d({
|
|
|
16
16
|
data: [],
|
|
17
17
|
fetching: !1
|
|
18
18
|
});
|
|
19
|
-
h(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
h(
|
|
20
|
+
r,
|
|
21
|
+
(e) => {
|
|
22
|
+
!e || a.data.some((o) => o.value === e) || (typeof e == "string" || typeof e == "number" ? l.company({
|
|
23
|
+
params: { value: e }
|
|
24
|
+
}).then((o) => {
|
|
25
|
+
a.data = o.data.options.map((n) => ({
|
|
26
|
+
label: n.label,
|
|
27
|
+
value: n.value
|
|
28
|
+
}));
|
|
29
|
+
}) : Array.isArray(e) && l.company({
|
|
30
|
+
params: { value: e.join(",") }
|
|
31
|
+
}).then((o) => {
|
|
32
|
+
a.data = o.data.options.map((n) => ({
|
|
33
|
+
label: n.label,
|
|
34
|
+
value: n.value
|
|
35
|
+
})), a.fetching = !1;
|
|
36
|
+
}));
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
immediate: !0
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
const d = k((e) => {
|
|
37
43
|
e && (a.fetching = !0, s.type === "company" ? l.company({
|
|
38
44
|
params: { label: e }
|
|
39
45
|
}).then((t) => {
|
|
@@ -56,7 +62,7 @@ const x = /* @__PURE__ */ d({
|
|
|
56
62
|
"filter-option": !1,
|
|
57
63
|
"not-found-content": a.fetching ? void 0 : null,
|
|
58
64
|
options: a.data,
|
|
59
|
-
onSearch: i(
|
|
65
|
+
onSearch: i(d)
|
|
60
66
|
}, v({
|
|
61
67
|
_: 2
|
|
62
68
|
/* DYNAMIC */
|
|
@@ -1 +1 @@
|
|
|
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}))
|
|
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}))}):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}))},{immediate:!0});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;
|