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