@aplus-frontend/ui 0.1.42 → 0.1.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.
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as y, unref as d, computed as g, renderSlot as b } from "vue";
|
|
2
2
|
import "../hooks/index.mjs";
|
|
3
|
-
import { useProvideCheckCard as
|
|
4
|
-
import { isUndefined as
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { useProvideCheckCard as S } from "./context.mjs";
|
|
4
|
+
import { isUndefined as B } from "lodash-unified";
|
|
5
|
+
import { Form as z } from "ant-design-vue";
|
|
6
|
+
import { useControllableValue as V } from "../hooks/useControllableValue.mjs";
|
|
7
|
+
const A = /* @__PURE__ */ y({
|
|
7
8
|
name: "CheckCardGroup",
|
|
8
9
|
__name: "group",
|
|
9
10
|
props: {
|
|
@@ -20,43 +21,43 @@ const P = /* @__PURE__ */ v({
|
|
|
20
21
|
"onUpdate:value": {}
|
|
21
22
|
},
|
|
22
23
|
emits: ["update:value"],
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
function
|
|
24
|
+
setup(u, { emit: s }) {
|
|
25
|
+
const { onFieldChange: o } = z.useInjectFormItemContext(), t = u, p = s, { value: r, updateValue: n } = V(t, p), l = /* @__PURE__ */ new Map();
|
|
26
|
+
function f(e) {
|
|
26
27
|
if (!t.multiple) {
|
|
27
|
-
if (r
|
|
28
|
+
if (d(r) === e)
|
|
28
29
|
return;
|
|
29
|
-
|
|
30
|
+
n(e), o == null || o();
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
|
-
let
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
let i = [...d(r) || []];
|
|
34
|
+
const v = i.find((a) => a === e);
|
|
35
|
+
B(v) ? i.push(e) : i = i.filter((a) => a !== e).filter((a) => l.has(a)), n(i), o == null || o();
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function m(e) {
|
|
37
38
|
l.set(e, !0);
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function c(e) {
|
|
40
41
|
l.delete(e);
|
|
41
42
|
}
|
|
42
|
-
return
|
|
43
|
+
return S(
|
|
43
44
|
g(() => ({
|
|
44
|
-
toggleOption:
|
|
45
|
-
registerValue:
|
|
46
|
-
cancelValue:
|
|
45
|
+
toggleOption: f,
|
|
46
|
+
registerValue: m,
|
|
47
|
+
cancelValue: c,
|
|
47
48
|
disabled: t.disabled,
|
|
48
49
|
size: t.size,
|
|
49
50
|
bordered: t.bordered,
|
|
50
51
|
loading: t.loading,
|
|
51
|
-
value: r
|
|
52
|
+
value: d(r),
|
|
52
53
|
multiple: t.multiple,
|
|
53
54
|
stopPropagation: t.stopPropagation,
|
|
54
55
|
style: t.style,
|
|
55
56
|
indicatorSize: t.indicatorSize
|
|
56
57
|
}))
|
|
57
|
-
), (e,
|
|
58
|
+
), (e, i) => b(e.$slots, "default");
|
|
58
59
|
}
|
|
59
60
|
});
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
A as default
|
|
62
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue");require("../hooks/index.js");const g=require("./context.js"),y=require("lodash-unified"),b=require("ant-design-vue"),S=require("../hooks/useControllableValue.js"),B=r.defineComponent({name:"CheckCardGroup",__name:"group",props:{bordered:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},size:{default:void 0},stopPropagation:{type:[Boolean,Function],default:void 0},indicatorSize:{default:void 0},style:{default:void 0},multiple:{type:Boolean,default:!1},defaultValue:{type:[String,Number,Boolean,Array],default:void 0},value:{type:[String,Number,Boolean,Array],default:void 0},"onUpdate:value":{}},emits:["update:value"],setup(d,{emit:s}){const{onFieldChange:o}=b.Form.useInjectFormItemContext(),t=d,p=s,{value:a,updateValue:n}=S.useControllableValue(t,p),u=new Map;function c(e){if(!t.multiple){if(r.unref(a)===e)return;n(e),o==null||o();return}let i=[...r.unref(a)||[]];const v=i.find(l=>l===e);y.isUndefined(v)?i.push(e):i=i.filter(l=>l!==e).filter(l=>u.has(l)),n(i),o==null||o()}function f(e){u.set(e,!0)}function m(e){u.delete(e)}return g.useProvideCheckCard(r.computed(()=>({toggleOption:c,registerValue:f,cancelValue:m,disabled:t.disabled,size:t.size,bordered:t.bordered,loading:t.loading,value:r.unref(a),multiple:t.multiple,stopPropagation:t.stopPropagation,style:t.style,indicatorSize:t.indicatorSize}))),(e,i)=>r.renderSlot(e.$slots,"default")}});exports.default=B;
|