@ditari/bsui 1.0.23 → 1.0.24
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";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("../../store/modules/DataDictionary.cjs.js"),b=require("./dic.worker.cjs.js"),D={name:"DSelect"},y=e.defineComponent({...D,props:{value:{default:null},name:{default:""},disabled:{type:Boolean,default:!1},placeholder:{default:"请填写默认占位符啊!老铁"},include:{default:[]}},emits:["update:value","change"],setup(u,{emit:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),_=require("../../store/modules/DataDictionary.cjs.js"),b=require("./dic.worker.cjs.js"),D={name:"DSelect"},y=e.defineComponent({...D,props:{value:{default:null},name:{default:""},disabled:{type:Boolean,default:!1},placeholder:{default:"请填写默认占位符啊!老铁"},include:{default:[]}},emits:["update:value","change"],setup(u,{emit:c}){const n=u,{getDicByKey:v,list:h}=_.useDataDicStore(),{modelValue:r,data:p,onSearch:S,onSelect:g,onChange:m}=C();function C(){let s=!0,t=[];const o=e.ref(t),l=e.ref(n.value),d=new b.default;d.onerror=()=>{s=!1,t=v(n.name)},d.onmessage=a=>{o.value=[...a.data]},e.watch(()=>n.include,()=>{i(l.value)}),e.watch(()=>n.value,a=>{l.value=a}),i(l.value);const w=a=>{s?i(a):o.value=t.filter(f=>f.value.toLowerCase().indexOf(a.toLowerCase())!==-1||f.label.toLowerCase().includes(a.toLowerCase())).splice(0,10)};function i(a){d.postMessage({list:JSON.stringify(h[n.name]),keywords:a,include:JSON.stringify(n.include??[])})}return{data:o,modelValue:l,onSearch:w,onSelect:a=>{c("update:value",a)},onChange:()=>{c("update:value",l.value),c("change",l.value)}}}return(s,t)=>{const o=e.resolveComponent("a-select");return e.openBlock(),e.createBlock(o,{value:e.unref(r),"onUpdate:value":t[0]||(t[0]=l=>e.isRef(r)?r.value=l:null),"allow-clear":"","show-search":"","filter-option":!1,options:e.unref(p),placeholder:u.placeholder,disabled:u.disabled,onSelect:e.unref(g),onSearch:e.unref(S),onChange:e.unref(m)},null,8,["value","options","placeholder","disabled","onSelect","onSearch","onChange"])}}});exports.default=y;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as _, ref as p, watch as h, resolveComponent as k, openBlock as B, createBlock as L, unref as t, isRef as x } from "vue";
|
|
2
2
|
import { useDataDicStore as y } from "../../store/modules/DataDictionary.esm.js";
|
|
3
3
|
import O from "./dic.worker.esm.js";
|
|
4
4
|
const V = {
|
|
5
5
|
name: "DSelect"
|
|
6
|
-
}, R = /* @__PURE__ */
|
|
6
|
+
}, R = /* @__PURE__ */ _({
|
|
7
7
|
...V,
|
|
8
8
|
props: {
|
|
9
9
|
value: { default: null },
|
|
@@ -14,34 +14,39 @@ const V = {
|
|
|
14
14
|
},
|
|
15
15
|
emits: ["update:value", "change"],
|
|
16
16
|
setup(c, { emit: r }) {
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
let s = !0,
|
|
20
|
-
const n = p(
|
|
17
|
+
const l = c, { getDicByKey: v, list: S } = y(), { modelValue: u, data: m, onSearch: g, onSelect: C, onChange: w } = b();
|
|
18
|
+
function b() {
|
|
19
|
+
let s = !0, o = [];
|
|
20
|
+
const n = p(o), a = p(l.value), d = new O();
|
|
21
21
|
d.onerror = () => {
|
|
22
|
-
s = !1,
|
|
22
|
+
s = !1, o = v(l.name);
|
|
23
23
|
}, d.onmessage = (e) => {
|
|
24
24
|
n.value = [...e.data];
|
|
25
|
-
},
|
|
26
|
-
() =>
|
|
25
|
+
}, h(
|
|
26
|
+
() => l.include,
|
|
27
27
|
() => {
|
|
28
28
|
i(a.value);
|
|
29
29
|
}
|
|
30
|
+
), h(
|
|
31
|
+
() => l.value,
|
|
32
|
+
(e) => {
|
|
33
|
+
a.value = e;
|
|
34
|
+
}
|
|
30
35
|
), i(a.value);
|
|
31
|
-
const
|
|
32
|
-
s ? i(e) : n.value =
|
|
36
|
+
const D = (e) => {
|
|
37
|
+
s ? i(e) : n.value = o.filter((f) => f.value.toLowerCase().indexOf(e.toLowerCase()) !== -1 || f.label.toLowerCase().includes(e.toLowerCase())).splice(0, 10);
|
|
33
38
|
};
|
|
34
39
|
function i(e) {
|
|
35
40
|
d.postMessage({
|
|
36
|
-
list: JSON.stringify(S[
|
|
41
|
+
list: JSON.stringify(S[l.name]),
|
|
37
42
|
keywords: e,
|
|
38
|
-
include: JSON.stringify(
|
|
43
|
+
include: JSON.stringify(l.include ?? [])
|
|
39
44
|
});
|
|
40
45
|
}
|
|
41
46
|
return {
|
|
42
47
|
data: n,
|
|
43
48
|
modelValue: a,
|
|
44
|
-
onSearch:
|
|
49
|
+
onSearch: D,
|
|
45
50
|
onSelect: (e) => {
|
|
46
51
|
r("update:value", e);
|
|
47
52
|
},
|
|
@@ -50,20 +55,20 @@ const V = {
|
|
|
50
55
|
}
|
|
51
56
|
};
|
|
52
57
|
}
|
|
53
|
-
return (s,
|
|
58
|
+
return (s, o) => {
|
|
54
59
|
const n = k("a-select");
|
|
55
60
|
return B(), L(n, {
|
|
56
61
|
value: t(u),
|
|
57
|
-
"onUpdate:value":
|
|
62
|
+
"onUpdate:value": o[0] || (o[0] = (a) => x(u) ? u.value = a : null),
|
|
58
63
|
"allow-clear": "",
|
|
59
64
|
"show-search": "",
|
|
60
65
|
"filter-option": !1,
|
|
61
66
|
options: t(m),
|
|
62
67
|
placeholder: c.placeholder,
|
|
63
68
|
disabled: c.disabled,
|
|
64
|
-
onSelect: t(
|
|
65
|
-
onSearch: t(
|
|
66
|
-
onChange: t(
|
|
69
|
+
onSelect: t(C),
|
|
70
|
+
onSearch: t(g),
|
|
71
|
+
onChange: t(w)
|
|
67
72
|
}, null, 8, ["value", "options", "placeholder", "disabled", "onSelect", "onSearch", "onChange"]);
|
|
68
73
|
};
|
|
69
74
|
}
|
package/package.json
CHANGED